Add hey bubble: list, up with schedule slots, and pop - #326
Merged
Conversation
Bubble a thread up in the Imbox right away through the SDK's Postings().BubbleUpNow, or cancel a bubble-up through CancelBubbleUp. Scheduled bubble-up is refused for now; --now is required so a --on date can join it later without changing the shape of the command. hey move keeps refusing Bubble Up as a destination, but now points at hey bubble up instead of a scheduled flow that never existed here. Co-authored-by: J.R. Lillard <14372920+jr-lillard@users.noreply.github.com>
hey bubble up now takes exactly one of --now and --on. --on takes a YYYY-MM-DD date and goes through the SDK's new Postings().ScheduleBubbleUp, which posts HEY's custom schedule slot with the date; HEY resurfaces the threads at its morning hour of that day. HEY accepts a past date without complaint, so the CLI does too. The SDK operation is new and comes from the local hey-sdk checkout via a replace directive until it is reviewed and released.
hey bubble up now takes exactly one of --now, --on <date>, --tomorrow, --weekend and --next-week. The named flags send HEY's tomorrow, weekend and next_week slots, which land at its morning hour of tomorrow, the coming Saturday and next Monday. --on with today's date sends the today slot — the web app's Later today, HEY's evening hour (18:00) — instead of a custom slot pointing at a morning that has already passed; the other web slots come out identical through custom, so this is full parity with the web menu short of surprise_me. HEY reads those hours in UTC over JSON, and it does not refuse a timestamp already past — the threads bubble up on the scheduler's next run — so the CLI does not second-guess the clock either. The SDK grew a typed slot for this: Postings().ScheduleBubbleUpFor takes a hey.BubbleUpSlot next to the date-taking ScheduleBubbleUp, still from the local checkout via the replace directive.
One listing for everything bubble-related: the threads that have already bubbled up in the Imbox and the ones still scheduled, each scheduled row showing when it resurfaces (HEY's bubble_up_schedule, ??? for a surprise). The bubbled-up half needs no endpoint of its own: /imbox/bubbled_up serves HTML only, but the Imbox orders bubbled-up threads first — that ordering is what draws the web app's Bubbled Up section — so the listing reads the Imbox's bubbled-up prefix and stops at the first row that is not. The scheduled half is the Bubble Up box, whose rows already carry the schedule. Styled output is two tables; --json answers honest bubbled_up and scheduled buckets; --ids-only and --count combine them; --limit caps each bucket.
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.
Bubble Up has been read-only from the CLI —
hey box view bubbleboxshows the queue, andhey moverefuses the box outright. This adds the missing verbs as ahey bubblecommand:bubble upmirrors HEY's own schedule menu.--nowbubbles immediately.--on <date>schedules the morning of that day; given today's date it schedules this evening instead, the same thing "Later today" does in the web app — a custom schedule for today would otherwise land at a time already in the past.--tomorrow,--weekendand--next-weekare the named slots, landing the morning of tomorrow, Saturday, and Monday. Exactly one is required, and each confirmation says in plain words when the threads will surface.bubble popcancels a scheduled bubble-up.bubble listshows both halves of the feature: threads that have already bubbled up, and threads scheduled to, with their scheduled time (a surprise-me schedule shows???, as in the web app). The scheduled rows come from the Bubble Up box; the bubbled-up rows are the contiguous prefix HEY sorts to the top of the Imbox, which is the same data the web app's Bubbled Up section draws.hey move's refusal now points here instead of a dead end.This depends on new SDK operations (
ScheduleBubbleUp/ScheduleBubbleUpForoverPOST /postings/bubble_up.json) that aren't released yet — go.mod carries a localreplacedirective until they ship, so CI will stay red until the SDK release lands and the directive is dropped for a pinned version.Replaces #164 — thanks to @jr-lillard for the original take on bubble-up commands, credited as co-author on the first commit here.