feat(oc-docs): page-based navigation with shareable slug URLs (BRU-3188)#43
Closed
sundram-bruno wants to merge 3 commits into
Closed
Conversation
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>
Contributor
Author
|
Superseded. This was the standalone BRU-3188 (placeholder bodies + a temporary Topbar stub, based on main). The work now lives on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/-2/-3by seq; built-in pages are tilde-namespaced (#/overview,#/~environments) so user content can never collide.seqthen name (BRU-3403), with a slug→entry lookup.Shell + cross-lane contracts (unblock the parallel lane)
src/components/AppShell/Topbar/Topbar.tsx{ collectionName, version?, logo?, searchSlot?, envSwitcherSlot?, onOpenInBruno? }. BRU-3572 replaces the body.PagePropscontract — BRU-3569 (request sections), BRU-3571 (overview), BRU-2548 (environments).ScriptPageis 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
mdpending BRU-3574's off-canvas (navigation via prev/next + breadcrumb meanwhile); no topbar/content break at small widths.Tests
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).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:run63/63 ·npm run test:e2e10 passed / 62 skipped ·npm run build:standalone✓Notes for reviewers
src/components/Docs/{Docs,Item}.tsxare now orphaned but left as reference for the body-building lanes; remove when BRU-3569/3571 land.