Skip to content

Replace log-update terminal UI with Ink components#149

Open
ddwang wants to merge 9 commits intomagnitudedev:mainfrom
ddwang:main
Open

Replace log-update terminal UI with Ink components#149
ddwang wants to merge 9 commits intomagnitudedev:mainfrom
ddwang:main

Conversation

@ddwang
Copy link
Contributor

@ddwang ddwang commented Feb 9, 2026

Summary

  • Replaces the log-update + manual ANSI string rendering layer in packages/magnitude-test/src/term-app/ with Ink (React for the terminal)
  • Adds ink, ink-spinner, react dependencies; removes log-update and @types/terminal-kit
  • State bridge pattern buffers updates before React mount, preventing race conditions
  • No changes to TestRenderer interface, TestStateTracker, or runner/state.ts
Screenshot 2026-02-08 at 5 50 06 PM

Test plan

  • Run bun src/cli.ts examples/tests/example.mag.ts — visual comparison with previous output
  • Confirm spinner animates, elapsed time ticks
  • Confirm --plain/--debug mode still uses DebugRenderer (not Ink)
  • Confirm showActions/showThoughts config respected
  • Test with workerCount > 1 — no rendering glitches from concurrent updates
  • Confirm SIGINT graceful shutdown

Closes #94

ddwang and others added 9 commits February 6, 2026 03:41
Allows pausing the agent's action loop at clean boundaries (between actions and between batches) for human-in-the-loop review or conditional execution, then resuming without losing state. stop() while paused unblocks the loop to prevent deadlocks.
Migrate the test runner rendering layer from manual ANSI string building with log-update to Ink components. State bridge pattern handles the async mount race condition. No changes to TestRenderer interface or TestStateTracker. Closes magnitudedev#94
Allow the LLM planner to hover over elements to reveal dropdown menus, tooltips, and other hover-triggered content. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Idempotent static method that closes all active browsers, clears the activeBrowsers record, and removes the singleton from globalThis. Safe to call when no browsers exist or when browsers are already closed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use Promise.allSettled for concurrent browser closing instead of sequential awaits. Replace per-key deletes with single object reset. Remove unused context variables in tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Lets consumers write `import { z } from 'magnitude-core'` instead of reaching into node_modules, avoiding version mismatch and breakage on internal restructuring. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary only read modelUsage[0], missing tokens from additional models. Also memoize groupRegisteredTestsForDisplay and testContextMap since their inputs are stable across re-renders. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename package to @ddwang/magnitude-core with prerelease version 0.3.1-ddwang.1 to avoid colliding with upstream. Add scripts/publish.sh for manual npm publishing with dry-run confirmation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant