You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dash-TUI: extract a shared append/backspace key handler for text-input buffers #770
Nine modules in crates/rocm-dash-tui each independently implement the same "append or backspace a char into a String buffer on a KeyCode::Char/KeyCode::Backspace key event" logic for their text-input fields:
src/ui/folder_browser.rs
src/ui/bench_run.rs (four separate input fields)
src/ui/install_manager.rs (its own small type_char/backspace dispatcher)
src/ui/logs_view.rs
src/ui/onboarding.rs
src/ui/command_screen.rs
src/ui/serve_wizard.rs (three separate input fields)
src/ui/model_picker.rs
src/ui/runtime_manager.rs
All of these are append-only (no cursor movement, no mid-string editing), so the actual shared surface is small: a single free function in src/ui/widgets.rs, something like fn apply_char_key(buf: &mut String, key: KeyCode) -> bool (returning whether the key was consumed), would collapse all nine near-identical match arms into one call site each.
This is one of a handful of shared-component opportunities surfaced in an audit of the dash-TUI's widget layer (see AGENTS.md's "Shared UI components" section, which documents ui/job_console.rs, ui/panel.rs, and ui/theme.rs::job_status_color as the existing reuse points this project follows) — filed as a standalone, scoped follow-up rather than bundled with unrelated changes.
Documentation: once this lands, add a bullet for apply_char_key to AGENTS.md's "Shared UI components" section (dash-TUI group), next to the other ui/-module entries, so the next text-input field reaches for it instead of writing a tenth copy.
Activity