Skip to content

fix: preserve extension widget order on updates - #839

Open
darthrick0 wants to merge 1 commit into
agegr:mainfrom
darthrick0:fix/extension-widget-order
Open

darthrick0 wants to merge 1 commit into
agegr:mainfrom
darthrick0:fix/extension-widget-order

Conversation

@darthrick0

Copy link
Copy Markdown

Problem

This was observed in Firefox on Windows with the @tintinweb/pi-subagents plugin. The independently updating Agents and Fleet widgets repeatedly swapped positions in the bottom widget strip, causing visible flickering.

setWidget removed the existing keyed widget and appended its replacement. Consequently, every content update moved that widget to the end of the list. The issue is in the client-side state logic and is not expected to be browser-specific.

Changes

  • Update existing widgets at their current array position.
  • Continue appending new widgets and removing explicitly cleared widgets.
  • Extract the state update into a small pure helper.
  • Add regression coverage for independently updating Agents and Fleet widgets.

Verification

  • npm test — 1,022 tests passed
  • node_modules/.bin/tsc --noEmit
  • npm run lint

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