Skip to content

Withdraw asset picker folder selection so the list shows content only - #37367

Open
nicobytes wants to merge 2 commits into
mainfrom
nicobytes/37366-asset-picker-list-panel-should-show-content-only-with-folders-navigated-through-the-sidebar-tree
Open

Withdraw asset picker folder selection so the list shows content only#37367
nicobytes wants to merge 2 commits into
mainfrom
nicobytes/37366-asset-picker-list-panel-should-show-content-only-with-folders-navigated-through-the-sidebar-tree

Conversation

@nicobytes

@nicobytes nicobytes commented Sep 3, 2026

Copy link
Copy Markdown
Member

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:

  • Drop 'folder' from DotBrowserItemKind and the DotBrowserSelection union in the edit-content-bridge interfaces.
  • Remove the showFolders browse option from DotAssetPickerBrowseOptions, and hardcode showFolders: false in the picker's search request (the endpoint defaults it to true, so the flag must be sent explicitly).
  • Remove the folder cursor/hasMoreFolders bookkeeping from pagination state — only content and link streams remain.
  • Warn (not throw) when a caller still passes an unsupported kind like 'folder', since callers are VTL string literals that TypeScript can't police.
  • Update file_browser_field_render_new.vtl to stop requesting folder in kinds.

A spec (specs/37366-assetpicker-list-content-only/) documents the decision and contract deltas against the prior #37207 baseline.

Testing

  • Updated/added unit specs in angular-form-bridge.spec.ts, dot-asset-picker.store.spec.ts, and asset-picker-config.spec.ts covering: 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

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.
Copilot AI lite review requested due to automatic review settings September 3, 2026 10:04
@github-actions github-actions Bot added Area : Backend PR changes Java/Maven backend code Area : Frontend PR changes Angular/TypeScript frontend code labels Sep 3, 2026
@claude

claude Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @nicobytes's task in 1m 17s —— View job


Code Review

Reviewed the full diff (origin/main...HEAD). The change is coherent: folder is dropped from the DotBrowserItemKind/DotBrowserSelection contract, showFolders: false is hardcoded (correctly sent explicitly, since the endpoint defaults it to true), folder cursor bookkeeping is removed from paging, and $totalRecords now sums only the content + link streams. No logic bugs found.

New Issues

  • 🟡 Medium: core-web/libs/edit-content-bridge/src/lib/interfaces/asset-browser.interface.ts:52 — TSDoc claims "every shipped template asked for it before the kind was withdrawn." That is inaccurate: only file_browser_field_render_new.vtl requested folder; the other shipped caller, redirect_custom_field_new.vtl, requests ["page", "link"] and never asked for folders. Narrow to "the shipped file-browser template" (and note third-party VTL callers that TS can't police). Same issue Copilot flagged. Fix this →
  • 🟡 Medium: core-web/libs/edit-content-bridge/src/lib/bridges/angular-form-bridge.ts:663 — same inaccurate claim in the inline comment ("which every template asked for until Asset Picker: list panel should show content only, with folders navigated through the sidebar tree #37366"). Fix both together so the contract docs stay accurate.

Notes (non-blocking)

  • console.warn (angular-form-bridge.ts:668) is appropriate here — this is a browser-side bridge and throwing would take down the whole custom field, as the comment explains. Warn-and-drop is the right call.
  • Removing showFolders? from DotAssetPickerBrowseOptions while hardcoding showFolders: false in the feature is safe: no other caller reads the flag.

Both findings are documentation-accuracy only — nothing blocks merge.

· nicobytes/37366-asset-picker-list-panel-should-show-content-only-with-folders-navigated-through-the-sidebar-tree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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: false in the picker search request and removed folder cursor/hasMoreFolders paging 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.

Comment on lines +50 to +53
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area : Backend PR changes Java/Maven backend code Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Asset Picker: list panel should show content only, with folders navigated through the sidebar tree

3 participants