DSH / Atlas
2026-10-14implementedarchitecture

Plugin entry customization: region-owned pins and More menus

插件入口自定义:区域自管的 Pin 与“更多”菜单

The `release/dsh-0.2.1` Web app shows plugin entries in three regions: the left sidebar's panel buttons (`sidebar.panellist`), the Conversation header's View tabs (`conversation.view`), and the right sidebar guide's tool cards (guide entries from the right-sidebar tab registry). Each region shows every entry in registration order, so users cannot hide entries they rarely use, and every installed plugin makes the regi

English

Problem

The release/dsh-0.2.1 Web app shows plugin entries in three regions: the left sidebar's panel buttons (sidebar.panellist), the Conversation header's View tabs (conversation.view), and the right sidebar guide's tool cards (guide entries from the right-sidebar tab registry). Each region shows every entry in registration order, so users cannot hide entries they rarely use, and every installed plugin makes the regions more crowded. Users also cannot browse more plugins or start creating a plugin from these positions.

The feature ships in release/dsh-0.2.1 and is later merged back to master with the release, so it changes as little as possible relative to the release: no changes to the slot framework (ui-slots, ui-renderer), no new Cordis service, ui-layout unchanged, and client plugin packages share only types (Client package export rules). Persisted data must be readable without migration by a later slot-level store for manual order and pin state.

Decision

Each region keeps and persists its own list of unpinned entries and filters its own entry buttons with it. Each region draws its own More button, opens a menu with the shared Menu component, and renders its actions slot inside that menu. The default-loaded plugin package ui-entry-customization registers the same menu-content component into the three actions slots: the entry list with pin buttons, Browse other plugins, and Create your plugin. This follows the Plugins page's Add plugin menu, where the page draws the button and menu and ui-agent-preset adds Create plugin through plugins.add.actions. Entries cannot be reordered.

User-visible behavior

  • The left sidebar, the Conversation header, and the right sidebar guide each have a More button. Its menu lists the region's customizable entries. Selecting an entry name opens the entry; its pin button shows or hides the entry in the region; the bottom of the menu has Browse other plugins (opens the Plugins main list) and Create your plugin (opens a new or reused blank Session with the Creator preset and fills in the region's prompt without sending it).
  • Entries appear in registration order, as in the release; they cannot be reordered.
  • Default entries always show and never appear in the menu: Plugins in the left sidebar, Chat in the Conversation header, and Files in the right sidebar.
  • Pin state survives page reloads and is shared by every Session.
  • Hiding the selected entry does not navigate away from its content; the left-sidebar row or View tab of the selected entry stays visible, as the current item, until another entry is selected.
  • The left-sidebar <nav> and the Conversation header tab bar keep their release visibility conditions: <nav> shows while any panel is registered, and the tab bar shows while more than one View is registered. Both conditions count registered entries, not entries left visible by pin state. With only Chat registered the tab bar stays hidden; with other Views registered, the tab bar and its More button stay visible even when every other View is hidden, so users can pin them again.
  • While an actions slot has no registrations, for example when ui-entry-customization is not loaded, its region shows no More button.

Structure and ownership

