shadcn.io is not affiliated with official shadcn/ui
Auto-Delete Rules Account Block for React
Rules for deleting personal history automatically: a select for each kind of history, what each rule would delete worked out from typed counts, a popover of the oldest items and an alert dialog before a large delete.
Installation
Overview
Let people decide how long you keep what they did, and see the cost of each rule before it is saved, with this retention panel for React with Base UI. Four kinds of history, each with a Native Select that keeps it until deleted or deletes it after 36, 18 or 3 months, and a sentence worked out from typed counts of items by month of age and the as-of day: how many items from before which day go in the next run. A band adds the kinds up and a Popover lists the six oldest items the rules would delete. Apply rules, the foot's Shine Button, saves the rules; when they would delete more than 100 items it asks first in an Alert Dialog with Cancel focused and a destructive action. Discard puts the saved rules back. Nothing is deleted: rules run in a nightly job that does not exist here. It's built from Native Select, Popover, Alert Dialog, Badge, Button, Shine Button and Guides, with a CSS entrance only. For privacy settings and any app that keeps people's history.
FAQ
How do I fill it with my own kinds of history?
Edit HISTORIES: each has an id, a name, a noun for sentences and counts, the number of items by age, where the first entry is the as-of month, the second the month before, and so on. OLDEST holds the items of the oldest months, typed, for the popover. A rule keeps this month and the months before it up to its length, so 3 months keeps the as-of month and the two before it; the day it cuts at is worked out from AS_OF. Keep OLDEST equal to the oldest entries of counts, or the six oldest will not be the oldest.
What stays local, and how do I make it real?
All of it. Apply saves the rules in this page and says what the next run would delete; no item is removed anywhere, and the status line says so. To make it real, save the rules on your server and let a scheduled job delete what they select; compute the counts there too, and show this page's sentences from what the server reports. Keep the confirmation: a rule that deletes history cannot be undone by the person.
When does the alert dialog appear?
When the rules you are about to apply would delete more than 100 items beyond what the saved rules already delete. It says how many and of what, Cancel has focus, and the action is the destructive Button; Escape closes it and focus returns to Apply. Below that number Apply saves at once. Once rules are saved the same choice asks nothing: nothing new would be deleted.
What does What would go list?
The six oldest items, across all kinds, that the rules as they stand would delete, with their kind and day. It is a popover, so Escape closes it and focus returns to its button. When no rule would delete anything the button waits quietly and says so if pressed.
How does it look on a phone?
The select sits under each kind's name and sentence, each row keeps its height whatever the rule says, and the foot stays pinned to the bottom of the screen with its status over Apply rules and Discard. A row whose rule you changed carries a Not applied badge until you apply or discard it.
Is it accessible?
Each select has a label that names its kind and is described by the sentence under it, so its effect is read with it. The status line is polite and present from the start, and says how many rules changed. Apply and Discard wait quietly when nothing changed and explain themselves if pressed, rather than disappearing.
Related
- Pro
What an account stores: one bar cut into five parts by pattern, a row for each with its size and share, and actions that free space after an alert dialog and can be undone.
- Pro
Audit Log Retention Settings
Backups and exportsAn audit log retention panel with a row for each class of event, a preset for how long to keep it, an archive-after menu, a legal hold that freezes the row and a two-part bar to one scale, with the gigabytes searchable and archived added up from typed daily volumes.
- Pro
The archives an account has asked for and not yet taken: a type filter, a table with size, request day and time to expiry, real sample downloads, Request again for an expired one and Undo.
- Pro
Export requests as a lifecycle: a request checked with the password, a four-stage track that moves one stage per press, and a real sample file to download once it is ready.
- Pro
The people a person has blocked or muted, as two tabs of rows with initials, handle and date, an Unblock or Unmute that can be undone, and a handle field that adds someone from four typed accounts.
- Pro
A person's consent choices as an accordion of purposes with switches beside a consent receipt, an ordered log that gains a line for each choice and saves as a real PDF or JSON file.