Skip to content

fix(frontend): keep the settings plugin list stable across refreshes - #1582

Open
abdulrafey1 wants to merge 10 commits into
issue-825-query-filter-barfrom
issue-825-settings-refresh
Open

abdulrafey1 wants to merge 10 commits into
issue-825-query-filter-barfrom
issue-825-settings-refresh

Conversation

@abdulrafey1

@abdulrafey1 abdulrafey1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Part of: Its difficult to find plugins in the Config tab

What

Toggling plugins quickly on the settings page could snap a switch back, swap the list for a spinner and drop
keyboard focus; this keeps the list, its state and focus stable while plugins refresh, so a filter typed above it
in the last PR of this stack survives a toggle. The sidebar, the dashboard and a plugin's own page no longer swap
to a spinner on a refresh either.

Changes

  • fix(frontend): apply only the newest plugin list response (a slow, older refresh can no longer overwrite a
    newer list; only the newest refresh reports an error)
  • fix(frontend): show the plugin loading state only on a first load (the provider turns loading on once per
    token, until that token's first answer, and a later refresh leaves it off; the settings page, the dashboard, a
    plugin's page and the sidebar keep their content while plugins refresh)
  • fix(frontend): keep switch focus and apply in-order plugin refreshes (a busy switch is aria-disabled rather
    than disabled, so focus stays on it; an older refresh that answers first is shown until the newer one arrives)
  • fix(frontend): keep a failed newest plugin refresh over older answers (an older list that arrives after the
    newest refresh failed no longer hides the error)
  • test(frontend): cover a plugin refresh that answers after sign-out (the signed-out user's plugins stay gone)
  • refactor(frontend): let the switch own its busy look (Switch styles aria-disabled beside disabled)

How to Test

  1. Open /dashboard/settings with several plugins.
  2. Click two plugin switches quickly, one after the other. Both end in the position you set, and the list never
    turns into a spinner.
  3. Tab to a plugin switch and press Space. Focus stays on the switch while it turns on or off, and pressing Space
    again before it finishes does nothing.
  4. Watch the sidebar while you click a switch. Its plugin links stay on screen instead of turning into a spinner.
  5. Reload the page. The spinner shows once while the plugins first load.
  6. Sign out and sign in again without reloading. The spinner shows once more while the plugins load.
  7. cd frontend && bun run vitest run tests/core/plugins/context.test.ts tests/app/dashboard/settings/page.test.tsx tests/core/settings/components/ui/SettingsRow.test.tsx

Environment Variables

Test Coverage

  • Backend: 95%
  • Frontend: 79.57%

Measured on the top branch of this stack, which contains this one.

Notes

Second of four stacked PRs; based on the query filter bar PR.

This description was written with the assistance of an LLM (Claude).

🤖 Generated with Claude Code

abdulrafey1 and others added 5 commits December 3, 2026 13:48
Two quick toggles start two refreshes. If the older one answered last it
overwrote the newer list, and a switch snapped back. Drop any response, or
failure, from a refresh that is no longer the newest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every toggle and config save refreshes the plugin list, and the settings page
swapped the whole list for a spinner each time. Show the spinner only on the
first load, so the list and its state stay put.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A settings switch stays focusable while its toggle runs, so keyboard focus is
not dropped to the page. A refresh that answers before a newer one now updates
the list instead of being dropped; only stale responses are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the newest refresh failed and an older one answered after it, the older list replaced the
error and left the plugins loading until the next refresh. The failure now counts as applied, so
older answers that arrive later are dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abdulrafey1
abdulrafey1 added this pull request to stack #1585 December 3, 2026 09:59
@abdulrafey1 abdulrafey1 self-assigned this Dec 3, 2026
Comment thread frontend/core/plugins/context.tsx Resolved
abdulrafey1 and others added 5 commits December 4, 2026 18:45
The settings page guessed a first load from an empty list, so a user with no plugins saw the
spinner on every refresh. The dashboard, the plugin page and the sidebar swapped to a spinner
on every refresh too, which blanked a plugin page after a config save.

The provider now turns loading on once per token, until that token's first answer, and a
later refresh leaves it off. No page has to work out what a first load is.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signing out counts as the newest applied request, which drops a fetch still in flight. No
test failed when that was removed, so the signed-out user's plugins could come back
unnoticed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The settings row passed the aria-disabled classes into the shared switch, which already
styles its disabled state. The switch now styles both, so a caller only sets the state.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants