SIGN IN SIGN UP

dock: Coalesce panel active-state delivery into a single deferred sync (#2646)

## Problem

TabPanel syncs `set_active` with one spawned task per event, each
capturing tab indices that can be stale by the time it runs. The visible
fallout: a panel sitting alone in a tab group never receives the initial
`set_active(true)`, so lazy-loading panels restored into single-panel
layouts stay blank until you switch tabs (which, with one tab, you
can't). The same root cause also sends the displayed panel a false→true
flip plus N−1 duplicate `true`s while a multi-tab group is being built,
drops the notification when a panel is inserted at the current active
index, and makes closing a tab to the left of the active one silently
change which panel is shown.

## Summary

Track what each panel was last told (`notified_active`), and reconcile
once per frame against the frame-end state, sending only the diffs.
`detach_panel` now keeps `active_ix` on the same panel, and
drag-and-drop carries the last-told state into the target group so a
move doesn't re-notify.

**Behavior change:**

- `set_collapsed` notifies on the next tick now, not synchronously.
- Removed panels are not told `false`; `on_removed` stays the removal
signal.
- Panels that reload on every `true` used to reload several times at
startup because of the duplicates. Now it's once.
F
Floyd Wang committed
bbf7650abae59e3a984d48bd120a6f9094fed1f2
Parent: 9abd89b
Committed by GitHub <noreply@github.com> on 8/4/2026, 8:38:48 AM