Project
cortex
Description
A — Help / legend row overlap
ModelPicker::render_help_bar in src/cortex-tui/src/widgets/model_picker.rs draws the legend (* current , + popular at fixed columns) and the shortcut string ([Enter] select [Esc] cancel [Ctrl+L] clear search) on the same row. The right block uses help_x = area.right().saturating_sub(help.len() as u16 + 1) with no guard that help_x stays strictly to the right of the legend’s last column. For small area.width, help_x moves left and overwrites the legend → garbled footer.
B — Search caret
render_search_bar sets
cursor_x = x + 3 + self.state.search_query.len() as u16.
str::len() is UTF-8 byte count, not terminal display width or grapheme count → caret misaligns for CJK, emoji, etc.
Code verification (local tree): Both behaviors are present exactly as above at the cited lines.
Error Message
Debug Logs
System Information
Cortex TUI / cortex-cli: v0.0.7 (per bounty title)
OS: Any
Terminal: width ~50–70 cols to reproduce A; UTF-8 locale for B
Screenshots
No response
Steps to Reproduce
A
- Open model picker (e.g. Ctrl+M where supported).
- Reduce terminal width (~50–60 columns).
- Observe bottom row: legend and hint string collide.
B
- Open model picker, focus search.
- Enter multi-byte characters (e.g.
你好, emoji).
- Observe caret vs visible glyphs.
Expected Behavior
A: Legend and hints do not overlap (wrap, truncate, hide one side, or two-line footer when width insufficient).
B: Caret position follows display width / grapheme-aware indexing (e.g. unicode-width or shared TUI helpers).
Actual Behavior
A: Single-line layout without collision detection → overlap when narrow.
B: Caret uses byte length → misalignment for non-ASCII.
Additional Context
No response
Project
cortex
Description
A — Help / legend row overlap
ModelPicker::render_help_barinsrc/cortex-tui/src/widgets/model_picker.rsdraws the legend (* current,+ popularat fixed columns) and the shortcut string ([Enter] select [Esc] cancel [Ctrl+L] clear search) on the same row. The right block useshelp_x = area.right().saturating_sub(help.len() as u16 + 1)with no guard thathelp_xstays strictly to the right of the legend’s last column. For smallarea.width,help_xmoves left and overwrites the legend → garbled footer.B — Search caret
render_search_barsetscursor_x = x + 3 + self.state.search_query.len() as u16.str::len()is UTF-8 byte count, not terminal display width or grapheme count → caret misaligns for CJK, emoji, etc.Code verification (local tree): Both behaviors are present exactly as above at the cited lines.
Error Message
Debug Logs
System Information
Screenshots
No response
Steps to Reproduce
A
B
你好, emoji).Expected Behavior
A: Legend and hints do not overlap (wrap, truncate, hide one side, or two-line footer when width insufficient).
B: Caret position follows display width / grapheme-aware indexing (e.g.
unicode-widthor shared TUI helpers).Actual Behavior
A: Single-line layout without collision detection → overlap when narrow.
B: Caret uses byte length → misalignment for non-ASCII.
Additional Context
No response