Skip to content

fix(desktop): compile annotation CSS in the preload bundler - #17850

Open
t3-code[bot] wants to merge 2 commits into
mainfrom
fix/annotation-css-bundler-plugin
Open

t3-code[bot] wants to merge 2 commits into
mainfrom
fix/annotation-css-bundler-plugin

Conversation

@t3-code

@t3-code t3-code Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Desktop annotation styles are compiled into a tracked TypeScript file before bundling. That can leave a dirty tree after a build, and the one-shot generation step does not refresh CSS during watch rebuilds.

Compile the stylesheet through a Vite+ Pack plugin instead. The preview preload imports a typed virtual module whose CSS remains embedded in the sandboxed preload bundle. Watch dependencies include the annotation CSS, preload class candidates, and Tailwind theme/preflight inputs; each load uses a fresh compiler so removed utilities disappear.

Remove the old generator and tracked output. Ignore the exact legacy output path and remove any leftover file at build start, so builds from older checkouts cannot supply stale CSS or leave an untracked generated file behind. Normal Git protections for local modifications still apply when switching branches; this does not force checkout or reset user changes.

#17838 has merged. This follow-up is rebased on main and replaces the refreshed tracked stylesheet with build-time compilation.

verification

  • Focused bundler integration tests pass: legacy-file cleanup and watch rebuilds after CSS and preload edits, including utility removal.
  • Built the real preview preload through vp pack --filter preview-pick-preload using Vite+ 1.0.0 and Tailwind 4.3.3.
  • Embedded CSS is byte-identical to the existing generator's regenerated output. No virtual-module runtime require remains.
  • Reintroduced the old generated file, confirmed it is ignored, built the real preload, and verified cleanup with unchanged Git status.
  • Targeted lint, strict typechecking of the plugin/tests, and git diff --check pass.
  • No full desktop packaging, Electron launch, or macOS/Windows local run performed.

requested by @mwolson. co-author credit included.

model: gpt-6.1-sol. harness: hermes agent.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 10, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 10, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR moves annotation CSS generation into the production Electron preload bundler and adds watch-aware integration coverage, while preserving the existing runtime injection path. Human review is warranted because the new bundler and test files suppress a static-analysis diagnostic.

Notes:

  • All code in this push has already been reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 4.9 KiB 4.9 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.8 KiB 20.8 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: e7db61f · PR result: ecd60b4 · 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: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

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

@macroscopeapp
macroscopeapp Bot dismissed their stale review October 10, 2026 15:37

Dismissing prior approval to re-evaluate c50ab39

@t3-code

t3-code Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

The two nodeBuiltinImport exemptions are scoped to bundler hooks and their filesystem integration fixtures. These run outside an Effect runtime, matching the existing build-bootstrap exemption in scripts/lib/public-config.ts; no repo-wide diagnostic setting changed. The current-head CI and correctness check pass, and the real preview preload bundles with CSS identical to the previous generator output. Leaving the build integration and these exemptions for human review, as requested by the approvability check.

t3-code Bot and others added 2 commits October 11, 2026 02:51
Co-authored-by: Mike Olson <1510193+mwolson@users.noreply.github.com>
Co-authored-by: Mike Olson <1510193+mwolson@users.noreply.github.com>
@t3-code
t3-code Bot force-pushed the fix/annotation-css-bundler-plugin branch from c50ab39 to ecd60b4 Compare October 11, 2026 02:52
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 11, 2026 — with ChatGPT Codex Connector

This branch has not been deployed

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

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:L 100-499 changed lines (additions + deletions). 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