ui-sidebar / ui-conversation / ui-sidebar-right (each region)
  apply: the region's unpinned list (createSnapshotStore + persist) and setPinned
         whether the actions slot has registrations (entriesOfSlot + subscribe)
  root component: draws only fixed or pinned entries
          while the actions slot has registrations, draws the region's More button and Menu:
            <Menu anchor={region's More button} …>
              renderSlot('<region>.actions', { entries, onOpen, onPinnedChange, onDismiss })
            </Menu>

ui-entry-customization (default-loaded)
  registers one menu-content component into each actions slot (id 'entry-customization')
  content: non-fixed entries with pin buttons, Browse other plugins, Create your plugin; keeps no state

Dependency direction: the three regions do not depend on the plugin package and only add uses of client-store and ui-primitives they already depend on. ui-entry-customization depends on the three regions (slot types) and on ui-plugin-manager and ui-workspace (service types), and calls ctx.pluginNavigation and ctx.uiWorkspace at runtime. No package gains a new runtime value import from another package.

Package changes relative to release/dsh-0.2.1

PackageChange
ui-sidebarAdds sidebar.panellist.actions; apply adds the unpinned list, setPinned, and the actions-slot registration state; SidebarRoot filters entries and draws the More button and menu at the end of <nav>; expanded panel rows use a 2px gap instead of 4px
ui-conversationAdds conversation.session.header.views.actions; apply adds the same three parts; the Session header filters View tabs and draws the More button and menu inside the tab bar after the tablist; View tabs use a 32px gap instead of 36px, with 20px before More
ui-sidebar-rightAdds sidebar.right.tab.guide.actions; apply adds the same three parts; the guide filters cards and draws the More card and menu after the cards; the guide registration declares the sidebarRight locale namespace
ui-entry-customization (new package)Registers the menu-content component into the three actions slots; owns the entryCustomization locale namespace; keeps no state
ui-plugin-managerAdds openList() to pluginNavigation: selects the Installed tab of the Plugins main list without opening a dialog or changing the current Session
ui-primitivesAdds minWidthFromAnchor to Menu so the right-sidebar menu is never narrower than its card; adds IconAppsAddOutlineRegular / IconAppsAddOutlineMedium (compact for card size), shared by the left-sidebar and right-sidebar buttons
@deepseek-ai/dsh-web-appLoads ui-entry-customization by default

Actions slots and menu content

The three actions slots are root-scoped list slots declared by their regions and rendered inside the region's More menu. Other plugins may register menu items into them; items follow their registration order. Each region declares the owner props in its own contract (SidebarPanelActionsOwnerProps, ConversationViewActionsOwnerProps, SidebarRightGuideActionsOwnerProps) with the same fields; the left sidebar's type is:

interface SidebarPanelActionsOwnerProps {
  /** The region's customizable entries in registration order; fixed entries are excluded. */
  readonly entries: readonly { readonly id: string; readonly label: string; readonly pinned: boolean }[]
  /** Open an entry without changing its pin state. */
  readonly onOpen: (id: string) => void
  /** Show (true) or hide (false) an entry. */
  readonly onPinnedChange: (id: string, pinned: boolean) => void
  /** Close the More menu. */
  readonly onDismiss: () => void
}

The ui-entry-customization menu-content component renders those fields: one row per entry (EntryPickerRow, whose name and pin button are separately focusable). Selecting the name calls onDismiss and then onOpen; the pin button calls onPinnedChange. Browse other plugins and Create your plugin follow and call onDismiss before acting. Each registration receives its region (used only to choose pin copy and the Creator prompt) and the two footer actions through its registration inject. Browse other plugins calls ctx.pluginNavigation.openList(); Create your plugin calls ctx.uiWorkspace.startSession(undefined, { agentPreset: 'cordis', prompt, whenDraftExists: 'append' }) with the region's localized prompt. The call does not go through ui-agent-preset, so the preset chip plays no introduction animation. When no Creator preset exists, Session creation fails, Workspace shows its creation-failure notice, and no draft is created.

The region decides its More button's styling, accessible name ("More", "More conversation views", and "More tools", from the regions' panels.more, session.moreViews, and tab.guide.more copy), Tooltip, and the menu's placement and width. Every menu uses the ui-primitives Menu component.

The three regions

Left sidebar (ui-sidebar)Conversation header (ui-conversation)Right sidebar guide (ui-sidebar-right)
Entry sourceExisting panels (from sidebar.panellist)Existing View list (from conversation.view; Trajectory is removed while developer tools are off)Existing tab registry guide()
Entry idPanel idView idkind:entryId
FixedpluginschatEntries of kind files
localStorage keydsh.slot.manual-order.sidebar.panellist.v1dsh.slot.manual-order.conversation.view.v1dsh.slot.manual-order.sidebar.right.tab.guide.list.v1
Actions slotsidebar.panellist.actionsconversation.session.header.views.actionssidebar.right.tab.guide.actions
More buttonPanel-button styling; shows its label when expanded and a Tooltip when collapsedSmall header button with a TooltipCard styling; the menu is at least as wide as the card and aligned to its end
onOpenselectPanel(id)The Session's selectView(id)Finds the entry by id, then openTab(kind, { replaceTab: true })

