Skip to content

Previews: archive names, font sheets, media length - #63

Open
thisisgm wants to merge 3 commits into
omacom:mainfrom
thisisgm:previews
Open

thisisgm wants to merge 3 commits into
omacom:mainfrom
thisisgm:previews

Conversation

@thisisgm

@thisisgm thisisgm commented Nov 11, 2026 •

Copy link
Copy Markdown

Three kinds of file that showed only an icon now show what is in them, one commit each with its own tests: an archive lists the names inside it, a font draws a sample sheet, and a video or a song shows its length and codecs. The suite goes from 196 to 211 tests. No library or depends entry is added: archives are read by bsdtar, which Folio already runs to extract and compress, and lengths by ffprobe when it is installed.

What you'd notice

  • An archive lists what is inside. Selecting a zip, a tarball or any archive bsdtar reads shows its names in the details pane, and Space shows the whole list, which keeps its scroll position while names are still arriving. bsdtar reads them off the UI thread, they show as they arrive, the count comes with them, and the read is stopped when the selection moves on, together with any program bsdtar started to unpack with. An encrypted listing, an archive that cannot be read, one that gives no name within five seconds and a missing bsdtar each say so in a sentence. A plugin's own item is no file on the disk, so no program is asked about it.
  • A font shows a sample sheet. Space on a TrueType, OpenType, collection, WOFF or Type 1 font draws its family and style, the alphabet, the digits and a line of text at five sizes, in the font itself, and the details pane shows a short sample. Only glyphs the font has are drawn: a font with the alphabet but no digits shows its letters, never digits from another font. The font is read off the UI thread and each sample is drawn from its own file: it is never added to the application's fonts, so two windows on two files of one family each show their own, and no other text in Folio changes while a font is shown. A font stepped past before its turn comes is never opened, and one written over in place is read again. It is opened without waiting and read only as far as its size, so a pipe or a device named like a font holds nothing up. A .otf file is named "OpenType font", where its extension alone had it named as an OpenDocument template.
  • A video or a song shows its length and codecs. The details pane adds Length, Video and Audio rows, and a video's dimensions, read by ffprobe for the one item shown. Without ffprobe a sentence names the package that holds it (ffmpeg). A file written over with something ffprobe cannot read loses the length and codecs it showed.

Screenshots

The details pane for an archive, a font, a video and a song: main above, this branch below.

The details pane before and after

Space on an archive, main on the left and this branch on the right.

An archive in the preview window before and after

Space on a font.

A font in the preview window before and after

Tests

Fifteen new cases, each failing without its commit: an archive's names are read as they arrive and counted, and very long ones are cut off by size; they are listed off the UI thread; the preview window keeps its place while more names arrive and starts the next file at its top; a read for what is no longer shown is stopped with what it started, a plugin's item asks no program, and an archive that gives no name in its time is said to have taken too long; of what a program complains of, only the start is kept, however much it prints; every font type opens as a sample sheet and a .otf is shown and named as a font; a font is kept by its sample and never added to the application's fonts; only the glyphs a font has are drawn, digits included, and a pipe named like a font is not waited on; two samples shown at once of two files with one family name each draw their own file, with lines broken at the width; a sample is drawn as a picture on the thread that holds its font, and painting only copies that picture; a font written over in place is read again; a font no longer shown is never opened, and a path and a time set together cost one read; the facts ffprobe prints are read into rows; ffprobe is asked about the item shown, and a second answer with nothing in it clears the first; and a length reads as a clock. Every commit builds and passes the suite on its own, also with TMPDIR set to a folder whose name has a space, where only extractRefusesWhatWouldLandOutside fails, as it does on main.

Limits

  • A listing is cut off at 32 MB of names and shows the first 500 of them, or the first 128 KB when they are long, with the rest counted. What ffprobe prints is cut off at 1 MB.
  • ffprobe would be an optional dependency (ffmpeg). The package recipe no longer lives in this repository, so that line is not part of this pull request.

@greptile-apps

greptile-apps Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was found.

Summary

Adds archive listings, private font samples, and media facts to previews.

  • Archive previews show the names inside each archive.
  • Font files open as sample sheets drawn in their own typeface.
  • Video and audio details show their length and available codecs.

The earlier findings are addressed in the supplied code. No new actionable issue was found. Tests were inspected, not run.

Reviews (10) · Last reviewed commit: "Show a video's or a song's length and co..." · Reviewed by Greptile

Comment thread src/fontsample.cpp Resolved
Comment thread src/fontsample.cpp Resolved
Comment thread src/PreviewPane.qml Resolved
Comment thread src/backend.cpp Resolved
Comment thread src/previewer.cpp Resolved
Comment thread src/fontsample.cpp Resolved
Comment thread src/previewer.cpp Resolved
@thisisgm
thisisgm force-pushed the previews branch 2 times, most recently from ba4808f to f1b0a2b Compare November 11, 2026 20:49
Comment thread src/previewer.cpp Resolved
Comment thread src/fontsample.cpp Resolved
An archive showed only its icon. Selecting one now lists the names
inside it, in the details pane and in the preview window. bsdtar reads
them off the UI thread, they show as they arrive, and the read stops
when the selection moves on.
A font file showed only its icon. The preview window now draws its
family, style, alphabet and a line of text at five sizes in the font
itself, and the details pane a short sample. Each sample is drawn
from its own file and never added to Folio's fonts, so two windows
on two files of one family each show their own, and a .otf file is
named as a font, not as the OpenDocument template its extension
alone would mean.
The details pane gave a video or a sound file only its size and date.
It now adds Length, Video and Audio rows, and a video's dimensions,
read by ffprobe for the item shown. Without ffprobe it names the
package that holds it.
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.

1 participant