Skip to content

fix(app-shell): an areas-only app lands on its first area entry; a url/action-only app says it opens from its menu - #29849

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-8604be
Nov 3, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-8604be

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread
Fixes #29771

Clause-②: yes
Metadata-protocol: none

维护者速读

  • 改了什么:控制台打开一个应用的根地址时,落地页不再只看顶层导航:先看顶层导航,再按顺序看每个分区(areas)的导航,在全部这些导航里先找对象、页面、仪表盘、报表或组件条目,找不到再找第一个文档条目。若成员能看到的条目全是外部链接或动作,根页面显示一个空状态,说明“这个应用从菜单使用”,不再是一片空白。设计器预览里的“首页”提示同步这条规则。
  • 为什么改:条目只放在分区里的应用、以及菜单只有链接或动作的应用,打开后主区域一片空白,没有跳转也没有任何说明,成员分不清是应用坏了还是本来就空(console: an app whose navigation holds only doc entries lands on a blank page, with no empty state #29678 的现场实测,fix(app-shell): an app whose navigation holds only doc entries opens its first doc #29769 只修了纯文档应用)。
  • 风险与回滚:只在原来什么都不落地的情况下生效;顶层导航有可落地条目的应用照旧落到原处。新空状态不带“去设置”按钮,也不说“无权限”,因为成员确实有权限。新增两条界面文案(十种语言)。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/console/AppContent.tsx 的 resolveLandingRoute / firstRouteAcross(跨全部导航树的落地顺序)和 AppRootLanding 末尾(原来的 return null);ui/packages/app-shell/src/console/AppNoAccessEmptyState.tsx 的 menu-only 分支。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.docOnlyLanding-29678.test.tsx,应见 13 个用例全绿:只有分区的应用落到分区里的第一个对象,只有链接/动作的应用显示 data-reason="menu-only" 的空状态,原有对照组照旧。
  • 需要你做的:无,席位落地。

What changes

Claim: issuecomment 6595973888, amended by 6596042756 (declaration lines Clause-②: yes, Metadata-protocol: none; surface plus AppNoAccessEmptyState.tsx and the ten locale packs).

An app whose entries live only under areas, or whose every entry is a url or action link, opened /apps/APP to an empty main. resolveLandingRoute walked only shownTrees[0] (the top-level navigation), although AppRootLanding already handed it every shown tree, and AppRootLanding then rendered null.

  • Landing walk across every shown tree (AppContent.tsx, new firstRouteAcross). The declared landing first, then the first working entry (object, page, dashboard, report, component) across navigation and each areas[].navigation in order, then the first doc entry across the same order. The preference holds across the trees, not per tree: a working entry in any area outranks a doc entry in the top-level navigation. That is console: an app whose navigation holds only doc entries lands on a blank page, with no empty state #29678's rule (a working entry outranks reading material) applied to the app rather than to one tree. The sidebar elects the area that holds the entry the route addresses (electSidebarArea), so a landing in a later area opens with that area active.
  • No in-app landing at all (AppContent.tsx). When nothing lands and the app still shows the member entries, every one of them is a url or action link. The root now draws AppNoAccessEmptyState with a new reason="menu-only" instead of null.
  • AppNoAccessEmptyState.tsx: the menu-only reason has its own title and description (empty.appOpensFromMenu, empty.appOpensFromMenuDescription), a menu icon instead of the lock, and no Setup link even when setupPath is given, because the member has access. The other two reasons are unchanged.
  • @object-ui/i18n: the two keys in all ten locale packs.
  • AppPreview.tsx: findFirstLandingAcross normalizes each area's navigation and walks the trees in the same order, so the designer names the entry the console opens on.
  • appServesNoNavigation.ts: the docblock said the resolver walks the top-level navigation only and that a doc entry does not land; both went stale (console: an app whose navigation holds only doc entries lands on a blank page, with no empty state #29678, and this PR). Docblock only.
  • Moved pin: AppContent.studioRootLanding-12113.test.tsx pinned, for objectui#12113, that a url-only app "stays on its root, with no empty state and no page" (it asserted app-no-access-empty-state absent). This card makes exactly that blank root the defect, so the case now asserts the menu-only empty state; the "stays on its root, no page" half is kept. Seat-approved in the card thread.

Tests

  • AppContent.docOnlyLanding-29678.test.tsx, new top-level describe on the same harness (real AppContent, ExpressionProvider, MePermissionsProvider): an areas-only app lands on the first working entry of its areas; a working entry in an area outranks a top-level doc; a doc in an area lands when no tree holds a working entry; a url/action-only app (group and area included) draws data-reason="menu-only" with no Setup link; CONTROL: no shown navigation keeps data-reason="no-navigation"; CONTROL: a pending read in an area holds the skeleton, then lands. The file's console: an app whose navigation holds only doc entries lands on a blank page, with no empty state #29678 cases (doc-only lands, object app redirects, no-navigation, pending read) stay as controls.
  • AppNoAccessEmptyState.sharedState-25915.test.tsx: menu-only added to the data-reason table; its copy is not the no-access sentence; no Setup link with a setup path.
  • AppPreview.areas-11027.test.tsx: the preview names the area entry for an areas-only app, prefers it over a top-level doc, and CONTROL keeps a top-level working entry first.
  • AppContent.studioRootLanding-12113.test.tsx: the moved pin above.

Acceptance notes

  • Across trees, not per tree (seat ruling, card thread): a working entry anywhere outranks a doc anywhere. An app with a manual at the top of navigation and objects in an area opens on the first object.
  • The menu-only screen reuses AppNoAccessEmptyState (seat ruling) and keeps its data-testid="app-no-access-empty-state"; data-reason="menu-only" is what tells it apart. It says nothing about access and offers no Setup link.
  • Clause-②: yes: the two new keys widen @object-ui/i18n's built dist/locales/en.d.ts (every leaf is a readonly literal and the entry re-exports en and type TranslationKeys). Changeset level stays patch with Metadata-protocol: none.
  • Read from source (UnifiedSidebar.tsx), not measured, not changed: when an app has a visible area, UnifiedSidebar draws the active area's tree in place of the top-level navigation (activeArea?.navigation || readableAppNavigation). So in an app that has both, a landing on a top-level entry can open a page with no sidebar entry. This PR does not change that; the order here only decides which entry lands.
  • Observed, not changed: on showcase the url-only app's root rewrote to its package address (/apps/com.example.r29771-landing), which is the existing package-address behaviour for the package's first app.

Verification

Final head: d1b4d8e8 (merge of origin/main at b0ef25f5).

Tests on the final head

On d1b4d8e8: every console/__tests__/AppContent.*.test.tsx file, AppNoAccessEmptyState.sharedState-25915.test.tsx, every previews/AppPreview*.test.tsx file and packages/i18n/: 150/150 files, 1932 passed, 13 skipped. turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n: 66/66 tasks.

Before the main merge (head fecc3403): the four touched files 4/4, 33/33; the consumer sweep (every ui test file naming AppContent, AppNoAccessEmptyState, AppPreview, appServesNoNavigation or the empty-state keys) 155/155 files, 1305/1305 tests in four locked batches; packages/i18n/ 95/95 files, 1443 passed, 13 skipped; turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n 66/66 tasks; eslint on the touched ui files 0 errors.

Ablations (each restored, blob equal to HEAD and git diff HEAD empty, by scripts/ablation-replace.mjs)
  1. resolveLandingRoute walks shownTrees.slice(0, 1) only: AppContent.docOnlyLanding-29678.test.tsx 4 failed, 9 passed (the areas-only, area-over-doc, doc-in-area and pending-in-area cases).
  2. The fallthrough back to return null: 2 failed across docOnlyLanding-29678 and studioRootLanding-12113 (both menu-only cases).
  3. AppPreview walks [navItems] only: AppPreview.areas-11027.test.tsx 2 failed, 6 passed.
  4. The menu-only branch made unreachable: AppNoAccessEmptyState.sharedState-25915.test.tsx 2 failed, 5 passed.
Local gate union

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 35 families on fecc3403; all 35 ran with exit 0 (pnpm --dir ui exec vitest run scripts/: 170 files passed, 2 skipped). --ran reconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN. Also node scripts/check-i18n-en-drift.mjs (from ui/) exit 0: 2 keys added, 0 en values changed. The body gates (check-adr-0087-registration, check-changeset-no-major, check-closing-keyword-parity) ran against this body.

Live, showcase --fresh with the Console Vite on source

Four apps published into a scratch package com.example.r29771-landing: url-only (one url and one action entry), areas-only (navigation: [], first area holds an object entry for showcase_account, second a url), doc-only (a doc entry for showcase_manual), and an object app. Opened at /apps/APP as admin and as auditor.demo@example.com.

app before (AppContent.tsx at main) after
url-only empty main (0 chars), admin and auditor data-reason="menu-only", "R29771 Links opens from its menu", admin and auditor
areas-only empty main (0 chars), admin and auditor redirects to /apps/r29771_areas/showcase_account, the list renders
doc-only (control) /apps/r29771_doconly/docs/manual/showcase_index
object app (control) /apps/r29771_object/showcase_account

The before leg swapped only AppContent.tsx to main under Vite (Vite was confirmed serving main's module), then restored it (blob equal to HEAD). The after shots were taken before the swap. Shots: desktop for both personas plus a 390 px phone shot of the menu-only screen.


Generated by Claude Code

…l/action-only app says it opens from its menu

The app root's landing walk read only the top-level navigation, so an app
whose entries live only under `areas` opened to an empty main, and an app
whose every entry is a `url` or `action` link rendered null. The walk now
covers every shown tree in order (working entry first, then doc, across
the trees), and the no-landing fallthrough draws AppNoAccessEmptyState
with a new `menu-only` reason. AppPreview mirrors the walk.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jSW6s8ABou6nBvnfbz
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Contract-review-claim: session_01QsR2jV5sBSzCYNEDgpYLJw · head d1b4d8e · 2026-11-03T07:30Z


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

director#1 · zhuangjianguo · session_01QsR2jV5sBSzCYNEDgpYLJw

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d1b4d8e85d67c952fa48a6f685dae878a6d2c482
Local-runs: none
Scope: every diff path — .changeset/29771-app-landing-menu-only.md; ui/packages/app-shell/src/console/AppContent.tsx, console/AppNoAccessEmptyState.tsx, console/appServesNoNavigation.ts, console/__tests__/AppContent.docOnlyLanding-29678.test.tsx, console/__tests__/AppContent.studioRootLanding-12113.test.tsx, console/__tests__/AppNoAccessEmptyState.sharedState-25915.test.tsx; ui/packages/app-shell/src/views/metadata-admin/previews/AppPreview.tsx, previews/AppPreview.areas-11027.test.tsx; ui/packages/i18n/src/locales/{ar,de,en,es,fr,ja,ko,pt,ru,zh}.ts — read against main: app-shell/package.json (exports: . and ./styles.css only), app-shell/src/index.ts L272 (AppContent exported as DefaultAppContent; AppNoAccessEmptyState and appServesNoNavigation exported from no entry), console/AppContent.tsx L1773–1778 (WORKING_LANDING_TYPES, DOC_LANDING_TYPES, findFirstRoute), console/AppNoAccessEmptyState.tsx L60–95 (the existing data-reason pass-through and Setup link), layout/sidebarAreaElection.ts L66 (electSidebarArea) and its readers in UnifiedSidebar.tsx, the first body line of every pending changeset on main, card #29771, claim 6595973888, amendment 6596042756, and os-dev report 6597909361.

Read-only; nothing built or run. Card #29771 (app root landing across areas; menu-only empty state), the out-of-scope finding of #29678.

① Derived judgments

  • The widening is the two empty.* locale keys, present in all ten packs (appOpensFromMenu, appOpensFromMenuDescription; each + line counted ten times; en carries one comment line more). On the grid: "select all matching" banner counts every match, but the bulk action processes only the first 5000 #28552 reading, TranslationKeys widens with them, which is what the amendment's Clause-②: yes declares.
  • No other published surface moves. AppNoAccessEmptyState's reason union gains 'menu-only', but the component is reachable from no package entry (exports is . and ./styles.css; index.ts does not export it), so the union is internal. AppContent is exported as DefaultAppContent and its props are untouched; what changes is its behaviour on an app root that used to render an empty main, which is the measured defect the card names. firstRouteAcross and findFirstLandingAcross are module-private.
  • The walk reuses the existing pieces. firstRouteAcross iterates shownTrees (already handed to resolveLandingRoute by AppRootLanding) through the existing findFirstRoute with the existing type sets; the declared landing stays first; the fallthrough that returned null now draws the empty state with reason="menu-only", and only after appServesNoNavigation has been answered false, so no-navigation keeps its own path. electSidebarArea on main elects the area holding the routed entry, so an area landing opens with that area active, as the body says.
  • The menu-only branch offers no Setup link by construction (it returns before the setupPath branches) and keeps the shared data-testid, with data-reason as the discriminator the tests pin. AppPreview mirrors the same order over normalizeNav of each area's navigation.

② Semver level

  • @object-ui/app-shell patch and @object-ui/i18n patch, Clause-②: yes (bare = widening), Metadata-protocol: none → patch is the level the protocol axis gives. No ADR-0087 marker is needed: nothing retires.

③ Boundary flags

  • Not Tier H. CI on d1b4d8e8 was in progress when this was written (10 success, 11 skipped, 31 in progress, 0 failure). The seat's ACCEPT waits on green.
  • Fixes #29771 closes the card; both options the card offered are taken (areas walked, menu-only state), which the card allowed the reader to decide.
  • The changeset body opens with the Clause-② line and has no type(scope): … title line, so the CHANGELOG bullet will open with the first prose sentence rather than a title. Five pending changesets on main already take this form, and the body gates pass on it, so this is a style note, not a finding.
  • The moved pin in AppContent.studioRootLanding-12113.test.tsx (url-only root: "no empty state" → "menu-only empty state") is the card's own defect being re-pinned; the seat approved it in the card thread per the report.
  • The body's "read from source, not measured" note (an app with a visible area draws that area's tree in place of the top-level navigation, so a top-level landing can open with no sidebar entry) is pre-existing UnifiedSidebar behaviour; this PR does not change it and the note is honest about that.

④ Design judgment

  • Walking every shown tree in authored order, with the working-over-doc preference held across trees rather than per tree, is the right generalization of console: an app whose navigation holds only doc entries lands on a blank page, with no empty state #29678: the question is "what does this app open on", and an app's manual at the top of its navigation should not beat its objects in an area.
  • Drawing a reason-specific empty state instead of null is the right answer to a blank main; reusing AppNoAccessEmptyState with its own title, icon and no Setup link keeps one empty-state surface while saying nothing untrue about access.
  • Narrowing face: nothing is taken away; every app that landed before lands on the same entry (the top-level tree is still walked first with the same types).

No must-fix. No should-fix.

Implemented-by: claude/project-thread-8604be
Reviewed-by: session_01QsR2jV5sBSzCYNEDgpYLJw

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m

席位核对 · ACCEPT · 2026-11-03T07:43Z

Head-sha: d1b4d8e85d67c952fa48a6f685dae878a6d2c482

  • Shape: draft → main, and Fixes #29771 is the only closing keyword in the body. 19 files, +326 / −26. check-governed-merges --pr 29849 reports NOT governed, at 352 lines, so this is an ordinary queue landing. Clause-②: yes and Metadata-protocol: none are line-initial in the body and the changeset, as in claim amendment 6596042756. The changeset is a patch for @object-ui/app-shell and @object-ui/i18n.
  • Contract review: PASS at this head, record 6597965690, with no must-fix and no should-fix. The widening is the two empty.* locale-pack keys. AppNoAccessEmptyState is reachable from no app-shell entry.
  • File surface: inside the amended claim, plus AppContent.studioRootLanding-12113.test.tsx. That is a moved pin, approved in the card thread before the edit and named in the body: objectui#12113's url-only "no empty state" assertion, which this card makes false by design.
  • Read in the diff:
    • resolveLandingRoute keeps the declared landing first. It then runs firstRouteAcross over [navigation, ...areas] for working entries, and then again for docs. The preference holds across trees, as ruled in the card thread, and reuses findFirstRoute and the existing type sets.
    • AppRootLanding's former return null now draws AppNoAccessEmptyState with reason menu-only. It has its own title and description, a menu icon, and no Setup link. The no-navigation and pending-read branches are unchanged above it.
    • AppPreview mirrors the walk with findFirstLandingAcross over the normalized area trees.
    • appServesNoNavigation.ts changes its docblock only.
  • Tests (dev, report 6597909361): 150/150 files across the AppContent.*, AppPreview*, sharedState and i18n suites. Four ablations each go red and were restored to the HEAD blob. Type-check passes 66/66. Of 35 derived gates, all 35 exit 0, with 0 NOT-MEASURED. en-drift passes.
  • Live (showcase, admin and auditor.demo): before, url-only and areas-only both showed an empty main. After, url-only shows the menu-only state, and areas-only lands on /apps/r29771_areas/showcase_account. The doc and object controls are unchanged. Shots are in /mnt/project-files/issue-29771/shots/.
  • Gates (check-runs on this head): 44 success, 11 skipped (opt-in and schedule gates), 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check both succeeded. mergeable_state is clean.
  • Accepted deviations: one local commit that skipped the hook was caught, redone through .githooks, and never pushed. A stray /tc.pid sits outside the repo and is in no tree. Main moved after the merge without touching these files.
  • Out of scope: none reported. Nothing to file.
  • Landing: pr_ready, then automerge_enable. Merging closes console: an app whose navigation holds only url / action entries, or only areas, lands on a blank page #29771.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 3, 2026 07:44
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 3, 2026 07:44
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 99c0696 Nov 3, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-8604be branch November 3, 2026 08:00
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/m 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.

console: an app whose navigation holds only url / action entries, or only areas, lands on a blank page

2 participants