mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
Switching sidebar tabs unmounts the layers panel. The search text and filters lived only in component state, so on return the still open search bar was treated as a new search and cleared. Keep that state per file in a session atom, as the assets panel already does. Closing or clearing the search mounts the tree container again, but the restore hook only ran on mount or page change, so the tree went back to the top. Let use-restore-scroll take an active? flag so each list restores its own position whenever it is shown again, and drop the saved search position on close so a new search starts at the top. Closes #11972 AI-assisted-by: claude-opus-5-5