Skip to content

Board auto-selects a spawned room's channel via a focus marker - #2

Merged
rogeriochaves merged 1 commit into
mainfrom
board-auto-select-channel
Jun 13, 2026
Merged

Board auto-selects a spawned room's channel via a focus marker#2
rogeriochaves merged 1 commit into
mainfrom
board-auto-select-channel

Conversation

@rogeriochaves

Copy link
Copy Markdown
Contributor

The board now snaps to the room you just spawned

When a room spawns, the gateway brings the KanbanCode board forward, but it did not auto-select the room's channel, so you still had to click into it to watch the agents self-organize. That channel auto-select was dropped earlier when we removed the kanbancode:// deep link (the deep link relaunched a stale registered build and tripped KanbanCode's quit-protection dialog mid-demo).

This restores it without a deep link. focusChannel now writes the channel slug to ~/.kanban-code/focus-channel before bringing the app forward. The KanbanCode app reads and drains that marker in applicationDidBecomeActive and selects the channel. A plain marker file needs no relaunch, so the quit dialog stays gone.

Contract (paired with the KanbanCode app-side watcher)

  • File: ~/.kanban-code/focus-channel
  • Content: the bare channel slug (room.channel, e.g. dark-mode), no #, no newline. The app-side read trims whitespace and strips a leading #, so either form is tolerated.
  • The app drains (deletes) the marker on read, so each spawn writes a fresh one and nothing accumulates.
  • Written before the System Events activate, so it is on disk when applicationDidBecomeActive fires.

Safety

Best-effort: the write is wrapped so a failure (missing dir, permissions) just means no auto-select, never a broken board-focus. The two halves are independent and harmless alone (the watcher no-ops with no marker; the marker no-ops with no reader).

Verification

  • Drove focusChannel("marker-probe-xyz") headless: the marker file held exactly marker-probe-xyz (bare slug, no newline).
  • Typecheck clean; gateway hot-reloads cleanly.
  • Joint test with the rebuilt app: spawn a room, board snaps to its channel.

focusChannel writes the channel slug to ~/.kanban-code/focus-channel before
bringing KanbanCode forward. The app reads and drains that marker on activation
and selects the channel, so the board snaps to the room you just spawned. This
restores the auto-select dropped when the kanbancode:// deep link was removed to
stop the quit-protection dialog: a plain marker file needs no relaunch, so the
dialog stays gone. Best-effort, a write failure just means no auto-select.
@rogeriochaves
rogeriochaves merged commit c32ed2c into main Jun 13, 2026
1 check passed
@rogeriochaves
rogeriochaves deleted the board-auto-select-channel branch June 13, 2026 14:58
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.

1 participant