Skip to content

fix: review-panel fixes for #85#86

Open
bird-m wants to merge 7 commits intokelsonpw/terminal-lib-upgradesfrom
fix/review-panel-85
Open

fix: review-panel fixes for #85#86
bird-m wants to merge 7 commits intokelsonpw/terminal-lib-upgradesfrom
fix/review-panel-85

Conversation

@bird-m
Copy link
Copy Markdown
Collaborator

@bird-m bird-m commented Apr 16, 2026

Summary

Review-panel fixes for PR #85 (terminal rendering libraries). Each commit is independently cherry-pickable.

Confirmed Findings — Fixed

# Sev Commit Finding Fix
1 🟡 Important 96ad5e3 JSON heuristic in LogViewer matched ALL log lines ([timestamp] starts with [) Narrowed [ check to [{ and ["
2 🟡 Important 42744d4 Table primitive had no consumers — dead code on merge Removed Table.tsx and barrel export
3 🟡 Important 7e7f2d4 Hardcoded ANSI escape sequences bypassed Brand/Colors design tokens Added hexToAnsi() helper using Brand.blueOnDark and Brand.lilac
4 🔵 Nit 7e7f2d4 marked.use() mutated global singleton Created scoped new marked.Marked() instance
5 🔵 Nit 5222418 Stripe tip showed "Add Stripe data source" instead of raw URL (inconsistent with all other TerminalLink usages) Changed to show raw URL
6 🔵 Nit 3a66fbc brandGradient('Amplitude Wizard') recomputed on every HeaderBar render Hoisted to module-level constant
7 🔵 Nit f03fc42 renderMarkdown ran full marked.parse on every fs.watch event without diffing Added content-diff cache
8 🔵 Nit 29cc151 TerminalLink hardcoded Colors.accent with no override Added optional color prop

Pre-existing / FYI (not fixed — pre-dates this PR)

  • AmplitudeLogo.tsx:37buildGradient silently skips last gradient segment (8 anchors, 7 steps)
  • AmplitudeLogo.tsx:62 — Comment claims 64 stops but code sums to 58

Considered & Dropped (12 findings)

  • S1: OAuth URL clickable — URL was already in plaintext, PKCE safe
  • S2: Agent markdown unsanitized — content from own agent, Ink escapes
  • S3: Sensitive data highlighted — data was already displayed
  • S5: Log path env var — pre-existing
  • C1/C2/C3: AmplitudeLogo issues — not in PR diff, pre-existing
  • C4/Q2: as string cast — marked.parse() is sync by default in v12
  • C5/C6: publish.yml changes — not in PR diff, pre-existing + intentional
  • C8: Stale closure — pre-existing, handler recreated each render
  • Q6: No memoization — subsumed by finding Bump esbuild and vitest #1
  • Q10: terminal-link v2 undocumented — documentation preference

Process

  • 3 specialist agents (Security, Correctness, Quality) ran in parallel
  • 1 judge agent validated all findings against actual code
  • All 849 tests pass on every commit

🤖 Generated with Claude Code review-panel


Note

Low Risk
Mostly UI/terminal rendering tweaks and dead-code removal; main risk is minor regressions in markdown/log highlighting behavior or link color defaults.

Overview
Fixes several TUI rendering issues and small performance nits. LogViewer now uses a narrower JSON detection heuristic (avoiding false positives on timestamped lines) and ReportViewer skips re-rendering markdown when file contents haven’t changed.

Markdown rendering in terminal-rendering is made more token-driven by deriving ANSI colors from Brand via hexToAnsi() and by switching to a scoped new marked.Marked() instance instead of mutating the global marked singleton. Also hoists the header gradient title to a module constant, adds an optional color override to TerminalLink, updates the Stripe tip to display the raw URL, and removes the unused Table primitive and its barrel exports.

Reviewed by Cursor Bugbot for commit 29cc151. Bugbot is set up for automated code reviews on this repo. Configure here.

bird-m and others added 7 commits April 15, 2026 17:40
`startsWith('[')` matched every log line because the wizard log format
is `[timestamp] msg`. Narrow `[` check to `[{` and `["` so only JSON
arrays are highlighted, not timestamp-prefixed lines.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Table.tsx was introduced with no consumers. Remove it to avoid dead
code on merge — can be re-added in the PR that actually needs it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…marked instance

Replace hardcoded ANSI RGB values with Brand.blueOnDark and Brand.lilac
via a hexToAnsi helper, keeping heading colors in sync with styles.ts.

Also scope marked config to a local Marked instance instead of mutating
the global singleton, preventing side effects on other marked consumers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All other TerminalLink usages in the PR show the URL as display text.
The Stripe tip was the only one using a descriptive label, which hides
the URL in fallback terminals. Use the raw URL for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The gradient for the constant string "Amplitude Wizard" was recomputed
on every HeaderBar render. Hoist to a module-level constant so the
gradient-string interpolation runs once.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fs.watch can fire multiple times per write. Cache the previous raw
content and skip the marked.parse call when it hasn't changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously hardcoded to Colors.accent. Add a `color` prop defaulting
to Colors.accent so callers can use different colors (e.g.
Colors.accentSecondary) without wrapping in an extra <Text>.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bird-m bird-m requested a review from a team as a code owner April 16, 2026 00:43
@github-actions
Copy link
Copy Markdown
Contributor

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci django
  • /wizard-ci fastapi
  • /wizard-ci flask
  • /wizard-ci javascript-node
  • /wizard-ci javascript-web
  • /wizard-ci next-js
  • /wizard-ci python
  • /wizard-ci react-router
  • /wizard-ci vue

Test an individual app:

  • /wizard-ci django/django3-saas
  • /wizard-ci fastapi/fastapi3-ai-saas
  • /wizard-ci flask/flask3-social-media
Show more apps
  • /wizard-ci javascript-node/express-todo
  • /wizard-ci javascript-node/fastify-blog
  • /wizard-ci javascript-node/hono-links
  • /wizard-ci javascript-node/koa-notes
  • /wizard-ci javascript-node/native-http-contacts
  • /wizard-ci javascript-web/saas-dashboard
  • /wizard-ci next-js/15-app-router-saas
  • /wizard-ci next-js/15-app-router-todo
  • /wizard-ci next-js/15-pages-router-saas
  • /wizard-ci next-js/15-pages-router-todo
  • /wizard-ci python/meeting-summarizer
  • /wizard-ci react-router/react-router-v7-project
  • /wizard-ci react-router/rrv7-starter
  • /wizard-ci react-router/saas-template
  • /wizard-ci react-router/shopper
  • /wizard-ci vue/movies

Results will be posted here when complete.

@kaiapeacock-eng
Copy link
Copy Markdown
Collaborator

Trivial fix — unblocks CI

src/ui/tui/utils/terminal-rendering.ts:63 uses new marked.Marked(), but Marked is a named export on the default import — hence the TS2339 build failure.

-import marked from 'marked';
+import marked, { Marked } from 'marked';
 ...
-const md = new marked.Marked();
+const md = new Marked();

Looks like you already have this locally — just needs pushing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants