Skip to content

1.0.46

Choose a tag to compare

@morapelker morapelker released this 27 Feb 10:42
· 2921 commits to main since this release

What's Changed

Add local supercharge and connection-aware session flow (#74)

  • Connection-aware handoff & supercharge: Both handlePlanReadyHandoff and handlePlanReadySuperpowers in SessionView now detect when the current session is a connection session and branch into a dedicated path that uses createConnectionSession instead of creating a local worktree session.
  • New "Supercharge locally" button: Added a handlePlanReadySuperpowersLocal handler that creates a supercharge session in the same worktree (no branch duplication), enabling local supercharge without spinning up a new worktree. A corresponding outlined violet "Supercharge locally" button appears in PlanReadyImplementFab when superpowers are available and the session is not a connection session.
  • Consistent setSessionMode await pattern: All code paths (handoff, supercharge, local supercharge, connection variants) now use a fire-and-await pattern — capturing the setSessionMode promise early and awaiting it at the end — for consistency and correct ordering.
  • Improved error messages: Error toasts now use result.error ?? 'fallback message' instead of hardcoded strings, surfacing server-side error details when available.

Redesign run pane with virtualized rendering, search, and RAF-throttled updates (#73)

Comprehensive redesign of the Run output pane with performance optimizations, always-on virtualization, and an inline search feature.

New Utilities

  • ansi-utils.ts — stripAnsi() and parseAnsiSegments() for stripping ANSI escape sequences (SGR, OSC, CSI, private-mode CSI) and parsing them into text+code segments, enabling search matching on plain text and highlight rendering
  • OutputRingBuffer enhancements — Added O(1) random-access get(index) method and renderCount getter, eliminating the O(n) toArray() copy on every render cycle

Performance Improvements

  • RAF-throttled version bumps — Replaced per-line Zustand set() calls in appendRunOutput with requestAnimationFrame-batched updates, capping re-renders at ~60/sec instead of potentially thousands during rapid build output
  • Always-virtualized rendering — Removed the VIRTUALIZE_THRESHOLD and non-virtualized .map() code path; the virtualizer now always drives rendering, using buffer.get(index) for O(1) row access
  • Smart auto-scroll — Tracks user scroll position and only auto-scrolls when near the bottom; suppresses auto-scroll while search is open

New Components

  • RunOutputLine — React.memo component extracting individual line rendering with truncation, command, error, and normal ANSI output markers. Supports search highlight rendering via parseAnsiSegments with bright/dim <mark> styling (intentionally drops ANSI coloring in favor of highlight visibility, matching VS Code terminal search behavior)
  • RunOutputSearch — Debounced (150ms) inline search bar triggered by Cmd+F. Searches through OutputRingBuffer lines, stripping ANSI codes and skipping marker lines. Reports matches via callback for the parent to build a highlight map and scroll. Keyboard navigation with Enter/Shift+Enter/Escape, plus prev/next/close buttons

RunTab Restructuring

  • Replaced toArray()/useMemo with index-based buffer.get(index) access
  • Replaced manual scrollTop assignment with virtualizer.scrollToIndex
  • Integrated Cmd+F search with highlight map for O(1) per-row lookup
  • Used refs for callbacks to avoid re-triggering debounce on parent re-renders
  • Removed dead Loader2 spinner code and unnecessary containment checks

Bug Fixes

  • Guard cancelAnimationFrame against sentinel value (-1) in clearRunOutput
  • Replace non-null assertions with guard patterns for type safety
  • Preserve current match index when re-searching on outputVersion changes

Tests (6 new test files, 1868 lines added)

  • ansi-utils.test.ts — ANSI stripping and segment parsing
  • output-ring-buffer-access.test.ts — O(1) random access, renderCount, truncation marker behavior
  • run-output-line.test.tsx — Line rendering with markers, truncation, ANSI, and search highlights
  • run-output-search.test.tsx — Search lifecycle, debounce, keyboard navigation, match reporting
  • script-store-raf-throttle.test.ts — RAF-throttled version bumps, batch behavior, cancellation