Problem
The list and detail views for job offers are crammed into a single page (job-offers.astro and admin/job-offers.astro). This causes:
- Flash-of-wrong-content (filter/list briefly visible before detail loads)
- Complex visibility toggle logic (
hidden class juggling between sections)
- Race conditions between list and detail rendering
- Hash-based navigation (
#id) instead of proper URLs
- Each page file is huge with two views worth of code
Proposed change
Split the detail view into a dedicated page using a query param for the ID:
/job-offers/detail?id=... — user detail page
/admin/job-offers/detail?id=... — admin detail page
These are still static Astro pages (no SSR needed) since all content is client-rendered after auth anyway. The ID is read from URLSearchParams instead of location.hash.
Benefits
- Each page renders exactly one view — no visibility juggling
- Direct, shareable URLs without hash fragments
- Roughly half the JS per page
- No flash between list and detail states
JobOfferDetail.astro component is already extracted — it just needs its own page wrapper
Migration
- List pages link to
/job-offers/detail?id=... instead of setting hash
- Detail pages read
id from query params
- Back button navigates to
/job-offers (or /admin/job-offers)
- Remove hash-based navigation,
popstate listeners, and visibility toggles from list pages
Files
frontend/src/pages/[...lang]/job-offers.astro — strip detail code, link to detail page
frontend/src/pages/[...lang]/admin/job-offers.astro — same
frontend/src/pages/[...lang]/job-offers/detail.astro — new, user detail page
frontend/src/pages/[...lang]/admin/job-offers/detail.astro — new, admin detail page
frontend/src/components/JobOfferDetail.astro — already exists, reused as-is
Problem
The list and detail views for job offers are crammed into a single page (
job-offers.astroandadmin/job-offers.astro). This causes:hiddenclass juggling between sections)#id) instead of proper URLsProposed change
Split the detail view into a dedicated page using a query param for the ID:
/job-offers/detail?id=...— user detail page/admin/job-offers/detail?id=...— admin detail pageThese are still static Astro pages (no SSR needed) since all content is client-rendered after auth anyway. The ID is read from
URLSearchParamsinstead oflocation.hash.Benefits
JobOfferDetail.astrocomponent is already extracted — it just needs its own page wrapperMigration
/job-offers/detail?id=...instead of setting hashidfrom query params/job-offers(or/admin/job-offers)popstatelisteners, and visibility toggles from list pagesFiles
frontend/src/pages/[...lang]/job-offers.astro— strip detail code, link to detail pagefrontend/src/pages/[...lang]/admin/job-offers.astro— samefrontend/src/pages/[...lang]/job-offers/detail.astro— new, user detail pagefrontend/src/pages/[...lang]/admin/job-offers/detail.astro— new, admin detail pagefrontend/src/components/JobOfferDetail.astro— already exists, reused as-is