feat(ui): mark entities queued for deletion across every list - #52
Merged
Conversation
System Safety queues destructive actions behind a grace period rather than doing them immediately, so an entity can sit in a list looking perfectly alive while already scheduled for deletion. Home's banner said the system had pending actions, but nothing said which rows they were. Adds a shared badge, "Deletes in 18h", plus a dimmed row, wherever such a thing is listed: members, groups, front history, journals, board messages, polls, reminders, tags, custom fields and notification channels, and again on the member, group, poll and journal detail screens so the marking survives the tap that opens them. Only NotificationChannelRead carried pending_delete_at; the other ten models had no idea the field existed, so this adds it to each. JournalEntryRead has a parallel JournalEntryReadWithCount that the detail screen reads, which needed it too, or an entry would look safe the moment you opened it. The badge is deliberately not clickable. These sit inside cards that are themselves clickable, and a tap target inside a tap target is a coin toss; cancelling stays in Settings > Safety, which the Home banner deep-links to. The countdown now rounds down rather than up, which also fixes the Home banner it was lifted from: this is a deadline for undoing something destructive, and telling someone they have 2 days when 25 hours remain can cost them the window, while erring short only makes them act sooner. Below an hour it says "in under an hour" rather than flooring to a "in 0h" that reads as already gone. Home now shares that one implementation instead of keeping its own copy. Not covered: watch tokens carry the field on the server but have no list UI here to mark.
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.
Closes #50.
System Safety queues destructive actions behind a grace period rather than doing them immediately, so an entity can sit in a list looking perfectly alive while already scheduled for deletion. Home's banner said the system had pending actions; nothing said which rows.
What you see
A dimmed row plus a badge - "Deletes in 18h" - wherever a deletable thing is listed:
Detail screens are marked too, so the state survives the tap that opens them - otherwise a dimmed row leads to a page that looks fine.
Why the models were the bulk of it
Only
NotificationChannelReadcarriedpending_delete_at; the other ten had no idea the field existed, so the data was being dropped on the floor before the UI ever got a chance.JournalEntryReadalso has a parallelJournalEntryReadWithCountthat the detail screen reads, which needed it too, or an entry would look safe the moment you opened it.Countdown rounding (a fix, not just a port)
The countdown now rounds down. The helper was lifted from Home's banner, which rounded up, and that's the wrong direction for this: it's a deadline for undoing something destructive. Telling someone they have "2 days" when 25 hours remain can cost them the window; erring short only makes them act sooner. Below an hour it reads "in under an hour" rather than flooring to "in 0h", which would look like it had already happened.
Home now shares that one implementation instead of keeping its own copy, so the banner and the badges can't drift apart - and the banner picks up the same fix.
Judgement calls
The badge isn't clickable, though web's is a link to the Safety page. These sit inside cards that are already clickable, and a tap target inside a tap target is a coin toss on a phone. Cancelling stays in Settings > Safety, which the Home banner deep-links to.
Relative countdown, not an absolute date. Web shows the finalize date on the badge and puts the countdown on the Safety page. Android already had a relative countdown in the Home banner, so this matches what's there.
Not covered
Watch tokens carry
pending_delete_atserver-side but have no list UI here to mark. The model field is added for consistency; nothing renders it.Testing
:app:assemblePlayRelease,:app:assembleOpenRelease,:wear:assembleRelease,:app:testPlayReleaseUnitTestall green. 8 new unit tests cover the countdown boundaries (round-down at 25h and 71h, the sub-hour wording, elapsed deadlines, unparseable input).Device checklist - needs a system with a grace period configured and something queued for deletion: