Commit Graph
1502 Commits
Author SHA1 Message Date
James Peter fcdebf603c chore(tui): polish maintainability
- Remove legacy string-based  (use ExecAction everywhere)
- Add ergonomic traits for newtype IDs (From<&str>, From<String>, AsRef<str>, Display)
- Replace remaining direct streaming mutations with streaming facade
- Update refactor docs: Step 3 and 4 marked DONE

Build: ./build-fast.sh clean
2025-09-02 21:14:34 +10:00
James Peter aef5029ef4 refactor(tui): complete Step 3 and Step 4
- Step 3: fully adopt  and ID newtypes
  * Replace string action checks in history_cell + chatwidget
  * Keep labels (Read/Searched/List Files/Ran) identical
  * Wrap stream/exec/tool ids in StreamId/ExecCallId/ToolCallId
- Step 4: streaming API cleanup
  * Add  and refactor callers
  * Encapsulate  mutations inside streaming module
  * Keep behavior identical; zero warnings

Validated with ./build-fast.sh (clean).
2025-09-02 21:08:47 +10:00
James Peter 929f1d7987 refactor(history_cell): adopt ExecAction in key paths
- Use ExecAction for ExecCell.kind() and MergedExecCell::from_exec
- Switch exec_render_parts_parsed to ExecAction for status/style logic
- Preserve text labels and styling; behavior unchanged

Builds green via ./build-fast.sh
2025-09-02 20:22:04 +10:00
James Peter c6d74b1b89 refactor(tui): finish step 3 partials — ID newtypes + broader ExecAction usage
- Add newtypes: ExecCallId, ToolCallId, StreamId
- Migrate ChatWidget state maps/sets to newtypes and update call sites
- Switch remaining stream-id guards to newtype wrappers
- Use ExecAction in exec begin/end; leave deep history_cell formatting on strings for now

Build: ./build-fast.sh passing (no warnings).
2025-09-02 20:15:04 +10:00
James Peter 73a358ab05 docs(tui): mark merge API consolidation done; note ExecAction adoption and next steps 2025-09-02 19:39:25 +10:00
James Peter cbb48b59a3 refactor(tui/history): consolidate merges + introduce ExecAction enum
- Add ExecAction enum and action_enum_from_parsed()
- Switch exec_tools to use enum instead of string tags
- Add ChatWidget::history_maybe_merge_tool_with_previous()
- Adopt merge helper in web_search_complete
- Keep behavior identical; centralize merge pathways

Validated with ./build-fast.sh (no warnings).
2025-09-02 19:38:37 +10:00
James Peter bdc4dde7f0 docs(tui): update refactor plan status
- Mark history helper adoption as DONE
- Note new history_*_and_maybe_merge API and partial adoption
- Update TODO checklist accordingly
2025-09-02 17:43:46 +10:00
James Peter f22f837f15 refactor(tui/history): add history_*_and_maybe_merge API and adopt in exec flow
- Add  and
- Use in exec completion paths to encapsulate merge heuristics
- Continue to centralize invalidation/redraw in helpers

Validated with ./build-fast.sh (no warnings).
2025-09-02 17:43:11 +10:00
James Peter d630d3f9fc refactor(tui/chatwidget): finish history helper adoption across TUI
- Replace direct history mutations with shim:
  - add_to_history -> history_push
  - history_cells[idx] = … -> history_replace_at
  - history_cells.remove(i) -> history_remove_at (where safe)
- Sweep chatwidget.rs, chatwidget/tools.rs, chatwidget/exec_tools.rs, chatwidget/interrupts.rs
- Preserve move-before-assistant helpers where removal return value is required
- Keep behavior identical; centralize invalidation/redraw in helpers

Validated with ./build-fast.sh (no warnings).
2025-09-02 17:41:46 +10:00
James Peter 145c1bbaef chore(tui/onboarding): copy tweak for ChatGPT sign-in message
- Use "use your paid OpenAI plan"
- Fix indentation in preferred-method note
- Add trailing newline for EOF hygiene
2025-09-02 13:56:10 +10:00
James Peter 811b4ffa87 fix(tui/history): restore ReadAggregationCell used by chat widget read grouping 2025-09-01 23:22:08 +10:00
James Peter 8cc7b8ef04 chore: revert unrelated changes in browser/prompt/history/tui files from prior commit 2025-09-01 23:16:39 +10:00
James Peter 3650b647cb fix(core/exec): kill child on task abort to avoid orphaned commands\n\nWrap spawned child in KillOnDrop guard so user interrupts (which abort the agent\ntask) terminate the process immediately. This ensures the UI no longer shows\ncommands as still running after cancel, and the OS process is not left alive. 2025-09-01 23:16:21 +10:00
James Peter 47cabd27e6 fix(tui/core): make cancel + exit immediate during streaming\n\n- TUI: on interrupt, finalize active stream and drop further deltas so output stops instantly.\n- TUI: second Ctrl+C sends ExitRequest immediately (don’t wait for ShutdownComplete).\n- Core: abort running agent on Op::Shutdown to stop model streaming promptly.\n\nThis fixes cases where Ctrl+C/Esc stopped the spinner but the model kept streaming until completion. 2025-09-01 23:10:52 +10:00
James Peter 4942acb061 Merge origin/main: adopt upstream 0.2.55 release commit; keep local TUI sequencing and deps updates 2025-09-01 22:21:54 +10:00
James Peter 323b8b748e feat(tui): preserve event order relative to final assistant message; stabilize interrupt processing order\n\n- Track per-event sequence in and \n- Move exec/tool cells ahead of final assistant cell to keep narrative flow\n- Render tool results with markdown extracted from JSON\n- Improve history insertion: use Reverse Index + Clear instead of raw escape strings\n\nchore(deps): remove ratatui git override; downgrade (tests only); refresh lockfile with minor bumps (image, clap, deadpool, deranged) 2025-09-01 22:21:39 +10:00
James Peter d2072587b6 refactor(tui/reasoning): enforce headings as 'entire line bold' only for collapsed summaries; remove leading-bold/markdown cases to match product constraint. 2025-09-01 21:51:04 +10:00
James Peter 03c147f72d refactor(tui/reasoning): remove brittle phrase checks; rely solely on formatting (all-bold, leading-bold with colon, or markdown heading) for collapsed reasoning titles. Clean up unused var. 2025-09-01 21:49:19 +10:00
James Peter ac6788b89d fix(tui/reasoning): improve collapsed-title extraction; ignore meta/preamble lines (e.g., 'Here are the key updates', 'I need to…'), treat trailing quotes/brackets when checking punctuation, and exclude ':' endings to prevent non‑titles from appearing as headings. 2025-09-01 21:47:24 +10:00
James Peter 900fba8d84 fix(tui/plan): defer PlanUpdate history while streaming to prevent interleaving between reasoning headings and content; queue and flush after stream finalization. 2025-09-01 21:45:35 +10:00
James Peter 7baeafe2e1 fix(tui/reasoning): ignore duplicate final Reasoning events (summary/raw) per id to prevent duplicated lines; guard deltas after final as well. Addresses duplicate 'Planning a concise approach' reasoning blocks after threading changes. 2025-09-01 21:37:43 +10:00
GitHub Action f66d3470a9 chore(release): 0.2.55 [skip ci] v0.2.55 2025-09-01 11:36:53 +00:00
James Peter e1d8b6eba3 Merge origin/main: adopt remote version bumps; keep ours elsewhere (no code changes) 2025-09-01 21:27:54 +10:00
James Peter 7378dd4475 fix(core/client): key reasoning delta ordering by (item_id, output_index, content_index); fallback duplicate-text guard when sequence_number missing 2025-09-01 21:25:01 +10:00
James Peter d6ae594a09 fix(tui/colors): unify truecolor detection and avoid false 256-color fallback on Windows Terminal; use env + supports_color + known terminals. Update shimmer to rely on unified detection for smooth gradients. 2025-09-01 21:20:31 +10:00
James Peter 49479510bf fix(core/client): record sequence_number on reasoning deltas and drop duplicates/out-of-order per item_id; reduces repeated or shuffled reasoning text 2025-09-01 21:19:28 +10:00
James Peter 9850c75024 fix(tui/init): skip full-screen background paint on Windows Terminal; avoid color/animation glitches. Gate macOS Terminal workaround behind TERM_PROGRAM and opt-in env var (CODE_FORCE_FULL_BG_PAINT=1). 2025-09-01 21:14:55 +10:00
GitHub Action 0267e17cd5 chore(release): 0.2.54 [skip ci] v0.2.54 2025-09-01 11:01:13 +00:00
James Peter d75c6cb125 fix(tui/streaming): merge final Reasoning content with streamed deltas to avoid losing text; preserve committed lines before finalize 2025-09-01 20:52:46 +10:00
James Peter bd7004d7a5 fix(tui/colors): map ANSI-256 Indexed to correct RGB; improve luminance decisions
Also update fallback detection:
- fix(tui/theme): treat Windows Terminal as truecolor using TERM_PROGRAM/WT_SESSION.

This prevents misclassifying light/dark themes on non-truecolor terminals and avoids unnecessary 256-color fallback on Windows Terminal.
2025-09-01 20:50:57 +10:00
James Peter 6f088a1675 fix(tui/paste): qualify AppEvent paths to satisfy CI name resolution; remove unused import 2025-09-01 20:36:05 +10:00
James Peter 88c88c5b2c Merge origin/main: adopt remote version bump; keep local clipboard image paste fixes 2025-09-01 20:30:17 +10:00
James Peter 33dc9b76b9 docs(changelog): note clipboard image paste support and auto-close #10 2025-09-01 20:29:56 +10:00
James Peter bc499636dd feat(tui/paste): show [image: filename] placeholder and map to temp path
- Composer now inserts a placeholder instead of a full temp path when an image
  is pasted (from clipboard or base64/data-URI).
- Added AppEvent::RegisterPastedImage; composer notifies ChatWidget to map the
  placeholder to its backing file so submit resolves to LocalImage.
