Repository navigation
feat: add recoverable dashboard error states - #287
Merged
TFT444 merged 2 commits intoAug 23, 2026
Merged
Conversation
Signed-off-by: Shaurya K Sharma <shauryaksharma24@gmail.com>
Signed-off-by: Shaurya K Sharma <shauryaksharma24@gmail.com>
SHAURYAKSHARMA24
marked this pull request as ready for review
August 18, 2026 16:09
SHAURYAKSHARMA24
requested review from
Vishnu2707,
ritiksah141 and
vogonPrayas
as code owners
August 18, 2026 16:09
TFT444
approved these changes
Aug 23, 2026
TFT444
left a comment
Collaborator
There was a problem hiding this comment.
Solid implementation. The stale-result suppression via request-ID counter is the right approach, and the queueMicrotask guard correctly prevents React Strict Mode double-fire. The eight hook tests cover the failure paths I would have asked about. Approving.
TFT444
approved these changes
Aug 23, 2026
TFT444
left a comment
Collaborator
There was a problem hiding this comment.
Solid implementation. The stale-result suppression via request-ID counter is the right approach, and the queueMicrotask guard correctly prevents React Strict Mode double-fire. The eight hook tests cover the failure paths I would have asked about. Approving.
Collaborator
|
Good to go, both sides approve and meet all the requirements. Merging into dev now. Thank you. |
This was referenced Aug 24, 2026
7 of 9 tasks
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.
What does this PR do?
Adds recoverable loading, error, empty, and populated states to the data-driven dashboard pages.
Discovery, Prioritization, Detailed Scan, Compliance, Drift, and Monitoring now use a small shared
usePageDatahook for their initial request lifecycle. Failed loads render a reusable inline error panel with aTry againaction; retry returns to the loader and can resolve to populated, empty, or another error state without reloading the browser.The hook ignores stale results after unmount and prevents repeated clicks from starting duplicate concurrent loads. Its cleanup-aware initial scheduling also prevents React Strict Mode effect replay from launching a duplicate initial request. Compliance derives its active framework after a successful load rather than writing component state from inside an async loader. Detailed Scan no longer treats an empty findings array as “still loading”; a successful zero-findings response displays a dedicated empty state. Existing page-specific empty states remain in use where appropriate.
The error panel uses
role="alert", an assertive live region, semantic headings, and a keyboard-accessible button. It displays page-specific safe copy rather than raw exception details.This PR is independently based on current
devand does not depend on #282. Its request callbacks remain compatible with the timeout/cancellation API proposed there, but no stacked branch or automatic retry policy is introduced here.Type of change
Rule details (if applicable)
Not applicable.
Testing
Executed from
frontend/:node src/hooks/usePageData.test.mjs— 8 load-state and retry tests passednode src/utils/aiApi.test.mjs— 9 existing AI settings tests passednpm run test:a11y— passednpm run test:i18n— passednpm run lint— passed with zero warningsnpm run build— passedFocused tests cover initial loading, populated success, successful empty data, rejected requests, retry to populated success, retry to empty success, rapid duplicate retry prevention, stale completion suppression after unmount, and React Strict Mode effect replay.
Related issue
Closes #281
Checklist
Signed-off-bytrailer (git commit -s; seedocs/dco.md)