Skip to content

feat(preview): start first-time video previews at a configured position - #1924

Merged
l0gicgate merged 28 commits into
lgse:stack/1925from
Bluesboy:feat/1910-video-preview-start-position
Nov 7, 2026
Merged

l0gicgate merged 28 commits into
lgse:stack/1925from
Bluesboy:feat/1910-video-preview-start-position

Conversation

@Bluesboy

@Bluesboy Bluesboy commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a Video preview start setting (Settings → General → Browsing, right under Autoplay media previews) so a video opened in the preview pane for the first time can start part-way into the file instead of at 0:00.

  • Stored as preview_video_start: a whole percentage of the duration, 0–99, default 0 (current behavior). Larger saved values clamp to 99.
  • Applied in DecodedMedia when the first Prepared header arrives, next to the feat(preview): recover playback stalls and resume per-file position #1326 resume logic and through the same restart_at path. The start is taken once, so the restarted session's own Prepared does not seek again.
  • A position remembered by feat(preview): recover playback stalls and resume per-file position #1326 still wins, so reopening a video resumes where it was left.
  • A video closed within its first second or at its end is remembered at 0, so it reopens at 0:00 instead of jumping to the configured start again (for example after seeking back to watch an intro, or watching to the end).
  • Only applies to video with a known duration (header.width > 0, duration not MAX_DURATION_US). Audio, GIF and streams of unknown length start at the beginning.
  • The control is the same number_stepper used by Thumbnail workers (± steps by 5, any whole number can be typed), with a Settings search target and keywords.
  • Strings added to all 13 catalogs; docs/preferences.md documents the key.

Tests: ui::media::tests::first_video_preview_starts_at_the_configured_percent (configured start, remembered position wins, 0 %, audio) and video_starts_past_the_maximum_clamp_on_load_and_set, plus the existing preferences round-trip and backward-compatibility tests updated for the new key.

Visual evidence

image

How to test

  1. Open Settings → General → Browsing and set Video preview start to 20.
  2. Preview a video you have not opened in this session.
  3. Close the preview part-way through, then preview the same video again.
  4. Set the value back to 0 and preview another unopened video; also preview an audio file with the value at 20.

Expected result: in step 2 playback starts at about 20 % of the duration. In step 3 it resumes where it was closed, not at 20 %. In step 4 the video and the audio file both start at 0:00.

Related issue

Closes #1910

Add a "Video preview start" percentage (0-99, default 0) under
Settings > General > Browsing, stored as `preview_video_start`. A video
preview with a known duration and no position remembered this session
seeks there once its header arrives; a remembered position from lgse#1326
still wins, and audio, GIF, and streams of unknown length start at the
beginning.

Closes lgse#1910
@wmfeht

wmfeht commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Review

1. Hungarian catalog is missing the new keys (blocks merge)

The three new keys (Video preview start, the description string, and settings_keywords.preview-video-start) were added to 12 catalogs but not data/locales/hu.json. The branch is based on 73b3258f, which predates #1918 (Hungarian locale). The PR passes on its own, but after merging main, i18n::catalog_tests::catalogs_cover_all_languages_and_preserve_interpolation fails. It requires every locale, including hu, to have exactly the same keys as en.json, in the same order. The merge has no textual conflicts, so this won't show up until tests run.

Fix: merge main and add the Hungarian translations. All 13 languages are required.

2. A deliberate restart from 0:00 can be overridden on the next open (low)

DecodedMedia::close forgets the position when it is ≤ 1 s (RESTORE_MIN_US) or playback reached the end. Before this change, the next open then started at 0:00. With a non-zero setting it jumps to the configured percent again. For example, with the setting at 20, seeking back to 0:00 to watch an intro and closing within a second, or watching to the end, makes the next open start at 20 %. The docs wording ("no position remembered") is accurate, but the Settings description ("resumes where you left it") doesn't hold in these cases.

3. < / > continuation also starts at the configured percent (behavior note)

The setting applies to every non-GIF DecodedMedia the preview creates, including the "continue playback into the next file with < / >" path. That fits the skimming use case in #1910, but it changes today's continue-playback behavior, so it's worth documenting.

Minor

  • set_start_percent clamps to 100 while the preference clamps to MAX_PREVIEW_VIDEO_START (99). Using the shared constant keeps them consistent.
  • Each first-time video with a non-zero setting starts a session, receives Prepared, then restarts, so it costs two sessions. This matches the existing feat(preview): recover playback stalls and resume per-file position #1326 resume path. Noting it only because skimming now does it for every file.

Checked with no problems found: the start is consumed once, so later seeks, resize restarts, and the restarted session's own Prepared are unaffected. The setting is applied before the session timer can fire, restart_at falls back to the header duration, GIF is the only image that reaches DecodedMedia, and the preferences fixture and tests are updated.

wmfeht and others added 4 commits October 31, 2026 12:00
KeyboardFixture seeds the exhaustive preferences fixture, which now sets
preview_video_start to 20, so the clip opened at 20 % and the handoff
reported --start=12.000 instead of the position reached by playing.
`DecodedMedia::close` forgot the position of a video closed within its
first second or at its end, so with a non-zero Video preview start the
next open jumped to the configured percent again. Seeking back to watch
an intro, or watching to the end, was overridden on the next preview,
and the Settings description ("A video you already previewed resumes
where you left it") did not hold.

Remember such a video at 0 instead. `resume_position` still ignores
positions within the first second, so it reopens at 0:00, and
`set_start_percent` applies the configured start only to a video not
previewed earlier this session. Audio is still forgotten as before.
@Bluesboy

Copy link
Copy Markdown
Contributor Author

Thanks for the review and for the follow-up commits (Hungarian strings, shared clamp, < / > in the docs).

For point 2 I went with a behavior fix rather than documenting it, in e5a1d4b:

  • DecodedMedia::close now remembers a video closed within its first second or at its end at position 0 instead of forgetting it. resume_position still ignores positions within the first second, so it reopens at 0:00.
  • set_start_percent applies the configured start only to a video not previewed earlier this session.
  • Audio is still forgotten as before.

So seeking back to watch an intro, or watching to the end, now reopens at 0:00, and the Settings description ("A video you already previewed resumes where you left it") holds without changing the 13 catalogs. docs/preferences.md describes the new behavior, and first_video_preview_starts_at_the_configured_percent covers both cases (closed at 1 s and at the end). The /shortened and /ended expectations in reopening_resumes_where_the_preview_closed change from None to Some(0).

If you'd rather keep the documented behavior, the commit stands alone and can be dropped.

…view-start-position

# Conflicts:
#	src/ui/media.rs
#	src/ui/preferences.rs
#	src/ui/preferences/tests/preferences.rs
#	src/ui/preview.rs
#	src/ui/settings/search.rs
@Bluesboy

Bluesboy commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Merged the latest main into the branch (8f45436) and resolved the conflicts from the #2022 module split. No behavior change, the PR's changes just moved to where the code lives now:

  • close() keeps resumes_later() from main and adds the branch that remembers a video left in its first second or at its end at 0.
  • The configured start moved from the old decoder loop into on_prepared in media/playback.rs, as start_position() next to resumable_position().
  • The start percent is passed to open_media_stream in preview/media_render.rs; GIFs still skip it.
  • Preferences went to stored.rs, defaults.rs and preview_settings.rs, the search target to settings/search/targets.rs, and the tests to tests/preferences/{loading,saved_fixture,setters}.rs.
  • recall_media_position is now imported outside #[cfg(test)], since set_start_percent needs it.

The media, preferences, preview and settings search tests pass locally.

wmfeht added 14 commits November 5, 2026 22:44
# Conflicts:
#	src/ui/preferences/tests/preferences/loading.rs
#	src/ui/preferences/tests/preferences/saved_fixture.rs
set_start_percent calls it in production code, so the #[cfg(test)] gate broke the non-test build.
With the start at 0, every previewed video and GIF was stored at 0 in the
128-entry position cache, evicting real resume positions and keeping a
video skimmed at 0 from getting a start configured later in the session.
The helper seeks raw elementary streams by decoding up to the target, so a
configured start on a long stream could exceed the first-frame timeout.
Issue lgse#1910 asks for these streams to start at 0.
…start

settle ticked without sleeping, so the fake stream's Prepared could arrive
after the check and the cases expecting no restart passed without
exercising the start decision.
…t row

The row description already says the value is a percent of the video's length.
In-range values only echoed the input; the saved fixture and the setter
persistence test already cover round-tripping.
…ttle

A wrong restart only reaches the loader once the cancelled worker exits,
which can take longer than the fixed tick count, so the start-at-0:00
cases could pass without seeing it. start_session clears restart after
calling the loader.
A short clip at a small percent got a start before its first frame tick,
which restarted the decoder at tick 0 for nothing.
An MP4 preview starts at 20 % as a control, then > continues into a raw
H.264 stream, which must start at the beginning.
Waiting for the timestamp to pass 11 s relied on the settle helper's
10 s timeout to fail when the start was not applied.
@wmfeht
wmfeht changed the base branch from main to stack/1925 November 6, 2026 05:21
@wmfeht

wmfeht commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Review and cleanup

Stacked PR. This PR is now stacked on #1925 → #2070. Its base is stack/1925, a mirror branch in lgse/strata that contains #2070 and #1925, so the diff shows only this PR's changes. It should merge after #2070 and #1925. The head is mirrored to stack/1924, the base for #1826.

Merged stack/1925 at 7f3711ad1. Two conflicts, both additive, kept both sides:

  • src/ui/preferences/tests/preferences/loading.rs: the backward-compatibility test now drops both preview_video_start and preview_text_wrap and expects 0 and true.
  • src/ui/preferences/tests/preferences/saved_fixture.rs: the saved-previews assertion is now (true, 0.35, false, Imperial, true, 20).

Head did not compile. The previous head 8f454365 failed cargo check for the binary target (E0425). set_start_percent calls recall_media_position, but its import in src/ui/media.rs was still #[cfg(test)]. CI had not run on that head. Fixed in d16112e5f.

Review against the description and #1910

  • Setting, clamp to 99, Settings row and search target: confirmed. The row is under General → Browsing because there is no Preview page.
  • Start applied once in on_prepared, and a remembered position still takes precedence: confirmed and covered by ui::media::tests::first_video_preview_starts_at_the_configured_percent.
  • Video only, known duration only: confirmed. A test for the unknown-length guard was missing; added in 9921d3014.
  • feat(preview): configurable start position for video previews #1910 also asks for streams that can't seek to start at 0. Raw H.264/H.265 elementary streams were not handled; fixed in b1f0183d9.
  • Review comments from 10-31: Hungarian strings, the shared clamp constant and the < / > docs were already addressed. The "restart from 0:00" point was changed in behaviour by e5a1d4b6; dc18bb6d7 now limits that remembering to previews opened with a start configured.

Fixes pushed

  • d16112e5f fix(preview): import recall_media_position outside test builds: the binary target did not compile.
  • dc18bb6d7 fix(preview): remember a video at 0:00 only when a start is configured: with the default setting of 0, every previewed video and GIF was stored at 0 in the 128-entry position cache. That evicted real resume positions and stopped a video skimmed at 0 from using a start configured later. resume_where_the_preview_closed again expects None for /shortened and /ended, as on main.
  • b1f0183d9 fix(preview): start raw H.264/H.265 streams at the beginning: the helper seeks raw elementary streams by decoding up to the target, so a start late in a long stream could exceed the first-frame timeout. New services::is_raw_video_stream; docs/preferences.md updated.
  • bae56fc79 fix(preview): skip the start restart when it rounds to the first frame: a short clip at a small percent restarted the decoder at tick 0 for nothing.
  • 83ad0dc7e fix(settings): drop the unlocalized percent label from the video start row: the description already says the value is a percent.
  • 0e99a6578 docs(preferences): note the video start must be set when the preview opens.
  • 4dc075763 style(preferences): format the stored import list.

Test reliability

  • 9ce6c28f9, 17bb85302: in ui::media::tests, settle() ticked 20 times without waiting. The fake stream's Prepared and any wrong restart could arrive after the assertion, so the "starts at 0:00" cases (/restarted, /finished, audio) passed even with the behaviour removed. settle() now waits for the decoder header and for any scheduled restart to reach the loader. Mutations now fail as expected: removing the "already previewed" check fails with [0, 360], removing the unknown-duration guard fails with [0, 858993459], and restoring the old position > 0 filter fails on /blink.
  • 629c25321, b275d4300: new keyboard_dispatch::video_clips::configured_start_skips_raw_video_streams. An MP4 preview must show its first frame at 20 % as a control; then > continues into a .h264 stream, which must start at the beginning. It fails if the raw-stream check is dropped or if the start is not applied.

Tests removed

  • ui::preferences::tests::preferences::loading::video_starts_past_the_maximum_clamp_on_load_and_set: removed the in-range rows (0, 15, 99 on load; 25, 7, 0 on set) because they only echoed the input. The clamp rows remain (load 100 and 5000 → 99, set u32::MAX → 99). Coverage owners: saved_fixture::assert_saved_previews and setters::all_preference_setters_publish_and_persist_without_duplicate_notifications.

Validation

  • ./scripts/test-headless.py ui::media::: 14 tests passed
  • ./scripts/test-headless.py ui::preview::: 81 tests passed
  • ./scripts/test-headless.py services::preview::: 25 tests passed
  • ./scripts/test-headless.py ui::preferences::: 69 tests passed
  • ./scripts/test-headless.py ui::settings::: 85 tests passed
  • ./scripts/test-headless.py keyboard_dispatch::video_clips: 4 tests passed
  • ./scripts/test-headless.py i18n::: 12 tests passed (after the merge; no catalog changes since)
  • ./scripts/qa.sh video-preview-badges-next-video disabled-transport-click thumbnail-workers-spin-button-persists settings-choice-buttons-expose-value: 10 runs passed
  • ./scripts/quality.sh fmt, ./scripts/quality.sh clippy: clean on the final code
  • Not run locally: the full quality.sh test and full qa.sh suites. CI runs the full Rust suite.

Follow-ups outside this PR

  • A raw H.264/H.265 stream is recognized only by its extension. A raw stream with a misleading extension, such as .mp4, still gets the configured start.
  • A video closed before its Prepared header arrives forgets its saved resume position. This already happens on main.

CI: all checks green as of 2026-11-06 05:33 UTC (run 42167957350 on b275d4300; QA scenarios runs only on manual dispatch and was skipped).

wmfeht and others added 2 commits November 6, 2026 00:04
… sweep (lgse#2070)

* refactor(paste): share what a collision's item kinds allow

Name the rule that a file and a folder never replace one another, and
that only two folders merge, as Collision::between and Collision::allows,
and keep it on the paste collision as its kinds rather than as two loose
flags. Apply to All's split of the collisions an answer covers and the
"a file and a folder can't replace one another" explanation become
helpers, so the undo and redo replay prompt can use the same rules.
No behaviour change.

Refs lgse#2017

* fix(undo): offer no Replace where a replayed move meets the other kind

Undo and Redo of a move asked about an item already at the destination
with Replace always offered, so a file meeting a folder of the same name
(or a folder meeting a file) could be told to replace it, and the replay
then failed that item. Apply to All with Replace carried the failure to
every such item.

The presence probe now reports whether an item it finds is a folder, a
link counting as a file, as the paste's own check does. The replay
prompt applies the paste's collision rules to the moved item and the one
in its way: it hides Replace and says why, and Apply to All with Replace
leaves those items their own prompt. A replay prompt with neither
Replace nor Keep Both starts on Skip, or on Cancel when Skip is hidden.
An item whose kind cannot be read is still offered Replace.

Refs lgse#2017

* build(test-image): install libheif for real AVIF and HEIC files

ImageMagick in the pinned image had no HEIF coder library, so it wrote
PNG bytes under .avif/.heic names. libheif from the same dated snapshot
brings the built-in aom, x265 and libde265 codecs, and also enables the
glycin heif loader that GDK Pixbuf uses inside the preview sandbox.

Refs lgse#2019

* test(qa): fail AVIF and HEIC fixtures that lack an ISO BMFF brand

ImageMagick exits 0 and writes the input format when it lacks an encoder,
which let camera-formats-preview-sandbox pass on PNG bytes. The magick
fixture step now requires an ftyp box with the brand its extension names.

Refs lgse#2019

* test: drop a private main context's leftover tasks on their own thread

A GIO call started on a test's private main context keeps the context
alive from its GTask. g_task_thread_pool_thread unrefs the task after
attaching the completion idle, so the test thread can dispatch the
callback, finish and drop its context first, leaving the pool thread
with the last reference. Finalizing the context there destroyed any
spawn_local future still attached to it, and glib-rs dropped the future
on the wrong thread and aborted the whole test process.

PendingVolumeLookup::start, exercised by the adapters::volume tests, is
one such shape: its query_info_async calls run on GIO pool threads and
its timeout task outlives the lookup.

Tests now create private contexts through test_support::PrivateContext,
which destroys every source left on the context when it is dropped, on
the thread that created them. Clippy rejects glib::MainContext::new so
new tests cannot bypass it.

Refs lgse#1963

* test(qa): accept AVIF and HEIC brands anywhere in the ftyp box

Read the whole ftyp box, including a 64-bit largesize or a box running
to the end of the file, and accept the expected brand as the major or a
compatible brand, so avis sequences and mif1-major files pass. Bytes
without a leading ftyp box, such as PNG, are still rejected. The docs
now credit glycin-heif, not a GDK Pixbuf loader, with decoding.

Refs lgse#2019

* fix(columns): open the selected folder's child column on returning to Columns

Switching back to Columns rebuilt every column the browser still held,
so a child column the List or Icons selection had since left reopened
with its open-path fill and the breadcrumb on it.

The selection now drives the child: a child that is no longer selected
closes before the columns are rebuilt, and a lone selected folder opens
as the new child. An empty selection reopens no child, and the
breadcrumb ends at the active folder.

Refs lgse#2016

* fix(conflicts): start a prompt with neither Replace nor Keep Both on Cancel

A replay prompt for an item meeting the other kind offers neither, and
started on Skip, which drops the item from the undo entry. Start on
Cancel instead, the one answer that never changes the history.

Refs lgse#2017

* fix(undo): keep a replay that moves nothing in the history

Skip with Apply to All, or skipping each conflict, left nothing to move,
and the replay then discarded its undo or redo entry, although Cancel,
which also moves nothing, keeps it. Now that an item meeting the other
kind cannot be replaced, a prompt could offer Skip where it was the
only answer besides Cancel, and so drop the entry that way.

A replay whose every conflict is skipped now keeps its entry, as Cancel
does. The prompt offers Skip, and Apply to All beside it, only while an
answer can still move something: an item already accepted, or a later
conflict that Replace can resolve. Otherwise it offers Cancel alone.
A partial replay still drops only the records it skipped.

Refs lgse#2017

* fix(list): start a grouped first visit on the first row shown

A first visit by typed path, sidebar or any route that asks for the
automatic cursor picked the first entry in name order. In a grouped List
that row can sit in a later group, so the cursor landed on the visually
last file or scrolled a large folder to its middle. A double-click left
the cursor to the view and was right.

The browser now knows when its listings show file-type groups, and the
automatic pick takes the first entry of the first visible group. The
group order and the per-folder grouping rules (Recent, unsettled camera
folders) move into the app so the GTK sorter and the pick share them.

Refs lgse#2016

* fix(list): keep a grouped first visit at the top of the list

A grouped List publishes a large folder's rows in name order, so a
group that sorts first arrives above the row GTK focused when the first
rows came in. A pointer first visit has no cursor to hold on to, so
focus followed that row into the middle of the list. Once the listing
is complete, such a pane now focuses the first row shown.

Scrolling a grouped List to its first row also shows the heading above
it, so the automatic cursor leaves the view at the very top.

Refs lgse#2016

* test(qa): cover the first-visit cursor of a grouped List

Opens a grouped List by typed path and by double-click on a listing
large enough to publish in chunks, and checks the first row shown takes
the cursor, then that a revisit restores the remembered one. The
grouped-first-row mutation reverts the automatic pick to name order.

Refs lgse#2016

* test: sweep a private main context until no source is left

Dropping a leftover source's future can attach another source, which a
single pass missed. Repeat from the last probed id until a pass destroys
nothing, and cover it with a task attached during the sweep while
another reference keeps the context alive.

Also disallow glib::MainContext::with_flags, word the Clippy reason for
production code too, and document that Default::default() escapes the
path check and that sources attached after the drop are leaked on
purpose.

Refs lgse#1963

* fix(columns): respect pending navigations and mirroring when returning to Columns

Following the selection on the switch back to Columns closed and opened
columns, which bumps the navigation generation, so a navigation still
validating (a remote folder opened in List) was dropped. The step now
changes nothing while a navigation is pending.

A selection made in List or Icons is not an activation, and with
"Mirror columns selection" off Columns never opens a child from a
selection, so the selected folder opens only while mirroring is on.
Closing a child the selection no longer holds stays unconditional.

Rename the step to follow_selection_on_return, extend its unit cases
(load cursor on a folder, several items without the open child, a held
validation), add mirroring-off runs to the QA scenario and rate it.

Refs lgse#2016

* docs(columns): describe the child column after returning to Columns

Refs lgse#2016

* fix(list): refocus the first row only on an untouched first visit

Focusing a pane without a cursor scrolled every List and Icons pane to
its first row, and the load-finish refocus also ran after reloads and
Back or Forward visits whose saved position a scroll had abandoned.

Focus without a cursor returns to GTK's own row again. Only a first
visit with no saved position, through to its load finishing with no
pointer, scroll, touch or key input in the pane, moves focus to the
first row shown, and only in a grouped pane with no cursor. A reload
drops the watch.

Refs lgse#2016

* fix(navigation): pick a grouped first row without needless type lookups

The automatic pick read every entry's type on the main thread, missing
the bounded type cache on large folders. A type sort already lists the
entries in group order, and under any other sort the first visible
folder leads, so only a folder-free listing not sorted by type needs
the lookups.

A grouped listing arriving in batches now picks its first row once it
is complete instead of from the first batch, and a step without a
cursor starts on the first row shown rather than the first by name.

Refs lgse#2016

* test(qa): check a large grouped first visit stays at the top

Adds a typed first visit to a grouped folder large enough to publish in
chunks, and checks both large visits keep the first row and its heading
in view. Drops the grouped-first-row mutation: the behaviour is not a
critical workflow, and unit tests pin the pick.

Refs lgse#2016

* fix(search): search only the mounts the Devices sidebar shows

Ctrl+K global search added every /dev-backed mount from the raw mount
table to the volume monitor's mounts, so it walked system subvolume
mounts such as /var/cache/pacman/pkg that Devices hides. Search roots
are now Home plus the native roots of the volumes and volume-less mounts
that Devices lists, taken from the same volume-monitor enumeration, which
the sidebar now shares. The roots are still computed on each Ctrl+K, so
mount and unmount changes apply the next time search opens.

Closes lgse#533
Refs lgse#2016

* test(qa): drop the heading geometry checks from the grouped first visit

AGENTS.md rules out layout assertions. The visible check on the first
row still shows each large first visit stayed at the top; the heading
reveal was verified by hand.

Refs lgse#2016

* test(preview): sample smooth scrolling only after the layout settles

The smooth-scrolling test sampled hit testing after fixed 20 ms
wall-clock waits. On a loaded machine GTK can paint newly mapped rows at
their estimated one-line text height before validating their layout,
then grow them a frame later, which re-anchors the list and moves later
rows down. A sample taken in that window and one taken after it read
different, but each correct, layouts, so the order check failed
depending on timing.

Wait on painted frames instead: sample after the mapped rows, their
materialization and the scroll adjustment are unchanged across two
painted frames with no ready main-context work, and drive momentum by
frame count. Hit testing itself already matches GTK's own pick.

Refs lgse#1970

* test(search): cover the volume-monitor root selection directly

Split the Devices mount selection for global search into plain-data
MountRoot and MountListing facts and a pure local_device_roots, so a
table-driven test covers volume mounts, own-row mounts, shadowed and
volume-listed mounts, pathless roots and non-native GVfs roots. A root
now counts only when it is native and has a path, as location_for_file
reads it. The sidebar shares the own-row predicate.

Drop the test-only early return from device_mount_roots; global search
is instead checked against a mount table holding fixture mounts the
volume monitor never lists, which fails if a raw mount-table step
returns.

Refs lgse#533

* fix(list): tie the first-visit watch to its navigation and depth

A parent column's load finishing, such as a monitor relist, used up the
child pane's first-visit watch, so the child's own load skipped its
refocus. The watch now records its depth and only that depth's load
ends it.

Rebuilds for relocations, truncations and mode switches also armed a
watch whenever the folder was still loading, though they are not first
visits. Only the rebuild for a navigation's new column arms one now.

The watch and the restore's input cancel share one user-input
predicate, and a unit test pins that input during the visit keeps its
load from refocusing.

Refs lgse#2016

* fix(navigation): start Up and Shift+arrow without a cursor at the end shown

Up with no cursor took the last entry by name, and Shift+arrow with no
cursor started from the first or last by name. In a grouped List they
now start from the last or first row shown, as Down already does.

Refs lgse#2016

* refactor(test): share the frame paint wait between test helpers

present_window and the virtual preview scrolling test each requested a
frame and ran the main context until it painted, with the same
ten-second timeout. Move that wait into test_support::wait_for_paint
and use it from both; present_window keeps its assertion and messages.

Refs lgse#1970

* test(preview): settle the scrolling test on two equal painted frames

Settling also waited for an empty main context after each paint, but
GTK always queues fresh work after a paint, so nearly every step paid
for a third frame although its rows had stopped moving after the
second. Every frame already runs all ready work before it paints, so
two equal painted frames are settled. This keeps every hit-test sample
and cuts the test from about 40 s to 30 s; update its CI weight.

Refs lgse#1970

* docs: describe the grouped fallback cursor and list the image's libheif separately

* style(tests): fold the PrivateContext import into the probe tests' crate block

* test(qa): refresh the context-menu baseline for the creation rows and sort button

* fix(columns): keep the child column while its parent reloads

A reload empties the column until its selection is restored, so returning
to Columns during one read an empty selection and closed a child that was
still selected.

* style: drop comments that restate the names beside them

* refactor: restore the code health of the files this change touches

Name the load's cursor predicates, extract the range origin and the focus
target, split the first-row table from its test, and move the ISO BMFF check
and the returning-to-Columns tests into their own modules. No behavior
changes.

---------

Co-authored-by: Pierre Berube <[email protected]>
wmfeht added a commit to FelipeJz/strata that referenced this pull request Nov 6, 2026
Resolve conflicts with the stacked PRs (lgse#2070, lgse#1925, lgse#1924, lgse#1826,
lgse#1802) and re-home the bookmark changes in the files they split:

- keys/conflicts.rs: keep the split step_digits/fixed_top_level_key and
  give the bookmark groups no digit range;
- keys/label.rs: keep both the two-key Digits `then` and the Letters
  range;
- keys/tests.rs: take the split modules and move the Letters cases of
  catalog_bindings_use_the_canonical_key and
  every_listed_binding_has_its_own_row_in_its_maps into tests/catalog.rs;
- shortcut_footer.rs: take the split modules and move the chord panel
  refill (show while rows exist, so the ' menu appears once the saved
  letters load) into shortcut_footer/indicators.rs;
- tenxer_mode.rs: add the bookmark marks and options next to
  FolderAction;
- window/keyboard.rs: take the split key routing, keep the pending
  bookmark cancel before the tab-shortcut check, and move the focus and
  mode-exit cancels into keyboard/footer_bindings.rs;
- keymap.md: list the bookmark chords alongside `; .`;
- keyboard_dispatch.rs: declare both letter_bookmarks and list_motion.
@wmfeht

wmfeht commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Merged the #2070 update (6da9d77) in through the stack at 19c5734. No fixes were needed. CI green.

@l0gicgate

Copy link
Copy Markdown
Contributor

Review and cleanup

Merged main at 35ee677ab (d18b14094). #2070 was squash-merged with a tree identical to its final head, already on this branch, so I merged with that squash commit as the base; a plain merge would have conflicted across the whole stack. The only real delta is #2072 (src/services/file_source.rs and its tests). Until stack/1925 also takes main, those two files appear in this PR's diff against its base.

Review against the description and #1910

  • Setting, clamp to 99, Settings row and search target: confirmed.
  • Start applied once, and a remembered position wins: confirmed.
  • Video of known duration only; audio, GIF and raw H.264/H.265 start at 0:00: confirmed. The description's list omits raw streams; docs/preferences.md has it.
  • Earlier feedback: the 10-31 review points (Hungarian strings, shared clamp, restart from 0:00, < / > docs) and the 11-06 review fixes all hold in the current code. There are no inline review threads. The double session on each first-time video is unchanged, and matches the feat(preview): recover playback stalls and resume per-file position #1326 resume path.

No behavioural blockers found.

Fixes pushed (code health only, no behaviour change)

  • 46f849344 refactor(settings): move the video preview options into a submodule: the new row pushed general.rs past CodeScene's file size limit (8.09 → 7.59). They now live in settings/general/video_preview.rs, and append_search_options is split out. general.rs now scores 8.5.
  • 9adde58aa test(preview): split the configured start test into shorter helpers: the 85-line body lowered media/tests.rs from 8.44 to 8.05; it is back to 8.44. Same cases and assertions.
  • 2d0a6c777 style(preferences): drop the comment labelling the video start getter.

Tests and comments audit. No tests removed: the PR's remaining tests each cover distinct behaviour. The other added comments explain a rule or a reason the code doesn't show, so they stay.

Manual check in the pinned QA container (qa-drive.sh), real decode, 60 s clips, setting at 20:

  • First open, paused: frame burned-in timestamp 00:00:12.000, transport 0:12 / 1:00.
  • Reopen after playing: resumes at 0:16, not 0:12.
  • Seek to the start, close, reopen: 0:00.
  • gamma.h264 and song.ogg: 0:00.
  • Stepping with the previous-video shortcut into an unopened clip: 0:12.
  • Settings: found by the keyword search skip intro; ± steps by 5; typing saves; setting 0 applies to the next video.
  • Typing 500 is rejected by the stepper and the saved value stays valid.

Validation

  • ./scripts/test-headless.py -- ui::media:: ui::preview:: services::preview:: services::file_source ui::preferences:: ui::settings:: keyboard_dispatch::video_clips i18n::: 303 passed before the fixes.
  • ./scripts/test-headless.py -- ui::media:: ui::settings:: keyboard_dispatch::video_clips: 103 passed after the first two fixes.
  • ./scripts/test-headless.py -- ui::settings:: ui::media::tests::first_video: 86 passed on the final code, before a rustfmt-only amend.
  • ./scripts/qa.sh --test-threads 6 video-preview-badges-next-video disabled-transport-click thumbnail-workers-spin-button-persists settings-choice-buttons-expose-value: 10 runs passed.
  • ./scripts/quality.sh fmt, ./scripts/quality.sh clippy: clean on the final code.
  • Not run locally: full quality.sh test and full qa.sh, because the impact is bounded. CI runs the full Rust suite; QA scenarios is dispatch-only and was skipped.

Follow-ups outside this PR

  • Silent videos snap back on Play. Pausing a video with no audio track and pressing Play jumps to where the decoder session started: 0:14 → 0:12 with the setting at 20, 0:03 → 0:00 with it at 0. A clip with audio keeps its position. sink_position only advances clock_base for audio, so play() restarts the wall clock from the old base. This PR doesn't touch that code, and I reproduced it on this branch only, not on a main build. The setting does make it more visible, because the jump lands on the configured start.
  • Flaky merge test. merge_never_overwrites_an_entry_created_during_the_merge failed once in shard 0 on this head, reporting photos/makefile where it expects photos (1)/makefile. src/adapters is identical to main, and it passed 41/41 alone and 12/12 with its module locally, then on the CI rerun. Root cause not established.
  • feat(actions): run 10xer custom actions on the focused folder with ; . #1826 is stranded on stack/1924. It was merged into that mirror (0e1f5e659), which this PR's head does not contain, so landing this PR will not bring feat(actions): run 10xer custom actions on the focused folder with ; . #1826 to main.

CI: all 11 checks green on 46f849344 (run 42319392865, after one full rerun for the flake above). QA scenarios is skipped on PRs.

@l0gicgate
l0gicgate merged commit 03d6b64 into lgse:stack/1925 Nov 7, 2026
18 of 20 checks passed
@Bluesboy
Bluesboy deleted the feat/1910-video-preview-start-position branch November 9, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(preview): configurable start position for video previews

4 participants