Skip to content

fix(trash): align restore visuals with trash state and flow - #1119

Open
JoeJoeflyn wants to merge 1 commit into
mainfrom
fix/trash-restore-visuals
Open

JoeJoeflyn wants to merge 1 commit into
mainfrom
fix/trash-restore-visuals

Conversation

@JoeJoeflyn

@JoeJoeflyn JoeJoeflyn commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes several misleading or missing trash/restore visuals reported in #1118:

  • Restore icon: Restore context-menu items and the restore confirmation dialog showed a folder glyph identical to "Move to…". Both now use a bundled Lucide undo-2 icon.
  • Trash fill level: The sidebar Trash icon was static. It now reflects the probed item count — outline (empty/unknown), low fill (1–4), half fill with a crest (5–14), solid bin with mound (15+). Count is enumerated capped at 32 items.
  • Lid animation: The sidebar trash lid flips open during delete and restore flights and closes when they finish, with an open variant per fill level.
  • Crosshair removal: Flying icons carried a ring border, shadow disc, and count badge that read as a crosshair/target. Flyers are now bare icons.
  • Release animation: Restoring while viewing Trash animated icons out of the sidebar button toward disappearing rows — backwards. Restored items now lift off their rows and launch upward (coil, banked launch, shockwave/beam/spark burst) since the destination folder is not visible. The trash-to-row flight still plays when restored rows materialize in a normal folder, including the Ctrl+Z path which now animates via a post-restore retry.
  • Ordering: The restore animation played before the confirmation modal. It now runs only after the modal is accepted; cancelling animates nothing.

Visual evidence

screenrecording-2026-09-18_20-20-10.mp4

Pending owner upload — gh cannot attach images. Local captures:

  • /tmp/strata-trash-fill-levels.png — sidebar icon progression: empty / low (1–4) / half (5–14) / full (15+)

How to test

  1. Open Trash, right-click an item → Restore → confirm in the modal — the icon lifts off its row and launches upward with a burst; the row then dissolves.
  2. Select several Trash items and restore — the launch fans out per item.
  3. Delete files from a folder — icons arc into the sidebar Trash button while the lid opens; the sidebar icon advances through low/half/full as the count grows.
  4. Empty Trash or restore everything — the icon returns to the outline.
  5. From a normal folder, press Ctrl+Z after deleting — once restored rows appear, icons fly from the Trash button onto them.

Expected result: restore uses the undo glyph, the sidebar icon tracks trash contents, flyers show no ring/disc/badge, restore-in-Trash animates items leaving upward after confirmation, and reduced-motion settings skip all flight animation.

Related issue

Closes #1118

- use an undo-style icon for restore actions and the confirm dialog
- show trash fill level in the sidebar icon (low/half/full by item count)
- open the trash lid during delete and restore flights
- drop ring, disc, and count badge chrome from flying icons
- release restored items upward when viewing Trash instead of flying
  them from the sidebar button onto disappearing rows
- animate restore only after the confirmation modal is accepted
@wmfeht

wmfeht commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

request-changes on 82586f2c47343510d44252b51d57e8fb123bba3e.

Production change matches #1118 (restore uses undo-2, fill-level sidebar icon, bare flyers, restore-in-Trash launches upward, animation only after confirm, Ctrl+Z peek-then-fly). Drop these three tests — they are tautological / trivial getters. Do not add replacements.

  1. launch_curve_explosive_burst (src/ui/browser/fly_to_trash/tests.rs) — asserts launch_curve(0)=0, (1)=1, (0.5)=0.875. That is 1-(1-p)³, which is also ease_out_cubic. Cannot fail unless f64 arithmetic is broken.

  2. entries_named_returns_loaded_entries_matching_display_names (src/app/browser/tests/undo.rs) — fixture navigate + filter by "child" / "missing". Trivial getter around the columns.entries display-name filter.

  3. the_trash_row_icon_fill_follows_the_probed_item_count (src/ui/window/tests/trash.rs) — six assert_eq! of trash_icon(…) against the match-arm constants. Restates the implementation literals.

Keep restore_flight_releases_only_when_every_entry_lives_in_trash, release_end_rises_above_the_row_and_fans_out, and pending_trash_undo_reports_original_locations_until_claimed.

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.

Trash and restore visuals: wrong restore icon, static trash icon, confusing flight animation

2 participants