Fix broken job detail styling on community and author listings - #1
Open
dearrudam wants to merge 2 commits into
Open
Fix broken job detail styling on community and author listings#1dearrudam wants to merge 2 commits into
dearrudam wants to merge 2 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…-sync Co-authored-by: Maximillian Arruda <dearrudam@gmail.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
Opening a job from a community listing (
/communities/[owner]/[name]/) rendered the detail overlay completely unstyled in the static export: the document<head>— stylesheet link and title — was emptied.Root cause is not in
OpportunityDetailsorDetailsDialog. Selecting a job only adds?job=<id>to the URL, but the listing controller pushed that purely client-side state throughrouter.replace(...). On the statically exported dynamic routes (/communities/[owner]/[name],/authors/[handle]) that is a router navigation whose segments are not in the prefetch cache, so Next fetches the full RSC payload (…/vagas/index.txt?job=…&_rsc=…) and applying it replaces the tree, dropping the head produced by the initial HTML. On/the segments are prefetched, so the same code path resolved from cache and never broke — which is why only profile routes showed it.Filters and job selection are client-side URL state, so they now use the shallow-routing API Next documents for exactly this (
window.history.replaceState), which keepsusePathname/useSearchParamsin sync without any navigation:useRouteris no longer needed in the controller, anduseUrlSyncno longer takes arouter.OpportunityDetailsmode behavior is untouched.Type of change
Validation
npm run lintnpm run buildnpm run test:job-headerpasses. Manually verified against the static export (out/served over HTTP): job detail opens correctly styled from home, community, and author listings; filters still update the URL (trailing slash preserved) and results; standalone/jobs/[id]unchanged.Notes
Before / after on the community route: