Skip to content

feat(oc-docs): page-based navigation with shareable slug URLs (BRU-3188)#43

Closed
sundram-bruno wants to merge 3 commits into
opencollection-dev:mainfrom
sundram-bruno:feat/bru-3188-page-based-navigation
Closed

feat(oc-docs): page-based navigation with shareable slug URLs (BRU-3188)#43
sundram-bruno wants to merge 3 commits into
opencollection-dev:mainfrom
sundram-bruno:feat/bru-3188-page-based-navigation

Conversation

@sundram-bruno

@sundram-bruno sundram-bruno commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

BRU-3188 — page-based navigation

Replaces the single-scroll renderer with one active page per item, driven by client-side hash routing (HashRouter), so the standalone HTML file deep-links without a server.

JIRA: https://usebruno.atlassian.net/browse/BRU-3188

Routing model (pure, unit-tested) — src/routing/

  • slug: path-based (folder hierarchy + kebab name), never the runtime uuid → URLs stable across reload and re-generation. Sibling collisions dedupe to -2/-3 by seq; built-in pages are tilde-namespaced (#/ overview, #/~environments) so user content can never collide.
  • navModel: DFS ordered sequence honouring seq then name (BRU-3403), with a slug→entry lookup.
  • resolve: prev/next neighbours; unknown slug → redirect to overview.

Shell + cross-lane contracts (unblock the parallel lane)

  • AppShell: Topbar (sticky) + Sidebar + Content outlet.
  • Topbar: minimal stub at the agreed path/props — src/components/AppShell/Topbar/Topbar.tsx { collectionName, version?, logo?, searchSlot?, envSwitcherSlot?, onOpenInBruno? }. BRU-3572 replaces the body.
  • PageRouter selects a page component by type; PageLayout owns the breadcrumb + prev/next chrome. Page bodies are placeholders consuming a documented PageProps contract — BRU-3569 (request sections), BRU-3571 (overview), BRU-2548 (environments). ScriptPage is a slot with no route yet (scripts render in the request body).

Sidebar

Clicks navigate to the slug route; active item derives from the URL; ancestor folders auto-expand (expand-only) on navigation/deep-link. Folder expand/collapse + playground drawer preserved. Look unchanged — BRU-3574 owns sidebar restyle / mobile off-canvas.

Responsive

Content fills available width with fluid padding. Sidebar region hidden below md pending BRU-3574's off-canvas (navigation via prev/next + breadcrumb meanwhile); no topbar/content break at small widths.

Tests

  • vitest (21): slug / ordering / prev-next / collision-stability.
  • Playwright e2e/routing.spec.ts (7): deep-link, prev/next, reload-stability, auto-expand, unknown-slug redirect, sidebar-click — against a nested-folder fixture (?fixture=folders, since the dev sample is flat).
  • The 3 content-detail e2e specs that asserted the old single-scroll bodies are test.describe.skip'd with TODO refs to the body-owning tickets (BRU-3569/3571).

Verification

npm run lint (added lines clean) · npm run test:run 63/63 · npm run test:e2e 10 passed / 62 skipped · npm run build:standalone

Notes for reviewers

  • Old src/components/Docs/{Docs,Item}.tsx are now orphaned but left as reference for the body-building lanes; remove when BRU-3569/3571 land.
  • Wide empty content area on request pages is expected — the rich body (params/body/code-snippet) is BRU-3569's lane.

sundram-bruno and others added 3 commits June 16, 2026 20:13
Replace the single-scroll renderer with one active page per item, driven by
client-side hash routing (HashRouter) so the standalone HTML file deep-links
without a server.

Routing model (pure, unit-tested):
- slug: path-based (folder hierarchy + kebab name), never the runtime uuid, so
  URLs are stable across reload and re-generation. Sibling collisions dedupe to
  -2/-3 by seq; built-in pages are tilde-namespaced (#/ overview, #/~environments)
  so user content never collides with them.
- navModel: DFS ordered sequence honouring seq then name (BRU-3403), with a
  slug->entry lookup; resolve computes prev/next neighbours and redirects
  unknown slugs to the overview.

Shell + contracts (unblock the parallel lane):
- AppShell: Topbar (sticky) + Sidebar + Content outlet. Minimal Topbar stub at
  the agreed path/props (BRU-3572 replaces the body).
- PageRouter selects a page component by type; PageLayout owns the breadcrumb +
  prev/next chrome. Page BODIES are placeholders consuming a documented
  PageProps contract (BRU-3569 request, BRU-3571 overview, BRU-2548 env). A
  ScriptPage slot exists with no route yet (scripts live in the request body).

Sidebar: clicks navigate to the slug route, active item derives from the URL,
ancestor folders auto-expand (expand-only) on navigation/deep-link; folder
expand/collapse and the playground drawer are preserved. Look unchanged
(BRU-3574 owns sidebar restyle/off-canvas).

Responsive: fluid content max-width/padding; sidebar region hidden below md
pending BRU-3574's off-canvas (navigation via prev/next/breadcrumb meanwhile);
no topbar/content break at small widths.

Tests: vitest for slug/order/prev-next/collision-stability (21); Playwright for
deep-link, prev/next, reload-stability, auto-expand, unknown-slug redirect
against a nested-folder fixture (?fixture=folders). The 3 content-detail e2e
specs that asserted the old single-scroll bodies are skipped with TODO refs to
the body-owning tickets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…d badge (BRU-3188)

- Sidebar: drop the extra overflow-y-auto on the AppShell <aside> wrapper. The
  inner SidebarItems already scrolls (overflow-y:auto; flex-grow:1), so the
  wrapper created a second scroll container and a stray horizontal scrollbar.
  Revert to overflow-hidden (matching the prior Docs wrapper).
- Prev/Next: each card now fills its half of the row (flex:1) and is taller,
  matching the design instead of small corner chips. Render the method badge on
  the Previous card too (was next-only), via a shared Card with flipped
  alignment. Trim the page's bottom padding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-3188)

- PageLayout: drop the 80rem centered cap (and margin auto) that left large
  empty gutters on wide screens; content now fills the available width with
  fluid horizontal padding.
- PrevNext: mirror the method badge to match the reference — method before the
  name on the Previous card, after the name on the Next card.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sundram-bruno

Copy link
Copy Markdown
Contributor Author

Superseded. This was the standalone BRU-3188 (placeholder bodies + a temporary Topbar stub, based on main).

The work now lives on feat/bru-3188-integrated, rebuilt on top of #44 (Topbar) + #45 (Overview/structure): real page bodies (Overview→#45, request/folder→Item, environments→EnvironmentsView), PR#45 folder convention, real Topbar. A fresh PR → main will be opened once #44 and #45 merge (3188 imports their code). Closing this to avoid confusion.

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