Skip to content

fix(portal): static files 404 on clients host + raw cuid in revision picker - #10

Merged
tanthehack merged 2 commits into
mainfrom
fix/portal-assets-and-picker
Aug 21, 2026
Merged

fix(portal): static files 404 on clients host + raw cuid in revision picker#10
tanthehack merged 2 commits into
mainfrom
fix/portal-assets-and-picker

Conversation

@tanthehack

Copy link
Copy Markdown
Contributor

Two portal bugs, both visible right now on main.

1. Static files 404 on the clients host — the login wash vanished

My regression from #9. The proxy rewrote /auth-wash.png/portal/auth-wash.png, which doesn't exist. The old matcher only excluded _next/static, _next/image, favicon.ico and icon.svg, so every other file in public/ got swallowed:

  /auth-wash.png   primary=200   clients=404
  /logo.svg        primary=200   clients=404

The giveaway was that the login page still showed its lime dot grid but no green wash — the grid is pure CSS (radial-gradient), so it drew fine, while the background <Image> was a 404. The wash only seemed to half-work because next/image proxies through /_next/image, which was excluded.

Fix: any path with a file extension (plus all of /_next/) returns early untouched; extension-less paths are routes and still rewrite into app/portal/*. Matcher broadened to /((?!_next/|api/).*) and the asset test moved into proxy() where it can carry a comment explaining why.

This also pre-empts robots.txt, sitemap.xml, manifest.json, OG images, and font files — all of which would have 404'd on the client domain.

2. Revision picker showed a raw cuid

The "Request a revision" dialog rendered cmss519yc0002o8rke1kpkv3x instead of the project name.

Base UI's Select.Root takes an items map (value → label), and its own types are explicit:

When specified, <Select.Value> renders the label of the selected item instead of the raw value.

Without it, Select.Value prints the raw value — the project id. Fix passes items={{ [p.id]: p.name }}.

Cherry-picked from 2c1c9c7 on feature/revision-flow, where this was already written but sits unmerged behind five feature commits. Applied cleanly and kept the root-relative link rewrites from #9 intact. When feature/revision-flow eventually lands, git will see the identical change — but worth a glance at that file during its rebase.

Verification

  • /auth-wash.png and /logo.svg now 200 on both hosts; login wash confirmed rendering (bright green leaf-shadow, sampled avg luminance 118/255 — it was loading and bright all along, just 404ing).
  • Full 21-case routing matrix re-run, nothing regressed — routes, bookmarks, admin blocking, dynamic routes, 404s, case-insensitive host match, other subdomains, primary-host admin.
  • tsc --noEmit clean · eslint clean on both changed files.

Not visually verified: the revision picker itself — that needs a logged-in portal session (OTP to your email), which I can't do. The fix is confirmed against Base UI's documented API rather than a screenshot. Worth a 5-second look after merge.

Every file in public/ 404'd on clients.* — the proxy rewrote
/auth-wash.png to /portal/auth-wash.png, which doesn't exist. The old
matcher only excluded _next/static, _next/image, favicon.ico and
icon.svg, so any other asset got swallowed. That's why the portal
login lost its green wash: the dot-grid overlay is pure CSS so it
still drew, but the background image was a 404.

Now any path with a file extension (and all of /_next/) returns
early untouched; extension-less paths are routes and still rewrite
into app/portal/*. Broadened the matcher to /((?!_next/|api/).*)
and moved the asset test into proxy() where it can be commented.

Verified /auth-wash.png and /logo.svg now 200 on both hosts, and the
full 21-case routing matrix still passes.
Base UI's Select.Root takes an `items` map (value → label) and its
docs are explicit: "When specified, <Select.Value> renders the label
of the selected item instead of the raw value." Without it the
trigger printed the cuid (cmss519yc0002o8rke1kpkv3x).

Cherry-picked from 2c1c9c7 on feature/revision-flow, where it was
written but is still unmerged behind five feature commits.

Co-authored-by: Tanyalouise <tanielou10@gmail.com>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clover-admin Ready Ready Preview Aug 21, 2026 2:29pm

@tanthehack
tanthehack merged commit 6536c20 into main Aug 21, 2026
2 checks passed
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.

1 participant