Skip to content

fix(ui): a tree list view draws the view's authored empty state, and the tree's load failure is translated - #29191

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

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-dqbxc7

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #28966

Clause-②: no
Metadata-protocol: none

The two lines are copied from the claim (comment 6572298995).

维护者速读

  • 改了什么:列表视图以树形显示且没有记录时,现在和表格、画廊一样显示视图作者写的空状态(标题、说明、图标、链接),没写就显示本地化的"这里还没有数据";树加载失败时显示翻译后的"无法加载记录"加上错误原文,不再是英文的 "Failed to load tree: …"。
  • 为什么改:管理员给视图写的空状态说明,在表格和画廊上能看到,切到树形(例如 Setup › 业务单元默认就是树)就丢了,只剩通用的"暂无数据";中文页面上树加载失败还冒出一句英文。
  • 风险与回滚:只影响树形视图的空结果和加载失败两种情况;有记录的树、其他视图类型不变。没有新增元数据键或选项。回滚即撤销本 PR。
  • 先看:ListView.tsx 空状态分支的条件(加了 tree);ObjectTree.tsx 加载失败分支改为 DataErrorState;新测试 ListView.treeEmptyState-28966.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-list/src/__tests__/ListView.treeEmptyState-28966.test.tsx packages/plugin-tree/src/ObjectTree.loadErrorI18n-28966.test.tsx,预期 2 个文件 8 个用例通过。
  • 需要你做的:无,席位落地。

What changes

  • Empty tree views (ui/packages/plugin-list/src/ListView.tsx). The empty-state branch now covers tree as well as grid and gallery, so an empty tree list view draws ListEmptyState: the authored emptyState first, resolved against the display locale, otherwise the localized list.* copy, with the same Create, Clear search and Clear filters actions. Before, the empty set went to ObjectTree, which reads no emptyState and drew common.noData. The edit is the condition plus its comment; nothing else in the branch moved.
  • Which of the two routes, measured. The card offered widening the ListView condition or handing the resolved empty state to ObjectTree. Widening was taken. ObjectTree has no toolbar of its own (its only chrome is the refresh bar over drawn rows), and the list toolbar sits outside the branch, so it stays on screen above the empty state; a test pins its Filter and Refresh buttons there. Handing the state down would have needed a new host prop on ObjectTree, against "no new option". ListView already fetches a tree view with the same effective filter the tree's own query is handed (selfQueryFilter) and with no search term (searchlessViewOnScreen), so its empty data is the tree's empty answer too.
  • Tree load failures (ui/packages/plugin-tree/src/ObjectTree.tsx). The English literal "Failed to load tree: MESSAGE" is now a DataErrorState (role="alert", data-testid="tree-load-error") titled by list.loadErrorTitle ("Couldn't load records", the list failure panel's own title) with the error's message under it, the shape ObjectGrid gives its failure. The key is borrowed, not minted: no pack gains a key, so @object-ui/i18n is untouched and Clause-②: no holds. The key is added to the tree's provider-less defaults table, as grid.refreshing and common.noData already are.
  • Repointed pin. ObjectTree.inlineQueryKeys-9136.test.tsx asserted the absence of the old English text, which would have passed vacuously after the change; it now asserts the absence of tree-load-error.

Tests

  • New ListView.treeEmptyState-28966.test.tsx (tree is a stand-in registered as object-tree; this package does not depend on plugin-tree, and the pinned decision is whether the tree is mounted at all):
    • CONTROL: with a row, the tree stand-in is mounted and no empty state;
    • an authored plain-string emptyState is drawn as written, in place of the tree;
    • an authored inline locale map paints its zh-CN entries;
    • zh with nothing authored: the pack's first-run copy, not 暂无数据;
    • the wide toolbar's Filter and Refresh stay on screen above the empty tree;
    • the tree and the grid draw the same empty state, node for node.
  • New ObjectTree.loadErrorI18n-28966.test.tsx: under the zh pack a rejected read shows an alert titled 无法加载记录 with the error message, and no English line; with no provider, the English title from the defaults table and the message.
  • Ablation (one-shot, through scripts/ablation-replace.mjs, restored to HEAD's blob): with the condition put back to grid/gallery only, 5 of 6 cases in the new ListView file go red and the CONTROL stays green.

Acceptance notes

  • A standalone object-tree node (not under a list view) still draws common.noData when empty: the tree node declares no empty-text key, and the card asks for no new key. Unchanged by this PR.

Verification

Readings on head 62040c75 (the fix and test commits), re-checked on the merge head 3f8de5f9 (origin/main merged; none of the 14 incoming commits touch plugin-list, plugin-tree or i18n).

Tests
  • New and neighbouring files on 3f8de5f9: ListView.treeEmptyState-28966, ObjectGallery.emptyState-12217, ObjectTree.loadErrorI18n-28966, ObjectTree.inlineQueryKeys-9136, ObjectTree.placeholderI18n: 5 files, 28 tests passed.
  • packages/plugin-tree/ plus the first half of plugin-list's test files: 119 files, 832 tests passed. The second half of plugin-list: 91 files, 1097 tests passed (all 183 plugin-list test files in the two batches).
  • packages/app-shell/src/views/InterfaceListPage.treeChartRelay-11572.test.tsx (the one test outside these packages authoring a tree list view): 9 passed.
  • pnpm --dir ui exec vitest run scripts/: 169 files passed, 2 skipped; 4900 tests passed.
  • Ablation of the condition: 5 failed, 1 passed (CONTROL); restored blob equals HEAD, git diff HEAD empty.
Type-check and gates
  • turbo run type-check --filter=@object-ui/plugin-list --filter=@object-ui/plugin-tree: 51 of 51 tasks successful (both packages' type-check covers tsconfig.test.json).
  • eslint on the five touched files under ui/: 0 errors (warnings only, all pre-existing).
  • node scripts/pm/dispatch-gates.mjs --commands derived 34 families for this diff; all 34 ran with exit 0, and --ran reconciled 34 derived, 34 run, 0 NOT MEASURED. The derived set is unchanged at the merge head, where the changeset, ADR-0087, empty-changeset, sdui-manifest, nul-bytes and published-files gates were re-run with exit 0. The changeset and closing-keyword gates ran against this body.
  • node scripts/check-sdui-manifest.mjs: exit 0 (no registry change).
  • pnpm check:new-line-citations (under ui/): 0 new citations.
  • The CI-only type-check lanes and the whole-tree families are CI's; their check-runs on this PR are the reading.

Generated by Claude Code

…the tree's load failure is translated

ListView draws ListEmptyState for a tree layout as it does for grid and
gallery, so the authored emptyState (else the localized list copy) shows
instead of ObjectTree's generic placeholder. ObjectTree's load failure is
a DataErrorState with the translated list.loadErrorTitle and the error's
own message, in place of an English literal.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUCYVF58JVbiXdjXuX
…re; add the changeset

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUCYVF58JVbiXdjXuX
@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 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m

席位核对 · ACCEPT · 2026-11-02T09:21Z

Head-sha: 3f8de5f9325088bc4d82899bc0e331d5a638b87a

  • Shape: draft → main, Fixes #28966 in the body only. 6 files, +305 / −5 (310 lines ≤ 3000). No governed path: check-governed-merges --pr 29191 hit 0 of 6 paths. Clause-②: no and Metadata-protocol: none are line-initial in the body and the changeset, as claimed (6572298995). The changeset is patch for @object-ui/plugin-list and @object-ui/plugin-tree.
  • Contract review: none owed (Clause-②: no; no exported prop or type, no pack key added).
  • File surface: inside the claim: ListView.tsx, ObjectTree.tsx, two new tests, one repointed tree pin, and the changeset.
  • Read in the diff:
    1. ListView's empty-state branch adds currentView === 'tree' beside grid and gallery, so an empty tree view draws ListEmptyState with the authored emptyState, else the localized list.* copy. The toolbar sits outside the branch and stays on screen.
    2. ObjectTree's load failure is a DataErrorState (data-testid="tree-load-error") titled t('list.loadErrorTitle') with the error's message, replacing the English "Failed to load tree: …". The key is borrowed from the list packs (present in all ten), and added to the tree's provider-less defaults; no pack changed.
    3. The docs(spec): the unresolvable-column entry states MySQL's reach after #8926 — envelope and recoveries both (#9060) #9136 pin that asserted the absent English text now asserts the absent tree-load-error, so it is not vacuous.
  • Tests (dev): new ListView.treeEmptyState-28966 (6 cases) and ObjectTree.loadErrorI18n-28966 (2 cases); plugin-tree and all 183 plugin-list files pass; scripts/ 169 files. Ablation (condition back to grid/gallery) reds 5 of 6 with the CONTROL green, restored. Type-check 51 of 51; derived gates 34 of 34.
  • Gates (check-runs on this head): 44 success, 11 skipped, 0 failed or pending. mergeable_state is clean.
  • NOT MEASURED: the seat ran no live browser session; the ListView tests stand in.
  • Accepted out of scope: a standalone object-tree node outside a list view still draws common.noData (no empty-text key on the tree node; the card asks for none).
  • Landing: ordinary queue landing, pr_ready then automerge_enable. Fixes #28966 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 2, 2026 09:22
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 2, 2026 09:22
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 02c9f98 Nov 2, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-dqbxc7 branch November 2, 2026 10:27
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.

List view: a tree layout ignores the view's authored emptyState, and the object tree's load-error line is still English

1 participant