Skip to content

feat(hub-ui): reopen a group's last-opened member ahead of defaultChildId - #309

Merged
antfu merged 1 commit into
mainfrom
feat/hub-ui-group-last-opened-member
Aug 27, 2026
Merged

feat(hub-ui): reopen a group's last-opened member ahead of defaultChildId#309
antfu merged 1 commit into
mainfrom
feat/hub-ui-group-last-opened-member

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

What

Group docks now remember the member last opened in them, per tab. Activating a group reopens that member directly — taking precedence over the group's defaultChildId — instead of showing the member popover again.

For a group A with members B C D and no defaultChildId: the first click on A reveals the member popover; picking D opens it and records it. Toggling A closes the panel, and the next click reopens D straight away. When a defaultChildId is set, it seeds the first activation and the last-opened member wins from then on.

How

  • DockSessionStorage gains groupLastChildIds (group id → member id), persisted beside selectedDockId/recentDockId in the per-tab devframes-dock-session store, so the memory survives reloads without two tabs fighting over it.
  • switchEntry records every grouped-member selection (popover, group sidebar, command palette, RPC activation all funnel through it) and resolves a group activation through the new resolveGroupPreferredChild — last-opened member first, then defaultChildId, each under the existing when/visibility rules, then the first member.
  • The dock-bar group button uses the same resolution before falling back to the popover.
  • A remembered member that no longer resolves (removed, or its when clause fails) falls back to defaultChildId gracefully.

Covered by new unit tests for resolveGroupPreferredChild and a createDocksContext round-trip test; docs and story descriptions updated.


Created with the help of an agent.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
devframe Ready Ready Preview Aug 27, 2026 9:36am

@antfu
antfu merged commit 9646fe7 into main Aug 27, 2026
11 checks passed
@antfu
antfu deleted the feat/hub-ui-group-last-opened-member branch August 27, 2026 09:57
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.

2 participants