Skip to content

Remove the FILE-menu Save/Load Local Storage dialogs - #439

Merged
maboa merged 4 commits into
mainfrom
enhancement/remove-save-load-dialogs-436
Jul 29, 2026
Merged

Remove the FILE-menu Save/Load Local Storage dialogs#439
maboa merged 4 commits into
mainfrom
enhancement/remove-save-load-dialogs-436

Conversation

@maboa

@maboa maboa commented Jul 29, 2026

Copy link
Copy Markdown
Member

Closes #436. Builds on #438.

Summary

With Recents autosaving everything (#435) and rows offering rename/delete + Restore (#434), the save/load dialogs had two remaining jobs — both now have direct homes, so the dialogs are removed outright:

  • Duplicate (per-row action) replaces "save under a different name": copies an entry under a fresh ID as name (2) with fresh timestamps (appears on top), sharing the original's cached media. Media deletion is now refcounted — a shared blob survives until the last referencing entry is deleted.
  • Auto-create on first edit covers the one remaining never-saved document (the intro demo, which fires no hyperaudioInit): editing a document with no active entry saves it as a new one. Exception: while a Restore offer is pending, auto-create is suppressed — silently recreating a just-deleted document would fight the delete; dismissing the offer makes it an ordinary unsaved doc, so edits then re-enter Recents.

The FILE menu loses its "Local Storage" section (continuing #428's shortening), index.html loses both modals, and the save-dialog prefill plumbing goes from storage.js.

Testing

  • 43 unit / 62 e2e, all green. New coverage: duplicate semantics (suffix, fresh stamps, shared mediaKey, refcounted delete), the demo auto-create, and restore-pending suppression + re-enable after dismissal.

maboa added 4 commits July 29, 2026 20:24
With Recents autosaving everything (#435), rows renaming inline and
deleting with Restore (#434), the dialogs' remaining jobs get direct
homes and the dialogs go:

- "Save under a different name" becomes a per-row Duplicate action:
  copies an entry under a fresh ID as "name (2)" with fresh timestamps
  (so it appears on top), sharing the original's cached media — and
  delete is now refcounted so shared media survives until the last
  referencing entry goes.
- The one remaining never-saved document (the intro demo — it fires no
  hyperaudioInit) is covered by auto-create on first edit: editing a
  document with no active entry saves it as a new one, EXCEPT while a
  Restore offer is pending — recreating a just-deleted doc on the next
  keystroke would fight the delete; dismissing the offer makes it an
  ordinary unsaved doc again, so edits then re-enter Recents.

The FILE menu loses its Local Storage section (continuing #428's
shortening), index.html loses both modals, and storage.js loses the
save-dialog prefill plumbing.
…ions off-screen

The daisyUI menu wraps with flex-shrink:0 items, so a long name sized
the row to its content — the rename/duplicate/delete icons ended up
past the card edge. max-width:100% on the row lets the name's existing
ellipsis absorb the difference, Claude-app style.
…ds carry created=now, so they outrank the seeded updated:9999 and the first row was a short name
Three inline icons reserved ~90px of every row even when invisible
(they fade, not collapse), truncating names early — and read as a
toolbar rather than quick actions. A single kebab opens a shared menu
with Rename / Duplicate / Delete; delete keeps its two-step arm inside
the menu, and closing the menu by any route disarms it.

The menu is fixed-position and anchored to the kebab's rect rather
than a dropdown inside the list: the Recents list scrolls, so an
absolutely-positioned dropdown would clip at the card edge for rows
near the bottom. It flips upward near the viewport bottom and closes
on outside click, Escape, any scroll (the anchor moves), or a list
re-render.

The actions span also sheds daisyUI's menu-item treatment (every
direct child of a menu li gets item padding + hover fill), which was
painting a pill around the kebab's own hover — one affordance now.
@maboa

maboa commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

Design revision after manual review: the three per-row icons (rename/duplicate/delete) are now a single kebab (⋯) opening a shared menu — three icons reserved ~90px of every row even when faded out, truncating names early, and read as a toolbar. The menu is fixed-position (anchored to the kebab) so it never clips against the Recents scroll container, flips upward near the viewport bottom, and closes on outside click / Escape / scroll / re-render. Two-step delete lives inside the menu. Also fixed en route: rows now clamp to the list width so long names ellipsis instead of pushing actions off-screen, and the actions span sheds daisyUI's menu-item hover treatment (it was painting a pill around the kebab's own hover).

@maboa
maboa merged commit b319bb0 into main Jul 29, 2026
1 check passed
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.

Simplify the FILE-menu save/load dialogs once Recents autosaves

1 participant