Skip to content

fix(admin): align console pages with the shared nav, add drive status - #206

Merged
barunaniket merged 1 commit into
mainfrom
fix/admin-nav-polish
Sep 8, 2026
Merged

fix(admin): align console pages with the shared nav, add drive status#206
barunaniket merged 1 commit into
mainfrom
fix/admin-nav-polish

Conversation

@barunaniket

@barunaniket barunaniket commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #205, as flagged in that review. Two cosmetic leftovers from the nav extraction, plus the two panel touches the plan listed as optional.

Layout consistency

Extracting the nav into admin/layout.tsx left the three pages that only inherit it out of step with the two that were edited:

before after
admin/teachers max-w-4xl px-6 **pt-6** pb-24 max-w-4xl px-6 pb-24
admin/problems/new **max-w-3xl** px-6 **pt-6** pb-24 max-w-4xl px-6 pb-24
admin/problems/[slug]/edit **max-w-3xl** px-6 **pt-6** pb-24 max-w-4xl px-6 pb-24
  • Double top padding — the layout supplies pt-6 now, so these three rendered the gap twice.
  • Nav wider than its content — the two problem pages were max-w-3xl against the layout's max-w-4xl.

I widened the problem pages rather than narrowing the nav: all six console pages now share one measure, which is rather the point of a shared layout. Worth noting explicitly — this makes the problem-authoring form slightly wider. That's deliberate, and it's an admin-only screen.

Recruitment panel

Both were in docs/recruitment.md and left optional in #205:

  • "Preview the saved form" link — opens the saved URL in a new tab so an admin can confirm they pasted the right form before opening the drive to applicants. Cheap, and the failure it prevents is embarrassing in public.
  • A plain-language status line — "Recruitment is open. /join is showing the form." / "No form link saved yet — /join is showing the closed notice."

The status line is derived from the saved row, not the editor fields. That's the whole subtlety: reading unsaved state would announce a drive as open the moment someone ticked the checkbox, before anything was written. There's a comment in the code saying so.

Verified

npx tsc --noEmit clean · npm run lint 0 errors (4 pre-existing warnings, untouched files) · npm run test 90/90 · npm run build succeeds.

No behaviour change to the auth gates — every page keeps its own getAdminUser() + redirect("/") and force-dynamic, exactly as #205 left them.

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
code-chef-pesuecc-chapter Ready Ready Preview Sep 8, 2026 7:35pm UTC

Follow-up to #205. Extracting the nav into admin/layout.tsx left three pages
that only inherit it out of step with the two that were edited.

- teachers, problems/new and problems/[slug]/edit still carried `pt-6` on
  their own section while the layout now supplies it, so those three rendered
  the gap twice.
- The two problem pages were `max-w-3xl` against the layout's `max-w-4xl`, so
  the nav sat wider than the content it heads. Widened them rather than
  narrowing the nav: all six console pages now share one measure, which is the
  point of having a shared layout. It does make the problem-authoring form
  slightly wider — deliberate, and admin-only.

Also picks up the two panel touches from the plan that #205 left optional:

- A "Preview the saved form" link, so an admin can confirm the URL they pasted
  is the right form *before* opening the drive to applicants.
- A plain-language line saying what /join is actually serving right now.
  Derived from the saved row rather than the editor fields on purpose — reading
  the unsaved state would announce a drive as open the moment someone ticked
  the box, before anything was written.
@barunaniket
barunaniket merged commit 6786772 into main Sep 8, 2026
3 checks passed
@barunaniket
barunaniket deleted the fix/admin-nav-polish branch September 8, 2026 19:39
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