Repository navigation
feat(content-drive): grid view with a table/grid switcher - #38009
Conversation
Content Drive can now show the current page as cards. A switcher beside the search box toggles between the table and the grid. - Cards follow the design: preview on top with the editor's avatar and the status over its corner and the checkbox opposite, then the title, language, type, lock state and a hover "more actions" button. A click opens the item; the checkbox selects; Shift on it selects a range. - The grid shares the table's selection, pagination, page size, sort, context menu, drag-and-drop and upload drop zone. The table stays mounted (hidden) while the grid shows, so switching never re-runs the search. - Keyboard: one tab stop, Left/Right/Up/Down/Home/End, Shift+arrows for ranges, Enter/Space to select, Shift+F10 for the actions menu. Focus and anchor carry across a switch. - The view opens from `viewType` in the URL, then the view remembered for the screen (localStorage, per portlet), then a custom tool's `defaultViewType`, then the table. Switching writes `viewType` to the URL so a copied link opens in the same view. - Shared table: optional `rows`, `activeKey`/`activeKeyChange` and `revealActive()`; unbound, it behaves as before. - Spec updated with the 2026-10-13 design and view-precedence answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @rjvelazco's task in 4m 4s —— View job ReviewI read the refactored listing ( New IssuesNo new blocking issues found. The refactor to a single A few things I confirmed behave correctly (not findings, just the ones worth stating because they were the risky parts):
Resolved
Test coverage is substantial for the new behavior ( Nice work on the refactor — this reads much better as one component than two listings kept in sync. |
) The cards' visually hidden labels are absolutely positioned. With no positioned ancestor inside the grid they anchored to the upload drop zone, escaped the grid's own scroll box and stretched the drop zone, which then scrolled as well. The card and the grid's scroll box are now positioned, so the drop zone's content fits it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A click on a card opens the item, so the card now shows a pointer. Not in a read-only grid or on a busy card, where a click does nothing, and not over the avatar or the lock icon, which only show a tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
)" This reverts commit d9d64f9: the cards keep the design's cursor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#37930) The card stopped the ⋮ click from bubbling so it would not open the item. That also kept it from PrimeNG's document click listener, which is what closes the menu, so a second click re-opened it instead of closing it as the table's ⋮ does. The click now bubbles, and the card ignores clicks that come from its ⋮ button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew (#37930) Addresses the review on #38009: - The grid is now `layout="grid"` on the shared dot-folder-list-view, with the Drive card passed in as a `#card` template. One component owns selection and ranges, the anchor and tab stop, the page lock and paginator, drag and drop, the skeleton and the empty state. The hidden table and the activeKey handoff between two listings are gone, which also removes the stale-key bug in #followActiveKey. Opt-in: other consumers keep the table unchanged. - The grid paginator shares the table's lock, with Previous/Next truly disabled while a page loads, so Enter can no longer move it past the page. - Drag pictures are looked up by dataKey (inode), so a language version drags its own preview; drags are accepted and highlighted over folders only, and dragleave clears the highlight (table and grid). - The card avatar shows the editor's initial and never calls Gravatar; card spacing goes through p-card's design tokens ([dt]). - Back/Forward keep the current view (it is a preference); the URL is fixed in place without a history push. The remembered-view storage key is worked out once when the Drive opens. - Spec, data model and UI contract updated to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #37930. Implementation for the spec merged in #37959 (PR 2 of 2).
Proposed Changes
p-selectbutton) beside the search box toggles table ↔ grid.dot-folder-list-view(layout="grid"), with the Drive'sdot-content-drive-grid-card(p-card) passed in as a#cardtemplate. The card: preview on top (video = still frame, type icon fallback), the editor's initial and the status badge over its top-left corner, checkbox top-right; title; language, content type, lock state and a hover ⋮ menu. Cards are at least 240px wide and fill the row.docs/frontend/KEYBOARD_SHORTCUTS.md.viewTypeURL param (written back on every switch, so a copied link opens in the same view) → the view remembered inlocalStorageper portlet (dotcms.content-drive.view-type.<portletId>, key worked out once when the Drive opens) →defaultViewType(for Open custom tools in Content Drive with their content types locked #37931) → table. Back/Forward keep the view showing.dot-folder-list-view), all opt-in:layout, the#cardtemplate (DotFolderListViewCardContext),rows,sortField/sortOrder(a switch back rebuilds the table, which must show the caller's page size and sort). The grid's paginator shares the table's lock, with Previous/Next truly disabled while a page loads. Drag pictures are found bydataKey, and drags highlight folders only (both layouts). Unbound, pickers, the Action Center, edit-content, publishing-queue and experiments behave as before.Checklist
portlets-content-drive(2180),ui(2222, including the newdot-folder-list-view.grid.spec.ts), plus the listing's consumersedit-content(2474),publishing-queue(1400),experiments(277). Lint,format:check, strict gate andnx build dotcms-uipass locally.Language.properties.Additional Info
defaultViewType, notviewMode/viewType, so it never outranks the user's remembered choice.dot-content-drive-shell.grid-view.spec.ts; the listing's grid tests live indot-folder-list-view.grid.spec.ts.viewType=Listoverriding it, selection kept across a switch, arrow keys (4 columns at 1440px), folder cards entering the folder, right-click menu, card click opening the editor, and the selected-card border. After the review refactor: no table in the DOM while the grid shows, the tab stop kept across table → grid → table, ⋮ menu closes on a second click, no Gravatar request from cards. No page errors.Screenshots
Local instance, Chrome, 1440px wide unless noted. Every avatar reads "A" because the editor here is "Admin User".
Grid view, all site content

One card on hover: the ⋮ button appears

The view switcher beside the search box

Folder cards. An owner the listing can't name gets the neutral person icon

Right-click opens the same menu as a table row

1000px window with the folder tree open: two columns

🤖 Generated with Claude Code
This PR fixes: #37930