Commit Graph

1321 Commits

Author SHA1 Message Date
Hunter Bown 7f0773a5d5 refactor(tui/ui): move per-turn notification composition into tui::notifications
The notification dispatch primitives (`Method`, `notify_done`,
`humanize_duration`, OSC 9 / OSC 99 / OSC 777 formatters) already live
in `tui/notifications.rs`. The five composition helpers that decided
*when* and *what* to notify still lived in ui.rs:

* `notification_settings`        → `notifications::settings`
* `completed_turn_notification_message` → `notifications::completed_turn_message`
* `subagent_completion_notification_message` → `notifications::subagent_completion_message`
* `latest_assistant_notification_text` → `notifications::latest_assistant_text`
* `notification_text_summary`    → `notifications::text_summary`

Move them so the whole notification stack lives in one file. The lone
streaming sanitizer they share, `sanitize_stream_chunk`, stays in ui.rs
(it has three other call sites in the streaming render path) but is
now `pub(super)` so notifications.rs can reuse it via `super::ui::`.

ui.rs drops to ~9290 lines (down ~735 from the pre-refactor baseline
of 10025). All 954 tui:: tests still pass.
2026-05-13 01:45:09 -05:00
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
Hunter Bown 838ad20d40 refactor(tui/ui): extract auto-router + onboarding-validation helpers
ui.rs has grown past 10k lines; the first two extraction targets are
self-contained function clusters that don't share state with the rest
of the file:

* `tui::auto_router` (new module) gathers the 7 functions that decide
  whether to run the auto-route flash model and what context to send
  it: `should_resolve_auto_model_selection`,
  `resolve_auto_model_selection`, `normalize_auto_routed_effort`,
  `recent_auto_router_context`, and three private helpers
  (`content_blocks_text`, `append_router_text`,
  `truncate_for_auto_router`). Adds unit tests for the pure pieces.

* `tui::onboarding` (existing module) grows three state-machine
  transitions and one API-key validator: `validate_api_key_for_onboarding`,
  `advance_onboarding_from_welcome`,
  `advance_onboarding_after_language`,
  `sync_api_key_validation_status`, plus the `ApiKeyValidation` enum.
  These belong next to the existing onboarding screen renderers.
  Adds unit tests for the validator.

Net effect: ui.rs is ~160 lines shorter and two cohesive concerns are
now reviewable without scrolling through unrelated UI plumbing. No
behavior change. All 954 tui:: tests still pass.
2026-05-13 01:34:39 -05:00
Hunter Bown 861fc9df36 fix(skills): partition /skills output so user-created skills stay visible
The /skills menu renders one history cell containing every discoverable
skill with full description. With the v0.8.34 bundled-skill set (11
first-party skills), a typical 40-row terminal viewport no longer fits
the message, and the top of the list scrolls off — including any
workspace-level user skill at .agents/skills/, which the registry
returns first thanks to precedence ordering.

The qa_pty `skills_menu_shows_local_and_global_skills` test exercises
exactly this case: a workspace skill plus a sealed-home global skill
plus the 11 bundled skills come to 13 entries, the viewport cuts off
above /global-alpha, and the workspace skill is invisible. Discovery
was healthy — confirmed by the new unit test
`discover_finds_both_workspace_and_global_skills`.

Render the menu in two sections so user-created skills stay prominent:

- `Your skills (N):` lists every user-installed skill with its full
  description.
- `Built-in skills (M):` either lists every bundled skill with its
  description (when there are no user skills to surface) or compacts
  them into a comma-separated name list with a "run /skills <name>
  for details" hint (when user skills are present).

Filtered views (`/skills <prefix>`) keep the old flat list — the user
has already narrowed the catalog and section headers would be noise.

