Office Overview Part 4/5 - All / Mine / Shared filter chips#5686
Draft
moodyjmz wants to merge 44 commits into
Draft
Office Overview Part 4/5 - All / Mine / Shared filter chips#5686moodyjmz wants to merge 44 commits into
moodyjmz wants to merge 44 commits into
Conversation
Adds the office overview page to the application bar, and the appropriate route, controller, and template Signed-off-by: Elizabeth Danzberger <[email protected]>
Adds the OfficeOverview Vue component and renders it Signed-off-by: Elizabeth Danzberger <[email protected]>
These template response parameters are used to determine where the app navigation and content are, so that keyboard users can jump to them easily Signed-off-by: Elizabeth Danzberger <[email protected]>
The OfficeOverview Vue component needs to be rendered directly to `#content` else it results in a weird double-margin visual bug. It causes some styles to be applied twice. This is also consistent with other apps. Signed-off-by: Elizabeth Danzberger <[email protected]>
We had imported material design icons for the office file type icons in the navigation bar, but it might be best to re-use the icons we are using in the rest of the richdocuments app now for consistency. Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
Adds some basic Cypress and PHP unit tests to have some tests in place already Signed-off-by: Elizabeth Danzberger <[email protected]>
Fetch files via WebDAV and cache them, and using the entries in the navigation bar to filter them. Unfortunately we cannot use the files entry grid from the Files app, so we have to use a somewhat custom Vue component. Signed-off-by: Elizabeth Danzberger <[email protected]>
Previously, fileid was used, but I learned that it is deprecated and snowflake IDs (node.id) should be used instead Signed-off-by: Elizabeth Danzberger <[email protected]>
In order for the viewer to be initiated and usable for opening documents, we need to dispatch this event. Previously, `LoadAdditionalScripts` was used, but it actually does not do what is necessary. It is unrelated. Signed-off-by: Elizabeth Danzberger <[email protected]>
Switch to using the event dispatcher instead of the service locator pattern. This also fixes a PHP Unit test Signed-off-by: Elizabeth Danzberger <[email protected]>
Turns out CI does not load the viewer app, and even stubs won't work; it keeps throwing errors. So, we don't check that the event is dispatched now. We can test this in other ways, naturally, via E2E tests Signed-off-by: Elizabeth Danzberger <[email protected]>
Seemed like a lot of extra steps to get the viewer loaded in the CI environment for the PHP tests, so we can just check if the class exists and gracefully skip it. The tests don't need it for now, and in a real scenario or E2E tests it will get dispatched just fine. Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
For right now, I want to focus solely on traditional office file types. Later on it will be easy to add other types. Signed-off-by: Elizabeth Danzberger <[email protected]>
Move to a custom Vue component for displaying the document cards. Signed-off-by: Elizabeth Danzberger <[email protected]>
We can get rid of the OfficeFileEntry component because it was just acting as a wrapper around each FileCard. We can just use FileCard directly and move those methods to the OfficeOverview component Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
Inject an initial state that determines whether file previews should be shown or not, based on either core settings (enable_previews) or richdocuments settings. Signed-off-by: Elizabeth Danzberger <[email protected]>
When previews are disabled, swap to using the file type icons instead. Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
Add Cypress assertion to check if the preview exists, and a PHP unit test to make sure the initial state is set correctly. Signed-off-by: Elizabeth Danzberger <[email protected]>
A lot of the logic was redundant, so we can use a setup method to not have to redefine the mocked objects Signed-off-by: Elizabeth Danzberger <[email protected]>
Make them more like file entry grid by removing the center alignment of the text. Signed-off-by: Elizabeth Danzberger <[email protected]>
This was missing and is an office type, so should be added. Signed-off-by: Elizabeth Danzberger <[email protected]>
Adds a search bar so that the current view can be searched to easily find files Signed-off-by: Elizabeth Danzberger <[email protected]>
Adds tests for the search functionality Signed-off-by: Elizabeth Danzberger <[email protected]>
The card should give the impression that it is "clickable" Signed-off-by: Elizabeth Danzberger <[email protected]>
DAV search finds documents that are not only in the root folder but also recursively in subdirectories. It was specified that it should be used in the feature spec anyway. Signed-off-by: Elizabeth Danzberger <[email protected]>
77b9024 to
9c8d978
Compare
Uses sortNodes from @nextcloud/files with sortFavoritesFirst and mtime descending so the most recently edited files appear first with starred items pinned to the top. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: James Manuel <[email protected]>
Signed-off-by: James Manuel <[email protected]>
… list as parameter Signed-off-by: James Manuel <[email protected]>
…rrel imports Nav items are now driven by whatever TemplateFileCreator objects are registered with the NC Files API, so installing or removing an office suite automatically updates the sidebar. Uses a single fetch on mount for both the category list and the MIME filter for DAV SEARCH. Shows NcEmptyContent when no providers are installed rather than displaying an empty nav with no files. Signed-off-by: James Manuel <[email protected]>
… cards Signed-off-by: James Manuel <[email protected]>
…dialog Signed-off-by: James Manuel <[email protected]>
…e creator and duplicate error Signed-off-by: James Manuel <[email protected]>
Adds PUT /apps/richdocuments/settings/overview/grid_view endpoint to persist the overview view mode per user. OverviewController injects the saved preference as initial state so the frontend reads it on mount. Signed-off-by: James Manuel <[email protected]>
List view is now the default. A toggle in the toolbar switches between list and grid. List rows use NcListItem with mtime subname and a star indicator for favourites. The chosen mode persists via the new settings/overview/grid_view endpoint. Signed-off-by: James Manuel <[email protected]>
…le toggle, a11y fixes
- Center search bar; move view toggle into a files section header alongside
a "Recent {category}" h2 heading
- Toggle is now a single button switching icon based on current mode
- TemplateSection gets a subtle background (--color-background-hover) and
uses h2 + aria-labelledby for correct heading hierarchy
- FileCard changed from div to button for keyboard accessibility;
adds focus-visible outline
Signed-off-by: James Manuel <[email protected]>
Blank card was taller than template cards because min-height and padding-bottom combined. Replaced flex centering with absolute positioning for the icon so height is driven by padding-bottom alone. Template preview URLs were null from the API despite hasPreview: true. Generate from fileid using /core/preview (mirrors TemplatePreview.vue). File grid preview URLs now include etag version param and mimeFallback=1 so broken previews degrade to MIME icons rather than broken img elements. Signed-off-by: James Manuel <[email protected]>
Guard setOverviewGridView() against a null userId by returning 401 rather than writing to an empty-string uid. Mirror the same null guard in OverviewController::index() when reading the stored grid-view pref. Also rename the initial state key from 'config' to 'overview_config' to avoid colliding with any existing config state provided by other parts of the app. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: James Manuel <[email protected]>
…meFallback param Replace the ratio-based padding-bottom trick in TemplateSection with a fixed 2/3 aspect-ratio so all categories (docs, sheets, presentations) render at the same height. Switch .template-card__preview to flex centering, removing the now-redundant absolute-position rule on the blank card icon. Add an @error handler that sets failedPreviews[fileid] so a broken image falls back to the file-type icon without a broken-image glitch. Use template.previewUrl when the API provides it, otherwise derive the URL from the fileid. In OfficeOverview, fix the preview URL to use mimeFallback=true (boolean string) instead of mimeFallback=1, and update the loadState key to match the renamed initial state ('overview_config'). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: James Manuel <[email protected]>
Add owner-based filtering to the files section: - 'Mine' (default): files owned by the current user that are not on a shared or group mount (mirrors apps/files PersonalFiles filter) - 'Shared with me': files where nc:mount-type === 'shared' - 'All': no filter applied Both properties (oc:owner-id → node.owner, nc:mount-type) are already returned by getDavProperties() so no extra API call is needed. Three NcButton chips (size=small, aria-pressed) in a role=group below the section title give keyboard-accessible toggle behaviour. The empty state is moved inside the section so the chips remain visible when a filter yields no results, allowing the user to switch back. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: James Manuel <[email protected]>
…rride Override --button-radius on the filter NcButton elements so they render as pill-shaped chips rather than square-cornered small buttons. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: James Manuel <[email protected]>
9c8d978 to
167a957
Compare
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.
Part of the Office Overview feature — merge into
feat/office-overview-v2.