Skip to content

feat(console): an app's docs pages draw in the app shell from 768 px up - #37193

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-37150-docs-in-app-shell
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-37150-docs-in-app-shell

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Part of #37150 — this PR carries Change items 1, 3 and 4 (an app's docs pages, /apps/APP/docs…, in the app shell from 768 px up; every old docs URL pinned; phone unchanged). Item 2 (the standalone /docs portal in the same appearance) is carried by #37197: the maintainer ruled B, an app-less shell variant (#37150 comment 7151721568), design first.
Clause-②: no
Metadata-protocol: none

维护者速读

What changes

  • ConsoleLayout (app shell): the isAppDocsPath exception now holds on a phone only. From 768 px up an app's docs pages mount UnifiedSidebar (head: app-name menu, collapse, search, bell; foot: account) and draw no top bar, like every other desktop app page. The connection banner shows there too, since no bar carries it any more.
  • UnifiedSidebar takes docsNav: on an app's docs route its body is an empty target (SidebarDocsNavTarget) in place of the app's menu and recents (the one-navigation rule of the earlier docs work holds: a reader has one navigation, the docs').
  • New layout/sidebarDocsNavSlot.tsx: a provider (mounted by ConsoleLayout), the sidebar's target element, and SidebarDocsNav, a portal the docs page draws its column through, so the column keeps the page's router and data context. Exported from @object-ui/app-shell with the two existing page-header slot hooks.
  • Console docs pages: DocShell draws the column into the sidebar when the slot exists (the reader's own column, else AppDocsNav: every book of the app, 「← Back to APP」 and 「All documentation」) and draws the page header's button group and expand button at the page's top. DocPage stops drawing its in-page column when the sidebar carries it. usePackageDocsNavBooks is the reader's former inline memo, lifted so the non-reader pages share it.
  • ConsoleBootShell: the boot fallback matches (sidebar, no bar on an app's docs page from 768 px up; unchanged on a phone).
  • Unchanged: every route and URL shape (ADR-0046 section 6), the /docs portal frame (DocsPortalRoute, DefaultHomeLayout variant="docs"), the phone.

Tests

  • ConsoleLayout.phoneRecordOneBar-28483.test.tsx: the route exception's removal: at 768 and 1440 px, /apps/crm/docs, /apps/crm/docs/, a book, a flat permalink and an article mount the sidebar with docsNav and no top bar; PHONE CONTROL at 390 px keeps no sidebar and the app bar; control: other app routes keep the app menu.
  • UnifiedSidebar.footerSlot-36739.test.tsx: the page's column lands in the sidebar body, the app menu is gone, head and foot stay; control without docsNav.
  • ConsoleBootShell-35981.test.tsx: the boot fallback at 768/1440 vs 375 px.
  • docs-portal.test.tsx (objectstack#37150 block): the reader's one column is in the sidebar; the page header carries the shell's group; old URL forms in the shell: reader, book, flat permalink, docs index, book NAME, book NAME/DOC, doc-name-that-is-also-a-book-name, canonical SLUG/DOC each land on the same canonical URL and article as before; non-reader pages; CONTROL without the shell (phone, /docs): the page draws its own column and back link. The /docs URL forms keep their existing pins in the same file (unchanged frame).
Test runs (head fd2011e)

All through scripts/pm/os-verify-lock.sh, --maxWorkers=2, at fd2011e unless noted.

  • The four pinned files (ConsoleLayout.phoneRecordOneBar-28483, ConsoleLayout.noTopBar-36112, UnifiedSidebar.footerSlot-36739, ConsoleBootShell-35981): Test Files 2 passed, Tests 23 passed for the two ConsoleLayout files at fd2011e; the sidebar and boot files Test Files 3 passed (3), Tests 27 passed (27) at 827b3c7 (unchanged since).
  • docs-portal.test.tsx: Test Files 1 passed (1), Tests 62 passed (62) at 827b3c7; the objectstack#37150 block with the added URL pins Tests 13 passed | 53 skipped (66) at 2ec4312.
  • Narrowed suite: every app-shell test that names ConsoleLayout, UnifiedSidebar, ConsoleBootShell, consoleRoutePaths, sidebarDocsNavSlot or isAppDocsPath (128 files) and every console test that names a docs page (13 files), at 2ec4312: app-shell Test Files 1 failed | 127 passed (128), the one red was ConsoleLayout.noTopBar-36112's control pinning the old docs-page bar, corrected in fd2011e and green above; console Test Files 13 passed (13), Tests 122 passed (122).
  • type-check (@object-ui/app-shell, @object-ui/console) after rebuilding the app-shell dependency closure: VERDICT command-exit 0.
  • Full app-shell and console suites: declared to CI (Test UI); the local full run was stopped after 38 minutes holding the shared lock.
Ablations (one-shot, restored byte-identical to HEAD)

Both through scripts/ablation-replace.mjs (anchor hit 1 -> 0 on disk, restored blob == HEAD, git diff HEAD empty). The tests import these sources directly (relative import; @object-ui/app-shell aliased to src in the console's vite config), so no dist/ is involved.

  1. ConsoleLayout.tsx: phoneDocsPage ? undefined : ( -> docsPage ? undefined : ( (the sidebar exception back at every width). Expected red; observed: × at 768 px and 1440 px a docs index, a book, a flat permalink and an article draw the sidebar …, Tests 1 failed | 14 passed (15); the PHONE CONTROL stayed green.
  2. DocPage.tsx: const pageNav = sidebarNav ? null : docsNav; -> const pageNav = docsNav; (the reader draws its in-page column in the shell too). Expected red; observed Tests 9 failed | 4 passed | 53 skipped (66): the one-column test and all eight URL-form pins (two columns).

Acceptance notes

Verification

Read first (by risk):

  1. ui/packages/app-shell/src/layout/ConsoleLayout.tsx: the phoneDocsPage hunk (sidebar mount and showHeader), the branch the shell's look hangs on.
  2. ui/apps/console/src/pages/DocShell.tsx: the sidebar portal and the page-header row.
  3. ui/packages/app-shell/src/layout/UnifiedSidebar.tsx: the docsNav body swap.

Two-minute check: in the showcase app (pnpm dev), open the Showcase app's documentation from its menu at 1440 px: no top bar, the sidebar head reads 「Showcase」, the sidebar body is the docs column with 「← Back to Showcase」 first and 「All documentation」 last; narrow the window to 390 px and the app bar and the in-page column are back.

Desktop, an app's docs reader (no top bar, sidebar body = docs column):
desktop app docs reader

Desktop, an app's docs index:
desktop app docs index

Desktop, a flat doc permalink (lands on the same reader):
desktop flat permalink

Desktop, the /docs portal entry (unchanged by this PR; item 2):
desktop docs portal

Phone control, 390 px (unchanged: app bar, in-page column):
phone control

Screenshots live on the assets-only branch claude/issue-37150-screenshots (never merged).


Generated by Claude Code

The shell sidebar is mounted on an app's docs pages at desktop width and
carries the docs' own navigation in the app menu's place; the top bar is
gone there as on every other desktop app page. A phone keeps its bar and
its in-page column.

Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Final green head for L1 (2026-11-25T03:41Z): fd2011e516147f382f234389b342a118e7fc9f56.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head fd2011e516147f382f234389b342a118e7fc9f56 · 2026-11-25T03:53Z

The rework is to the PR body only. The code, tests and changeset are ready to accept at this head. Editing the body does not move the head, so the check-runs below stay valid.

Checklist

  • Shape (l1-face CLEAN, 13/13):
    • draft, base main, Part of #37150, and no closing keyword;
    • no releases path; no +0/-0 files; dogfood not owed;
    • the one published package touched (@object-ui/console) has a changeset;
    • mergeable_state: clean.
  • Check-runs at head: 55 runs: 40 success, 15 expected skips, 0 failed, 0 pending.
    • The floors Lint & Repo Gates and TypeScript Type Check both succeeded.
    • Test UI ran in affected mode on @object-ui/app-shell and @object-ui/console: 3217 files in 9 of 16 slots, with 3216 passed and 1 skipped. All five touched test files ran green: phoneRecordOneBar 15, noTopBar 8, footerSlot 5, BootShell 7 and docs-portal 66.
  • K = 12.
  • Item 1 (desktop app shell):
    • Code:
      • ConsoleLayout.tsx:206,290,295,307,359;
      • UnifiedSidebar.tsx:843 (body swap);
      • the new sidebarDocsNavSlot.tsx;
      • DocShell.tsx:60 (portal) and :65 (header row);
      • DocPage.tsx:397;
      • ConsoleBootShell.tsx:94,109.
    • Tests that go red on revert:
      • phoneRecordOneBar-28483:241 (768/1440 × 5 paths: sidebar present, data-docs-nav, 0 headers);
      • noTopBar-36112:109;
      • footerSlot-36739:235;
      • docs-portal:1006/1019/1040;
      • ConsoleBootShell-35981 at 768/1440.
    • The two ablations agree: 1 failed | 14 passed, and 9 red.
  • Item 3 (old links):
    • No route or isAppDocsPath change: AppContent.tsx docs routes and App.tsx /docs are not in the diff, and nothing is redirected or dropped.
    • 8 URL forms are pinned in the shell (docs-portal:1027, :1070). Each asserts the landing path, the article body and a single column. Ablation 2 reddened all 8.
    • /apps/crm/docs/ and the flat permalink are added to the frame pin.
  • Item 4 (phone): every new branch is gated on phone.
    • The slot hooks return null on a phone.
    • No sidebar means a null slot, so the in-page column and the back bar stay.
    • Pinned by:
      • phoneRecordOneBar:254 PHONE CONTROL (390 × 5 paths, one header);
      • noTopBar:109 (the 390 leg);
      • BootShell at 375;
      • docs-portal:1084.
  • /docs… untouched: DocsPortalRoute, HomeLayout and AppHeader are not in the diff.
    • The shared DocShell/DocPage branches are inert there, because the provider and the ShellPageActionsScope are mounted only by ConsoleLayout.
    • usePackageDocsNavBooks is an exact lift of the old memo, reading the same useBookData().docs.
    • The existing /docs pins are unchanged and green.
  • i18n vs @object-ui/i18n@18.6.0: no locale file in the diff, and no key removed or renamed.
  • Published exports and types: no change.
    • @object-ui/app-shell is private: true. Its root exports gain additively: the 4 slot symbols, plus useShellPageActionsSlot and useShellSidebarExpandSlot.
    • @object-ui/console publishes only plugin.ts/plugin.d.ts and the SPA dist, and plugin.ts is untouched.
  • Declarations: Clause-②: no and Metadata-protocol: none hold, in both the PR body and the changeset. Nothing published is widened, and no spec or metadata key changes.
  • Changeset, read sentence by sentence: it is in user terms, and each sentence matches the code.
    • "page header's button group (assistant and help)" matches ShellPageActionsGroup (AssistantTopBarButton + HelpMenu).
    • "The reader no longer draws that column inside the page there" matches DocPage:397.
    • "other docs pages … carry the same column in the sidebar instead of a back link" matches DocShell:60,70.
    • "every docs address resolves … phone … /docs not changed" matches items 3 and 4 and the portal check above.
  • Local narrowing: acceptable.
    • The full app-shell and console suites the dev stopped locally did run at this head in CI Test UI: the affected set holds both packages' whole suites (2443 + 335 files) plus 437 always-on files.
    • The PR body's local readings at 827b3c75a and 2ec431259 are not at the head, so they are not counted. CI at the head covers the same files.
  • Browser evidence: 5 screenshots are linked on claude/issue-37150-screenshots (da446f108), and all resolve.
    • They were taken at 096ac6732. Since then the only implementation-file drift is the changeset line and 3 index.ts lines from the main merge.
    • The desktop reader shot shows no top bar, a head with 「Showcase」, search and bell, a body from 「← Back to Showcase」 to 「All documentation」, and the account foot. The portal still has its bar, and the phone control keeps its bar and the in-page disclosure.
  • Overlap:

Open

Note for later (not graded): suppose the maintainer answers #37197's 「全部文档」 question with B, first in both sidebars.

  • This PR's sidebar would then change at ui/apps/console/src/pages/DocsNav.tsx:119-128: the <div className="border-t pt-3"> with <Link to={allDocsHref} data-testid="docs-nav-all-docs">, at the foot after the book list.
  • It is shared by the reader (DocPage.tsx:384-393) and AppDocsNav (DocsNav.tsx:181).
  • It also renders the phone in-page column, so the move needs a phone guard to keep item 4.
  • It is pinned for presence only, not position (docs-portal.test.tsx:1013).

Landing to-dos at ACCEPT: Part of #37150 does not auto-close the card. #37150 stays open for item 2 (#37197), and pm:dispatched on #37150 stays until #37197 lands (landing rule B).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head fd2011e516147f382f234389b342a118e7fc9f56 · 2026-11-25T03:56Z

Delta over the body-only REWORK 7152350994. The head is unchanged.

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Landing (2026-11-25T03:57Z) — head fd2011e516147f382f234389b342a118e7fc9f56, on L1 ACCEPT 7152386684 (over body-only REWORK 7152350994).

Probe Reading
check-governed-merges.mjs --pr 37193 NOT governed: 0 of 15 paths hit the register; 581 changed lines ≤ 3000
Check-runs at this head 0 failed; one PR-body guard re-running after the body-only edit; mergeable_state was clean before the edit
Landing K 12 since the merge base (L1's reading); under 15, so no main merge first

State change: ready for review, and auto-merge armed; the merge queue lands it. This PR is "Part of #37150", so #37150 stays open, keeping pm:dispatched, for item 2, which #37197 carries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants