Fix TUI accessibility and responsive rendering issues#128
Merged
Conversation
Accessibility: - Fix mojibake in rendered strings — statusline separator rendered as literal "â"‚" not "│", ctx warning as "âš " not "⚠", bridge glyph as "ðŸ"—" not "🔗" (double-encoded UTF-8; live bug on every terminal) - Selected list rows in dialog_select/model_picker now use a "> " marker + bold, not background color alone, so focus survives NO_COLOR/monochrome/ colorblind/low-contrast themes - Statusline context gauge conveys danger level by shape (○ ok / ◐ warn / ● critical), not color alone Responsiveness (all terminal sizes): - Convert 6 unguarded rect width/height subtractions to saturating_sub (ask_user_dialog, prompt_input, stats_dialog, tasks_overlay) so tiny terminals degrade instead of panicking UI/UX consistency: - Consolidate the accent color literal Rgb(139,92,246) (21 copies across 11 files) onto the existing overlays::COVEN_CODE_ACCENT constant (18 replaced), the foundation for making the accent theme-aware Docs: add docs/tui-ux-accessibility-review.md cataloguing all findings, what was fixed, verified non-issues, and prioritized follow-ups (NO_COLOR support, theme-wiring, contrast bumps). Verified: tui unit tests 649 passed/0 failed; interactive tmux suite green on changed areas (welcome/tips/statusline/no-panic); no-panic smoke at 20x6 → 120x40. The one interactive failure (Ctrl+C-twice-exits) is a pre-existing load/timing flake unrelated to these changes (passes in isolation; touches no code changed here). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR improves the TUI’s resilience and accessibility by fixing mojibake/Unicode rendering issues, reducing reliance on color-only affordances for focus/status, and hardening small-terminal layout math to avoid underflow/panics. It also consolidates the repeated violet accent literal behind the existing overlays::COVEN_CODE_ACCENT constant and documents the audit/follow-ups.
Changes:
- Replace mojibake-rendering glyph sequences and standardize status separators/glyphs; add non-color status context markers in the footer/status line.
- Make selection/focus visible without highlight backgrounds (caret marker + bold) and guard several
Rectsubtractions withsaturating_sub. - Replace hard-coded accent RGB literals with
crate::overlays::COVEN_CODE_ACCENTand add an accessibility review doc.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src-rust/crates/tui/src/tasks_overlay.rs | Prevent tiny-terminal underflow in hint footer positioning via saturating_sub. |
| src-rust/crates/tui/src/stats_dialog.rs | Guard chart label Y positioning with saturating_sub for small heights. |
| src-rust/crates/tui/src/render.rs | Fix mojibake glyphs/separators; add shape+color context gauge indicator; use shared accent constant in a few places. |
| src-rust/crates/tui/src/prompt_input.rs | Use shared accent constant for the prompt accent and guard height subtraction with saturating_sub. |
| src-rust/crates/tui/src/onboarding_dialog.rs | Replace duplicated accent RGB literals with COVEN_CODE_ACCENT. |
| src-rust/crates/tui/src/model_picker.rs | Replace accent literals; add non-color selection indicator (caret + bold). |
| src-rust/crates/tui/src/key_input_dialog.rs | Replace duplicated accent RGB literal with COVEN_CODE_ACCENT. |
| src-rust/crates/tui/src/dialog_select.rs | Replace accent literals; add non-color selection marker + bold for accessibility. |
| src-rust/crates/tui/src/device_auth_dialog.rs | Replace duplicated accent RGB literal with COVEN_CODE_ACCENT. |
| src-rust/crates/tui/src/ask_user_dialog.rs | Guard layout bounds with saturating_sub for tiny terminals. |
| src-rust/crates/tui/src/app.rs | Route ACCENT_BUILD through the shared accent constant; simplify familiar-switcher key handling with match guards. |
| src-rust/crates/tui/src/agents_view.rs | Replace duplicated accent RGB literals with COVEN_CODE_ACCENT. |
| docs/tui-ux-accessibility-review.md | Add an audit summary and prioritized follow-ups for TUI responsiveness/accessibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| use unicode_width::{UnicodeWidthChar, UnicodeWidthStr}; | ||
|
|
||
| const CLAUDE_ORANGE: Color = Color::Rgb(139, 92, 246); | ||
| const CLAUDE_ORANGE: Color = crate::overlays::COVEN_CODE_ACCENT; |
Comment on lines
+31
to
+35
| re-encoded). The statusline segment separator rendered as literal `â"‚` instead of | ||
| `│`, the context warning as `âš ` instead of `⚠`, and the bridge glyph as `ðŸ"—` | ||
| instead of `🔗`. Fixed all 12 occurrences (5 rendered + 7 comments) via a safe | ||
| CP1252 round-trip that only touches CP1252-encodable runs, leaving legitimate | ||
| multibyte glyphs (`✓ 🌿 ─ │ ⚠`) untouched. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/tui-ux-accessibility-review.mdwith fixed items and prioritized follow-ups.Test Plan
cargo fmt --all -- --checkcargo check --workspacecargo clippy --workspace --all-targets -- -D warningscargo test -p claurst-tuibash scripts/tui-tests/run.sh --buildNote:
cargo test --workspacewas attempted in a clean worktree but was interrupted after severalclaurst-coretests produced Rust's >60s running warnings and then no additional output for another two minutes. The failing/hung area was outside the TUI changes; the dedicated TUI crate tests and tmux smoke suite passed.