Each region defines its fixed entry in a module constant. The unpinned list is created in apply with client-store's createSnapshotStore(…, { persist }), is independent of Sessions, and stores { "unpinned": string[] }. It reaches the region's root component through the inject hooks.entryPins; setPinned is an inject callback and ignores the fixed entry. Reads accept only an array of strings and treat any other value as an empty list, so corrupted localStorage content cannot break rendering. Ids that are no longer registered stay in unpinned, so an entry registered again stays hidden. Whether the actions slot has registrations reaches the root component through hooks.entryActions.

Every localStorage key has the form dsh.slot.manual-order.<list slot key>.v1, named after the list slot that holds the entries rather than after the region package: the left sidebar and the Conversation header use the existing sidebar.panellist and conversation.view. The right-sidebar guide entries come from the tab registry and have no list slot in the release, so their key uses the name reserved for one, sidebar.right.tab.guide.list. A later slot-level store for the manual order and pin state of a list slot reads these keys and ids directly; saved unpinned values need no migration, and fields added later default to empty lists when absent from saved values.

Right-sidebar ids use kind instead of providerId: when an extension takes over a kind, providerId changes while kind stays the same, so persisted pin state remains valid after the takeover.

Alternatives considered

Keep pin state in a Cordis service (provided by ui-layout or the plugin). A region must read pin state while drawing its own buttons, and a slot only passes data from the region to the plugin, so plugin-held state needs a new public service. A ui-layout service would hold state unrelated to layout; a plugin-provided service would require each region to handle the service appearing and disappearing. Region-held state needs only a few lines.

One pin service per region. Adds three public services with different signatures, while pin state is used only by its region and that region's menu.

Add useSlotEntries / useManualOrderedListSlot to the slot framework. Requires changing ui-slots and ui-renderer, makes ui-renderer hold user preferences and read and write localStorage, and requires the right sidebar to mirror its guide entries into an internal list slot. Without reordering, each region's pin logic is a few lines, which does not justify changing the framework in a release.

Drag reordering in the left sidebar. Only the left sidebar would use it, so the three regions would behave differently; this version does not support reordering.

Make the popover a Component Factory with the More button as a local slot. The callers are the three regions and the implementation is the plugin. Declaring the Factory in the plugin package creates a dependency cycle, because the plugin's dependencies ui-plugin-manager and ui-workspace depend on the regions. Declaring it in ui-layout cannot name the plugin's locale namespace, so the declaration would be split across two packages and completed through declaration merging.

Let the plugin draw the whole More control (button and menu) from region data. The plugin would copy the three regions' button styles, because CSS Modules cannot be reused across packages, and would need layout state from each region. Button styling carries region-specific behavior and belongs to the region.

Let the plugin render the region entries. Left-sidebar icons and right-sidebar cards depend on their regions' child slots, and the plugin cannot reach the region's renderSlot; React nodes also cannot be passed as props.

Stop applying pin state while the plugin is not loaded. The only benefit is that entries hidden before the plugin was disabled or failed to load would still show. That case requires explicitly disabling a default-loaded plugin; the limitation is accepted and documented in the README.

Show the tab bar based on entries left visible by pin state. With other Views registered, hiding all of them would remove the tab bar together with its More button, and users could not pin them again.

Publish agentPresetNavigation, or have ui-agent-preset react to startSession calls that carry agentPreset and play the introduction animation. The first adds a service only to forward to startSession; the second changes the ui-workspace and ui-agent-preset interfaces, and the introduction animation is not essential to this feature.

Name localStorage keys after region packages. A later slot-level store keyed by list slot would have to migrate saved data.

