Skip to content

feat: ask an agent from a popup that you can pin, resize and keep on screen - #274

Merged
Seb-GRAF merged 1 commit into
mainfrom
feat/89-quick-ask-popups
Oct 23, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
feat/89-quick-ask-popups

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

The quick-ask package (stablebox/stablebar-packages#24) asks Claude Code or Codex a question from the bar. Popups couldn't take typed text, showed one line of a field, closed on the next click elsewhere, and had no way to choose a model and effort or to show that an answer is on its way.

Closes #78
Closes #264
Closes #89
Closes #273

Changes

New blocks and options (decoded, in the schema and in Custom popups):

  • input: a text field. Return runs onSubmit with the text in VALUE and clears the field; placeholder and autofocus are optional.
  • field blocks: wrap shows the whole text, selectable; maxHeight scrolls past that height and keeps the newest lines in view as the text grows (macOS 15 and later); markdown shows inline Markdown.
  • shimmer on text and field blocks: light sweeps across the text, as while something works. Reduce Motion keeps it still.
  • chooser: a pill naming the chosen group, option and level, which opens a panel with the groups on the left and the chosen group's options and a bar of its levels on the right. Choices show at once and run onChange with VALUE, OPTION and LEVEL. The panel has a fixed size and a fixed anchor, so it stays still as you switch groups.

Pinned popups (popup.pinnable):

  • A pin button in the top trailing corner, and a close button beside it while pinned. Dragging the popup by its background pins it where it's dropped.
  • A pinned popup lives outside the one open popup WidgetPopup tracks, so app switches, workspace changes, reloads and other popups don't close it. It can be resized by its edges; it then keeps that size, and fields with maxHeight take the height.
  • Unpinning glides it back under its widget. Pinning again, or reopening one that was closed while pinned, glides it back to its spot and size.
  • Clicks inside a popup's own child windows, such as the chooser's panel, no longer count as clicks outside the popup.
  • BarStore.stop() closes pinned popups too.

Smoother resizing: a popup with its own animation now animates its height in SwiftUI inside its window (PopupCanvas), instead of animating the window frame: the window grows first and shrinks last, so the edge, shadow and content move together and shrinking no longer leaves a clipped gap. What its data changes animates with it. The reveal view's content now follows the window, so popupFoldKeepsTheScrollViewportAndPosition, which guarded the fold of an older opening animation, is removed; popupResizesWithItsContentAndKeepsItsWidthAndTopEdge checks that the content fills the window.

examples/interactive gains a note input with a wrapping field and a pinnable popup.

Testing

  • swift test passes: 285 XCTest and 423 Swift Testing tests.
  • New tests: decoding mistakes for wrap, markdown, maxHeight and shimmer; wrapping fields that grow and stop at maxHeight; and one lifecycle test for pinned popups: staying open through close() and another popup, resizing with content, a resize by hand, unpinning back home, pinning again at the remembered frame, reopening pinned after closing pinned, Escape, the close button and drag to pin.
  • StableBar --validate examples/interactive/config.json passes, and the store's check-package.sh passes for the quick-ask package with this build.
  • The developer ran the package on their own bar with earlier builds of this branch, which led to the chooser, the input at the bottom, drag to pin, the close button and reopening pinned. The last fixes (the steady chooser panel and reopening pinned) are covered by the tests and offscreen renders, not yet tried on screen.
  • Not checked automatically: resizing by the edges and dragging with a real mouse, which only the window server does.

Screenshots to follow.

Merging

One commit: a merge commit or a squash keeps the same title.

Claude Opus 5.5 via Claude Code (T3 Code)

@Seb-GRAF
Seb-GRAF merged commit b1da417 into main Oct 23, 2026
7 checks passed
@Seb-GRAF
Seb-GRAF deleted the feat/89-quick-ask-popups branch October 23, 2026 09:53
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

1 participant