Skip to content

Fix TUI accessibility and responsive rendering issues#128

Merged
BunsDev merged 1 commit into
mainfrom
finish/tui-uiux-accessibility
Jul 4, 2026
Merged

Fix TUI accessibility and responsive rendering issues#128
BunsDev merged 1 commit into
mainfrom
finish/tui-uiux-accessibility

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix TUI mojibake/status glyph rendering, color-only focus/status affordances, and tiny-terminal layout underflow risks.
  • Consolidate repeated TUI accent color use behind the existing overlay accent constant.
  • Add docs/tui-ux-accessibility-review.md with fixed items and prioritized follow-ups.

Test Plan

  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p claurst-tui
  • bash scripts/tui-tests/run.sh --build

Note: cargo test --workspace was attempted in a clean worktree but was interrupted after several claurst-core tests 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.

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>
Copilot AI review requested due to automatic review settings July 4, 2026 13:23
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jul 4, 2026 1:23pm

@BunsDev BunsDev merged commit 90d9bc0 into main Jul 4, 2026
3 checks passed
@BunsDev BunsDev deleted the finish/tui-uiux-accessibility branch July 4, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Rect subtractions with saturating_sub.
  • Replace hard-coded accent RGB literals with crate::overlays::COVEN_CODE_ACCENT and 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants