hex/src/rune_ui/screenshot_thumbnail
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dax 631b60b414
screenshots: choose the save folder from labs (#1843)
* labs: choose the screenshots folder from its card

Labs › Screenshots' Saves to row was read-only text naming the folder's
last part. It now reads the folder in full with the home folder as `~`, on
a Secondary button that opens the one native folder chooser (the seam Labs
› Import audio uses) at the folder in use, with Reveal beside it opening
that folder (making it first, as a save would). A pick is written to
screenshots.folder at once, so it applies live to the next shot or
recording; a cancel changes nothing, and a click while a chooser is open
opens no second one.

A chooser that couldn't open, or the last save that failed
("Couldn't save to ~/…: <why>"), reads as a danger note under the row.
The screenshots module keeps that failure bounded at 300 characters and
clears it when a save works or another folder is chosen.

The folder label is one shared `controls::folder_label` now, used by
Annotate's and Meetings' folder rows too.

Closes #1836

* labs: keep the screenshots save error with the folder that failed

Review fixes for the screenshots folder card:

- `screenshots::save_error` keeps the folder the save meant with the
  reason, so a folder changed since through `hex settings` or
  `settings.json` can't make the note name the wrong one.
- The editor's Save records a failed shot PNG or trimmed recording movie
  into the screenshots folder, and clears the note when it works, so the
  docs' "cleared when a later save works" covers every save into it.
- `take` clears the note as soon as the write succeeds, before the
  clipboard copy, so a clipboard failure can't resurrect a stale note.
- Reveal takes `&mut Ui` and puts a failed `create_dir_all` on the card,
  as Meetings' and Annotate's folder hosts do.
- `apply_chosen_folder` only clears the note and reports a change once
  `ui.update` saved the pick; a refused settings save reads as the card's
  danger note instead.
- The test records a failure into an older folder and checks the note
  names it (not the current setting), then that a pick clears it, with the
  process-wide error reset before and after.

Also: the file dialog's `Target::Folder` doc names its callers, the new
Japanese string uses フォルダー like the rest of the table, and the docs
say a visible window's 250 ms tick carries a background save failure, so
no extra wake is kept.

* labs: redraw the screenshots card when a save fails

A window's poll that returns false runs again on the next tick but leaves
the frame alone, so a save that failed on its own thread never showed its
note. `screenshots::save_error_generation` counts each recorded or cleared
save error, `FolderChoice` keeps the count it last drew, and the card's
poll reports the difference, so the visible window's 250 ms tick draws it.

`apply_chosen_folder` returns true for a pick whether or not the settings
save worked: the card changes either way (the new label or the danger
note). The test now settles the window after recording the error and
after the pick, so only the poll can make the note appear and disappear.
2026-11-14 23:23:59 -05:00
..
editor screenshots: choose the save folder from labs (#1843) 2026-11-14 23:23:59 -05:00
card.rs feat(screenshots): record the screen, and keep captures until you close them (#1371) 2026-11-09 08:18:56 -08:00
editor.rs fix(capture): Undo, marks and Copied only claim what really happened (#1669) 2026-11-12 18:52:42 -08:00
tests.rs feat(screenshots): record the screen, and keep captures until you close them (#1371) 2026-11-09 08:18:56 -08:00