Expose `skills::is_bundled_skill_name` so the renderer can partition
without a side-channel marker. Replace one unit test that asserted
the old between-entry blank-line spacing with one that asserts the
section structure.
2026-05-13 01:25:38 -05:00
Hunter Bown cf45efa07b chore(release): bump workspace to v0.8.34 and clean repo root
- Bump workspace.package.version 0.8.33 -> 0.8.34 across all 14 crates
- Bump npm wrapper version + deepseekBinaryVersion pin
- Update docs/TOOL_SURFACE.md "Current surface" + docs/ARCHITECTURE.md
  current-surface references; historical "removed_in"/"v0.8.33 began
  moving" wording stays as fact
- Update web/lib/facts.generated.ts version pin
- Draft [0.8.34] CHANGELOG section covering the 135 commits since 0.8.33
  (prefix-cache stability, bundled skills, Kitty/Ghostty notifications,
  theme picker, chunked tool dispatch, MCP session-id persistence,
  cost-calc reasoning tokens, and the in-flight internal cleanup)
- Remove stale repo-root development artifacts:
  * TAKEOVER_PROMPT.md (v0.8.6 handoff, 3 minors stale)
  * PROMPT_ANALYSIS.md (v0.8.13-era prompt audit doc)
  * DEPENDENCY_GRAPH.md (claimed monolith layout, predates 14-crate split)
  docs/ARCHITECTURE.md already contains the live crate map.
- Update CONTRIBUTING.md to reference docs/ARCHITECTURE.md for build
  ordering instead of the removed DEPENDENCY_GRAPH.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 01:12:21 -05:00
