Skip to content

Feature/split pill - #37

Merged
EvanKoe merged 6 commits into
devfrom
feature/split-pill
Aug 27, 2026
Merged

Feature/split pill#37
EvanKoe merged 6 commits into
devfrom
feature/split-pill

Conversation

@EvanKoe

@EvanKoe EvanKoe commented Aug 27, 2026

Copy link
Copy Markdown
Owner

In this PR, I did:

  • Add a split pill when a second notification arrives
Screenshot_20260827-120524

When a new event takes the pill over, whatever it displaced now stays
visible in a circular bubble beside it instead of disappearing until
livePillToReturnTo brings it back. Tapping the bubble swaps it into
the pill.

The pair shares the normal cutout's width rather than growing past it:
the pill gives up the bubble's diameter plus the gap and its centre
steps away from the bubble's side by half of that, so the two together
span exactly the width the user chose and the overlay window never has
to resize for a split.

A pinned live tile parks with no timer and persists for as long as its
bus reports it live; a transient keeps the deadline it already had, so
being pushed sideways never extends its life. satelliteAllowed() holds
every suppression rule: calls own the whole cutout, the assistant tile
is screen-height, and a cutout too narrow to give the width away falls
back to the previous replace-and-return behaviour.

The bubble reuses IslandSurface and the badge composables, widened to
internal, so it cannot drift from the collapsed pill's rendering. The
touchable region became a union of two rects that track the shrunken,
shifted pill.

Portrait only for now; landscape has its own camera-anchored geometry.
Off switch and the Left/Right side selector live on the Behaviour
screen, defaulting to on and right.
Posts one test notification and a second, distinct one two seconds
later, which is the sequence the split island needs to be seen: the
first should hand the pill over and drop into the satellite bubble
rather than disappearing. Reproducing it otherwise means racing two
real apps.

The second half carries its own id, title, text and status-bar icon,
so the two are told apart at a glance both in the shade and on the
island.
The project had no written commit convention, so contributor PRs were
guessing: 122 commits use a [FEAT] prefix and ten use conventional
commits, the latter arriving almost entirely through outside PRs.

Settles on Conventional Commits and ties the optional scope to the
existing package names, so nobody has to invent their own vocabulary.
Notes that the [FEAT] history is superseded and should be left alone
rather than rewritten.
The split is portrait-only: landscape reserves no width for a bubble
and registers no touchable region for it, so one that survived the
rotation was drawn but dead, and could be positioned outside the
overlay window entirely.
Two faults on the dismiss path.

The promoted event was moved into the pill as-is, so the open state of
the notification the user had just swiped away could carry across and
blow the arriving normal cutout open on its own -- geometry the overlay
window was never sized for. It is now promoted with initiallyExpanded
cleared and an explicit collapse asked for, rather than trusting the
new event's id to reset the composable.

Only a pinned live tile was promoted at all: the check required a null
deadline, which only music, a call or a timer ever have. A plain
notification parked in the bubble was silently dropped when the pill
was dismissed. Both dismiss paths now share one helper that promotes
either kind, and a transient whose own deadline ran out while it sat in
the bubble is dropped rather than promoted for a single frame.
Tapping the bubble opens that event's expanded cutout, since the tap is
a request to read the thing rather than to reorder the island.

Expansion and slot ownership are kept separate. The two slots do swap
internally for as long as the cutout is open, which is what lets every
action, reply and dismiss inside it act on a real currentEvent instead
of introducing a second notion of "which event is open" for each of
those paths to get wrong. The bubble is hidden while expanded, so the
swap is never visible, and both slots are put back on collapse with the
time each one had left -- neither event appears to move and neither is
dropped.

Two behaviours fall out of settings rather than being special-cased
here: with "disappear on shrink" on, a collapse hands the island to the
displaced event instead of returning the opened one to the bubble; and
an app set to "Normal only" has no expanded state, so tapping its
bubble fires its content intent and leaves the island alone.

The swap flag is cleared on every other path that can change the pill,
so it cannot fire later and shuffle the slots unprompted.
@EvanKoe EvanKoe self-assigned this Aug 27, 2026
@EvanKoe
EvanKoe merged commit 9ef7b8a into dev Aug 27, 2026
1 check passed
@EvanKoe
EvanKoe deleted the feature/split-pill branch August 27, 2026 11:28
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