Skip to content

Pill: no empty dock after a meeting's stop; content shown after every beat - #36

Merged
ofcRS merged 11 commits into
mainfrom
fix/pill-empty-on-stop
Nov 19, 2026
Merged

ofcRS merged 11 commits into
mainfrom
fix/pill-empty-on-stop

Conversation

@ofcRS

@ofcRS ofcRS commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

The bug

After a long meeting was stopped from the pill (docked top), the pill showed an empty soft grey capsule. The report's hypothesis was the .saving phase, which since 0.5.8 lasts ~17 s for a 47-minute meeting.

Root cause (reproduced in films)

The empty capsule was not .saving. It was the peek dock with its fields invisible.

  • Geometry. The screenshot's capsule is about 282 × 57 pt at 2×, centred 86 pt below the top of the screen. The .saving capsule is 240 × 30, centred 75 pt down. The dock is 275 × 60, centred 86 pt down, and the films' dock measures 562 × 112 px against 564 × 115 in the screenshot. The flat 0x77 grey and the soft, offset shadow are the glass dock's surface.
  • Trace. "Meeting saved" sank into the edge at 12:45:34.085. The dock peeked out of that sink 50 ms later and stayed out until 12:45:42, with the pointer on the pill.
  • Mechanism. The content reveal and the squash-and-stretch are keyframeAnimator(trigger: beat)s that chose their keyframes from a kind stored in the animated value. Retriggered mid-flight, SwiftUI hands the keyframes closure the in-flight value, so a beat landing while the previous one plays replays the previous beat. A peek within ~0.1 s of a sink replayed the sink, which fades the content to 0 and held it there until the next beat: the dock's surface with no fields.
    • A timing sweep with a debug print of each cue: empty with cue=peek at 81–111 ms into the sink; fields at 121, 135 and 341 ms.
  • Deterministic film (the user's flow): meeting bar on the top edge, pointer on Stop, click Stop, a long save, "Meeting saved", collapse under the parked pointer. Old view: the settled dock is empty (ink 0). The same through the stop suggestion fails on all four edges. .saving itself shows its travelling wave in the meeting-sized bar for the whole save, on every edge.
  • Same cause, second symptom (review): a meeting starting just as a dictation's done folds away. The rise lands inside the sink, and the old view drew the meeting bar empty — no dot, timer or Stop while the microphone records. Old view: 77–84 of ~105–112 settled frames empty at 30, 60 and 90 ms.

Fix

  • ContentReveal and the squash-and-stretch pick their keyframes from the trigger read in body. The animated values carry no kind. This is the fix for the reported flow (a sink, then a peek 40–56 ms later in every stop film).
  • PillReveal (KleothCore) holds the reveal data:
    • every beat ends with the content shown;
    • a sink hides the outgoing content only until it has settled;
    • a rise opens with a jump to hidden (MoveKeyframe to 0 / 0.6).
  • settle() plays a .morph when it lands a pending phase.
  • PillMotion.beat: an active phase collapsing straight onto the dock is a .morph, not a .sink. This does not fire in the reported flow. It fires with the menu open over an active phase that auto-hides, or with a hover landing in the same turn as the collapse.
  • Filming that menu case found an older bug. The pill was sized as the dock but placed tucked, with no fill, no dock surface and no fields: an invisible pill. show(.idle) with the menu open now brings the dock out. Before: 12 of 99 settled frames empty, panel at y = −48. After: the trace reads dock out under the open menu, then beat morph meetingSaved(…) → idle (dock), and the dock settles on screen with its fields.
  • Film mode only:
    • reconsiderPointer reads the scripted hover;
    • the menu's global click monitor is skipped;
    • DictationPillController.motionOverride (pillsandbox --motion on|off) forces full motion or Reduce Motion. The app never sets it.

Regression guards

  • CI (tests.yml, the macos-26 app job, after the smoke test): bash app/pill-film-check.sh --quick, ~45 s, timeout 10 min, frames uploaded as pill-films on failure. Four films: stop-bar-top (save 3 s), capture-in-sink-60ms, and the bare races sink-then-dock and sink-then-bar.

    • CI's runner has Reduce Motion ON. The first CI probe with the old view passed: its trace had no beat line at all, so every transition jumped and the reveal never ran. The films now force motion (--motion on).
    • With the old view, all four fail locally: 34/130, 82/109, 24/36 and 35/35 settled frames empty.
    • On CI, with the old view, all four fail too (a throwaway branch, run 44505874148): 14/105, 55/73, 18/27 and 24/24 empty. The runner logged motion: forced on — system Reduce Motion is ON.
    • With the fix, CI is green (run 44505896204): 108, 86, 22 and 27 settled frames judged, none empty.
  • pillsandbox --check-content fails a film when:

    • a settled frame of a phase with content has no ink;
    • a visible phase stays mid-transition for more than 1 s;
    • a capture's bar is due (a .meeting / .recording backdrop, or a hot phase asked for) with no bar for more than 0.5 s, whether no frame was captured or the pill settled on a resting phase;
    • no frame was judged.

    Each was shown red on a deliberately broken build or film: transitions that never settle; the meeting backdrop that never shows, with the panel down and over a resting pill; a film of only a tucked idle.

  • app/pill-film-check.sh runs 25 films in about 5 min, all passing:

    • on every edge: the stop from the bar, the stop suggestion, a dictation;
    • a meeting starting inside a sink at 30/60/90 ms, and the two bare races;
    • a dictation over a meeting, a chord inside a sink, starts from the dock, the menu over a confirmation, faults and an offer, a drag;
    • two films under Reduce Motion.

    It has a per-film timeout, and reports a crash as CRASH and a hang as TIMEOUT (both shown with stand-in binaries). A temp out-dir is deleted when every film passes and kept on failure.

  • PillRevealTests (7 tests, KleothCore) pin the reveal data and the beat table. They do not see which keyframes the view plays: with the old view they stay green while the films fail. Only the films guard the real cause, hence the CI step.

Trace

KleothPillTrace now also logs:

  • show (over what, fresh or transition, dock out, capsule size), dismiss, a backdrop taken over or only stored, hide and order-out, auto-hide;
  • the beat each transition plays, a settle landing a phase, pointer on/off, dock out/in, menu open/closed, drag and drop;
  • the coordinator's refusals, queues and withdrawals.

Phases print as kinds and ids only (PillTrace.name).

Checks

  • swift build && swift test: 819 tests pass.
  • swift build --package-path app: no new warnings.
  • swift test --package-path app: 18 tests pass.
  • CI green on this PR.

Not verified

  • Not by eye on the real pill. Only the user can confirm that.
  • The exact trigger of the user's 50 ms hover is inferred. The old trace had resizes only.
  • Real Liquid Glass. Films capture the panel's own pixels.
  • macOS 14–15. Not checked.
  • The rise's opening jump is pinned by tests only. No film resolves its first 80 ms.
  • The README demo GIFs were not re-rendered.

ofcRS added 11 commits November 19, 2026 13:21
The empty grey capsule after a meeting's stop (2026-11-19) was the peek
dock, not the saving bar: "Meeting saved" sank into the edge under the
parked pointer and the dock peeked out 50 ms later. A keyframe animator
retriggered mid-flight gets its in-flight value, and the reveal chose its
keyframes from a kind stored in that value, so the peek replayed the
sink, whose content faded to nothing and stayed there.

- ContentReveal and the squash-and-stretch pick their keyframes from the
  trigger read in body; the animated values carry no kind.
- PillReveal (KleothCore) holds the reveal: every beat ends shown; a sink
  hides the outgoing content only until it has settled.
- PillMotion.beat: an active phase going straight to the dock is a morph,
  never a sink. A settle that lands a pending phase plays a morph.
- reconsiderPointer reads the film's scripted hover in film mode, so a
  film can park the pointer through a collapse.
- PillTrace: the opt-in trace now logs show, dismiss, backdrop, hide,
  beat, settle, hover, dock and drag decisions, and the coordinator's
  refusals, queues and withdrawals; phases print as kinds and ids only.
--check-content fails a film (exit 1, content-check.txt) when a frame of
a phase with content has stayed settled with nothing drawn inside the
capsule, measured on the panel's own pixels. --save-seconds sets how
long a stop's saving lasts (the app's combine takes ~17 s for a long
meeting). pill-film-check.sh runs the flows that have gone empty before
on every edge: a meeting stopped from its bar with the pointer left on
the pill and a long save, the stop suggestion, dictation, dock starts,
faults, an offer, a chord inside a sink and a drag.
A rise now jumps its content to hidden (MoveKeyframe to 0 / 0.6) before
blooming it in: the reveal starts every beat from its current value,
fully shown at rest, so a rise faded its content 1 to 0 first.

With the pill's menu open over an active phase that auto-hid, show(.idle)
sized the pill as the dock but placed it tucked, with neither the pill's
fill nor the dock's surface and fields: an invisible pill half off the
screen (filmed). It now brings the dock out under the menu.

Film mode skips the menu's global click monitor, so a click in another
app does not close a film's menu. The trace logs the menu opening and
closing. Test wording: the dock-straight-out-of-a-phase beat is the
menu or same-turn-hover case, not the reported flow.
…ged; CI guard

--check-content also fails when a visible phase stays mid-transition
over 1 s, when a capture's bar is due (a meeting or recording backdrop,
or a hot phase asked for) with no bar for over 0.5 s, and when a film
judged no frame. A film that captured nothing exits 1 instead of
hanging. New film items menu:open / menu:close (no screen grab).

pill-film-check.sh: 21 films (a meeting starting inside a sink at
30/60/90 ms, the menu over a confirmation), a per-film timeout, CRASH /
TIMEOUT / FAIL reported apart, a temp folder deleted on success and kept
on failure, --quick for CI. tests.yml runs --quick in the app job after
the smoke test and uploads the frames on failure.
@ofcRS
ofcRS merged commit 4f72028 into main Nov 19, 2026
3 checks passed
@ofcRS ofcRS mentioned this pull request Nov 19, 2026
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