Commit Graph
16 Commits
Author SHA1 Message Date
roboomp b1b6d99627 fix(tui): backpressured slow loader paints
Measured each animated Loader paint and recursively scheduled the next frame with a 10% duty-cycle target, capped at 200ms to retain responsiveness.

Added a regression covering a slow synchronized-output direct-write path and documented the fix.

Fixes #7290
2026-08-01 17:23:26 +00:00
roboompandcan1357 beaafb9955 fix(tui): handled mixed-width spinner frames
Cached one stable layout representative per frame display width so same-width animation retains the fast path while width transitions rewrap before painting. Added coverage for wider custom frames remaining within terminal bounds.

(cherry picked from commit 3aa173a574538d754e68f8d10f7b88d437709884)
2026-07-29 23:08:40 +02:00
roboompandcan1357 b152f40134 fix(tui): stopped loader spinner re-wrapping text every tick
The Loader baked the advancing braille glyph into the underlying Text
via setText, so Text.render's wrap cache (keyed on text) missed every
80ms tick and re-ran wrapTextWithAnsi plus per-line width measurement
over the whole message even though only a 1-cell glyph changed. On a
single-subagent hub wait the direct-write render loop consumed ~48% of
a saturated core.

The wrapped text now carries a stable sentinel glyph (frames[0]); the
spinner advance only bumps the frame index and requests a repaint, and
render() swaps the visible glyph over the cached layout. wrapTextWithAnsi
and stringWidth now run only when the message actually changes.

Fixes #6940

(cherry picked from commit 6ec38053ebc1e33859358df3b66f71fea27532c7)
2026-07-29 23:08:40 +02:00
roboomp 09429fe4ea fix(tui): cached loader layout across shimmer frames
Separated stable plain-text layout from animated ANSI coloring so 30fps shimmer updates no longer repeat wrapping and width measurement.

Fixes #5230
2026-07-14 19:47:33 +00:00
roboomp 62172339b0 fix(tui): preserved loader stub compatibility
Fell back to requestComponentRender when Loader receives a lightweight TUI stub without requestDirectWrite.

Added regression coverage for legacy Loader stubs used by component tests.
2026-07-11 15:00:27 +00:00
roboomp 276092eac8 fix(tui): reduced idle loader render work
Added a direct-write path for quiet visible component segments so Loader animation rewrites only its known rows instead of scheduling the full render pipeline.

Updated Loader scheduling and regression coverage for direct-write fast paths and overlay fallback behavior.

Fixes #5192
2026-07-11 14:46:40 +00:00
roboomp 568226abb9 fix(tui): disposed stale session ui renderers
Stopped new-session and session-switch UI paths from detaching active loader/render components without running their disposal hooks.

Added container and loader coverage for disposing children before destructive transcript/status replacement.

Fixes #4686
2026-07-06 08:49:02 +00:00
roboomp f2b92059cf fix(tui): reduced loader repaint flicker
Throttled animated loader message-only repaints when synchronized output is unavailable so unsupported terminals only repaint on spinner frame changes.

Fixes #2771
2026-06-16 12:16:40 +00:00
can1357 b1338b8f57 feat(tui): added component-scoped rendering with partial compose reuse
- Added `TUI.requestComponentRender`, enabling component-scoped render requests.
- Implemented partial compose reuse by resolving and memoizing affected root segments.
- Fixed component-scoped updates to keep frame-seam rows continuous across partial renders.
- Added component-render and loader tests for reuse, downgrade, and call-count coverage.
2026-06-11 16:13:18 +02:00
can1357 00e6e14cb4 feat: added reconstructed raw SSE capture for stream provider SDKs
- Added reconstructed SSE event emission for OpenAI, Azure, and Anthropic streams.
- Added raw SSE text to debug report bundles, including raw-sse.txt output.
- Included dropped-record metadata in raw SSE text when events were trimmed.
- Updated raw SSE and sse-debug tests for observer-based capture and safety checks.
2026-06-08 02:35:14 +02:00
can1357 a3efb62998 feat(coding-agent/modes): added canonical key matching behavior and exported alias utilities
- Built canonical and alias key maps for action/custom handlers and rebuilt them on changes.
- Preserved the first handler when custom key alias collisions occurred during rebuilds.
- Exported canonicalKeyId and addKeyAliases from keybindings for external use.
2026-06-08 02:29:30 +02:00
can1357 078dac7ea8 fix(tui): skipped loader render requests when text unchanged
- Returned a changed flag from setText to gate render requests.
- Avoided redundant renders when composed loader text matches prior frame.
2026-06-08 02:15:24 +02:00
can1357 9b98dafe4e test(packages/tui): updated tui test timing for 30fps render cadence
- Updated settle helpers in repro tests to wait 40ms before terminal flush.
- Raised process-terminal-render-harness SETTLE_MS to 67ms for 30fps timing.
- Updated render-throttle mocks to advance mock time by 40ms per frame.
- Added Loader component cadence test for 30fps animated repaint timing.
- Added render-regressions check that non-force renders are scheduled at ~33ms.
2026-06-07 08:42:51 +02:00
can1357 99e91138a4 feat(coding-agent): enabled component-based chat rendering with managed block lifecycles
- Added ChatBlock and ChatBlockHost with mount, finish, and dispose lifecycle callbacks.
- Added InteractiveModeContext.present and resetTranscript APIs and used them to mount/repaint blocks.
- Reworked controller rendering paths to emit command, event, extension, and selector outputs via ctx.present.
- Implemented component and container dispose hooks in tui so loaders and child blocks cleanup timers/effects.
2026-06-07 03:33:53 +02:00
can1357 c3d0bd9773 feat(coding-agent): deferrable tools, LIFO pending-action stack, custom tool pushPendingAction
- Introduce `deferrable?: boolean` on AgentTool, CustomTool, and ToolDefinition.
  AstEditTool sets it to true; resolve is now injected only when at least one
  active tool is deferrable (previously unconditional).

- Replace single-slot PendingActionStore (set/get/clear) with a LIFO stack
  (push/peek/pop/clear). Multiple deferrable tools can stage independent
  preview actions; resolve always consumes the topmost one first.

- Wire pendingActionStore through discoverAndLoadCustomTools / loadCustomTools /
  CustomToolLoader so custom tools can call pushPendingAction(action) to
  register a resolve-compatible pending action with label, apply callback,
  optional details, and optional sourceToolName.

- Export HIDDEN_TOOLS and ResolveTool from the SDK for manual tool composition.

- Add CustomToolPendingAction type and pushPendingAction to CustomToolAPI.

- Update createAgentSession to re-inject or remove resolve after the deferrable
  audit, consistent with createTools behavior.

- Add LIFO resolve test, update existing tests (set -> push, get -> peek).

- Add docs/resolve-tool-runtime.md covering PendingActionStore internals,
  built-in producer example, and custom tool usage guide.
2026-03-01 02:57:31 +01:00
can1357 0a49a4a9a7 fix(tui): corrected loader text overflow and terminal clear behavior
- Fixed loader component text overflow by truncating lines exceeding terminal width using column-aware slicing.
- Improved terminal clear logic on resize to use hard clear (\x1b[2J) preventing stale wrapped cells.
- Added test coverage for loader component line clamping to verify rendered lines fit within terminal width.
- Refactored terminal clear conditional logic from ternary to multi-line if-else for improved maintainability.
2026-03-01 02:35:43 +01:00