Merge master and preserve pinned-row visibility. Remove redundant Chat and tool-tree menu forwarding, unify trigger names, and bind file targets at the consuming Slot. Address CI static and coverage gaps without changing upstream scroll assertions.
3.5 KiB
kind, description
| kind | description |
|---|---|
| upgrade-guide | Custom Client compositions must provide the context-menu and file-action services required by GUI plugins. |
Context menu services in custom Client compositions
English | 中文
Change
GUI plugins now inject contextMenus to open shared object menus. The open-in-app plugin also injects fileActions, sidebarRight, sidebarRightTabs, and remote.workspaceFiles. Custom compositions that mount these GUI plugins without the new services cannot activate them. The shipped Web application bundle includes the providers; existing Session and tab menu Slot names remain available.
Migration
-
In the package manifest that owns a custom composition, add dependencies on
@deepseek-ai/dsh-client-ui-context-menuand@deepseek-ai/dsh-client-ui-file-actionsat the same Harness version. -
Add both package names as plugin rows in the custom Client composition alongside the existing locale, slots, shortcuts, sidebar, and workspace-file providers. The default
@deepseek-ai/dsh-web-appbundle already contains these rows. -
Rename
ctx.menustoctx.contextMenusandMenuTargetMaptoContextMenuTargetMap; neither old name has an alias. Mount the menu plugin so itsctx.slots.provideRootcontribution suppliesuseContextMenuto every Slot. Components call the hook once and spreadgetTriggerProps(target, handlers?)onto each element, including elements created in loops. See the menu reference for handler composition and external action registration. -
Rebuild and launch the custom profile. Confirm that GUI plugins activate, right-clicking a background Session preserves selection, and existing Session/tab Slot contributions still appear.
-
Custom Slot hosts must remove their declarations of
sidebar.workspaces.session.menu.itemandsidebar.right.tab.menu.item; the workspace and right-sidebar adapters now own these undercontextMenu.content. Session rows retain the[open, setOpen]hook context, and tab rows receive{ tab, dismiss }within the clicked Session’s provider. A custom host replacing these adapters must declare the same children and supply those owners itself. Dockkit embedders usinggetTabTriggerPropsown the popup and dismissal;renderTabMenuItemsis used only by the kit popup. Supply reactivetabMenuOpento suppress close-button tooltips while a custom menu prepares or remains open. -
Built-in Session menu items are data contributions. The legacy React Slot retains external entries together before Archive; Slot priority no longer shadows built-in actions. Use
ctx.contextMenus.registerfor new actions and optionalcommandIdto display an existing command’s current binding. Keep captured-target execution inrun; no command dispatch is added. -
Menu contributions use
icon?: ReactNode; replacesymbolwith a glyph element and wrap icon URLs in<img>. ObtainuseContextMenuat each actual Slot entry. Plain children receivegetTriggerPropsor boundcontextMenuProps; ToolRow usesfileContextMenuPropsandurlContextMenuProps. Remove menu fields from Chat flow/node owners. The assistant entry supplies an ordinary file adapter toforClosing(), while Markdown adapts its target type atMarkdownDelegateProvider.getTriggerProps. Keep Session identity and gesture-time path resolution in the business registration. Remove imports ofcontextMenuTriggerandmenuPoint; their independent utility package is removed. Do not add gesture exports to ui-primitives.