Skip to content

Preview PDFs, 3D models and songs in Files, and find pasted paths in search - #151

Open
Xpond wants to merge 2 commits into
mainfrom
pdf-and-3d-previews
Open

Xpond wants to merge 2 commits into
mainfrom
pdf-and-3d-previews

Conversation

@Xpond

@Xpond Xpond commented Dec 6, 2026 •

Copy link
Copy Markdown
Owner

What

  • PDF preview: every page in a scrolling column, each rendered by pdftoppm only as it scrolls into view. Shift+↑/↓, PageUp/PageDown, Home/End scroll. No new dependency: poppler arrives with cups.
  • 3D model preview (glb, gltf, obj, stl, ply, fbx): Qt Quick 3D RuntimeLoader, framed about the model's centre. Drag or Shift+arrows turn it, the wheel zooms.
    • qt6-quick3d and assimp stay optional. Without them, "no preview" gets a second line naming what to install. A corrupt model shows only "no preview".
    • FilesModel.qml is loaded untyped, so a shell without Qt Quick 3D loses only this preview.
  • Audio preview (mp3, flac, wav, ogg, opus, m4a, aac): cover, title and artist over a waveform drawn by ffmpeg, filling in as it plays. Space plays and pauses, a click on the waveform seeks. It never starts on its own.
  • Pasted paths in search: the / scan stops six folders under home, so a deeper pasted path matched nothing. A pasted absolute path that exists (checked with stat) now leads the results. One that doesn't exist adds nothing.

Checked

  • tests/all.sh: all 30 suites pass. New tests cover isPdf and pastedPath.
  • Offscreen: the audio preview shows Clean Reveal's cover, tags and waveform, plays, and the waveform fills in.
  • Offscreen: PDF pages render, stack and scroll. A damaged PDF (0 pages) reports failure.
  • In a Wayland window: the Khronos duck and five game models import and render, turn() rotates. A corrupt .glb gives "IO Error", so no install hint. Without assimp the error is "Unsupported", so the hint shows.
  • By hand in the live shell: PDF and 3D previews, Shift+arrow turning, pasting a deep path into search.

Xpond added 2 commits December 6, 2026 13:39
- PDF: every page in a column, each drawn by pdftoppm (poppler, already
  installed through cups) as it scrolls into view. Shift+Up/Down, PageUp/Down
  and Home/End scroll. A damaged PDF with no readable pages shows no preview.
- 3D models (glb, gltf, obj, stl, ply, fbx): Qt Quick 3D's RuntimeLoader,
  scaled about the model's centre. Drag or Shift+arrows turn it, the wheel
  zooms. qt6-quick3d and assimp stay optional: without them the preview says
  which to install, under "no preview". Loaded untyped, so a shell without
  Qt Quick 3D loses only this preview.
- Search: the scan stops six folders under home, so a pasted path deeper than
  that found nothing. A pasted absolute path that exists now leads the
  results, checked with stat; one that does not exist adds nothing.
mp3, flac, wav, ogg, opus, m4a and aac show their cover, title and artist
over their waveform, which fills in as they play. ffmpeg draws the cover and
the waveform (in the theme's accent, square-root scaled so a loud master
keeps its shape) as PNG data URLs. Space plays and pauses, as for video, and
a click on the waveform seeks. A song never starts on its own, so stepping
through a folder of music stays quiet.
@Xpond Xpond changed the title Preview PDFs and 3D models in Files, and find pasted paths in search Preview PDFs, 3D models and songs in Files, and find pasted paths in search Dec 6, 2026
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