Skip to content

Fix CF icon flicker on Servers page via targeted single-server patch - #194

Merged
vishu-bh merged 1 commit into
contextforge-org:mainfrom
CloudCorpRecords:fix/servers-flicker-targeted-patch
Oct 21, 2026
Merged

vishu-bh merged 1 commit into
contextforge-org:mainfrom
CloudCorpRecords:fix/servers-flicker-targeted-patch

Conversation

@CloudCorpRecords

Copy link
Copy Markdown
Contributor

Fixes #120.

Activate/deactivate and the Refresh action called refetch() after their API calls. That sets the page-level isLoading flag, which unmounts the whole ServersTable behind a spinner and reads as flicker.

This applies the same targeted-patch approach Tools.tsx uses in handleToggleTool: after the mutation the page re-reads just the affected server (serversApi.get, with the single-server request cache invalidated first) and patches it into local state and the query cache. The table never unmounts, so there is no spinner and no flicker.

Changes:

  • src/pages/Servers.tsx: new patchServer callback; handleToggleEnabled and handleRefresh use it instead of refetch(). refetch() is still used for delete, OAuth authorize, and the create/edit form, which need a full list.
  • src/api/servers.ts: new serversApi.invalidateGetCache(id) so the re-read after a mutation does not return the pre-mutation cached snapshot.

Tests:

  • src/pages/Servers.test.tsx: rewrote the toggle test to assert the single server is re-read and patched with no list refetch and no spinner; added a refresh test asserting the row counts update with no list refetch. Both fail against the unfixed code (red-checked).
  • src/api/servers.test.ts: added a test for invalidateGetCache.
  • Full suite: 227 files, 3790 passed, 1 skipped (the extra api test ran green separately).
  • tsc -b clean (after orval generate); eslint clean on all changed files.

@marekdano marekdano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@CloudCorpRecords - thanks for your contribution!
The core fix directly solves the issue and follows existing patterns in the codebase.

LGTM 🚀

Activate/deactivate and the Refresh action called refetch() after their API calls, which sets the page-level isLoading flag and remounts the whole ServersTable behind a spinner. This applies the same targeted-patch approach Tools.tsx uses in handleToggleTool: after the mutation, re-read just the affected server (with the single-server request cache invalidated first) and patch it into local state and the query cache. The table never unmounts, so there is no spinner and no flicker.

Signed-off-by: Rene Turcios <95189389+CloudCorpRecords@users.noreply.github.com>
@CloudCorpRecords
CloudCorpRecords force-pushed the fix/servers-flicker-targeted-patch branch from 62ac3e4 to 019f204 Compare October 20, 2026 21:27

@vishu-bh vishu-bh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean implementation and solid code.

LGTM 🚀

@vishu-bh
vishu-bh merged commit f0b92f2 into contextforge-org:main Oct 21, 2026
5 checks passed
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.

CF icon flickers on MCP Servers page during activate/deactivate/refresh

3 participants