From 54b0299b746c385073b2e84e7e751076433145d2 Mon Sep 17 00:00:00 2001 From: Chris Hendrickson Date: Sat, 25 Apr 2026 14:24:36 -0400 Subject: [PATCH] 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> --- packages/kanban/lib/src/commands/tui_command.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/kanban/lib/src/commands/tui_command.dart b/packages/kanban/lib/src/commands/tui_command.dart index a128712..d245a72 100644 --- a/packages/kanban/lib/src/commands/tui_command.dart +++ b/packages/kanban/lib/src/commands/tui_command.dart @@ -1186,7 +1186,7 @@ class TuiCommand extends DewCommand { final scrollInfo = lines.isNotEmpty ? ' [${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(); } @@ -1472,14 +1472,14 @@ class TuiCommand extends DewCommand { // Plain text field (title, body preview) console.setForegroundColor(focused ? accentColor : textColor); 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)); - if (focused && field != _EditorField.body) { + if (hint.isNotEmpty) { console.setForegroundColor(ConsoleColor.white); - console.write(' [Enter to edit]'); - } else if (focused && field == _EditorField.body) { - console.setForegroundColor(ConsoleColor.white); - console.write(' [Enter → \$EDITOR]'); + console.write(hint); } } console.resetColorAttributes();