fix(portal): static files 404 on clients host + raw cuid in revision picker - #10
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.icoandicon.svg, so every other file inpublic/got swallowed: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 becausenext/imageproxies 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 intoapp/portal/*. Matcher broadened to/((?!_next/|api/).*)and the asset test moved intoproxy()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
cmss519yc0002o8rke1kpkv3xinstead of the project name.Base UI's
Select.Roottakes anitemsmap (value → label), and its own types are explicit:Without it,
Select.Valueprints the raw value — the project id. Fix passesitems={{ [p.id]: p.name }}.Cherry-picked from
2c1c9c7onfeature/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. Whenfeature/revision-floweventually lands, git will see the identical change — but worth a glance at that file during its rebase.Verification
/auth-wash.pngand/logo.svgnow 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).tsc --noEmitclean ·eslintclean 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.