Skip to content

Split job offer detail into a separate page #44

@KaliCZ

Description

@KaliCZ

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions