Skip to content

Step the preview with ↑ and ↓, like Quick Look on macOS - #174

Merged
dhh merged 6 commits into
mainfrom
preview-up-down-rows
Nov 18, 2026
Merged

dhh merged 6 commits into
mainfrom
preview-up-down-rows

Conversation

@dhh

@dhh dhh commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

In the preview, ↑ and ↓ only scrolled, so on a picture, a video or a folder they did nothing, and in the list and column views, where files sit one above the other, there was no way to step to the next one with the keys that move through them in the folder.

Now ↑ and ↓ still scroll what's taller than the window (a long text, a zoomed picture, a PDF), and anything that fits moves to the item above or below as the folder view lays them out: the row above or below in the list and columns, the tile above or below in the grid. The preview asks Folio with a "step -1" or "step 1" line, since only the window knows its layout; Folio moves its selection and sends the new item back as it already does. A preview running on its own falls back to the previous and next file.

Arrows pressed before Folio has answered a step (within milliseconds, or a second at most if it never does) are let go, so ↓ then → in a grid no longer undoes the ↓, and the next arrow is judged from the file the step reached. While a text is still being read, ↑ and ↓ do nothing, so a long file on a slow mount isn't stepped past before its length is known. The preview's shortcuts sheet lists ↑ and ↓ beside ← and → for the previous and next file.

Based on #21 by @kevinpardo, rebased onto today's main (the shortcuts sheet is now in groups) with his two commits as they were.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

The PR lets ↑ and ↓ move through previewed files using the folder’s layout, while keeping scrolling for longer content.

  • Up and Down scroll tall previews and step through folder items.

The numbered finding about skipping unknown text is fixed. No new actionable issues were found.

Reviews (6) · Last reviewed commit: "Step past a one-page PDF with ↑ and ↓" · Reviewed by Greptile

Comment thread src/previewer.cpp Resolved
Comment thread src/previewer.cpp Resolved
@dhh
dhh force-pushed the preview-up-down-rows branch from 9ce57c1 to b1b60f2 Compare November 18, 2026 15:42
Comment thread src/FolderPane.qml Resolved
kevinpardo and others added 4 commits November 18, 2026 17:16
In the preview, ↑ and ↓ only scrolled, so on a picture, a video or a
folder they did nothing, and in the list and column views, where files sit
one above the other, there was no way to step to the next one with the
keys that move through them in the folder.

Now ↑ and ↓ still scroll what's taller than the window (a long text, a
zoomed picture, a PDF), and anything that fits moves to the item above or
below as the folder view lays them out: the row above or below in the list
and columns, the tile above or below in the grid. The preview asks Folio
with a "step -1" or "step 1" line, since only the window knows its layout;
Folio moves its selection and sends the new item back as it already does.
A preview running on its own falls back to the previous and next file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xt loads

After ↑ or ↓ the preview asked Folio for the row above or below, but an arrow
pressed before the answer was taken from the old item: ↓ then → in a grid
undid the ↓. Folio now sends the new item at once and then "stepped", and the
preview keeps the arrows that came meanwhile until it does (a second at most,
if no answer comes).

A text still being read looked short, so ↑ and ↓ stepped past a long file on
a slow mount. They do nothing until the text is in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arrows pressed while the preview waited for Folio to step a row were
queued and replayed once it had. Replayed, they were taken from a file
nobody had looked at yet: a second ↓ queued on a picture stepped past
the long text or PDF the first ↓ reached instead of scrolling it, or
before its text was read; and a → queued behind a ↓ onto an opened
folder's first child was played against a list of one, and lost.

Folio answers a step within milliseconds, sooner than a held key
repeats, so the arrows pressed in between are now simply let go, and
the next one is judged from the file the step reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The preview reported each file it stepped to, and the list's cursor
followed only a file directly in the folder shown. Previewing a file in a
folder opened in the tree and stepping with → left the cursor behind, so
↓ then stepped from the old row, backward. A file anywhere under the
folder shown now moves the cursor to its row. The preview's lines are
read by Backend::previewSaid, which the test drives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh force-pushed the preview-up-down-rows branch from 755bafa to 86c66c8 Compare November 18, 2026 16:17
Comment thread src/PreviewWindow.qml Resolved
Comment thread src/previewer.cpp Resolved
dhh and others added 2 commits November 18, 2026 17:31
A file whose name gives no type is read off the UI thread to learn what
it holds, and it may turn out to be a long text. While that read ran,
readingText stayed off, so on a slow mount ↑ or ↓ could step past it as
if it fit, before its text had appeared.

The guard now stays on while such a file's type and possible text are
read, as it does for a text whose name says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PDF preview has no contentHeight, so the window always took it for
something to scroll: ↑ and ↓ turned its pages, and on a PDF of a single
page they went nowhere, never on to the item above or below.

The PDF preview now says whether it scrolls, which it does with more
than one page, and the window asks a view that says so before falling
back on its content's height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh merged commit 480a319 into main Nov 18, 2026
2 checks passed
@dhh
dhh deleted the preview-up-down-rows branch November 18, 2026 16:43
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.

2 participants