- Keeps visual consistency with drag-and-drop and avoids leaking temp paths in
  the visible message.
2025-09-01 20:28:12 +10:00
James Peter 63d1e4acba fix(tui/paste): treat data-URI and raw base64 image pastes as images
- Add decoder to recognize  and common raw base64
  (PNG/JPEG/GIF) payloads, decode with , and write a temp .png.
- Hook into composer paste path before large-paste placeholder logic so iTerm2’s
  menu Paste (which pastes an iVBORw0K... blob) becomes an attached image
  with a temp path and a footer notice, not raw base64 text.
2025-09-01 20:24:20 +10:00
James Peter ecf3d2bbb1 feat(tui): add paste shortcuts fallback to read raw image from clipboard
Terminals like iTerm2 do not emit  for non-text clipboards. When
users press common paste keys (Ctrl+V, Ctrl+Shift+V, Shift+Insert), dispatch an
empty paste to the composer. The composer already treats empty paste as a cue to
attempt  via arboard+image and attach the PNG path.

This keeps normal text paste behavior (Cmd+V still triggers Event::Paste) and
adds a sensible fallback for image-only clipboards.
2025-09-01 20:18:22 +10:00
James Peter 590f18c5f0 fix(tui/clipboard): enable PNG encoder so raw image clipboard paste saves to temp .png
Clipboard reading uses arboard -> RGBA -> image::write_to(ImageFormat::Png), but the
 crate disabled default features on  and only enabled .
This meant encoding PNG failed at runtime and the paste path returned Err,
so pasting raw image data appeared to do nothing.

Enable the  feature on  for the TUI crate so we can encode the
clipboard image to PNG, insert the temp path, and flash the footer notice as intended.
2025-09-01 18:24:23 +10:00
James Peter 58baec56d9 fix(tui/chatwidget): handle ExecCommandBegin before flushing queued interrupts to ensure running cell exists and prevent out-of-order End showing call_id instead of command 2025-09-01 18:20:10 +10:00
GitHub Action d2282bc850 chore(release): 0.2.53 [skip ci] v0.2.53 2025-09-01 08:14:33 +00:00
James Peter 0bb261a936 Merge origin/main: keep local HUD min-height change and browser diagnostics; no conflicts 2025-09-01 18:05:26 +10:00
James Peter a240e22e45 feat(browser): improve internal browser launch diagnostics and log path 2025-09-01 18:05:09 +10:00
James Peter 38f446fce0 feat(tui/hud): raise expanded HUD minimum to 25 rows 2025-09-01 18:05:09 +10:00
James Peter 0e73ea095d feat(tui): coalesce redraws; refine HUD sizing; update shortcuts
- Coalesce scheduled redraws via atomic flag; send Redraw and clear pending\n- Remove ScheduleFrameIn from allowed AppEvent variants\n- Track full frame height to size HUD: 30% of terminal, min 15 rows (<=60%)\n- Simplify header copy and show dynamic "expand/collapse" hints\n- Change Agents toggle to Ctrl+A (was Ctrl+P); keep Browser on Ctrl+B
2025-09-01 11:45:44 +10:00
James Peter c38ed5bf31 feat(browser,tui): CDP console logs; collapsible HUD; page scroll
browser/manager: install JS console hook on connect to capture logs immediately for already-loaded pages; prefer CDP-captured buffer and fall back to JS hook.\n\nbrowser/page: enable CDP Runtime/Log and buffer console + log events; expose tail accessor.\n\nTUI/chatwidget: add HUD expand/collapse toggles (Ctrl+B for Browser, Ctrl+P for Agents), PageUp/PageDown to page transcript, and track external Chrome connection status for titles.\n\nTUI/height_manager: allow caller-provided HUD target height to support stacked/collapsed layout; keep legacy aspect estimate as fallback.\n\napp, app_event_sender, tui: wire height target and redraws.\n\nRationale: ensure reliable console capture regardless of page state and improve TUI ergonomics for HUD and scrolling.
2025-09-01 09:53:22 +10:00
GitHub Action 8ec9c781ec chore(release): 0.2.52 [skip ci] v0.2.52 2025-08-30 05:25:35 +00:00
James Peter b2f6adf507 Merge origin/main: adopt 0.2.51 release version bumps; keep ours elsewhere (tui/diff) 2025-08-30 15:16:59 +10:00
James Peter 0d40711c2b fix(tui/diff): sanitize diff content like input/output (expand tabs, strip control sequences) to avoid terminal layout issues with tabs and ANSI codes 2025-08-30 14:51:45 +10:00
GitHub Action 900ff9fdbc chore(release): 0.2.51 [skip ci] v0.2.51 2025-08-30 04:23:54 +00:00
James Peter 28cee9c884 Merge origin/main: adopt 0.2.50 version bump metadata 2025-08-30 14:15:30 +10:00
James Peter dca72e915f fix(cli/coder): de-duplicate validateBinary to avoid ESM redeclare error under Bun/Node 23 2025-08-30 14:15:21 +10:00