Conversation
Author-tier picker always reopened at the DAM root, forcing re-browsing for every asset on a page. Remember the folder of the last selected asset in-memory and pass it back as the selector's `path` prop. Delivery-tier repos have no folder structure, so skipped there. Fixes #1345 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
shsteimer
marked this pull request as ready for review
September 16, 2026 17:21
mhaack
reviewed
Sep 17, 2026
| return features; | ||
| } | ||
|
|
||
| let lastFolderPath; |
Contributor
There was a problem hiding this comment.
lastFolderPath is a single module-level var, not scoped per repo. The PR description says this is "scoped to the page session — resets on reload," but edit.js:87-89,146 shows navigation is handled via hashchange without a full reload, so the description doesn't match actual behavior: switching orgs/sites in the same tab carries the remembered folder over into an unrelated repo's asset picker. Affects both /edit and /canvas (both route through this shared module).
Fix: key lastFolderPath by repoConfig.repositoryId instead of a flat variable.
Contributor
Author
There was a problem hiding this comment.
good catch, updated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
buildAssetSelectorPropsnow passes apathprop to the AEM asset selector, set to the folder of the last selected asset.rememberAssetFolder(inblocks/shared/aem-assets/selector-props.js) captures that folder inbuildHandleSelection, shared by both /edit and /canvas. Only applies to author-tier repos — delivery tier has no folder structure.Why
Author feedback: the picker always reopened at the DAM root, forcing re-browsing (or search) for every asset inserted into a page. Remembering the last folder for the editor session avoids that.
Reviewer notes
State is in-memory (module-level var), scoped to the page session — resets on reload, not persisted. Only captured on actual selection; browsing-then-canceling isn't tracked, since the assets-selectors.js library exposes no folder-navigation callback.
Fixes #1345
https://lastpath--da-live--adobe.aem.live/