Skip to content

feat(hello): use path-based profile URLs for modal deep links#1341

Merged
ronggur merged 1 commit into
mainfrom
feat/hello
May 25, 2026
Merged

feat(hello): use path-based profile URLs for modal deep links#1341
ronggur merged 1 commit into
mainfrom
feat/hello

Conversation

@ronggur
Copy link
Copy Markdown
Collaborator

@ronggur ronggur commented May 25, 2026

Summary

  • Replace hash-based profile deep links (/hello/#scott) with shareable path URLs (/hello/scott) while keeping the popup UX on a single /hello page
  • Add server rewrites in server.mjs (production) and src/middleware.ts (dev) so direct visits to /hello/:slug render the same /hello SSR page without a new Astro route per profile
  • Update client-side History API in HelloModal and HelloPeople for open/close/back navigation, legacy hash migration, and invalid slug handling

How it works

  • Click card: pushState/hello/scott, modal opens (no server request)
  • Close modal: URL normalizes back to /hello
  • Browser back: popstate closes the modal
  • Direct link: /hello/scott loads /hello via rewrite, client opens modal from pathname
  • Legacy links: /hello/#scott migrates once to /hello/scott

Test plan

  • Visit /hello, click a profile card → URL becomes /hello/:slug, modal opens
  • Close modal (X, backdrop, Escape) → URL returns to /hello
  • Open modal, press browser back → modal closes, URL is /hello
  • Direct visit /hello/:slug → page loads, modal auto-opens
  • Direct visit /hello/invalid-slug → grid visible, no modal, URL normalized to /hello
  • Visit /hello/#:slug → client migrates to /hello/:slug, modal opens

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

🔎 SEO & Meta Review

Skipped (mode: skipped-no-changes).

No CHANGED_FILES provided in changed-only mode.

Replace hash deep links (/hello/#slug) with shareable paths (/hello/slug)
while keeping the popup on a single /hello page via client History API
and server rewrites in middleware and server.mjs.
@ronggur ronggur merged commit e801ed3 into main May 25, 2026
6 checks passed
@ronggur ronggur deleted the feat/hello branch May 25, 2026 10:15
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.

3 participants