Skip to content

Add runpane panes focus command (#401) - #461

Open
ilijachrchev wants to merge 1 commit into
dcouple:mainfrom
ilijachrchev:feature/panes-focus-command
Open

Add runpane panes focus command (#401)#461
ilijachrchev wants to merge 1 commit into
dcouple:mainfrom
ilijachrchev:feature/panes-focus-command

Conversation

@ilijachrchev

Copy link
Copy Markdown
Contributor

Description

Adds runpane panes focus command. Raises the Pane window, selects a pane, and optionally selects a specific panel within it.

Closes #401.

Follows the same pattern as panes rename / panes archive: contract.json -> generated artifacts -> CLI dispatch -> daemon handler -> renderer event.

New pieces: window-raising plumbing (show/restore/focus on BrowserWindow) and a pane:focus-requested IPC event that tells the renderer to call setActiveSession and setActivePanel.

Usage:

runpane panes focus --pane [--panel ] --source user|agent --yes [--json]

Requires --yes. Accepts --source agent|user. Archived/missing panes and mismatched panels return clear errors, never falls back to focusing something else. Doctrine text added to contract: agents invoke this only on explicit user request, never proactively.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING.md guidelines
  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have run pnpm typecheck and pnpm lint locally
  • I have tested the Electron app locally with pnpm electron-dev

Critical Areas Modified

  • State management/IPC events

Screenshots (if applicable)

N/A. CLI command with no UI changes. The renderer-side change is a new IPC listener that calls existing store actions (setActiveSession, setActivePanel).

Additional Notes

5 new tests in runpane.test.ts: happy path, minimized window restore + panel selection, archived pane rejection, unknown pane rejection, panel-not-belonging rejection. All 64 existing tests pass (1 pre-existing skip).

Contract artifacts regenerated via pnpm run generate-runpane-contract. The 6 generated files were not hand-edited.

The handler sends pane:focus-requested via window.webContents.send() directly rather than through sendRendererEvent in events.ts, since the handler already holds the raised window reference. This matches how window:focus-changed is dispatched in index.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: focus/open a pane on request, so the orchestrator can navigate for the user

1 participant