From cfa7784fd491ef16e815daa0d975414cffe44eaa Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Tue, 29 Sep 2026 10:35:06 +0800 Subject: [PATCH] refactor(sidebar-right): declare SidebarRightHost where the binding was Moves the interface to the position SidebarRightBinding held, after the controller factory, so the change reads as one interface replacing the other. Its content is unchanged. --- .../ui-sidebar-right/src/client/service.ts | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/client/ui-sidebar-right/src/client/service.ts b/packages/client/ui-sidebar-right/src/client/service.ts index f056f4b280..c4bfc1252b 100644 --- a/packages/client/ui-sidebar-right/src/client/service.ts +++ b/packages/client/ui-sidebar-right/src/client/service.ts @@ -79,28 +79,6 @@ interface SidebarRightSessions { readonly openTabs: SidebarTabInventory['source'] } -/** What the controller needs from the page around it: the viewport rule and focus continuity. */ -export interface SidebarRightHost { - /** - * Whether the viewport is narrow enough that an expanded panel is presented fullscreen. - * @returns the rule's verdict for the frame width the seats last rendered at. - */ - readonly autoFullscreen: () => boolean - /** - * Commit a page operation and focus the pane it selects. - * @param sessionId - the Session whose page is opening. - * @param open - the synchronous operation; returns the selected pane, or `undefined` when unchanged. - */ - readonly openWithFocus: (sessionId: SessionId, open: () => PaneId | undefined) => void - /** - * Commit a keyboard/menu close and retain focus on a surviving visible pane. - * @param sessionId - the Session whose page is closing. - * @param paneId - the pane whose page is closing. - * @param close - the synchronous cleanup and removal. - */ - readonly closeWithFocus: (sessionId: SessionId, paneId: PaneId, close: () => void) => void -} - /** * Create the public controller and the plugin-private Session callbacks. * Adoption reconciles restored records before any seat renders, then follows commits. @@ -147,6 +125,28 @@ export function createSidebarRightController(tabs: SidebarRightTabRegistry, pin: } } +/** What the controller needs from the page around it: the viewport rule and focus continuity. */ +export interface SidebarRightHost { + /** + * Whether the viewport is narrow enough that an expanded panel is presented fullscreen. + * @returns the rule's verdict for the frame width the seats last rendered at. + */ + readonly autoFullscreen: () => boolean + /** + * Commit a page operation and focus the pane it selects. + * @param sessionId - the Session whose page is opening. + * @param open - the synchronous operation; returns the selected pane, or `undefined` when unchanged. + */ + readonly openWithFocus: (sessionId: SessionId, open: () => PaneId | undefined) => void + /** + * Commit a keyboard/menu close and retain focus on a surviving visible pane. + * @param sessionId - the Session whose page is closing. + * @param paneId - the pane whose page is closing. + * @param close - the synchronous cleanup and removal. + */ + readonly closeWithFocus: (sessionId: SessionId, paneId: PaneId, close: () => void) => void +} + /** Where an open lands; every field is optional and the defaults are the common case. */ export interface SidebarRightPlacement { /** Land a new tab in this pane instead of the active docked one. */