Repository navigation
fix(ui): a tree list view draws the view's authored empty state, and the tree's load failure is translated - #29191
Merged
Conversation
…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
Contributor
Author
|
domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m 席位核对 · ACCEPT · 2026-11-02T09:21ZHead-sha:
|
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.
Requested by Steedos · project thread
Fixes #28966
Clause-②: no
Metadata-protocol: none
The two lines are copied from the claim (comment 6572298995).
维护者速读
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
ui/packages/plugin-list/src/ListView.tsx). The empty-state branch now coverstreeas well asgridandgallery, so an empty tree list view drawsListEmptyState: the authoredemptyStatefirst, resolved against the display locale, otherwise the localizedlist.*copy, with the same Create, Clear search and Clear filters actions. Before, the empty set went toObjectTree, which reads noemptyStateand drewcommon.noData. The edit is the condition plus its comment; nothing else in the branch moved.ListViewcondition or handing the resolved empty state toObjectTree. Widening was taken.ObjectTreehas 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 onObjectTree, against "no new option".ListViewalready 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 emptydatais the tree's empty answer too.ui/packages/plugin-tree/src/ObjectTree.tsx). The English literal "Failed to load tree: MESSAGE" is now aDataErrorState(role="alert",data-testid="tree-load-error") titled bylist.loadErrorTitle("Couldn't load records", the list failure panel's own title) with the error's message under it, the shapeObjectGridgives its failure. The key is borrowed, not minted: no pack gains a key, so@object-ui/i18nis untouched andClause-②: noholds. The key is added to the tree's provider-less defaults table, asgrid.refreshingandcommon.noDataalready are.ObjectTree.inlineQueryKeys-9136.test.tsxasserted the absence of the old English text, which would have passed vacuously after the change; it now asserts the absence oftree-load-error.Tests
ListView.treeEmptyState-28966.test.tsx(tree is a stand-in registered asobject-tree; this package does not depend onplugin-tree, and the pinned decision is whether the tree is mounted at all):emptyStateis drawn as written, in place of the tree;暂无数据;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.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
object-treenode (not under a list view) still drawscommon.noDatawhen 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 head3f8de5f9(origin/mainmerged; none of the 14 incoming commits touchplugin-list,plugin-treeori18n).Tests
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 ofplugin-list's test files: 119 files, 832 tests passed. The second half ofplugin-list: 91 files, 1097 tests passed (all 183plugin-listtest files in the two batches).packages/app-shell/src/views/InterfaceListPage.treeChartRelay-11572.test.tsx(the one test outside these packages authoring atreelist view): 9 passed.pnpm --dir ui exec vitest run scripts/: 169 files passed, 2 skipped; 4900 tests passed.git diff HEADempty.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-checkcoverstsconfig.test.json).eslinton the five touched files underui/: 0 errors (warnings only, all pre-existing).node scripts/pm/dispatch-gates.mjs --commandsderived 34 families for this diff; all 34 ran with exit 0, and--ranreconciled 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(underui/): 0 new citations.Generated by Claude Code