Board auto-selects a spawned room's channel via a focus marker - #2
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
focusChannelnow writes the channel slug to~/.kanban-code/focus-channelbefore bringing the app forward. The KanbanCode app reads and drains that marker inapplicationDidBecomeActiveand selects the channel. A plain marker file needs no relaunch, so the quit dialog stays gone.Contract (paired with the KanbanCode app-side watcher)
~/.kanban-code/focus-channelroom.channel, e.g.dark-mode), no#, no newline. The app-side read trims whitespace and strips a leading#, so either form is tolerated.applicationDidBecomeActivefires.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
focusChannel("marker-probe-xyz")headless: the marker file held exactlymarker-probe-xyz(bare slug, no newline).