fix(admin-form): show error state when webhook settings fetch fails#9524
Open
LoneRifle wants to merge 4 commits into
Open
fix(admin-form): show error state when webhook settings fetch fails#9524LoneRifle wants to merge 4 commits into
LoneRifle wants to merge 4 commits into
Conversation
…9523) * feat(admin-form): add WebhooksErrorMsg settings error state * fix(admin-form): show error state when webhook settings fetch fails A failed settings query left settings undefined, which collapsed into the unsupported-response-mode branch and told storage-mode admins their form does not support webhooks. Read isError from the query and render an explicit retry state before evaluating the response mode. * test(admin-form): add Error story for webhook settings fetch failure * test(admin-form): assert error state hides unsupported webhook msg * fix(admin-form): announce webhook settings load error to a11y The error state appears after an async settings-fetch failure; add role="alert" so screen readers announce it instead of leaving AT users unaware that anything changed. Covered by a getByRole('alert') assertion. * refactor(admin-form): use isRefetching for webhook retry state isFetching is also true for background refetches (window focus/reconnect), which could spin the retry button without a user action. isRefetching reflects the user-initiated retry more precisely. * fix(settings/webhooks): enforce strict equality Co-authored-by: LoneRifle <LoneRifle@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a misleading UX on the admin “Settings → Webhooks” page where a failed settings fetch could incorrectly render the “Webhooks are only available in storage mode” unsupported-mode message, by introducing an explicit error/retry state and adding regression coverage.
Changes:
- Update
SettingsWebhooksPageto branch onisErrorfromuseAdminFormSettings()and render a dedicated error state with retry. - Add
WebhooksErrorMsgpresentational component (with retry CTA and loading state). - Add Storybook “Error” story + a component test to guard against regressions for both error and genuinely-unsupported modes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/frontend/src/features/admin-form/settings/SettingsWebhooksPage.tsx | Adds explicit query error handling and wires retry into a new error-state component. |
| apps/frontend/src/features/admin-form/settings/SettingsWebhooksPage.test.tsx | Adds regression tests ensuring error state is shown on fetch failure and unsupported message still shows for unsupported modes. |
| apps/frontend/src/features/admin-form/settings/SettingsWebhooksPage.stories.tsx | Adds an MSW-backed “Error” story that simulates a 500 on settings fetch. |
| apps/frontend/src/features/admin-form/settings/components/WebhooksSection/WebhooksErrorMsg.tsx | Introduces the new error/retry UI component for the webhooks settings page. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
kevin9foong
reviewed
Jun 2, 2026
kevin9foong
reviewed
Jun 2, 2026
kevin9foong
reviewed
Jun 2, 2026
2 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.
Problem and Solution
Closes #9512
Closes #9525
Merges #9523