Repository navigation
Issue #1882: stack the pill and the messages - #1883
Merged
Merged
Conversation
- One layout function (crates/ui-egui/src/stack.rs) places the pill and the messages, so a pill and a message at the same position no longer draw over each other: the later one takes the place nearest the edge and the earlier one moves inward. - The pill keeps the place it got when it appeared while it updates, and stays inward when a message in front of it leaves. - ui.inspect lists the stack in a new `stack` field. - Manual: the notifications page says how they stack. Manual: platforms/notifications Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
emmertex
approved these changes
Dec 4, 2026
emmertex
left a comment
Owner
There was a problem hiding this comment.
Looks good: one layout function (stack::place / stack::layout) for the pill and the messages, no panic paths (get_mut, total_cmp; the inward-move loop always ends because each step clears every box it overlapped), no new text on screen, and the manual, What's New and changelog entries are all there. Approving. Auto-merge is on, so it merges once the Linux gate passes.
Small things, none blocking:
stack::layoutruns up to three times a frame (the pill, the toasts, andui.inspectwhen it's called), and each run lays out every message galley again. That's cheap with three messages, but it could be worked out once per frame if the stack grows.changing_the_pills_position_puts_it_at_the_new_positions_own_placecompares an exact20.0to the edge. That's fine as a check that Down Low's own offset is used, but tying it toPILL_EDGE_OFFSET(or a tolerance) would hold up better if the offset ever changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1882
Problem
The on-screen overlay (the pill) and the messages at the bottom of the window were placed by two separate pieces of code that did not know about each other. Both sit near the same edge, and Settings lets a person put them at the same position, so a pill and a message could be drawn on top of one another.
Change
crates/ui-egui/src/stack.rs: one function places the pill and the messages. Each box keeps the distance from its edge that its own settings give it; when two would overlap, the later one keeps its place and the earlier one moves inward, with 8 points between them. A box that does not fit in the view is not drawn.surface_osd::paintnow draws into the rectangle it is given. The message with a button still draws itself; the stack makes room for it using its height from the last frame.ui.inspecthas a newstackfield: the pill and the messages, oldest first, each with kind, text, edge, rectangle and seconds left (docs/control-protocol.md).Not in this PR: an animation when a box moves, and a limit on how many boxes the pill can sit behind (it simply is not drawn when there is no room). The limit of three messages is unchanged and does not count the pill.
Acceptance criteria
stack::layoutandstack::place;surface_osd::painttakes the rectangle, andpanels::toastreads its rectangles from the stack.a_pill_and_a_message_never_overlap_at_any_pair_of_positionscovers all 16 pairs of the four positions, in both arrival orders (seen failing first: on the old placement the pill drew over the message).a_pill_that_updates_keeps_its_place_in_the_stack,a_pill_does_not_jump_when_the_message_in_front_of_it_leavesandchanging_the_pills_position_puts_it_at_the_new_positions_own_place; the last two were each seen failing with the remembered distance, or its position check, taken out.the_overlay_stays_off_the_photo_while_a_tool_is_in_useand the slideshow message tests.ui.inspectshows the stack in order with kind, text and seconds left —inspect_lists_the_pill_and_the_messages_in_the_order_they_arrived.platforms/notifications.md.How it was checked
cargo xtask ci --quick,cargo xtask silandcargo test -pfor the touched crates pass on this branch, up todate with
staging(merged in, not rebased)stagingon other files and merges cleanly.a_pill_does_not_jump_when_the_message_in_front_of_it_leavesandchanging_the_pills_position_puts_it_at_the_new_positions_own_place, pass onstagingtoo: the old pill never moved, so they only mean something with the new stack. Each was seen failing on this branch with its part of the behaviour taken out.Merging
unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgatechanges: none (see Runs on CI).
Runs on CI
Nothing beyond the touched crates' own tests. The new tests are headless and open no sockets and start no processes. No workflow, build-script, packaging,
xtaskor dependency changes.Checklist
get_mutandtotal_cmp, no indexingtr(); no new text on screendocs/manual-site/; pages: platforms/notifications)Manual: platforms/notifications.
Sources: own design.
🤖 Generated with Claude Code