Skip to content

feat(cli): add /diff-fold command to toggle diff line folding#3952

Merged
esengine merged 2 commits into
esengine:main-v2from
wudiandy:feat/full-diff-in-chat-tui
Jun 12, 2026
Merged

feat(cli): add /diff-fold command to toggle diff line folding#3952
esengine merged 2 commits into
esengine:main-v2from
wudiandy:feat/full-diff-in-chat-tui

Conversation

@wudiandy

Copy link
Copy Markdown
Contributor

Add a slash command that lets users toggle whether diffs show all lines or are folded to a limit (40 lines). The toggle is session-scoped and affects subsequent diff rendering without modifying historical content.

  • Replace diffScrollbackMaxLines constant with diffFoldLimit (40)
  • Add diffMaxLines field to chatTUI (default 0 = show all)
  • Add /diff-fold command with toggle logic using i18n messages
  • Register command in help listing and tab completion
  • Add i18n messages for en and zh locales

@github-actions github-actions Bot added tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 11, 2026
@esengine

Copy link
Copy Markdown
Owner

One behavioral question before merge: as written, the session field's zero value flips the default from folded-at-40 to show-all — so after this lands every user's diffs dump fully into scrollback and /diff-fold becomes the way to turn folding on. If that flip is intended, say so in the description; otherwise initialize the session value from the configured fold limit so the default stays folded and /diff-fold is the opt-out. One-line change either way. Kicking fork CI now.

wudiandy and others added 2 commits June 11, 2026 20:17
Add a slash command that lets users toggle whether diffs show all lines
or are folded to a limit (40 lines). The toggle is session-scoped and
affects subsequent diff rendering without modifying historical content.

- Replace diffScrollbackMaxLines constant with diffFoldLimit (40)
- Add diffMaxLines field to chatTUI (default 0 = show all)
- Add /diff-fold command with toggle logic using i18n messages
- Register command in help listing and tab completion
- Add i18n messages for en and zh locales

Co-Authored-By: Claude noreply@anthropic.com
Co-Authored-By: Claude <noreply@anthropic.com>
@wudiandy wudiandy force-pushed the feat/full-diff-in-chat-tui branch 2 times, most recently from c91e374 to 1d26e4c Compare June 11, 2026 12:24
@wudiandy

Copy link
Copy Markdown
Contributor Author

One behavioral question before merge: as written, the session field's zero value flips the default from folded-at-40 to show-all — so after this lands every user's diffs dump fully into scrollback and /diff-fold becomes the way to turn folding on. If that flip is intended, say so in the description; otherwise initialize the session value from the configured fold limit so the default stays folded and /diff-fold is the opt-out. One-line change either way. Kicking fork CI now.

You're right. I've changed the default state to folded.

@esengine

Copy link
Copy Markdown
Owner

Confirmed the default-state fix — initializing diffMaxLines to diffFoldLimit keeps diffs folded-at-40 by default and makes /diff-fold the expand toggle, which is exactly right. Rename is complete (both diffScrollbackMaxLines refs updated), i18n covers en/zh, and it's wired into help + completion. Thanks for the quick turnaround — merging!

@esengine esengine merged commit b977d87 into esengine:main-v2 Jun 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants