Repository navigation
[2.1] Fixes #38372: split per-fetch loading flags in KnowledgePageVersionPage (#38408) - #38508
Conversation
…ge to eliminate torn version-history frame (#38408) * fix(ui): split per-fetch loading flags in KnowledgePageVersionPage to eliminate torn version-history frame * fix(ui): replace inline style with tw: utility to satisfy style guard Replaces on the version-data skeleton Box with the Tailwind utility. The PR moved the skeleton into a reusable const, which put the pre-existing inline style on a newly added line and tripped the Antd + Less Deprecation Guard. The width is unchanged. * fix(ui): guard stale version-data responses and clear data flag on base fetch failure Addresses greptile review feedback on PR #38408: - Guard fetchActiveVersion state updates with a request id so a stale version-data response cannot overwrite a newer version's content when the user switches versions mid-flight. - Clear isVersionDataLoading in fetchKnowledgePage's catch, since a failed base lookup leaves no knowledgePage to drive the version-data request and would otherwise hang the content skeleton. - Add tests for both cases. * fix(ui): show a no-data placeholder when knowledge page version data fails to load Clear the selected version on a failed version-data fetch so the page no longer shows the previous version's content under the new version, or a blank content area on first load. Drop the KnowledgePageVersion loading prop, which its only caller always passed as false. * fix(ui): contain the knowledge page version empty state in its content area NoDataPlaceholder is absolutely positioned and fills its nearest positioned ancestor. .version-data is not positioned, so the message centred across the whole card, including the version rail. Wrap it in a relative Box with a minimum height. * refactor(ui): build the knowledge page version skeleton row with core Box Replace the flex divs with a Box row. SkeletonParagraph is already a full-width flex column, so it fills the space beside the avatar without a wrapper. --------- Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com> Co-authored-by: Sweta Agarwalla <[email protected]> Co-authored-by: Sweta Agarwalla <[email protected]> (cherry picked from commit 38872db)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsSeparating version-fetch states and ignoring stale responses changes page rendering; request failures or fetch timing may show an empty version placeholder. Splits the single loading flag in ✅ 1 closedClosed: Edge Case: Full-page skeleton never clears if a new FQN resolves to the same id
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Backport of #38408 to
2.1.Fixes #38372
Describe your changes:
Cherry-pick of 38872db from
main, applied cleanly with no conflicts.The Knowledge Center version-history page (
KnowledgePageVersionPage) used oneloadingflag for three concurrent fetches, so whichever fetch resolved first removed the skeleton and left a torn frame: a blank content area, or content beside an empty timeline.Box, instead of the previous version's content or a blank area.loadingprop fromKnowledgePageVersion; its only caller always passedfalse.Type of change:
Tests:
2.1:KnowledgePageVersionPage.test.tsxandKnowledgePageVersion.test.tsx, 11/11 passing.tsc --noEmiton2.1: no errors in the changed files.2.1has everything the change uses: theFile06icon, theNoDataPlaceholdericon/titleprops, thelabel.no-entityandlabel.versionkeys, and theBoxandSkeletonParagraphAPIs.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Splits loading state in
KnowledgePageVersionPageso the timeline and article content wait for their own requests.Review used source inspection; tests and browser checks were not run.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Look up article] --> B{Lookup succeeds?} B -->|No| C[Clear loading flags and show empty state] B -->|Yes| D[Fetch version list] B -->|Yes| E[Fetch selected version] D --> F[Show timeline] E --> G{Still the latest request?} G -->|No| H[Ignore result] G -->|Yes, succeeds| I[Show version content] G -->|Yes, fails| J[Show empty state] F --> K[Keep content skeleton until version fetch finishes]Reviews (1) · Last reviewed commit: "Fixes #38372: split per-fetch loading fl..." · Reviewed by Greptile