Open
Conversation
64e2ee3 to
e2454b1
Compare
Rename PreviewControls to PlayerPreviewControls and swap material icons for ui-kit SVG icons. Move arrow-key seeking from global keydown to the DurationBar input so it only activates when the slider is focused, and add a focus-visible outline for accessibility. Simplify VolumeBar styling by removing unused btn-mute overrides.
These labels are used by the new preview actions dropdown menu across English, French and Dutch.
Reorganize all viewer components under a viewers/ directory and rewrite FilesPreview as the single orchestrator at the preview root. Add ZoomControls shared component for image and PDF viewers. The new layout centralizes the preview chrome (header, controls bar, navigation) in FilesPreview while each viewer only handles its own rendering.
Cover the download/print actions dropdown, keyboard navigation between files, and the close button in the new preview chrome.
The preview refactor renamed CSS classes from pdf-preview__controls / pdf-preview__zoom-controls to file-preview__controls / file-preview__controls__zoom. Update the e2e tests to match.
The preview for files that cannot be rendered inline now shows the
filename as the title and folds the "unsupported format" notice into
the description paragraph as a bold disclaimer, so the panel reads as
"<filename> — Unsupported format. Download it to view." The download
CTA is promoted to a secondary neutral button to stand out on the
empty-state panel.
The i18n key file_preview.unsupported.title is renamed to disclaimer
in en/fr/nl and the copy shortened accordingly. search.spec.ts
assertions are updated to match the filename via getByRole("heading")
now that the preview wraps the title in a heading element.
The predicate in the preview close branch was (className) => className !== className, which compared the lambda parameter to itself and therefore never matched, leaving stale class names on the preview when the PDF thumbnail sidebar was closed. Rename the inner parameter so the filter compares against the outer className as intended.
The preview-related specs are now numerous enough to warrant their
own subfolder. Move pdf, heic and preview-actions specs into
__tests__/app-drive/file-preview/ so future preview tests land next
to them rather than at the drive-level root. Import and asset paths
are adjusted to the new depth, the heic row lookup is simplified to
getByRole("cell", ...), and the preview-actions spec gains a small
File Preview Header describe block to exercise the header controls.
Cover the audio viewer with a dedicated spec that uploads a small mp3 fixture, opens the preview and checks the playback controls. Ensures the audio branch of the preview rewrite stays covered as we iterate on the other viewers.
Cover the image viewer with a dedicated spec that uploads a small png fixture, opens the preview and asserts the image renders and reacts to the viewer controls. Mirrors the audio/video specs so each viewer has its own file.
Cover the video viewer with a dedicated spec that uploads a small mp4 fixture, opens the preview and exercises the player controls. Keeps the new viewer types consistently covered alongside the audio and image specs.
Cover the fallback viewer that kicks in for file types the app cannot render inline. A minimal .bin fixture exercises the redesign so the filename, the "Unsupported format." disclaimer and the secondary download button are all checked end to end.
10887fe to
341850c
Compare
Add entry about the file preview v2 iteration.
Contributor
Comment on lines
+122
to
+125
| const handlePrint = () => { | ||
| if (!currentFile) return; | ||
| window.open(currentFile.url_preview, "_blank"); | ||
| }; |
Contributor
There was a problem hiding this comment.
I'm not sure I understand why "handle Print" opens a new tab; it's hard for the user to understand.
Contributor
Author
There was a problem hiding this comment.
what do you suggest instead?
Comment on lines
+227
to
+235
| useEffect(() => { | ||
| if (openedFileId) { | ||
| const index = data.findIndex((file) => file.id === openedFileId); | ||
| const newIndex = index > -1 ? index : -1; | ||
| setCurrentIndex(newIndex); | ||
| } else { | ||
| setCurrentIndex(-1); | ||
| } | ||
| }, [openedFileId]); |
Contributor
There was a problem hiding this comment.
And if data change ?
Comment on lines
+309
to
+311
| <div className="file-preview__title"> | ||
| <FileIcon file={currentFile} type="mini" size="small" /> | ||
| <h1 className="file-preview__title"> |
Contributor
There was a problem hiding this comment.
twice the same class: file-preview__title. weird right?
| interface PdfControlsProps { | ||
| numPages: number; | ||
| pageInputValue: string; | ||
| isSidebarOpen: boolean; |
Comment on lines
+34
to
+36
| const moreButton = filePreview.locator( | ||
| ".file-preview__header__content__right button:has(.material-icons)", | ||
| ); |
Contributor
Author
The component lives in DurationBar.tsx but was exported as ProgressBar, which was confusing. Rename the export and update the two call sites in AudioPlayer and VideoPlayer.
The effect that toggles the pdf-sidebar class scheduled a setTimeout without returning a cleanup, so the timer could fire after the file preview unmounted. Capture the timeout id and clear it on cleanup.
Add the en/fr/nl entries needed by the upcoming WOPI "open in editor" placeholder and the image viewer loading label.
The loading spinner label was hardcoded in French. Use the translated file_preview.image.loading key so other locales render correctly.
WOPI editors (OnlyOffice / Collabora) work better as a full-page experience than embedded inside the preview modal. Double-clicking a WOPI file in the grid or activating one from the search modal now opens /wopi/:id in a new tab. The preview modal still shows an "Open in editor" placeholder when a user navigates onto a WOPI file via keyboard, so the preview flow stays consistent. The former WopiEditor component is renamed WopiEditorFrame and hosted on the new page. The inline rename-sync path is removed because the editor no longer lives inside the items list.
Follow the WOPI-in-new-tab change: the double-click scenario now asserts that a new page opens with the office iframe and that the preview modal stays closed, a new test covers the "Open in editor" placeholder reached by keyboard navigating onto a WOPI file, and the copy/paste scenario drives the detached wopiPage. Refresh canvas snapshots accordingly and drop the obsolete per-spec snapshot copies.
|
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.








Main UI changes
Behavior
Refactor
Tests
Added more tests for existing media that were not tested yet. ( smoke testing )