Skip to content

fix(admin-form): show error state when webhook settings fetch fails#9524

Open
LoneRifle wants to merge 4 commits into
developfrom
fix/webhooks-settings-error-state
Open

fix(admin-form): show error state when webhook settings fetch fails#9524
LoneRifle wants to merge 4 commits into
developfrom
fix/webhooks-settings-error-state

Conversation

@LoneRifle
Copy link
Copy Markdown
Contributor

@LoneRifle LoneRifle commented Jun 2, 2026

Problem and Solution

Closes #9512
Closes #9525
Merges #9523

…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>
Copilot AI review requested due to automatic review settings June 2, 2026 08:29
@LoneRifle LoneRifle requested a review from a team as a code owner June 2, 2026 08:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SettingsWebhooksPage to branch on isError from useAdminFormSettings() and render a dedicated error state with retry.
  • Add WebhooksErrorMsg presentational 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>
Comment thread apps/frontend/src/features/admin-form/settings/SettingsWebhooksPage.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants