Skip to content

omamobile-shell: wait for notification deletion acknowledgments - #533

Closed
marselnenaj wants to merge 3 commits into
derekross:shell-notifications-45from
marselnenaj:codex/notification-delete-confirmation
Closed

marselnenaj wants to merge 3 commits into
derekross:shell-notifications-45from
marselnenaj:codex/notification-delete-confirmation

Conversation

@marselnenaj

@marselnenaj marselnenaj commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Keep notification rows until the daemon accepts their deletion requests. Keyed Clear all uses one provider-owned snapshot and hides only acknowledged keys; legacy Clear all hides only the rows captured before its call. Notifications arriving afterwards remain visible.

Scrolling now only inhibits new swipes. A row already flying off or awaiting its reply stays folded when the list moves. Clear all cancels only a swipe whose request has not yet been accepted. If the asynchronous single-forget IPC fails, its keyed refusal signal restores only the matching accepted row, while other queued rows remain folded and continue normally. The existing two-tap confirmation and fixed IPC argv remain.

This remains stacked on #482 and requires provider #585. #471 is merged; the remaining order is #585, #482, then this consumer. After #482 is squash-merged, retarget to main and rebase only this consumer contribution. Package version allocation remains with the maintainer.

Validation: 12 actual-production callback cases and 17 real offscreen Qt entries pass without skips. The Qt fixtures cover swipe then immediate scroll, dragging while a reply is pending, Clear-all cancellation, and asynchronous refusal with the same delegate retained and another request queued. The prior implementations genuinely fail the regression assertions. Independent review and the complete shell package suite pass on the revised source (374.77 seconds), as do policy and whitespace checks.

The exact revised-head 4.0.6 and 4.5 phone acceptance remains outstanding. The maintainer is handling the legacy phone run; the 4.5 path requires the provider from #585.

Policy, tests/all and every package suite pass in GitHub Actions.

…ification store

The review of derekross#471 found that the bar's unread count and the quick-settings
shade read Omarchy 4.0's notification files (one <timestamp>-<id>.json per
notification under ~/.local/state/omarchy/notifications/ and history/),
which Omarchy 4.5 no longer writes: its Store.js keeps live.json (toasts on
screen) and history.json (closed rows, newest first, 100 over 24 hours), one
JSON array each, rows named by a key with `ts` in seconds, and its migration
1792648436 deletes the 4.0 files. On 4.5 the shade would show nothing, the
badge would never count, and Clear all would call a `clear` that 4.5 lacks.

Both layouts are now read, chosen by what exists, not by version: where
history.json exists the shade reads live.json and history.json, and Clear
all is dismissAll followed by `forget <key>` for every notification read
(the 4.5 version of patch 0019 in derekross#471 takes the key); the bar counts
history.json rows newer than the shade's mark, watching the file and
re-reading it every 30 s, since the service replaces it with rename(2).
Without history.json, every command and count is the one 0.2.101 runs.

Tested: test/all (the offscreen touch tests included); new rows in
test/notifications-model.js and test/status-model.js in 4.5.0-3's format,
made by its own Store.js; test/notifications-store.sh runs the shade's read
and Clear all commands from QuickSettings.qml on both layouts with a fake qs;
test/quicksettings-render now draws the light theme over 4.5 files and
checks that all three rows show (run in a sandbox like the OWL container,
with Omarchy 4.0.6's shell: 3 rows on both layouts; main's plugin shows 0 on
4.5). Mutations of each new branch fail a test. Not run on a phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, @marselnenaj. Waiting for the service to confirm before a row disappears is the right behaviour, and the details are careful: the strict reply format, one forget at a time with a fixed argv instead of the shell loop, arrivals outside the snapshot kept, and an error line rather than a silently lost row. I ran test/notification-delete.js here: 9 of 9 pass, and notifications-store.sh passes for both layouts. I also checked that our 4.0.6 forget patch answers ok, so the swipe path works there without the provider.

I have to hold it for now, for three reasons:

  1. The dependency has no provider yet. omamobile-notification-snapshot>=1 is only in your fork's commit 0247da2, not on main or in any open PR. If this merged first, pacman couldn't install the shell on any phone. Please open the provider as its own PR on top of omamobile-omarchy 0.1.39: select 4.0.6 and 4.5 patch families #471. Note that main shipped omamobile-omarchy 0.1.37 yesterday with omamobile-omarchy 0.1.37, omamobile-shell 0.2.103: double tap to wake, a single touch leaves the screen dark #420, and omamobile-omarchy 0.1.38: omamobile-update refuses to run as root, and passes OMARCHY_PATH on #548 says 0.1.38, so it will need a later number. I'll allocate it at merge if you prefer.
  2. It's stacked on omamobile-shell 0.2.125: the shade and the bar read Omarchy 4.5's notification store #482, and the provider on omamobile-omarchy 0.1.39: select 4.0.6 and 4.5 patch families #471. So the order is omamobile-omarchy 0.1.39: select 4.0.6 and 4.5 patch families #471, the provider, omamobile-shell 0.2.125: the shade and the bar read Omarchy 4.5's notification store #482, then this one, retargeted to main and rebased so it carries only its own commit (omamobile-shell 0.2.125: the shade and the bar read Omarchy 4.5's notification store #482 lands as a squash).
  3. It changes what 4.0.6 phones do, which is every phone on the current pin, my 7 Pro included. A swiped row now waits for the reply, and Clear all leaves the rows up until the refresh, where today the list empties at once. Once it's unblocked, I'll try it on my 7 Pro: a swipe, a swipe while the shade refreshes, Clear all, and Clear all with a new notification arriving. The 4.5 path will need a run on a 4.5 phone with the public provider installed.

A question: on 4.0.6 a successful clear empties the whole history, so would it be safe to hide the rows that were read before the call when the result is legacy? That would keep today's instant empty list.

Two small things: NotificationsModel.js and QuickSettings.qml each gain a blank line at the end of the file (git diff --check flags them). And a swipe made while Clear all is running is refused after the row has already folded away, so it stays hidden until the next refresh with no error. That may be worth a line. I'll set the shell version at merge, as you suggested. Main is at 0.2.107 now.

Keep notification rows until the daemon acknowledges logical deletion.
Use its keyed snapshot on 4.5 and hide only the pre-call visible snapshot
on a successful legacy clear, retaining arrivals and every failure.

Disable swipes during Clear all and restore interrupted or refused rows
without waiting for a store refresh. Keep the two-tap clear confirmation
and fixed single-forget argv. Require the separate provider capability.

The actual source/IPC model and both-layout tests pass. Eleven offscreen
Qt entries exercise the real row, including rejected/interrupted swipes;
the published parent fails the same refused-forget assertion. Package
version allocation and physical tests remain for the maintainer.

Co-Authored-By: Codex <codex@openai.com>
@marselnenaj

Copy link
Copy Markdown
Contributor Author

Thank you for the precise review. I prepared the provider as its own six-file follow-up on the corrected #471 head, with 0.1.40 provisional after its 0.1.39 parent. Both complete provider suites pass against the genuine 4.0.6-1 and 4.5.0-3 packages. The separate provider PR is #585: #585.

The legacy path now captures the visible keys before Clear all starts and hides only that snapshot after a successful legacy reply. An arrival during the call stays visible; failure retains all rows. Clear all disables row swipes and restores an interrupted fly-off, and a late refusal restores the row without waiting for a refresh. A direct busy request also reports an error. The two EOF blank lines are removed.

Eleven source/IPC cases and eleven real Qt entries pass, including the refused/interrupted swipe cases. The published parent fails the same Qt refusal assertion and legacy-snapshot assertion. The existing model and both-layout tests, QML parse, policy and consumer whitespace checks pass.

Understood on the order: #471, #585, #482, then this consumer retargeted to main and rebased after #482's squash. I left final shell version allocation for merge; main is now at 0.2.108. These changes have not been installed on a phone, so the requested public-provider device tests remain outstanding.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @marselnenaj. The legacy Clear all now does what I asked: it remembers the rows that were up, hides exactly those on success and keeps a late arrival. The provider is open as #585, the blank lines are gone, and a refused swipe no longer leaves an invisible row. I ran your eleven source cases and the eleven Qt entries, and the whole shell suite on main plus #482 plus this commit: 307 ok, nothing failed or skipped.

One problem came in with the new restore, and I'd like it fixed before this goes further. In NotificationRow.qml, onSwipeEnabledChanged: if (!swipeEnabled && dismissing) restoreSwipe() was written for Clear all, but swipeEnabled is !shadeList.moving && !clearProc.running, so scrolling the list triggers it too. I added two cases to your shade-touch.qml harness and ran them on main's row and on yours:

  • swipe a row away, then flick the list straight away: main forgets the notification (9 rows left); here the row springs back and nothing is forgotten (fold=1, forgotten=0);
  • swipe a row away and, while the reply is still outstanding, drag the list: main's row stays folded; here it comes back at full height with the forget already sent, and then disappears when the reply lands.

Could you separate the two reasons? For example a clearing property on the row, bound to clearProc.running, with the restore on that alone (in the handler and after the fly-off), and swipeEnabled left as the gate for starting a swipe. Once forgetNotification has returned true, only a refusal should bring the row back. Both cases would make good additions to shade-touch.qml.

The order hasn't changed: #471, #585, #482, then this one. #482 lands as a squash, so afterwards please retarget to main and git rebase --onto origin/main 6be78a30 <your branch>, which keeps just your commit. I'll set the version at merge (main is at 0.2.113 now).

The phone runs are still to come, and the 4.0.6 one is mine: on my Pixel 7 Pro I'll try a swipe, a swipe followed by a scroll, three quick swipes, a swipe while the shade refreshes, Clear all, and Clear all with a notification arriving. The 4.5 path needs a phone on 4.5 with #585 installed; I've asked on #585.

Separate Clear all cancellation from the gate that inhibits new swipes during a scroll. A row already flying off or awaiting its deletion reply stays folded when the list moves.

Restore only the matching accepted row when the actual asynchronous forget IPC is refused. Keep other queued rows folded and continue their requests. Exercise the production callbacks and actual Qt row for immediate scrolling, pending replies and keyed refusal; the old implementations fail the new regressions.

Co-Authored-By: Codex <codex@openai.com>
@marselnenaj

Copy link
Copy Markdown
Contributor Author

Thank you for reproducing both scrolling cases. I separated clearing from swipeEnabled: the latter only gates new gestures, while Clear all cancels only a swipe whose request has not yet been accepted. An accepted row stays folded through list movement and Clear all.

I also reproduced an existing asynchronous refusal problem: a locally accepted row stayed folded after the service IPC failed if the next read retained the same delegate. The actual failure callback now emits the rejected key, and only its matching accepted row restores. A second queued row stays folded and proceeds normally.

The real Qt harness covers immediate scrolling, dragging while a reply is pending, and both refusal cases using the actual production queue/completion/read callbacks. The old implementations genuinely fail the regressions. The new source callback suite passes 12 cases, and the combined Qt harness passes 17 entries without skips. I have kept #482 as the parent and left package version allocation to you. The exact revised-head phone acceptance is still outstanding.

The complete shell package suite also passes on this exact revised source (374.77 seconds, no resource stop). Independent source review and the commit-range policy gate pass.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @marselnenaj. The scrolling problem is fixed the way I hoped: clearing is its own property, swipeEnabled only decides whether a new swipe may start, and once forgetNotification has returned true only a refusal for that key brings the row back. The refusal signal is a good addition, and thank you for putting both of my cases into shade-touch.qml.

I found one more thing with a probe, and I'd like it fixed before I take this to my phone. I used your refusal fixture with the production callbacks, swiped row 0 and then row 1, and answered ok for row 0:

before ack:      first.fold=0 second.fold=0
after first ack: pending=true sameDelegate=false fold=1 height=66 visible=true forgetAccepted=false

acknowledgeNotifications replaces root.notifications, the Repeater rebuilds every row, and the second row, whose request is still queued or outstanding, comes back at full height until its own reply lands. With three quick swipes, rows two and three each pop back once. On main they simply go. The same happens if the 3-second refresh or a new notification changes the list while a reply is outstanding. Could a new row ask the host whether its key is pendingForget or in forgetQueue, and start folded and accepted if so? A case for it (two swipes, ok for the first, the second still folded) would fit next to your refusal tests.

Two small things: the error line is only cleared by a later success, so "Wait for Clear all to finish" can sit there after it has finished; clearing it when the shade opens would be enough.

The order is unchanged: #585 (waiting for its run on a 4.5 phone), then #482, which I need to rebase onto main first, since it conflicts now. That one is on me. Then this, retargeted to main with git rebase --onto origin/main 6be78a30 <your branch>. I'll set the version at merge (main is at 0.2.114). The 4.0.6 run on my Pixel 7 Pro is still mine to do: a swipe, a swipe then a scroll, three quick swipes, a swipe during a refresh, Clear all, and Clear all with a notification arriving.

@derekross
derekross force-pushed the shell-notifications-45 branch 3 times, most recently from 9783a78 to e6a2020 Compare November 11, 2026 18:18
@derekross
derekross deleted the branch derekross:shell-notifications-45 November 11, 2026 19:36
@derekross derekross closed this Nov 11, 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.

2 participants