Files
codewhale/crates
Hunter Bown 7744ee781a refactor(tui/ui): extract vim-mode, workspace-context, streaming-thinking
Three more cohesive function clusters move out of the 10k-line ui.rs:

* `tui::vim_mode` (new) — `handle_vim_normal_key`, the composer's
  Normal-mode dispatch (h/j/k/l, w/b, x/dd, i/a/o/v/G, plus the
  pending-`d` operator state).

* `tui::workspace_context` (new) — the composer-header git context
  badge: `refresh_if_needed`, `collect`, `branch`, `change_summary`,
  `run_git`, the `ChangeSummary` struct, and the `REFRESH_SECS` TTL
  constant. Replaces `refresh_workspace_context_if_needed` /
  `collect_workspace_context` / `workspace_git_branch` /
  `workspace_git_change_summary` / `run_git_query` / `WorkspaceChangeSummary`
  / `WORKSPACE_CONTEXT_REFRESH_SECS` in ui.rs.

* `tui::streaming_thinking` (new) — the 10-function lifecycle that
  manages the live "Thinking" entry inside `active_cell`: ensuring an
  entry exists, appending chunks, animating the translation
  placeholder, replacing it with finalized text, starting / finalizing
  a block, and stashing the reasoning buffer onto `app.last_reasoning`
  so it survives compaction.

Plus the unused `ActiveCell` import in ui.rs that became dead after
the streaming-thinking move.

ui.rs is now ~9434 lines (down from ~10025). All 954 tui::* tests
still pass; no runtime behavior change.
2026-05-13 01:41:15 -05:00
..