Skip to content

fix(details): keep list rows on show while a refresh loads - #2277

Merged
Brendonovich merged 1 commit into
devfrom
fix/details-lists-keep-rows-on-refresh
Dec 3, 2026
Merged

Brendonovich merged 1 commit into
devfrom
fix/details-lists-keep-rows-on-refresh

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

What

Turning an MCP server on or off made the Details popover's MCP flyout flicker: the rows briefly turned into "Loading…" (and the footer disappeared), then came back.

Why

The toggle calls Server.Invalidate("/api/mcp"), and each mcp.status.changed event calls lists.invalidate, which also cleared the parsed rows. Server.Invalidate drops the cached read entirely, so the next Server.Resource starts again from Ticket::Empty: status: "loading" at generation 0. lists.read takes that as a first load and shows the loading message until the refetch lands. A single toggle can send several status events, so it can flicker more than once.

Change (plugins/details, no Rust)

  • lists.invalidate keeps the parsed items and marks them refreshing instead of deleting them.
  • lists.read keeps showing a refreshing entry's rows while its read loads again from generation 0. The new answer replaces them when it lands, since its generation is always newer. An error still drops them and shows the failed state.
  • mcp.js's three Server.Invalidate("/api/mcp") calls now go through env.invalidate() (lists.invalidate(env, "mcp", null)). The server sees the same invalidation, and the flyout knows a refresh is in progress.

Only refreshes started by an invalidation fall back to the old rows. A first open, a server switch, and the Retry button (Invalidate("/api/")) still show "Loading…" as before. Plugins and skills get the same fix through lists.invalidate.

Verification

  • node --check on plugins/details/*.js; plugin-props, external-open, file-size and folder-shape guardrails pass.
  • Checked live in Desktop by Brendan: toggling an MCP with the flyout open no longer flickers. (I couldn't build Desktop in my sandbox: no Rust toolchain, 1 CPU.)

Requested by: Brendan via Slack

@Brendonovich
Brendonovich merged commit 32eb559 into dev Dec 3, 2026
8 checks passed
@Brendonovich
Brendonovich deleted the fix/details-lists-keep-rows-on-refresh branch December 3, 2026 13:02
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.

1 participant