Withdraw asset picker folder selection so the list shows content only - #37367
Conversation
Withdraws `'folder'` from the browse contract end to end — the VTL-facing `DotBrowserItemKind`, the returned selection union, the picker's browse options, and the two-cursor paging model — so folders are reached only through the sidebar tree, per QA's rejection of the #37273 design. Also adds the spec-kit artifacts (spec.md, data-model.md, contracts) recording the decision and its rationale.
|
Claude finished @nicobytes's task in 1m 17s —— View job Code ReviewReviewed the full diff ( New Issues
Notes (non-blocking)
Both findings are documentation-accuracy only — nothing blocks merge. · |
There was a problem hiding this comment.
🟢 Approval recommended
The contract, request-building, paging model, shipped VTL, and unit coverage are coherently updated to remove folder selection while preserving folder navigation via the sidebar.
Pull request overview
Withdraws folder selection from the Asset Picker browse contract so the right-hand list panel only ever shows selectable content (files/pages/links) and folders remain navigation-only via the sidebar tree, aligning with QA’s updated UX decision for openBrowserModal callers.
Changes:
- Removed
'folder'from the VTL-facing browse kinds/selection contract and adjusted bridge behavior to warn-and-ignore unsupported kinds at runtime. - Hardcoded
showFolders: falsein the picker search request and removed folder cursor/hasMoreFolderspaging bookkeeping from the picker store model. - Updated shipped VTL + Jest/Spectator specs to reflect “content-only list” and validate paging correctness across the remaining streams (content + links).
File summaries
| File | Description |
|---|---|
| specs/37366-assetpicker-list-content-only/spec.md | Adds spec documenting the decision/contract delta and verification plan. |
| specs/37366-assetpicker-list-content-only/data-model.md | Records the intended TS type/store-state deltas for the change. |
| specs/37366-assetpicker-list-content-only/contracts/README.md | Index for contract deltas affected by this change. |
| specs/37366-assetpicker-list-content-only/contracts/openbrowsermodal-public-api.md | Documents openBrowserModal contract changes (no folder kind/selection). |
| specs/37366-assetpicker-list-content-only/contracts/drive-search-request-delta.md | Documents the request delta (explicit showFolders:false, no folder cursor). |
| dotCMS/src/main/webapp/WEB-INF/velocity/static/content/file_browser_field_render_new.vtl | Stops requesting folder in kinds for the shipped template. |
| core-web/libs/ui/src/lib/components/dot-asset-picker/store/models.ts | Removes folder-related browse option/page cursor state and updates docs. |
| core-web/libs/ui/src/lib/components/dot-asset-picker/store/features/with-asset-browse.feature.ts | Forces showFolders:false, drops folder cursor bookmark logic, updates paginator union. |
| core-web/libs/ui/src/lib/components/dot-asset-picker/store/dot-asset-picker.store.spec.ts | Updates/extends store tests to assert no folder flags/cursors and correct paging totals. |
| core-web/libs/ui/src/lib/components/dot-asset-picker/store/constants.ts | Removes folder cursor defaults from DEFAULT_ASSET_PICKER_PAGE. |
| core-web/libs/ui/src/lib/components/dot-asset-picker/asset-picker-config.spec.ts | Updates config tests to reflect removal of showFolders in browse options. |
| core-web/libs/edit-content-bridge/src/lib/interfaces/form-bridge.interface.ts | Updates public bridge docs: assets/pages/links only; folders are navigation-only. |
| core-web/libs/edit-content-bridge/src/lib/interfaces/asset-browser.interface.ts | Removes folder from kind/selection union and updates contract docs for runtime handling. |
| core-web/libs/edit-content-bridge/src/lib/bridges/angular-form-bridge.ts | Drops folder mapping, adds runtime warning for unsupported kinds, removes folder selection mapping. |
| core-web/libs/edit-content-bridge/src/lib/bridges/angular-form-bridge.spec.ts | Updates bridge specs for new contract and warning behavior; removes folder selection expectations. |
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| * An entry that is not a {@link DotBrowserItemKind} is **ignored with a console warning** | ||
| * rather than throwing, since a caller is a VTL `<script>` where an exception would break the | ||
| * whole custom field. `'folder'` is the case this exists for: every shipped template asked for | ||
| * it before the kind was withdrawn. |
The format-test step of Frontend Unit Tests flagged two `expect` calls that fit on one line under the repo's 100-column Prettier config. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Problem
The Asset Picker's list panel listed folders as selectable rows alongside files and pages, and let a folder be picked as the return value. QA rejected this design: folders should only be navigated through the sidebar tree, not listed or returned in the content list.
Solution
Remove folder selection from the browse contract entirely rather than hiding it in the UI:
'folder'fromDotBrowserItemKindand theDotBrowserSelectionunion in the edit-content-bridge interfaces.showFoldersbrowse option fromDotAssetPickerBrowseOptions, and hardcodeshowFolders: falsein the picker's search request (the endpoint defaults it totrue, so the flag must be sent explicitly).hasMoreFoldersbookkeeping from pagination state — only content and link streams remain.'folder', since callers are VTL string literals that TypeScript can't police.file_browser_field_render_new.vtlto stop requestingfolderinkinds.A spec (
specs/37366-assetpicker-list-content-only/) documents the decision and contract deltas against the prior #37207 baseline.Testing
angular-form-bridge.spec.ts,dot-asset-picker.store.spec.ts, andasset-picker-config.spec.tscovering: no folder rows/cursor ever sent, warning on unsupported kinds, and paginator total correctness across the two remaining streams (content + links).This PR fixes: #37366