Skip to content

D-22: PaneManager — Tab.surface + New Dialogue Session actions #272

@kirich1409

Description

@kirich1409

Description

Add surface: SessionSurface to Tab, wire surface selection in new-session flows, and expose keyboard shortcuts / menu entries for creating each session type.

Spec: Epic #250 §5 (mode selection UX).

Scope

File

MacApp/Packages/PaneManager/Sources/PaneManager/TabFeature.swift + menu commands in app target.

Tab changes

```swift
public struct Tab: Equatable, Identifiable, Sendable {
public var id: UUID
public var title: String
public var terminalSessionID: UUID?
public var agentSessionID: UUID?
public var worktreeID: UUID?
public var kind: SessionKind
public var surface: SessionSurface // NEW, immutable after creation
}
```

TabFeature actions

  • newTab(surface:) — creates a tab with explicit surface. Defaults: shell → .shell; agent → preferredClaudeSurface from SettingsStore (see D-24).
  • newDialogueSession(workingDirectory:) — convenience creating .agentDialogue(.claudeCode).
  • newTerminalSession(workingDirectory:) — convenience creating .agentTerminal(.claudeCode).

UI menu entries (app target)

Update RelayApp .commands:

  • ⌘T → New Tab (shell).
  • ⌘⇧N → New Dialogue Session.
  • ⌘⌥N → New Terminal Session.
  • ⌘⇧T (per-tab) → Open as Terminal (active session).
  • ⌘⇧D (per-tab) → Open as Dialogue (active session). (D-25 implements the cross-surface resume.)

Session creation sheet

If a New Session sheet UI exists (or is added as part of onboarding), it exposes a Terminal / Dialogue picker:

  • Radio buttons: Terminal / Dialogue.
  • Default from preferredClaudeSurface.
  • Preview description per choice — single paragraph explaining difference.

Acceptance Criteria

  • Tab.surface added, immutable after creation.
  • newTab(surface:) action honors passed surface.
  • Menu entries with shortcuts work and create correct session type.
  • New Session sheet (if extended) shows Terminal / Dialogue picker.
  • Existing shell / terminal tests unaffected (regression green).
  • Persisted tab state (if any) migrates: missing surface fields default to .shell for shell tabs, .agentTerminal(.claudeCode) for agent tabs.

Relationships

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions