Skip to content

Bot bubbles: floating Bot heads with a mini chat - #930

Open
sambitcreate wants to merge 11 commits into
mainfrom
feature/bot-bubbles
Open

sambitcreate wants to merge 11 commits into
mainfrom
feature/bot-bubbles

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Any Bot chat can now shrink into a round head (Edge heads). On macOS the heads float over every app; clicking one opens a mini chat beside it. This implements the 2026-11-25 plan with the assumed answers 1a, 2a, 3a, 4a, 5a, 6a and 7b, plus the decisions taken that day: no bounce, the Bot's photo or else its face, no Android Bubbles.

What people get

  • Ways in: a bubble button in the Bot chat header, Bubble in the Bot ••• menu and the sidebar right-click menu, and the command Bubble this Bot on ⌥⌘B, which can be changed in Settings → Keyboard shortcuts.
  • Heads:
    • There can be up to 5. Bubbling a sixth Bot moves the oldest head to a recent list, shown as "Bubble again" in the ••• menu.
    • A head shows the unread count, a Needs-you mark and a working ring.
    • Hovering a head shows a peek of the latest line.
    • A head can be dragged to either side; drop it on × to close it.
    • Heads come back after a restart.
  • Mini chat: shows the transcript, the status line, the same approval and question cards as the main chat, and a composer. It has buttons for Open in Aiden, Shrink and Close bubble.
  • Main window: while a Bot is bubbled, its chat shows a "Penny is in a bubble" card with Bring back here and Open bubble. The sidebar row shows a Bubble label. A Bot's live chat is only ever open in one window at a time.
  • Settings → Bots → Bubbles: Allow bubbles, and Float over other apps (macOS only).
  • Onboarding: the Bots tile art now shows a head with an unread count.

How it is built

  • Main process:
    • main/services/bot-bubbles/ holds the state. It is saved atomically to <userData>/bot-bubbles.json, and Bots that are deleted are pruned.
    • main/handlers/bot-bubbles.ts has the IPC handlers.
    • main/windows/bot-bubbles-window.ts creates one see-through overlay panel per display. Clicks pass through it except over its own UI. It takes focus only while a mini chat is open, and a crashed or reloaded overlay is rebuilt (at most 3 times a minute per display).
  • Overlay permissions: the overlay page has its own least-privilege preload and allowlists. In main, every Bot and bubble handler is wrapped so that a request from an overlay is limited to its bubbled Bots. Bot notifications are filtered the same way.
  • Renderer: the heads and mini chat live in renderer/bot-bubbles/. The approval cards and transcript were moved out of bot-chat-pane.tsx into bot-approvals.tsx and bot-transcript-entries.tsx so the mini chat can reuse them.
  • Not changed: no Aiden Remote protocol change and no new analytics events. Phones, Bots on another paired Mac and Telegram are out of scope.

Platform notes

  • Linux (X11 and Wayland): heads always stay inside the Aiden window. Electron passes clicks through a see-through window only on macOS and Windows, and an X11 overlay couldn't be checked on real hardware. The plan allowed this fallback.
  • Keyboard on macOS: heads in the overlay never take focus away from the app you are using, so they can be reached by keyboard only while a mini chat is open. Heads inside the Aiden window can always be reached with Tab. The docs say this.

Tests

  • New behavioural suites, all in npm run test:bot-bubbles and the CI registry:
    • the service and core, with fixtures;
    • the IPC handlers, called the way the app registers and invokes them;
    • the overlay access guard and the preload allowlists;
    • window security and options;
    • the head layout math;
    • rendered tests for the heads, the mini chat, the bubble card, the approvals, the settings page, the header, the sidebar and the menu.
  • Existing suites extended: ipc-contract, bot-live, portable config, the command system, the settings sections and the onboarding gallery.
  • No Playwright spec: the bubble service checks that a Bot exists through the Bot store in main, which the E2E profile can't open (the existing Bot specs mock the Bot IPC). Rendered component tests cover the in-window heads instead.
  • Run locally: tsc, ESLint on every changed file, check:aiden-rules and test:ci:registry are all clean. bot-bubbles passed 95/95, the contract, settings and onboarding suites 150/150, the command system 233/233, and renderer/main/bots/* plus the remote Bot chat 488/488.

Still owed: a hands-on check of the overlay on a Mac

I did not run the overlay on a real Mac, because that would have opened windows on the owner's desktop. Please check:

  1. Bubble a Bot. It should shrink into a head that floats over another app and over a full-screen app.
  2. Clicks next to the head should reach the app underneath.
  3. Open the mini chat, type, and approve something.
  4. Drag a head to the × to close it.
  5. Restart Aiden. The heads should come back.

Screenshots

These come from the real overlay components with stubbed IPC.

Light Dark
Mini chat with an approval
Heads with the peek
Dragging to close

Docs

README.md, PRODUCT.md, docs/bot-bubbles.md (new), docs/keyboard.md, docs/plans/bot-bubbles.md and the docs/plans/README.md row.

CI and review fixes (2026-11-25)

  • Merged main. Fixed three real CI failures: chat-transition.test.tsx imported bot-bubbles.css through window-host.tsx (the CSS now loads from the main-window entry); the scheduled-notification harness now stubs the funnel's new isAidenAppWindowFocused seam; the Bot IPC gating contract now matches the bots block that also registers bubble handlers.
  • Pullfrog: overlay Bot IPC now needs the overlay's trusted main document and is scoped to the heads on that overlay's display; in-window heads show the exact unread count (from the summary's new recentReplyAt); the mini chat no longer shows a settings Undo that can't work. The badge change was not screenshotted: it now shows the number where it used to show an empty dot.

Any Bot chat can shrink into a round head. On macOS heads float over every app in a click-through overlay per display; on Linux, or with Float over other apps off, they stay inside the Aiden window. Clicking a head opens a mini chat with the live transcript, approval and question cards and a composer. Up to 5 heads; the oldest moves to a recent list. Heads show an unread count, a Needs-you mark and a working ring, and come back after a restart.

Entry points: a header button, Bubble in the Bot menus, and Bubble this Bot (Option-Command-B). The main window shows an in-a-bubble card while a Bot is bubbled. Settings -> Bots -> Bubbles has Allow bubbles and Float over other apps.
# Conflicts:
#	renderer/main/bots/bot-chat-pane.tsx
#	renderer/main/remote-bot-chat-view.tsx

@pullfrog pullfrog Bot 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.

Important

The overlay authorization boundary is broader than the trusted document and per-display head set, and two advertised interactions break in the in-window and mini-chat surfaces.

Reviewed changes Reviewed the full initial Bot bubbles implementation through d5124a68b.

  • Bubble lifecycle and persistence Adds validated, atomic state for active heads, recents, settings, placement, display changes, and deleted-Bot pruning.
  • Overlay window and IPC boundary Adds per-display transparent windows, focus and pointer management, recovery, a restricted preload, and guarded Bot/bubble handlers.
  • Heads and mini chat Adds status badges, previews, drag and keyboard controls, shared transcript and approval UI, sending, questions, and bring-back behavior.
  • Product integration Adds chat, menu, sidebar, command, settings, onboarding, documentation, and focused behavioral test coverage.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread main/windows/bot-bubbles-window.ts Resolved
- Load bot-bubbles.css from the main-window entry, not window-host.tsx, so
  chat-transition tests can import the component under tsx.
- Give the scheduled-notification harness the new is-Aiden-in-front seam the
  delivery funnel imports, instead of bundling the real Electron registry.
- Point the Bot IPC gating contract at the bots block that now also
  registers the bubble handlers.

@pullfrog pullfrog Bot 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.

ℹ️ No new issues in these commits; the three existing must-address threads remain open.

Reviewed changes Reviewed the Bot bubble changes since the prior Pullfrog review through 97f430eab.

  • Refreshed restored heads Invalidated a Bot's definition, canonical photo, and live summary when it newly appears or returns as an overlay head.
  • Handled settled approvals Let stale approval clicks reach the real handler and report an undecided result while retaining Bot scoping for active waits.
  • Repaired merge fallout Updated the host-policy contract, notification test harness, CSS loading, and CI compatibility after merging main.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using GPT Sol | 𝕏

- Overlay Bot IPC now requires the overlay's trusted main document and
  scopes every request, Bot list and notification to the heads on that
  overlay's display.
- Heads inside the Aiden window show the exact unread count from new
  recentReplyAt reply times on the live summary, still without subscribing.
- Settings receipts in the mini chat no longer show an Undo that can't work.

@pullfrog pullfrog Bot 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.

Important

The prior fixes close the three original threads, but live-stream authorization and unread-count equivalence still have behavioral gaps.

Reviewed changes Reviewed the Bot bubble changes since the prior Pullfrog review through 51a6e4d63.

  • Tightened overlay authority Required the trusted overlay main document, scoped Bot IPC and broadcast notifications to heads on the sender's display, and added register-and-invoke coverage.

  • Added summary unread counts Projected up to 100 person-facing reply times so in-window heads can show a numeric count without opening a live feed.

  • Removed nonfunctional Undo Hid settings-receipt Undo actions on surfaces, including the mini chat, that cannot perform the mutation.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread main/windows/bot-bubbles-window.ts Resolved
Comment thread renderer/bot-bubbles/bot-head-status.ts Resolved
- An overlay's live feed for a Bot ends once that Bot's head leaves the
  overlay's display or closes, checked on every event (mayFollow).
- Floating and in-window heads count unread replies from the same
  person-facing reply times, capped at 100 and shown as 99+.

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes Reviewed the Bot bubble changes since the prior Pullfrog review through de48f29aa.

  • Revoked moved live feeds Rechecked per-display head authority before every live event and released an old overlay's feed when its head moved or closed, including subscribe-completion and replacement-subscribe races.

  • Unified unread counting Counted both overlay and in-window heads from the same capped person-facing reply times, preserving delegated-turn semantics and matching 99+ badge and accessible text.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

- Tucking a mini chat no longer calls blur(), which on macOS orders the
  overlay out and back in and blinked every head. The overlay is made
  unfocusable and a throwaway 1 px panel takes the key window; blur() is
  only a fallback.
- The tucked chat stays mounted, inert, until its exit animation ends;
  re-opening mid-exit keeps the same element and draft.
- Shrink: when the display already has an overlay, the captured chat is
  laid over the window first (transitionShown ack, 250 ms cap), so the
  swap to the "in a bubble" card happens underneath. The picture is
  decoded before it shows and moves only once its head exists.
- Grow is skipped with Reduce Motion or no known head instead of flashing
  a window-sized sheet.
- A head dropped on the close target stays there until it is removed;
  other heads keep their photo while the cache reloads, and a new head
  fades in only once its Bot and photo are known.

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes Reviewed the flicker-removal changes since the prior Pullfrog review through 383f41e0e.

  • Stabilized focus handoff Replaced the normal macOS overlay blur with a non-activating key-window sink while retaining a safe last-resort fallback.

  • Sequenced shrink transitions Painted and acknowledged decoded chat captures before adding heads, then waited for each destination head without flashing an empty transition sheet.

  • Preserved mini-chat identity Kept tucked chats mounted and inert through their exit animation so reopening preserves drafts and heads no longer remount.

  • Smoothed head lifecycle Held canonical photos through cache refreshes, delayed first paint until Bot identity settled, and kept dropped heads on the close target until the close completed.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

# Conflicts:
#	docs/plans/README.md
#	main/services/bot-runtime/live-projection.ts
#	renderer/main/bots/bot-chat-pane.tsx
#	renderer/shared/bot-live.ts

@pullfrog pullfrog Bot 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.

Important

The latest main merge introduced two avatar-state integration regressions that should be fixed before merge.

Findings

[P1] Include lastTurnEnd in the sidebar row memo boundary (renderer/main/bots/bot-sidebar.tsx:100-115)

BotRowAvatar now renders failed/stopped poses from row.lastTurnEnd, but sameRowProps does not compare that field. If a summary refresh changes only lastTurnEnd while state, preview, and the other compared references remain stable, React.memo returns the old row and the failed/stopped pose is never shown. Compare a.lastTurnEnd === b.lastTurnEnd and add a test that updates only that value; the current test changes state at the same time, so it cannot catch this case.

Reviewed changes

Reviewed the merge of main into the Bot-bubbles branch, focusing on the new live avatar state contract, conflict resolutions, and focused renderer coverage. All prior Pullfrog threads are resolved.

Validation

  • npm run test:bot-bubbles passed.
  • npx tsx --test renderer/main/bots/bot-sidebar.test.tsx renderer/components/bot-avatar.test.tsx passed (49 tests).
  • npx tsc --noEmit passed.
Review metadata
  • Files reviewed: 95
  • Commits reviewed: 1
  • Prior Pullfrog review: 383f41e0
  • Base: main (f3302e5e)

Reviewed commits:

  • a9a9498656be2d4194efd2515803bec346fccf2f — Merge remote-tracking branch origin/main into feature/bot-bubbles

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

const showPhoto = photo && failed !== photo.assetRevision;
return (
<span className="bot-bubble-face" aria-hidden="true" title={name}>
<AvatarFace avatar={avatar} />

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.

[P2] Opt bubble faces into the merged live sprite contract. This bare AvatarFace stays in its default idle pose, and its ancestor is not .bot-avatar[data-live], so the new sprite CSS cannot animate it even when status.working is true. The ring moves, but the fallback face no longer delivers the documented working glance. Route this through BotAvatar or provide the equivalent live wrapper and state, then cover the working fallback face behavior.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant