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:
parent
eeed3fdba0
commit
54b0299b74
1 changed files with 7 additions and 7 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue