Skip to content

Add a Bubble Up scheduling menu to the TUI - #670

Open
WhiskeyTuesday wants to merge 6 commits into
basecamp:mainfrom
WhiskeyTuesday:tui-bubble-up
Open

WhiskeyTuesday wants to merge 6 commits into
basecamp:mainfrom
WhiskeyTuesday:tui-bubble-up

Conversation

@WhiskeyTuesday

@WhiskeyTuesday WhiskeyTuesday commented Nov 21, 2026 •

Copy link
Copy Markdown

The TUI can show Bubble Up mail but has no action for bubbling up a thread. Pressing w now opens a menu over the current mail screen to bubble up immediately, choose a preset, enter a date, or cancel an existing bubble-up.

Presets display their local time while using HEY's UTC scheduling rules. Search results lack Bubble Up metadata, so the menu checks the bubbled-up and scheduled feeds before offering cancellation. That lookup is bounded, cancellable, and retryable. Failed writes keep the menu open; successful writes refresh the source.

Uses the existing modal and SDK infrastructure. Includes regression coverage for request payloads, date boundaries, real search-response shapes, cancellation, stale lookup results, and preserving the screen and scroll position behind the menu. The existing Bubble Up success mocks now use the SDK's HTTP 200 contract.

Validation after rebasing onto f6244d7: TUI tests, make lint, and make build passed. make test failed only TestFindBareLinksPastRejectedPrefixesIsLinear; the same five-second assertion fails on unchanged upstream on this machine. Focused live checks on combined build 9da3f57 passed in a real HEY account: Tomorrow scheduling, cancellation from search, and independent server readbacks.


Summary by cubic

The TUI can now schedule, apply, and cancel Bubble Up from a menu opened with w on a mail list or open thread. The menu offers Now, Later today, Tomorrow, This weekend, Next week, a custom date, or Cancel bubble-up, and it works from search, bundles, seen, and thread views.

  • Presets display local time while HEY schedules on its UTC calendar, and "Later today" disappears once its slot has passed.
  • Search results have no bubble metadata, so the menu scans the bubbled-up and scheduled feeds first to decide whether to offer cancellation; that lookup is bounded, cancellable, and retryable.
  • Failed writes keep the menu open for retry, and successful writes close the thread and refresh the source.
  • Bubble-up applies to one thread at a time; opening it with a bulk selection, a bundle, or a loading list shows a notice instead.
  • Opening and closing the menu preserves the thread's scroll position and selected link, even across terminal resizes.

Written for commit 67ad6bb. Summary will update on new commits.

View guided diff

@WhiskeyTuesday
WhiskeyTuesday requested a review from a team as a code owner November 21, 2026 01:47
Copilot AI balanced review requested due to automatic review settings November 21, 2026 01:47
@WhiskeyTuesday

Copy link
Copy Markdown
Author

Related UI work: #671 gives Move, labels, and collection membership the same compact overlay treatment. The features are independent and use the modal infrastructure already in main. Both include the same small background-rendering extraction, which can be dropped from whichever branch is rebased second.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Opening the picker after scrolling away from a selected thread link resets the background scroll position, and Escape does not restore it; viewport preservation and a regression test through model.Update are needed.

1 open issue
What changed in this PR

Adds Bubble Up scheduling to the TUI using the existing modal and SDK infrastructure.

Changes:

  • Adds a w menu for immediate bubbling, scheduling presets, custom dates, and cancellation.
  • Resolves missing search-result metadata through bounded, cancellable lookups.
  • Adds regression coverage and documents the menu’s behavior.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
internal/​tui/​mail.go Connects Bubble Up keys, messages, help, and background rendering.
internal/​tui/​bubble.go Implements the scheduling menu and mutation handling.
internal/​tui/​bubble_test.go Tests scheduling, retries, targeting, and screen preservation.
internal/​tui/​bubble_state.go Adds bounded Bubble Up state lookups for search results.
internal/​tui/​bubble_state_test.go Tests lookup results, cancellation, retries, and limits.
internal/​mail/​posting.go Preserves scheduled Bubble Up metadata.
internal/​mail/​posting_test.go Tests schedule metadata conversion.
internal/​cmd/​bubble_test.go Aligns success mocks with HTTP 200 responses.
docs/​tui.md Documents shortcuts, scheduling rules, and cancellation.

Review effort: Balanced

Comment thread internal/tui/bubble.go
}
}
picker := newBubblePicker(*posting, scheduled, time.Now)
v.openModal(picker)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 21db033, with the root-model regression in 67ad6bb. Opening the picker changed the help/footer height, and the resulting resize revealed the selected link or changed the offset at the bottom. The fix preserves the reading position across those modal layout changes and restores it on dismissal.

The regression sends Tab, scrolling, w, and Escape through model.Update, covering a wrapping selected-link footer and an unselected thread, both partway down and at the bottom. Actual terminal resizing still lays out the thread at its new dimensions.

TUI/mail tests and lint pass. Offline PTY checks on the combined build also verified that Bubble Up restores the rendered screen after dismissal, including at the bottom.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants