Skip to content

Add an All lines toggle that shows every line of the file - #33

Merged
dgsienko merged 3 commits into
dgsienko:mainfrom
bwets:feat/show-all-lines
Nov 20, 2026
Merged

dgsienko merged 3 commits into
dgsienko:mainfrom
bwets:feat/show-all-lines

Conversation

@bwets

@bwets bwets commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Problem

A diff only shows the changes with 3 lines of context, so the start of the file and everything between hunks stays hidden. More context / Less context can step up to the whole file, but only in unified view (the buttons never show in split), a few clicks at a time, and the choice resets on reload. The TUI has no way to see more context at all.

What

An All lines toggle that shows every line of the file, in the web UI and the TUI, saved as the show_all_lines setting so it holds across files and sessions.

  • Web UI: an All lines button in the file header in unified and split view, the e key (rebindable in Settings, listed in the shortcuts overlay) and a "Show all lines of the file" palette command. More / Less context now also show in split view, and are hidden while All lines is on.
  • TUI: e toggles it, with "all lines" in the status bar and an entry in the help screen.

How

  • SettingsUpdate and AppState gain show_all_lines, like word_wrap.
  • All lines sends context=1000000 to /api/diff (FULL_CONTEXT), so git returns the whole file as one hunk. No server change was needed beyond the setting.
  • Web: contextRef now holds the effective context, FULL_CONTEXT while the toggle is on, else contextLines. fetchDiff drops a response whose context is no longer current, so the 3-line fetch at startup cannot overwrite the full one once the saved setting is read.
  • TUI: ApiClient.diff takes a context, ApiClient.update_settings saves the toggle, and _apply_theme reads it at startup along with the theme.

Tests

  • test_settings_roundtrip covers show_all_lines.
  • test_e_shows_every_line_of_the_file_and_is_remembered (TUI): e brings line 1 of app.py into the view and saves the setting, and e again hides it and clears the setting.

pytest (319 passed), ruff check and ruff format --check are clean. Checked by hand in the web UI on a C# file in split view: the diff went from starting at line 29 to the whole file, the setting survived a reload, and e turned it off again. Also tried in the TUI.

README and AGENTS.md are updated. Version bumped to 0.12.0, like #31 and #32: whichever of those merges first, the other ones only need the version line and the neighbouring settings lines (models.py, state.py, test_server.py, the AGENTS.md settings table) resolved by keeping both sides.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xshwvphn2wQmVKLLS2G9kJ

The diff only showed the changes with a few lines of context, hiding
the start of the file and the stretches between hunks. More context and
Less context could step up to the whole file, but only in unified view,
a few clicks at a time, and the choice reset on reload.

A show_all_lines setting now asks git for the whole file as context. In
the web UI it is the All lines button in the file header, shown in
unified and split view, the e key and a palette command. In the TUI it
is e, with "all lines" in the status bar. Both save the setting, so it
holds across files and sessions. More and Less context now also show in
split view, and stay out of the way while All lines is on.

Bump version to 0.12.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xshwvphn2wQmVKLLS2G9kJ
# Conflicts:
#	AGENTS.md
#	diffui/server/models.py
#	diffui/server/state.py
#	diffui/static/lib/useKeyboard.js
#	tests/test_server.py
@dgsienko
dgsienko merged commit 05155c0 into dgsienko:main Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants