Repository navigation
fix(plugin-detail): a related list that already shows 0 keeps showing 0 while it reloads - #37220
Draft
objectstack-fleet[bot] wants to merge 7 commits into
Draft
objectstack-fleet[bot] wants to merge 7 commits into
objectstack-fleet[bot] wants to merge 7 commits into
Conversation
…rough a refetch Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Contributor
Author
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 · area a4-U · 2026-11-25T04:59Z
|
Contributor
Author
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…ad forgets it Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Contributor
Author
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for the delta read (rework round 1) · area a4-U · 2026-11-25T07:18Z Against REWORK 7153451306:
|
Contributor
Author
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…etch Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
…st's count Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
This branch has not been deployed
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.
Fixes #36822
Clause-②: no
Metadata-protocol: none
维护者速读
Responsibility
@object-ui/plugin-detailRelatedList.countPending.What changes
ui/packages/plugin-detail/src/RelatedList.tsx:countPendingnow also requires!countKnown.countKnownis set to true only where a read the list actually issued resolves (the record-payload seeded read, thedataSource.findread, the raw-URL read), and set back to false where one of those reads rejects, because the rejection empties the rows and 0 is not their count. A path that reads nothing never sets it: the no-scope early return (parent still loading,parentIdnull), a refused filter, the no-adapter refusals. Result:describefor 相关列表:重新加载后结果为 0 条时,数量角标会短暂消失,而不是显示 0 #36822 in the existing badge harnessui/packages/plugin-detail/src/__tests__/RelatedList.countPending-36235.test.tsx.patchchangeset for@object-ui/plugin-detail.Files to read first
ui/packages/plugin-detail/src/RelatedList.tsx, thecountKnown/countPendinghunk: the only behaviour change.#36822describe in the test file: the held in-flight frame assertions (refetch, Retry, first scoped read).Two-minute check
cd ui && pnpm exec vitest run packages/plugin-detail/src/__tests__/RelatedList.countPending-36235.test.tsx— expect 7 passed.Tests
a list that answered 0 keeps drawing 0 through a refetch that answers no rows: holds the refetch in flight and asserts the badge reads0on that held frame; that assertion carries the pin. A MutationObserver also samples the badge across the refetch and finds no reading other than0. It is a secondary signal only: it samples when its callback runs, not on each commit, so two commits inside one task would be coalesced.a list that answered rows draws their count through a refetch, then the 0 it answers:2during the held refetch, then0, nothing else in between.a read that fails after rows were known draws no count while Retry reads, never a false 0: answers 2 rows, makes the refetch reject, clicks Retry, holds Retry's read and asserts no badge, then0once it answers no rows.a list with no scope on its first render draws no count during its first real read: renders withparentIdnull (no read is sent), rerenders with the parent id, holds that first read and asserts no badge, then2.Readings (head 8c0243b)
Test Files 1 passed (1),Tests 7 passed (7).cd ui && pnpm exec vitest run packages/plugin-detail/):Test Files 417 passed | 1 skipped (418),Tests 3945 passed | 18 skipped (3963), exit 0.pnpm --filter @object-ui/plugin-detail run type-check: exit 0 (the test file is in thetsconfig.test.jsonprogram, counted with--listFiles).scripts/ablation-replace.mjs. Each mutation landed (anchor 1 to 0) and was restored to blob == HEAD (1426a1d54928) withgit diff HEADempty:!countKnowndropped fromcountPending. ResultTests 1 failed | 6 passed (7): the 0-refetch pin fails on the held frame (expected null to be '0').setCountKnown(false)removed from thefindrejection. ResultTests 1 failed | 6 passed (7): the Retry pin fails (expected '0' to be null).setCountKnown(true)added to the no-scope early return. ResultTests 1 failed | 6 passed (7): the first-scoped-read pin fails (expected '0' to be null).Acceptance notes
countKnownis not reset when the parent or the list's filter changes: a reparented list keeps drawing its last count during the new read, the same thing the list already did when its last answer had rows. No new behaviour beyond extending that rule to 0.loadingis false and the badge draws0. That is the same onmain(read from the code, not measured in a browser). This PR only makes sure that phase does not mark the count known, so the first real read draws nothing.RelatedListin jsdom with a deferredfind.Verification
node scripts/pm/dispatch-gates.mjs --commandsfor this diff are run locally; CI-only families (type-check lanes, whole-tree families) are left to the PR's check-runs.Generated by Claude Code