fix(tui): body text overflow; add [e] edit hotkey to detail view

- Editor: compute maxLen accounting for hint text length so body preview
  and title value never overflow the modal border
- Detail view footer: add [e] edit hint (key was already wired, just undiscoverable)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Chris Hendrickson 2026-04-25 14:24:36 -04:00
parent eeed3fdba0
commit 54b0299b74

View file

@ -1186,7 +1186,7 @@ class TuiCommand extends DewCommand {
final scrollInfo = lines.isNotEmpty final scrollInfo = lines.isNotEmpty
? ' [${s + 1}-${min(s + contentH, lines.length)}/${lines.length}]' ? ' [${s + 1}-${min(s + contentH, lines.length)}/${lines.length}]'
: ''; : '';
console.write(' [j/k↑↓] scroll$scrollInfo [b/Esc] back [q] quit'.padRight(w)); console.write(' [j/k↑↓] scroll$scrollInfo [e] edit [b/Esc] back [q] quit'.padRight(w));
console.resetColorAttributes(); console.resetColorAttributes();
} }
@ -1472,14 +1472,14 @@ class TuiCommand extends DewCommand {
// Plain text field (title, body preview) // Plain text field (title, body preview)
console.setForegroundColor(focused ? accentColor : textColor); console.setForegroundColor(focused ? accentColor : textColor);
final disp = value.isNotEmpty ? value : '(empty)'; final disp = value.isNotEmpty ? value : '(empty)';
final maxLen = innerW - 15; final hint = focused
? (field == _EditorField.body ? ' [Enter → \$EDITOR]' : ' [Enter to edit]')
: '';
final maxLen = innerW - 15 - hint.length;
console.write(_trunc(disp, maxLen)); console.write(_trunc(disp, maxLen));
if (focused && field != _EditorField.body) { if (hint.isNotEmpty) {
console.setForegroundColor(ConsoleColor.white); console.setForegroundColor(ConsoleColor.white);
console.write(' [Enter to edit]'); console.write(hint);
} else if (focused && field == _EditorField.body) {
console.setForegroundColor(ConsoleColor.white);
console.write(' [Enter → \$EDITOR]');
} }
} }
console.resetColorAttributes(); console.resetColorAttributes();