Skip to content

Add a grid view to Content Drive #37930

Description

@zJaaal

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.

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:

  1. viewType=list|card in the URL, in any letter case.
  2. 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>.
  3. 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.
  4. The table.
  • A switch writes viewType to the URL without adding a history entry, so a copied link opens in the same view.
  • Opening a link with viewType does 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

  1. 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.
  2. Switch back to the table. Expect: same page, page size, sort indicator and selection as before.
  3. Pick grid, leave Content Drive and come back with no viewType in the URL. Expect: opens in the grid.
  4. Open …/content-drive?viewType=List while grid is remembered. Expect: the table; going back without the param still opens the grid (the URL did not change the remembered view).
  5. Open with ?viewType=mosaic. Expect: falls back to the remembered view, else the table, with no error.
  6. Open with ?defaultViewType=card and nothing remembered. Expect: the grid. With list remembered: expect the table.
  7. Copy the URL in the grid and open it in another browser or profile. Expect: the grid.
  8. 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.
  9. With browser storage blocked (private mode, or site data off): Expect: switching still works for the session.

Cards

  1. 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.
  2. 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.
  3. Check draft, changed and published items. Expect: the same status badge the table shows.
  4. 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.
  5. Check the locks. Expect: a closed lock with "Locked by: name" on a locked item, and an open lock with "Unlocked" otherwise.
  6. Check a folder card. Expect: folder icon, name, owner's avatar, "Folder", and no status, language or lock.
  7. Turn on the multi-language filter. Expect: the EN and ES versions are separate cards with their own language chip.
  8. 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

  1. Click a folder card. Expect: enters the folder. Click a content card. Expect: opens its editor.
  2. Click the checkbox, avatar, lock and ⋮. Expect: none of them open the item.
  3. 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.
  4. Shift-click a checkbox with nothing selected. Expect: only that card is selected.
  5. 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.
  6. Right-click a card. Expect: the table row's menu. Click ⋮, then ⋮ again. Expect: opens, then closes.
  7. 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.
  8. 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.
  9. With EN and ES shown, drag only the ES card. Expect: the drag picture is the ES card's.
  10. Drop files from the computer onto the grid. Expect: they upload into the current folder.
  11. Go to the next page, change the page size to 40, then switch to the table. Expect: the same page and page size.
  12. 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

  1. Tab into the grid. Expect: exactly one card is focusable, and Tab again leaves the grid.
  2. → to the end of a row. Expect: wraps to the next row's first card. ← from a row start wraps back.
  3. ↓ / ↑. Expect: same column one row down or up. From the row above a shorter last row, ↓ lands on the last card.
  4. Home / End. Expect: first or last card. At the edges, the arrows do nothing and the page does not scroll.
  5. Shift + → ×2, then Shift + ←. Expect: the selection grows by two cards, then shrinks by one, and the earlier picks are kept.
  6. Enter and Space on a card. Expect: toggle its selection without opening it.
  7. Shift + F10 (or the ContextMenu key). Expect: the actions menu opens at the focused card.
  8. 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.
  9. 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.
  10. In the grid, press Escape with a selection, /, Mod + K and Mod + B. Expect: the same as in the table.

Regression (other users of the shared listing)

  1. 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

Activity

  1. added theissue type on Oct 7, 2026
  2. self-assigned this
    on Oct 8, 2026
  3. github-actions commented on Oct 8, 2026

    @github-actions
    Contributor
  4. moved this from Spec In Progress to In Progress in dotCMS - Product Planningon Oct 12, 2026
  5. removed their assignment
    on Oct 14, 2026
  6. moved this from In Progress to QA in dotCMS - Product Planningon Oct 14, 2026
  7. dario-daza commented on Oct 16, 2026

    @dario-daza
    Member

    ✅ QA Passed

    QA-CD-grid-view.mp4
  8. removed their assignment
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions