Repository navigation
refactor(preview): share media UI - #1764
Merged
l0gicgate merged 6 commits intoOct 20, 2026
Merged
Conversation
Contributor
ReviewMerged Checked
Non-blocking notes
Review commit: Local verification (tests limited to the affected preview code; CI runs the full suites)
CI: Metadata policy passes. The main CI run for this fork PR is waiting for maintainer approval and has not started. |
Contributor
|
@adamcbrewer I am removing the loading cards on the models. They flash in/out too quickly for small models and it's not necessary imo. The loading spinner in the header is sufficient. |
Contributor
Author
|
I debated this myself. No worries |
Remove the centred progress card over the mesh image. The header spinner beside the open button is again the only loading indicator for the first load and for view changes, with the stage carried by its accessible label. Drop the orphaned "Waiting for preview…" catalog string.
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Audio, video and model previews repeat their headers, navigation buttons and badge construction. I've pulled those common pieces into shared components so we can change them in one place and keep the previews consistent.
The shared UI now lives in two files under
src/ui/preview:components.rscontains the details header, previous/next button builder, navigation row, badge row and badge label builders. It also holds the common spacing and minimum panel width values.player_layout.rscontains the video/model layout, moved out ofvideo/layout.rs. Each preview supplies its content, details and controls, with optional badges and timeline sections. The model badges now have their own named area instead of occupying a slot calledtimeline.Their common appearance is defined in
src/style.css, using neutral classes such aspreview-details-titleandpreview-details-badge.Audio uses the shared header and navigation, while keeping its larger title, artwork, spectrum and responsive layout. Video and models also use the shared badges and player layout. Each preview supplies its centre widget: a playback button for audio/video, or the camera indicator for models.
The waveform and volume controls were already shared. Playback, seeking, metadata loading and camera animation stay in their existing preview implementations. The loaded previews keep their existing appearance, with one implementation to edit when we change a common header, navigation button or badge.
Mesh previews now also show their filename, listing position and file format during the first load, with the triangle count appearing as soon as parsing provides it. Camera controls become active once the first image is ready. When changing angles, the current mesh dims and the spinner in the preview header shows progress until the next view is ready. Failed angle changes keep the previous image and allow a retry. Next rotates the camera clockwise around the model; Previous rotates it anticlockwise. The dot follows the rendered view.
Starts from upstream
mainate0f73973, after #1644 was confirmed merged.Visual evidence
N/A. The loaded previews retain their existing typography, theme styling and narrow, wide and tall arrangements. Mesh loading shows the available file details with the loading spinner in the preview header.
How to test
Expected result: Loaded previews keep their existing appearance and behaviour. Mesh previews show useful details from the start and the header spinner while generating an image or changing angle.
Related issue
Closes #1659