Verification

  • Unit tests for the three regions cover: entry buttons show only fixed or pinned entries; setPinned ignores the fixed entry; setPinned writes and persists to the region's key; corrupted localStorage content reads as an empty list; ids that are no longer registered are kept; More shows while the actions slot has registrations and passes entries without fixed entries and the callbacks, and is absent without registrations; the Conversation header tab bar stays hidden with only Chat and stays visible after every other View is hidden; right-sidebar ids are kind:entryId.
  • Unit tests for the menu-content component cover: opening an entry, toggling a pin, an empty list showing only the footer actions, the arguments of Browse other plugins and Create your plugin, and removal of the three registrations when the plugin is released.
  • The Web e2e entry-customization.e2e.ts exercises the left sidebar through the real Web composition: More shows by default, hiding a panel removes its button, the panel still opens from the menu, it stays hidden after a reload, and pinning it again restores the button. Recorded-session Web goldens cover the Conversation header and right-sidebar More buttons; changed-files-turn.e2e.ts and document-preview.e2e.ts assert that the compact header has no tab bar with only Chat.
  • Every changed source file has 100% per-file coverage.

Consequences

  • If a user hides entries and the plugin is later explicitly disabled or fails to load, the hidden entries stay hidden with no menu to restore them; re-enabling the plugin or clearing the region's localStorage key restores them.
  • localStorage is isolated by protocol, host, and port, so pin state is not shared after changing the Web port or between Web and Desktop.
  • client-store's persist does not validate restored values, so each region validates on read; the validation and the owner props type exist once per region.
  • The actions slots sit inside the More menus, so other plugins can add menu items but cannot place arbitrary controls beside the entries.
  • The right-sidebar key reserves sidebar.right.tab.guide.list; a later list slot for guide entries must use that name for saved pin state to carry over.
  • When an extension takes over a kind and uses different guide entry ids, existing pin state does not match the new entries.
  • With the plugin loaded by default, Web goldens that record the left navigation, the Conversation header tab bar, or the right sidebar guide include a More button.

中文

问题

release/dsh-0.2.1 的 Web 应用在三个区域显示插件入口:左侧栏的面板按钮(sidebar.panellist)、会话头部的 View 标签(conversation.view)和右侧栏起始页的工具卡片(右侧栏 tab 注册表的 guide 入口)。三处都按注册顺序显示全部入口,用户不能收起不常用的入口,插件越多三处越挤;用户也不能在这些位置直接浏览更多插件或开始创建插件。

该功能随 release/dsh-0.2.1 发布,之后随 release 合回 master,因此相对 release 的改动要尽量少:不修改 slot 框架(ui-slots、ui-renderer),不新增 Cordis 服务,ui-layout 保持不变,client 插件包之间只共享类型(Client 包导出规则)。持久化的数据要能被以后在 slot 层统一保存手动顺序与 Pin 状态的实现直接沿用。

决策

三个区域各自保存本区域被收起入口的列表并持久化,用它过滤自己的入口按钮;各自画自己的“更多”按钮,用共用的 Menu 组件弹出菜单,菜单里渲染本区域的 actions slot。默认加载的插件包 ui-entry-customization 往三个 actions slot 注册同一个菜单内容组件:入口列表与 Pin 按钮、“浏览更多插件”和“创建你的插件”。做法与插件页的“添加插件”菜单一致:页面画按钮和菜单,ui-agent-preset 通过 plugins.add.actions 往菜单里加“创建插件”。不提供排序。

用户可见行为

  • 左侧栏、会话头部、右侧栏起始页各有一个“更多”按钮,打开后的菜单列出该区域可自定义的入口。点入口名称打开它;点 Pin 让它在区域里显示或收起;底部有“浏览更多插件”(打开插件页主列表)和“创建你的插件”(用 Creator 预设新开或复用空白会话,填入该区域对应的提示语,不发送)。
  • 入口按注册顺序显示,与 release 一致;不提供排序。
  • 默认绑定的入口始终显示,不进入菜单:左侧栏的插件管理、会话头部的 Chat、右侧栏的文件。
  • Pin 状态在刷新页面后保留,所有会话共用。
  • 收起当前选中的入口不会切走当前内容;左侧栏行或 View 标签在选中其他入口之前保持显示,并标为当前项。
  • 左侧栏 <nav> 与会话头部标签条的显示条件与 release 一致:<nav> 在有已注册面板时显示,标签条在注册的 View 多于一个时显示。条件按已注册的入口计算,不按 Pin 后可见的入口计算,因此只有 Chat 时不显示标签条;有其他 View 时即使全部收起,标签条和其中的“更多”仍然显示,用户可以重新固定。
  • actions slot 没有注册项时(例如 ui-entry-customization 未加载),区域不显示“更多”。

结构与职责

ui-sidebar / ui-conversation / ui-sidebar-right (each region)
  apply: the region's unpinned list (createSnapshotStore + persist) and setPinned
         whether the actions slot has registrations (entriesOfSlot + subscribe)
  root component: draws only fixed or pinned entries
          while the actions slot has registrations, draws the region's More button and Menu:
            <Menu anchor={region's More button} …>
              renderSlot('<region>.actions', { entries, onOpen, onPinnedChange, onDismiss })
            </Menu>

ui-entry-customization (default-loaded)
  registers one menu-content component into each actions slot (id 'entry-customization')
  content: non-fixed entries with pin buttons, Browse other plugins, Create your plugin; keeps no state

依赖方向:三个区域不依赖插件包,只增加 client-store 与 ui-primitives 的既有用法;ui-entry-customization 依赖三个区域(slot 类型)、ui-plugin-manager 与 ui-workspace(服务类型),运行时通过 ctx.pluginNavigation 与 ctx.uiWorkspace 调用。各包之间不新增运行时值导入。

各包改动(相对 release/dsh-0.2.1)

包改动
ui-sidebar新增 sidebar.panellist.actions;apply 中新增 unpinned 列表、setPinned 和 actions slot 注册状态;SidebarRoot 过滤入口,并在 <nav> 末尾画“更多”按钮与菜单;展开态面板行间距由 4px 改为 2px
ui-conversation新增 conversation.session.header.views.actions;apply 中新增同样三项;会话头部过滤 View 标签,并在标签条内、tablist 之后画“更多”按钮与菜单;View 标签间距由 36px 改为 32px,与“更多”间隔 20px
ui-sidebar-right新增 sidebar.right.tab.guide.actions;apply 中新增同样三项;起始页过滤卡片,并在卡片之后画“更多”卡片与菜单;guide 注册声明 sidebarRight 文案命名空间
ui-entry-customization(新包)往三个 actions slot 注册菜单内容组件;entryCustomization 文案命名空间;不保存状态
ui-plugin-managerpluginNavigation 增加 openList():切到插件页主列表的“已安装”标签,不打开对话框,不改变当前会话
ui-primitivesMenu 增加 minWidthFromAnchor,让右侧栏菜单不窄于卡片;新增 IconAppsAddOutlineRegular / IconAppsAddOutlineMedium(compact 用于卡片尺寸),供左侧栏和右侧栏的按钮共用
@deepseek-ai/dsh-web-app默认加载 ui-entry-customization

actions slot 与菜单内容

三个 actions slot 都是 root 级 list slot,由各区域声明,渲染在本区域的“更多”菜单里,其他插件也可以往里注册菜单项,排列顺序按注册项的 order。owner props 由各区域在自己的 contract 中声明(SidebarPanelActionsOwnerProps、ConversationViewActionsOwnerProps、SidebarRightGuideActionsOwnerProps),三处字段相同,以左侧栏为例:

interface SidebarPanelActionsOwnerProps {
  /** The region's customizable entries in registration order; fixed entries are excluded. */
  readonly entries: readonly { readonly id: string; readonly label: string; readonly pinned: boolean }[]
  /** Open an entry without changing its pin state. */
  readonly onOpen: (id: string) => void
  /** Show (true) or hide (false) an entry. */
  readonly onPinnedChange: (id: string, pinned: boolean) => void
  /** Close the More menu. */
  readonly onDismiss: () => void
}

ui-entry-customization 的菜单内容组件按上述字段渲染:每个入口一行(EntryPickerRow,名称与 Pin 按钮各自可聚焦),点名称先 onDismiss 再 onOpen,点 Pin 调 onPinnedChange;其后是“浏览更多插件”和“创建你的插件”,先 onDismiss 再执行。每个注册项通过 registration inject 得到所属区域(只用于选择 Pin 提示与创建提示语)和两个底部操作:“浏览更多插件”调用 ctx.pluginNavigation.openList();“创建你的插件”调用 ctx.uiWorkspace.startSession(undefined, { agentPreset: 'cordis', prompt, whenDraftExists: 'append' }),prompt 按区域取本地化文案。该调用不经过 ui-agent-preset,预设标签不播放介绍动画;Creator 预设不存在时会话创建失败,Workspace 显示创建失败提示,不产生草稿。

“更多”按钮的样式、无障碍名称(“更多”“更多会话视图”“更多工具”,分别来自各区域的 panels.more、session.moreViews、tab.guide.more 文案)、Tooltip、菜单的弹出方向与宽度都由区域决定;菜单外框统一使用 ui-primitives 的 Menu。

三个区域

左侧栏(ui-sidebar)会话头部(ui-conversation)右侧栏起始页(ui-sidebar-right)
入口来源现有的 panels(来自 sidebar.panellist)现有的 View 列表(来自 conversation.view,未开启开发者工具时去掉 Trajectory)现有的 tab 注册表 guide()
入口 id面板 idView idkind:入口id
fixedpluginschatkind 为 files 的入口
localStorage 键dsh.slot.manual-order.sidebar.panellist.v1dsh.slot.manual-order.conversation.view.v1dsh.slot.manual-order.sidebar.right.tab.guide.list.v1
actions slotsidebar.panellist.actionsconversation.session.header.views.actionssidebar.right.tab.guide.actions
“更多”按钮与面板按钮同样式;展开时显示文字,收起时显示 Tooltip头部样式的小按钮,带 Tooltip卡片样式,菜单不窄于卡片并右对齐
onOpenselectPanel(id)本会话的 selectView(id)按 id 找到入口后 openTab(kind, { replaceTab: true })

每个区域用一个模块常量定义 fixed。unpinned 列表在 apply 中用 client-store 的 createSnapshotStore(…, { persist }) 创建,与会话无关,值为 { "unpinned": string[] },经 inject 的 hooks.entryPins 交给区域根组件,setPinned 作为 inject 回调,对 fixed 入口不生效。读取时只接受字符串数组,其他值按空列表处理,避免损坏的 localStorage 内容影响渲染。unpinned 中已不存在的 id 保留,同一入口重新注册后保持收起。actions slot 是否有注册项经 hooks.entryActions 交给根组件。

localStorage 键统一为 dsh.slot.manual-order.<list slot key>.v1,按入口所在的 list slot 命名,不按区域包命名:左侧栏与会话头部使用现有的 sidebar.panellist、conversation.view;右侧栏的 guide 入口来自 tab 注册表,release 中还没有对应的 list slot,键名使用为它预留的 sidebar.right.tab.guide.list。以后在 slot 层统一保存同一 list slot 的手动顺序与 Pin 状态时,直接沿用这些键和 id,已保存的 unpinned 不需要迁移;新增的字段在旧值中缺失时按空列表处理。

右侧栏 id 使用 kind 而不是 providerId:扩展接管某个 kind 时 providerId 会改变,kind 不变,持久化的 Pin 状态在接管后仍然有效。

考虑过的替代方案

由一个 Cordis 服务保存 Pin 状态(在 ui-layout 或插件中提供)。 区域画自己的按钮时要读到 Pin 状态,而 slot 只能把数据从区域传给插件;由插件保存就必须新增公开服务。放在 ui-layout 会让布局服务承担与布局无关的状态;由插件提供时,区域还要处理服务时有时无。区域自己保存只需几行。

三个区域各提供一个 Pin 服务。 新增三个形态不同的公开服务,而 Pin 状态只被所在区域和它的菜单使用。

在 slot 框架中提供 useSlotEntries / useManualOrderedListSlot。 需要修改 ui-slots 与 ui-renderer,让 ui-renderer 持有用户偏好并读写 localStorage,右侧栏还要在内部同步成 list slot;不提供排序时,各区域的 Pin 逻辑只有几行,不值得为 release 修改框架。

左侧栏拖动排序。 只有左侧栏使用,三个区域的交互不一致;本版本不提供排序。

把弹出框做成 Component Factory,“更多”按钮作为局部 slot。 调用方是三个区域,实现方是插件:Factory 声明放在插件包会形成依赖环(插件依赖的 ui-plugin-manager、ui-workspace 依赖区域),放在 ui-layout 又引用不到插件的文案命名空间,只能把声明拆在两个包里用声明合并补齐。

插件画整个“更多”(按钮与菜单),区域只提供数据。 插件要复制三个区域的按钮样式(CSS Module 不能跨包复用),并从区域取得布局状态;按钮样式带有区域的业务特点,应留在各自的区域。

由插件渲染区域入口。 左侧栏图标和右侧栏卡片依赖各自的子 slot,插件拿不到区域的 renderSlot;ReactNode 也不能作为 props 传递。

插件未加载时停止应用 Pin 状态。 唯一收益是插件在用户收起入口后被禁用或加载失败时,入口仍能显示;该情形需要显式禁用默认加载的插件,接受这一限制并在 README 中说明。

按 Pin 后可见的入口数决定标签条是否显示。 有其他 View 时全部收起后,标签条和其中的“更多”一起消失,用户无法重新固定。

公开 agentPresetNavigation,或让 ui-agent-preset 响应带 agentPreset 的 startSession 并播放介绍动画。 前者只为转调 startSession 新增服务;后者要修改 ui-workspace 与 ui-agent-preset 的接口,介绍动画不是本功能的必要部分。

按区域包命名 localStorage 键。 以后在 slot 层按 list slot 统一保存时需要迁移已保存的数据。

验证

  • 三个区域的单元测试覆盖:入口按钮只显示 fixed 或未收起的入口;对 fixed 入口调用 setPinned 不生效;setPinned 写入并持久化到对应键;localStorage 内容损坏时按空列表处理;已不存在的 id 被保留;actions slot 有注册项时显示“更多”并传入不含 fixed 入口的 entries 与回调,没有注册项时不显示;会话头部标签条在只有 Chat 时不显示,有其他 View 时全部收起后仍然显示;右侧栏 id 为 kind:入口id。
  • 菜单内容组件的单元测试覆盖:入口打开、Pin 切换、空列表时只有底部操作、浏览更多插件与创建插件的调用参数,以及三个注册项在插件释放后移除。
  • Web e2e entry-customization.e2e.ts 通过真实 Web 组合验证左侧栏:默认显示“更多”,收起后面板按钮消失,仍可从菜单打开,刷新后保持收起,重新固定后恢复。会话头部与右侧栏的“更多”由录制会话的 Web golden 覆盖;changed-files-turn.e2e.ts 与 document-preview.e2e.ts 断言只有 Chat 时紧凑头部没有标签条。
  • 改动的源文件逐文件覆盖率 100%。

后果

  • 用户收起入口后,若插件被显式禁用或加载失败,被收起的入口保持隐藏且没有菜单可以恢复;恢复方式是重新启用插件或清除对应 localStorage 键。
  • localStorage 按协议、主机和端口隔离,更换 Web 端口或在 Web 与 Desktop 之间切换时 Pin 状态不共享。
  • client-store 的 persist 读回时不校验格式,三个区域各自在读取处校验;校验逻辑与 owner props 类型在三处各有一份。
  • actions slot 位于“更多”菜单内,其他插件只能往里加菜单项,不能在入口旁放置任意控件。
  • 右侧栏的键名预留了 sidebar.right.tab.guide.list;以后为 guide 入口新增 list slot 时必须使用这个名称,已保存的 Pin 状态才能沿用。
  • 扩展接管某个 kind 且使用不同的 guide 入口 id 时,原有 Pin 状态无法对应到新入口。
  • 插件默认加载后,录有左侧导航、会话头部标签条或右侧栏起始页的 Web golden 都会出现“更多”按钮。