Skip to content

Open Content Drive filtered to the last content type opened in the Content Types editor #37903

Description

@zJaaal

Description

When you open a content type in the Content Types editor and then go to Content Search, Content Search opens already filtered to that type. Content Drive doesn't do this, so after editing a type you have to pick it again in the Drive's filters.

How Content Search does it today (server side):

  • Fetching a content type through GET /api/v1/contenttype/id/{idOrVar} saves its inode in the HTTP session as selectedStructure (ContentTypeResource.java, retrieveContentType).
  • Content Search pre-selects that type when it opens without a ?filter= param (ViewContentletAction.resolveStructureSelected).
  • Content Search's first search then removes the value from the session (ContentletAjax.java, searchContentletsByUser), so it's a one-time handoff. Reloading Content Search afterwards shows All.
  • No REST endpoint returns that session value, so the Drive can't read it.

Proposed approach (frontend only):

  • When the content type editor opens an existing type (dot-content-types-edit-resolver.service.ts), save the type's variable name to sessionStorage.
  • When the Drive loads and its URL has no filters param, apply contentType:<variable> and clear the saved value right away.
  • The Drive already keeps its filters in the URL (?filters=contentType:Blog), so after the handoff, reloading the page keeps the filter until the user clears it.

Other screens that fetch content types (Edit Content and others) don't change the value. Only the content type editor sets it, so the Drive gets "the last type I worked on," not "the last type any screen loaded."

Acceptance Criteria

Happy path

  • Open an existing content type (for example Blog) in the Content Types editor, then open Content Drive from the menu: the Drive shows the Content Type filter set to Blog and the grid lists only Blog content.
  • Create a new content type and save it, then open Content Drive: the Drive is filtered to the new type.
  • After the Drive applies the filter, the URL contains filters=contentType:<variable>, and reloading the page keeps the filter.
  • Open a folder link (URL with path and no filters) right after opening a type in the editor: the Drive opens that folder with the type filter applied.

One-time handoff

  • After the Drive applies the type, clear the filter, then leave the Drive and open it again from the menu: the Drive opens with no content type filter.
  • Opening a second type in the editor (for example News after Blog), then opening the Drive: the Drive is filtered to News, not Blog.

Does not override explicit filters

  • Open a Drive URL that already has a filters param (for example filters=baseType:4) after opening a type in the editor: the Drive applies only the URL's filters, and the saved type is not applied.

Only the editor sets the value

  • Opening a contentlet in Edit Content (which also fetches its content type), then opening the Drive: the Drive opens with no content type filter.

Storage lifetime

  • The saved value lives in sessionStorage, so it's per tab: opening a type in the editor in tab A, then opening the Drive in a new tab B: tab B's Drive has no content type filter.
  • Logging out removes the saved value, next to the existing experiments key cleanup in LoginService (clearExperimentPersistence).

Edge cases

  • If the saved type was deleted, or the user has no permission on it, by the time the Drive opens: the Drive loads without an error message, the saved value is cleared, and the grid behaves as it does with an unknown content type in the URL.

Priority

Low

Additional Context

  • Investigated and tested locally: with a type opened in the editor, Content Search pre-selected it, and one reload later it showed All.
  • DotSessionStorageService in libs/data-access only handles the experiments variant id (its TODO says it needs a real name). Either extend it with get/set/remove for this key or add a small Drive-specific helper; don't call sessionStorage directly from components.
  • Out of scope: changing how Content Search behaves, and exposing the server selectedStructure value through a new endpoint.

Activity

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

    @github-actions
    Contributor
  4. 2 remaining items

  5. removed their assignment
    on Oct 8, 2026
  6. zJaaal commented on Oct 8, 2026

    @zJaaal
    MemberAuthor

    Note for QA

    Merged in #37937. It's frontend only, so no backend setup is needed. Test in one browser tab unless a step says otherwise.

    Main flow: the Drive opens on the last content type you edited

    • Open any existing content type in the Content Types editor, then open Content Drive from the menu: the Content Type filter is set to that type and the list shows only its content.
    • Reload the page: the filter stays (it's in the URL now).
    • Open Content Drive from the menu again: it opens unfiltered. The handoff happens once.
    • Create a new content type and save it, then open the Drive: it's filtered to the new type.
    • Open one type, then another, then the Drive: it's filtered to the second one.
    • Open a type in the editor, then open the Drive in a new tab: the new tab is unfiltered (the value is per tab).
    • Open a contentlet in Edit Content (not the Content Types editor), then the Drive: unfiltered. Only the Content Types editor sets the value.

    Links keep their own instructions

    • Open a type, then a Drive link that already has filters (for example filters=baseType:4): only the link's filters apply. Opening the Drive again from the menu is unfiltered.
    • Open a type, then a Drive link that opens an item (editContent=...): the item opens and no type filter is added.
    • Open a type, then a folder link with a path and no filters: the folder opens with the type filter applied.

    Edge cases

    • Open a form or a system type in the editor, then the Drive: unfiltered. The Drive's Content Type filter doesn't offer those types.
    • Open a type, delete it, then open the Drive: the filter is dropped from the URL and the chip, and the list is unfiltered.
    • Open a type, switch the site in the top bar inside the Drive: the Drive starts unfiltered for the new site.

    Two differences from the acceptance criteria above (decided in the spec, not bugs)

    • Logout doesn't clear the value. The ticket says it should. The spec decided against it, because the value lives only in that browser tab and is used once anyway.
    • A deleted type shows a notice. The ticket says no error message. In practice the Drive's existing "Something went wrong loading options" notice shows once, the same as for any link with a type that no longer exists. The list itself loads normally.

    Also shipped in the same PR, please check

    • Rename is gone. Selecting one item in the Drive no longer offers Rename (it only logged "under development" before).

    • Row menu follows permissions. As a user with read but not write permission on an item:

      • a content row's menu says View Content, and a page row's says View Page, and both still open the item;
      • pages also offer View Properties, which opens the page's form in the side panel;
      • Push Publish and Add to Bundle don't appear without publish permission.

      As an admin, the same rows show Edit Content / Edit Page, Edit Properties, Push Publish and Add to Bundle.

    • Tree toggle: the toolbar button that shows or hides the folder tree is now a secondary button. Check it still works.

    Written by Claude Code on behalf of @zJaaal.

  7. KevinDavilaDotCMS commented on Oct 8, 2026

    @KevinDavilaDotCMS
    Contributor

    QA Passed

    Tested in main e917330

    2026-10-08.16-02-25.mov
  8. removed their assignment
    on Oct 8, 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