Skip to content

feat(web): path-based account and admin sections#125

Merged
Zach Dunn (zachdunn) merged 1 commit into
mainfrom
feat/account-path-routes
Jul 13, 2026
Merged

feat(web): path-based account and admin sections#125
Zach Dunn (zachdunn) merged 1 commit into
mainfrom
feat/account-path-routes

Conversation

@zachdunn

Copy link
Copy Markdown
Member

In plain terms

Account and admin used hash fragments (/account#workspaces) for sidebar sections. That felt like a mini-SPA glued onto Astro. This switches those sections to real file-based routes (/account/workspaces, /admin/users, …) so URLs are shareable and match how Astro is meant to work.

What it does

  • Replaces hash-panel switching with path routes under shared layouts
  • Account: /account, /account/workspaces, /account/profile, /account/developers
  • Admin: /admin, /admin/users
  • Extracts shared shell CSS + signed-in-page helpers (origins, CSP, favicon, console-link visibility)
  • Keeps session gating client-side as a UX affordance (API/auth still enforce server-side)

What it is not

  • No backwards-compat redirects for old #… hashes (intentional)
  • No Cloudflare adapter config change — we already use @astrojs/cloudflare with a custom entry for markdown negotiation

How to try it

  1. Sign in and open /account (overview).
  2. Use the sidebar: each section should load a real path, not a hash.
  3. Hard-refresh /account/workspaces and /admin/users — both should resolve.

Technical notes

  • Layouts: AccountLayout.astro, AdminLayout.astro
  • Client: onSession / resolveSessionGate in account-shell.ts so page scripts do not race the layout gate
  • aria-current="page" on the active nav link

Test plan

  • pnpm --filter @uploads/web test
  • pnpm --filter @uploads/web typecheck
  • pnpm --filter @uploads/web build
  • Manual: sign in, click each account/admin section, hard-refresh nested paths

Replace hash-panel switching (#workspaces) with file-based routes under
shared layouts so sections are real URLs, bookmarkable, and idiomatic Astro.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (2)
  • coderabbit:review
  • review
🚫 Excluded labels (none allowed) (1)
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e73c4268-194a-42f3-b825-b529f4ed5b84

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/account-path-routes

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
uploads-web 13488bc Commit Preview URL

Branch Preview URL
Jul 13 2026, 03:15 PM

@zachdunn Zach Dunn (zachdunn) merged commit 4152c79 into main Jul 13, 2026
4 checks passed
@zachdunn Zach Dunn (zachdunn) deleted the feat/account-path-routes branch July 13, 2026 15:15
Zach Dunn (zachdunn) added a commit that referenced this pull request Jul 13, 2026
Port the branch's work onto the #125/#126 restructure:
- AccountLayout/AdminLayout adopt BaseHead (DS tokens/fonts/favicon);
  SITE_FAVICON removed from signed-in-page.ts
- signed-in-shell.css drops its :root copy and the side-stripe .status;
  session-gate blocks render as ul-callout (data-state=error for denied)
  and each shell gets an sr-only h1
- workspaces.astro: file browsers mount via IntersectionObserver;
  invite copy buttons announce via aria-live
- account-shell.ts taken from main wholesale (hash-panel focus fix is
  obsolete under path-based navigation)
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