Hunter Bown 1af37e3fab Add DeepSeek-native bundled workflow skills 2026-05-13 00:53:44 -05:00
Hunter Bown 7b61983804 Merge remote-tracking branch 'origin/pr/1456' into work/v0.8.34 2026-05-13 00:26:49 -05:00
Hunter Bown ee0b1be9e2 fix(auth): check startup keys against saved provider 2026-05-13 00:26:13 -05:00
Hunter Bown fe98cce1c7 fix(auto): skip router for decisive local routes 2026-05-13 00:23:46 -05:00
Hunter Bown 2c58f1eafe Merge remote-tracking branch 'origin/pr/1144' into work/v0.8.34 2026-05-13 00:21:45 -05:00
Hunter Bown 8ec7ccddb0 Merge remote-tracking branch 'origin/pr/1560' into work/v0.8.34 2026-05-13 00:19:51 -05:00
Hunter Bown ac01b225e7 fix(client): strip reasoning content for generic providers
Fixes #1542.
2026-05-13 00:17:14 -05:00
Hunter Bown bad58784e4 Merge remote-tracking branch 'origin/pr/1384' into work/v0.8.34 2026-05-13 00:13:30 -05:00
Hunter Bown 6873784b22 Merge remote-tracking branch 'origin/pr/1479' into work/v0.8.34 2026-05-13 00:12:23 -05:00
Hunter Bown 5c8d0a7918 Merge remote-tracking branch 'origin/pr/1517' into work/v0.8.34 2026-05-13 00:11:45 -05:00
Hunter Bown 5fa372202c fix(help): repaint and close searchable overlay
Fixes #1559.
2026-05-13 00:09:15 -05:00
Hunter Bown 2e022bda25 Merge remote-tracking branch 'origin/pr/1065' into work/v0.8.34
# Conflicts:
#	crates/tui/src/commands/mod.rs
#	crates/tui/src/tui/app.rs
#	crates/tui/src/tui/ui.rs
2026-05-13 00:06:56 -05:00
v_wanghuanping01 9038e70bcb fix(tui): debounce FocusGained recovery to prevent flicker loop on Tabby
Some terminal emulators (observed on Tabby / xterm.js) re-trigger a
FocusGained event when the application sends EnableFocusChange
(\e[?1004h) inside recover_terminal_modes(). This creates a tight
event→redraw→event loop that manifests as continuous screen flicker
whenever the terminal window has focus.

Root cause chain:
  FocusGained → recover_terminal_modes() → EnableFocusChange
      ↑                                              ↓
      └── Tabby retriggers FocusGained ←─────────────┘

Fix: add a 200 ms debounce window on FocusGained-triggered mode
recovery.  If a FocusGained arrives within 200 ms of the last
recovery call, skip recover_terminal_modes() (avoiding the
EnableFocusChange that feeds the loop) but still mark a repaint.

The debounce constant FOCUS_RECOVERY_DEBOUNCE uses a 200 ms window,
which is short enough that legitimate app-switch focus events (>200 ms
apart) still get full mode recovery, while spurious back-to-back
events from terminal quirks are suppressed.

Fixes flickering reported when running deepseek-tui inside Tabby on
macOS (deepseek-tui 0.8.32).

--- Fixed with DeepSeek V4 Pro ---

Signed-off-by: DeepSeek V4 Pro <via deepseek-tui>
2026-05-13 13:03:54 +08:00
Hunter Bown 87c0436a83 Merge remote-tracking branch 'origin/pr/1451' into work/v0.8.34 2026-05-13 00:01:11 -05:00
Hunter Bown 2eb866584e Merge remote-tracking branch 'origin/pr/1239' into work/v0.8.34
# Conflicts:
#	crates/tui/src/tui/transcript.rs
#	crates/tui/src/tui/ui/tests.rs
2026-05-13 00:00:10 -05:00
Hunter Bown ccfece77e3 Merge remote-tracking branch 'origin/pr/1534' into work/v0.8.34
# Conflicts:
#	crates/tui/src/commands/config.rs
#	crates/tui/src/commands/mod.rs
#	crates/tui/src/palette.rs
#	crates/tui/src/settings.rs
#	crates/tui/src/tui/app.rs
#	crates/tui/src/tui/color_compat.rs
#	crates/tui/src/tui/widgets/footer.rs
2026-05-12 23:58:39 -05:00
Hunter Bown 4766adf8e3 Merge remote-tracking branch 'origin/pr/702' into work/v0.8.34 2026-05-12 23:51:30 -05:00
Hunter Bown 67f2e3d913 Merge remote-tracking branch 'origin/pr/746' into work/v0.8.34 2026-05-12 23:50:15 -05:00
Hunter Bown 5aee539ff2 fix(commands): dispatch pinyin skills alias 2026-05-12 23:46:56 -05:00
Hunter Bown 48fbbcdb19 Merge remote-tracking branch 'origin/pr/1535' into work/v0.8.34 2026-05-12 23:44:20 -05:00
Hunter Bown ca605d2ef5 Merge remote-tracking branch 'origin/pr/1011' into work/v0.8.34
# Conflicts:
#	docs/INSTALL.md
2026-05-12 23:44:04 -05:00
Hunter Bown 6d1d9779fb Merge remote-tracking branch 'origin/pr/1452' into work/v0.8.34
# Conflicts:
#	crates/tui/src/localization.rs
2026-05-12 23:43:12 -05:00
Hunter Bown c39480bfd4 docs: reference community ACP adapter
Harvested from PR #1543 by @rockeverm3m.

Co-authored-by: rockeverm3m <wfxqws65hc@privaterelay.appleid.com>
2026-05-12 23:40:02 -05:00
Hunter Bown a4637fe7d1 fix(settings): reduce motion in VTE flicker terminals
Harvested from PR #1527 by @axobase001.

Co-authored-by: axobase001 <dengzhuoran9@gmail.com>
2026-05-12 23:39:44 -05:00
Hunter Bown ac77f0ff63 fix(shell): preserve output tail when truncating
Harvested from PR #1521 by @axobase001.

Co-authored-by: axobase001 <dengzhuoran9@gmail.com>
2026-05-12 23:37:45 -05:00
Hunter Bown 3e93962bdd feat(jobs): add cancel-all shell job action
Harvested from PR #1536 by @jieshu666.

Co-authored-by: jieshu666 <jieshu666@users.noreply.github.com>
2026-05-12 23:36:31 -05:00
Hunter Bown b816234fbc Merge remote-tracking branch 'origin/pr/1339' into work/v0.8.34 2026-05-12 23:34:22 -05:00
Hunter Bown ee7a6044f4 fix(mcp): default HTTP Accept to JSON and SSE 2026-05-12 23:33:52 -05:00
Hunter Bown b5a0e77bd3 fix: resolve v0.8.34 integration compile issues 2026-05-12 23:33:49 -05:00
Hunter Bown 6f3814f39c Merge remote-tracking branch 'origin/pr/1220' into work/v0.8.34
# Conflicts:
#	crates/tui/src/artifacts.rs
#	crates/tui/src/commands/session.rs
#	crates/tui/src/tui/app.rs
#	crates/tui/src/tui/ui.rs
2026-05-12 23:28:32 -05:00
Hunter Bown 16107cbe8e Merge remote-tracking branch 'origin/pr/1185' into work/v0.8.34
# Conflicts:
#	crates/tui/src/commands/mod.rs
#	crates/tui/src/tui/ui.rs
2026-05-12 23:28:16 -05:00
Hunter Bown 2631ee41af Merge remote-tracking branch 'origin/pr/1223' into work/v0.8.34
# Conflicts:
#	crates/tui/src/commands/mod.rs
2026-05-12 23:27:39 -05:00
Hunter Bown 6c9e198720 style: format command alias and deferred tool integrations 2026-05-12 23:26:48 -05:00
Hunter Bown 4063c61ad6 Merge remote-tracking branch 'origin/pr/1306' into work/v0.8.34
# Conflicts:
#	crates/tui/src/commands/mod.rs
#	crates/tui/src/tui/ui/tests.rs
#	crates/tui/src/tui/widgets/mod.rs
2026-05-12 23:26:13 -05:00
Hunter Bown 6be0a9a6d6 Merge remote-tracking branch 'origin/pr/1381' into work/v0.8.34
# Conflicts:
#	crates/tui/src/prompts.rs
2026-05-12 23:23:30 -05:00
Hunter Bown e254780e48 Merge remote-tracking branch 'origin/pr/1385' into work/v0.8.34
# Conflicts:
#	crates/tui/src/commands/config.rs
2026-05-12 23:22:56 -05:00
Hunter Bown dfd02e343c Merge remote-tracking branch 'origin/pr/1423' into work/v0.8.34
# Conflicts:
#	crates/tui/src/core/engine.rs
#	crates/tui/src/core/engine/tool_catalog.rs
#	crates/tui/src/core/engine/turn_loop.rs
2026-05-12 23:22:17 -05:00
Hunter Bown 9d1c1d1422 Merge remote-tracking branch 'origin/pr/1426' into work/v0.8.34 2026-05-12 23:20:07 -05:00
Hunter Bown 5d41656e4c style: format additional v0.8.34 integrations 2026-05-12 23:19:43 -05:00
Hunter Bown 7eeb8fde5f Merge remote-tracking branch 'origin/pr/1126' into work/v0.8.34
# Conflicts:
#	crates/tui/src/core/turn.rs
2026-05-12 23:19:23 -05:00
Hunter Bown 868bc2ce74 Merge remote-tracking branch 'origin/pr/1181' into work/v0.8.34 2026-05-12 23:18:57 -05:00
Hunter Bown bf0ad18a37 Merge remote-tracking branch 'origin/pr/1192' into work/v0.8.34
# Conflicts:
#	crates/tui/src/commands/session.rs
#	crates/tui/src/session_manager.rs
#	crates/tui/src/tui/session_picker.rs
#	crates/tui/src/tui/sidebar.rs
#	crates/tui/src/tui/ui.rs
2026-05-12 23:18:55 -05:00
Hunter Bown 2b915b687f Merge remote-tracking branch 'origin/pr/1197' into work/v0.8.34
# Conflicts:
#	crates/tui/src/project_context.rs
2026-05-12 23:17:53 -05:00
Hunter Bown b8036b4b4a Merge remote-tracking branch 'origin/pr/1346' into work/v0.8.34 2026-05-12 23:17:36 -05:00
Hunter Bown b21c733934 Merge remote-tracking branch 'origin/pr/1270' into work/v0.8.34
# Conflicts:
#	crates/tui/src/working_set.rs
2026-05-12 23:17:34 -05:00