Skip to content

perf(web): lazy-load the ambient appearance hover card - #91

Merged
maarco merged 3 commits into
mainfrom
perf/lazy-ambient-appearance-hover-card
Sep 29, 2026
Merged

maarco merged 3 commits into
mainfrom
perf/lazy-ambient-appearance-hover-card

Conversation

@maarco

@maarco maarco commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What Changed

The ambient appearance hover card moves into its own module, ChatAmbientAppearanceHoverCard, loaded with React.lazy. The picker button renders immediately as the Suspense fallback, so it never waits on the import.

The new file joins the Marcode fork seam's lint exemption list in vite.config.ts, as the file it was extracted from already is.

Why

The hover card only matters after a pointer rests on the picker, but its code was part of the module that renders the chat header. Loading it separately keeps hover-only code out of that module.

Checked in a running app: the module is fetched as its own request, the card appears on hover and hides on mouse-out, and a click still opens the appearance popover.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (n/a: no visible UI change)
  • I included a video for animation/interaction changes (n/a: no animation change)

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 29, 2026
The hover card moved out of chatAmbientEffects.tsx, which the Marcode fork seam exempts from the shadcn rules, into a new file that was not exempt. Its two raw cyan classes failed no-raw-colors in CI. The new file joins the same exemption list.
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.5 KiB −5 B (−0.0%) 15.1 KiB ✅
Codex Thread snapshot wire 7.1 KiB 7.1 KiB 0 B (0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.4 KiB 6.4 KiB −5 B (−0.1%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 56.2 KiB 56.2 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 9 9 0 (0.0%) 21 ✅
Claude Total thread wire 13.5 KiB 13.5 KiB −7 B (−0.1%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB −1 B (−0.0%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.4 KiB 6.4 KiB −6 B (−0.1%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.1 KiB 57.0 KiB −44 B (−0.1%) 66.4 KiB ✅
Claude Live turn messages 10 9 −1 (−10.0%) 21 ✅

Baseline: b99b215 · PR result: 59f547a · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@maarco
maarco merged commit 77e9457 into main Sep 29, 2026
17 of 18 checks passed
@maarco
maarco deleted the perf/lazy-ambient-appearance-hover-card branch September 29, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant