fix(client): inherit current workspace for new sessions

This commit is contained in:
_Kerman
2026-08-11 14:19:51 +08:00
parent a46a7bf912
commit 4ce51888be
6 changed files with 24 additions and 16 deletions

View File

@@ -58,8 +58,8 @@ export interface SidebarSettingsOwnerProps {
export type SidebarRootInjected = {
/**
* Start a New Session: with a workspace, reuse-or-create its blank session
* and open it; without one, clear the selection into the New Session pure
* view state (the conversation.empty seat).
* and open it; without one, inherit the current Session Workspace, then the
* recent Workspace, or clear into the New Session pure view when none exist.
*/
startSession: (workspaceId?: WorkspaceId) => void
/** Toggle the sidebar column through the layout service. */

View File

@@ -30,7 +30,7 @@ export function apply(ctx: ClientContext): void {
const injectProps = (): SidebarRootInjected => ({
// The shell's New Session button rides the runtime's shared action
// (recent-Workspace targeting; explicit Workspace wins for scoped actions).
// (current Session Workspace, then recent Workspace).
startSession: (workspaceId) => { ctx.workspaces.startSession(workspaceId) },
toggleSidebar: () => { ctx.layout.toggleSidebar() },
})