Skip to content

feat: get a desktop notification when a watched build finishes - #36

Open
enesccinar wants to merge 1 commit into
JacobAtchley:mainfrom
enesccinar:feat/build-watch-notify
Open

enesccinar wants to merge 1 commit into
JacobAtchley:mainfrom
enesccinar:feat/build-watch-notify

Conversation

@enesccinar

Copy link
Copy Markdown
Contributor

Waiting on a build meant keeping its log pane open, or coming back and
pressing r until it finished. Now a on a build — from the build list, a
pull request's gate runs, or the log pane — watches it, and boardwalk puts a
desktop notification up when it succeeds, fails, partially succeeds or is
canceled. Press a again to stop watching.

Related to #19. That issue asks for a watch on new pull requests; this is the
build half of the same idea, and the notifier is its own package so a pull
request watch — or a builds -watch subcommand that works without the TUI
open — can reuse it.

internal/notify. Send(title, message), built the way the clipboard and
browser actions are: a pure list of candidate commands per platform, first one
on PATH wins. macOS uses terminal-notifier when it is installed, otherwise
osascript; Linux uses notify-send; Windows says it is not supported. A
missing tool and a tool that refuses are reported differently.

The watch. Root owns it rather than a view, so a watch survives esc back
to the menu. Watched builds are checked every twenty seconds for as long as
boardwalk is open, and the header reads · watching N. A finished build is
dropped and announced — a failure names the first task that failed and its
first error, from the timeline — and the status line says the same. A check
that fails keeps the watch and retries next tick; a notifier that fails says
so on the status line. A build that has already finished is not watched.

Notes

a rather than n: n is next-error on the log pane the build list opens.
a is free on the build list, the log pane and the pull request pane p
opens. It is on the help panel, not the footer, so the short help still fits
at 80 columns.

The poll and the notifier run in a command, off the update loop, with the ids
copied out first so the command never reads the map Update writes.

Whether a macOS notification stays on screen is the app's alert style in
System Settings, not something the command can ask for — set terminal-notifier
(or Script Editor, for osascript) to Persistent to make them sticky.

go test ./... and go vet ./... clean.

🤖 Generated with Claude Code

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