Repository navigation
Description
Description
Content Drive gets a grid view: the current page of results shown as cards, as an alternative to the table. A switcher next to the search box toggles between the two. Both views show the same items in the same order, share one selection, one page and one page size, and offer the same actions.
The grid is a second layout of the shared listing (dot-folder-list-view, layout="grid"). It is opt-in, so the other places that use the listing (asset pickers, Action Center, edit-content, publishing-queue, experiments) are unchanged.
- Spec:
specs/37930-content-drive-grid-view/spec.md(docs(spec): Content Drive grid view as an alternative to the table #37959) - Implementation: feat(content-drive): grid view with a table/grid switcher #38009 (merged; first image
trunk_c711383)
What the card shows
- The preview on top, the same one the table's thumbnail uses. Images and PDFs are cropped to fill without distortion, a video shows a still frame with no player, and anything with no preview shows its type icon.
- Over the preview's top-left corner: the editor's avatar and the status badge. Over its top-right corner: the selection checkbox.
- The title on one line, cut with an ellipsis. The full title shows on hover only when it is cut.
- A second line with the language chip, the content type, the lock icon and a ⋮ button. The lock icon is always shown: closed with "Locked by: name" on hover, open with "Unlocked". The ⋮ shows on hover or keyboard focus.
- Folder cards show the folder icon, the name, the owner's avatar and "Folder". They have no status, language or lock.
- Avatar: the first letter of the editor's name (the owner's for a folder), with the name on hover or tap. Nothing is sent to Gravatar: Drive results carry names only, and a user without first or last names is named after their email. An unknown editor shows a neutral placeholder.
- Cards are at least 240px wide with a 20px gap, fill the row and all have the same height.
Which view opens
The first usable value wins:
viewType=list|cardin the URL, in any letter case.- The view the user last picked with the switcher on this screen. It is stored in the browser per portlet, under
dotcms.content-drive.view-type.<portletId>. - A custom tool's default, passed as
defaultViewType. Custom tools sending it is Open custom tools in Content Drive with their content types locked #37931. - The table.
- A switch writes
viewTypeto the URL without adding a history entry, so a copied link opens in the same view. - Opening a link with
viewTypedoes not change the remembered view. - Back and Forward never change the view: it is a preference, not a place.
Acceptance Criteria
- A switcher beside the search box toggles table ↔ grid; the grid shows the same items, order and page as the table.
- Cards follow the design: preview, avatar and status over the image, checkbox top-right, title, language, type, lock and ⋮.
- A plain click on a card opens the item (enters a folder, opens content in its editor). The checkbox, avatar, lock and ⋮ never open it.
- Selection is made with the checkbox. Shift-click on a checkbox selects the range from the anchor, and the selection is the same object in both views.
- Right-click and ⋮ open the same actions menu as the table row. A second ⋮ click closes it.
- Pagination: same control, page sizes (20/40/60) and "Page N" as the table. Previous and Next are disabled while a page loads.
- Dragging cards onto a folder card or a tree folder moves them, carrying the whole selection when the dragged card is selected. Only folders highlight as drop targets. Dropping files from the computer uploads them.
- Loading shows skeleton cards, an empty folder shows the table's empty state, and the search-failed message shows above the grid.
- A card with an action running on it is dimmed with a spinner, and cannot be selected, opened or dragged.
- The full keyboard set below works, and the view opens per the order above.
Keyboard (grid view)
The grid is one tab stop, like the table. The keys below act on the focused card.
| Keys | Does |
|---|---|
Tab / Shift + Tab |
Enter or leave the grid, landing on the last focused card |
← → |
Move one card, wrapping onto the row before or after |
↑ ↓ |
Move one row of cards. Down from a row above a shorter last row lands on its last card. |
Home / End |
First / last card of the page |
Shift + any move above |
Extend or shrink the selection from the anchor card |
Enter / Space |
Select or unselect the focused card |
Shift + F10 / ContextMenu key |
Open the focused card's actions menu |
Shift + click (checkbox) |
Select the range from the anchor to the clicked card |
Escape |
Clear the selection (same as the table) |
/ or Mod + K |
Focus the search box (same as the table) |
Mod + B |
Show or hide the sidebar (same as the table) |
- Busy cards are skipped by every move and left out of every range.
- Moves never leave the page: at an edge, focus stays put.
- Arrows do not scroll the page.
- Up and Down follow the real layout after a resize or a sidebar toggle.
QA scenarios
Test data:
- One folder with subfolders and an empty folder.
- A folder with 60+ images, for paging and ranges.
- Images of different shapes, an SVG, a video, and a PDF and other files.
- A very long file name.
- Items that are draft, changed, archived and locked.
- One content item in two languages (EN and ES).
- Items last edited by two different users.
Switching and which view opens
- Open Content Drive, click the grid option in the switcher. Expect: cards with the same items, order and page; URL has
viewType=card; Back does not return to the table. - Switch back to the table. Expect: same page, page size, sort indicator and selection as before.
- Pick grid, leave Content Drive and come back with no
viewTypein the URL. Expect: opens in the grid. - Open
…/content-drive?viewType=Listwhile grid is remembered. Expect: the table; going back without the param still opens the grid (the URL did not change the remembered view). - Open with
?viewType=mosaic. Expect: falls back to the remembered view, else the table, with no error. - Open with
?defaultViewType=cardand nothing remembered. Expect: the grid. With list remembered: expect the table. - Copy the URL in the grid and open it in another browser or profile. Expect: the grid.
- Open folder A in the table, then folder B, switch to the grid, press Back. Expect: folder A in the grid; Forward still returns to B.
- With browser storage blocked (private mode, or site data off): Expect: switching still works for the session.
Cards
- Check an image, the SVG, the PDF, the video, a
.zip. Expect: cropped previews, a still frame for the video (no controls), and a type icon where there is no preview. No broken images, and every card is the same height. - Check a long title and a long content type name. Expect: one line with an ellipsis, and the full text on hover only when cut.
- Check draft, changed and published items. Expect: the same status badge the table shows.
- Check the avatars. Expect: the editor's first letter, the full name on hover, and "Unknown" for an unresolved user. In DevTools → Network, cards make no gravatar.com request.
- Check the locks. Expect: a closed lock with "Locked by: name" on a locked item, and an open lock with "Unlocked" otherwise.
- Check a folder card. Expect: folder icon, name, owner's avatar, "Folder", and no status, language or lock.
- Turn on the multi-language filter. Expect: the EN and ES versions are separate cards with their own language chip.
- Resize to about 1000px and then to phone width, and toggle the sidebar (
Mod + B). Expect: cards reflow, stay at least 240px (one column below that), there is no horizontal scroll, and the grid has one scrollbar.
Mouse
- Click a folder card. Expect: enters the folder. Click a content card. Expect: opens its editor.
- Click the checkbox, avatar, lock and ⋮. Expect: none of them open the item.
- Tick two cards, then Shift-click a third checkbox. Expect: the range from the anchor is selected, and the earlier picks are kept. Switch to the table. Expect: the same rows are ticked.
- Shift-click a checkbox with nothing selected. Expect: only that card is selected.
- Ctrl/Cmd/Shift/Alt + click on a card body, and a double-click. Expect: no open on the modifier clicks, and the double-click opens once.
- Right-click a card. Expect: the table row's menu. Click ⋮, then ⋮ again. Expect: opens, then closes.
- Drag a selected card. Expect: the drag picture shows the selected items (up to 3 plus a count), and dropping on a folder card or a tree folder moves them all. Drag an unselected card. Expect: only it moves.
- Drag over a content card or the gap between cards. Expect: no highlight and no "move" cursor. Only folders highlight, and the highlight clears when the drag leaves.
- With EN and ES shown, drag only the ES card. Expect: the drag picture is the ES card's.
- Drop files from the computer onto the grid. Expect: they upload into the current folder.
- Go to the next page, change the page size to 40, then switch to the table. Expect: the same page and page size.
- Click Next and quickly press Enter on Next again while it loads. Expect: Next is disabled, and "Page N" always matches the cards shown.
Keyboard
- Tab into the grid. Expect: exactly one card is focusable, and Tab again leaves the grid.
→to the end of a row. Expect: wraps to the next row's first card.←from a row start wraps back.↓/↑. Expect: same column one row down or up. From the row above a shorter last row,↓lands on the last card.Home/End. Expect: first or last card. At the edges, the arrows do nothing and the page does not scroll.Shift + →×2, thenShift + ←. Expect: the selection grows by two cards, then shrinks by one, and the earlier picks are kept.EnterandSpaceon a card. Expect: toggle its selection without opening it.Shift + F10(or the ContextMenu key). Expect: the actions menu opens at the focused card.- Run an action on a card (for example, delete), then arrow across it. Expect: the busy card is skipped and left out of Shift ranges.
- Focus card 3 in the grid and switch to the table. Expect: row 3 has focus and is scrolled into view. Arrow to row 5, switch back. Expect: card 5. Repeat table → grid → table → grid. Expect: always lands on the last item focused.
- In the grid, press
Escapewith a selection,/,Mod + KandMod + B. Expect: the same as in the table.
Regression (other users of the shared listing)
- Asset picker, relationship picker, Action Center preview, and the edit-content, publishing-queue and experiments lists. Expect: the table looks and behaves exactly as before.
Priority
Medium
Additional Context
- Design: claude.ai/design project
fabdd784-6103-4670-9c76-dfb2aff9f623,Content Drive - Dialog.html. The design wins over the original spec where they differ. - Follow-ups:
- Open custom tools in Content Drive with their content types locked #37931: custom tools open the Drive and send
defaultViewType. - [TASK] Finish the ARIA grid wiring on the shared folder list view #37439: full
role="grid"wiring for the table.
- Open custom tools in Content Drive with their content types locked #37931: custom tools open the Drive and send
- Out of scope: sorting from the grid (it keeps the table's sort), and showing real Gravatar photos (that would need the Drive search to return an email or hash).
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Oct 8, 2026
PRs linked to this issue
docs(spec): carry Content Drive keyboard shortcuts into the grid view (…
docs(spec): apply PR review answers to the Content Drive grid spec (#…
docs(spec): apply second-round review to the Content Drive grid spec (#…
fix(content-drive): remove the second scrollbar in the grid view (#37930
feat(content-drive): show a pointer cursor on grid cards (#37930)
Revert "feat(content-drive): show a pointer cursor on grid cards (#37930
fix(content-drive): close the card's actions menu on a second ⋮ click (…
refactor(content-drive): make the grid a layout of dot-folder-list-vi…
test(content-drive): the grid-view spec stops mocking the removed sid…
test(content-drive): give the grid-view spec's store the Edit Source …
test(content-drive): give the grid-view spec's store the Edit Source …
Merge origin/main into issue-37896-content-drive-csv-import-impl
dario-daza commentedon Oct 16, 2026
✅ QA Passed
QA-CD-grid-view.mp4