Skip to content

refactor(web): one Tailwind sheet, scanned from the routes' imports, inside each page CU-17tkuw617h7 - #737

Merged
michaelassraf merged 10 commits into
mainfrom
refactor/per-page-css
Oct 29, 2026
Merged

michaelassraf merged 10 commits into
mainfrom
refactor/per-page-css

Conversation

@michaelassraf

@michaelassraf michaelassraf commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

What

apps/web/tailwind.config.ts: content is the lib's appStyleSources({ root: __dirname, appDir: 'src/app' }), the files the app's routes import (its own and the design-system lib's per-module build), instead of every file under src plus the lib's whole dist. Tailwind then writes rules only for classes something on a page can render.

No firstPaint split here: the app does not pass loadStyles, so its one stylesheet keeps every class it imports, the chat included.

Before merging

Needs the lib release carrying style-sources and next-styles (the PR below), and this app's lib pin moved to it.

Not run locally

The pre-commit hook (eslint, prettier, tsc in apps/web) needs node_modules, which this worktree has none of; the commit skipped it. CI runs the same checks.

Also: the stylesheet inside each page's HTML, one Tailwind sheet, and its budget

  • next.config.mjs wraps the config in the lib's withInlineStyles: the route's CSS is written into its HTML, the static export included (checked: no stylesheet links left in dist/*.html).
  • globals.css no longer repeats @tailwind base/components/utilities. The library's styles already carry them, and Turbopack builds each imported CSS file as its own chunk, so the app shipped two full Tailwind sheets. Inlined CSS per page: 607 KB → 326 KB raw. Computed styles of all 52 visible elements on /auth are identical before and after.
  • npm run css:budget:check (the lib's budget command, 35,000 bytes brotli; today 31.8 KB) runs in CI's Unit Test job, after codegen.
  • apps/web/CLAUDE.md states the rule.

Change-Set: refactor-per-page-css
Depends-On: flamingo-stack/openframe-oss-lib#2855
ClickUp task: CU-17tkuw617h7 Refactor all CSS so every page ships only the styles it uses, by default

🤖 Generated with Claude Code

Change set flamingo-stack/openframe-oss-frontend#737: these pull requests are one change, reviewed together.

  • flamingo-stack/openframe-oss-frontend#737 (this pull request): refactor(web): one Tailwind sheet, scanned from the routes' imports, inside each page CU-17tkuw617h7 · landed
  • …and 2 pull requests not visible

Linked work

  • …and 1 linked item not shown here

Linked by the Depends-On / Change-Set lines in these descriptions; this block is maintained by the hub.

…es import

content is the lib's appStyleSources over src/app, not every file under src plus
the design-system lib's whole dist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaelassraf
michaelassraf requested review from a team as code owners October 28, 2026 05:18
@michaelassraf

Copy link
Copy Markdown
Member Author

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦩 Flamingo Code Review

✅ Tests and checks passed on this commit (6 lanes).

✅ No findings on the current head.

Advisory: findings do not block the merge.

Files Lines 🔴 Action required 🟠 Recommended 🔵 Informational
6 +26 / -11 0 0 0

✅ What this change does well

  • apps/web/package.json simplifies the css:budget:check script, delegating the --input/--config/--name flags to the CLI's own defaults instead of hardcoding paths in the app.
1 possible problem checked and ruled out, 1 after reading more of the repository
  • apps/web/package.json:38 css:budget:check now invokes an unresolvable next-styles CLI with no package providing that bin: The sibling PR openframe-oss-lib#2855 (part of this same change set, per resolve_code_imports' change_set field) is the one introducing the next-styles bin/CLI in the core package; this repo's package.json bump to 0.0.812 and script rewrite depend on that sibling, which is only partially visible (1 sibling hidden). The import resolver's 'unresolved' here reflects coverage gaps, not a…

🧪 Tests and mutation

Tests per lane

Language Project Command Status Counts Time
TypeScript (npm) apps/web npx vitest related --run next.config.mjs tailwind.config.ts ✅ passed 2.2 s

Checks

Check Kind Language Project Status Time
lint:ci lint TypeScript (npm) apps/web ✅ passed 39.3 s
check:loading lint TypeScript (npm) apps/web ✅ passed 3 s
Trivy security JavaScript (Trivy) . ✅ passed 18.1 s
YAML syntax lint YAML (YAML and GitHub Actions) . ✅ passed 0.7 s
actionlint lint YAML (YAML and GitHub Actions) . ✅ passed 2.1 s

flamingo-stack/openframe-oss-lib#2855 was not built first: none of this change's toolchains says how to install it.

1 gap (not tested here):

  • TypeScript (npm) apps/web: no mutation testing (no Stryker configured: mutation coverage is a gap to report)

Review again. New commits are not reviewed until you ask:

  • Review the new commits: only what was pushed since this review
  • Review the whole diff again: everything, including what was already reviewed

Or comment @flamingo-review (new commits) or @flamingo-review full (everything). Add the flamingo-review-always label to review every push.

Started 2026-10-29 13:17 UTC · updated 2026-10-29 13:19 UTC · workflow run

michaelassraf and others added 3 commits October 28, 2026 01:25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… one Tailwind sheet, and its budget

withInlineStyles (the lib's next-styles) writes the route's CSS into its HTML, the
static export included, so a page paints without a second request. globals.css no
longer repeats the @tailwind directives the library's styles carry: each imported
file is its own chunk, so the app shipped two full Tailwind sheets (607 KB inlined,
now 326 KB). npm run css:budget:check holds the sheet under 35,000 bytes brotli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaelassraf michaelassraf changed the title refactor(web): Tailwind scans only what the app's routes import CU-17tkuw617h7 refactor(web): one Tailwind sheet, scanned from the routes' imports, inside each page CU-17tkuw617h7 Oct 28, 2026
@michaelassraf michaelassraf added the flamingo-review Ask for one more review pass; removed automatically when the run is requested label Oct 29, 2026
@github-actions github-actions Bot removed the flamingo-review Ask for one more review pass; removed automatically when the run is requested label Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaelassraf michaelassraf added the flamingo-review Ask for one more review pass; removed automatically when the run is requested label Oct 29, 2026
@github-actions github-actions Bot removed the flamingo-review Ask for one more review pass; removed automatically when the run is requested label Oct 29, 2026
Comment thread apps/web/package.json Resolved
…-styles command

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaelassraf michaelassraf added the flamingo-review Ask for one more review pass; removed automatically when the run is requested label Oct 29, 2026
@github-actions github-actions Bot removed the flamingo-review Ask for one more review pass; removed automatically when the run is requested label Oct 29, 2026
michaelassraf and others added 3 commits October 29, 2026 11:12
…-17tkuw617h7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rder CU-17tkuw617h7

- .nvmrc, the Dockerfile (node:26.13.0-alpine3.24), @types/node 26.6.6 and the docs move to Node 26.
- vitest 5: Node 25+ defines its own localStorage on the global object, and vitest 4 left it in
  place of jsdom's, so every test that used storage failed on Node 26. vitest 5 puts jsdom's in.
- api-client, session-poll and session-revalidation tests imported two modules in parallel right
  after vi.resetModules(); under load each import could evaluate its own copy of the shared module,
  so a test read a store the code under test never wrote. They load in order now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread apps/web/src/app/globals.css Resolved
Comment thread apps/web/package.json Resolved
…617h7

tailwindcss-animate was listed twice: the preset already carries it, and the package comes with
the library. The app keeps no safelist of its own, which would replace the preset's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaelassraf
michaelassraf merged commit c5d3369 into main Oct 29, 2026
15 of 19 checks passed
@michaelassraf
michaelassraf deleted the refactor/per-page-css branch October 29, 2026 18:38
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