fix(staged): preserve project sidebar scroll position - #845
Conversation
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Drop the temporary sidebar scroll diagnostics while keeping the restore guards that prevent stale zero offsets and duplicate restore attempts. Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a6b372cb2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (active) { | ||
| activeProjectRowEl = node; | ||
| } |
There was a problem hiding this comment.
Scroll newly mounted active rows into view
When the sidebar has already restored and a selected row is mounted for the first time, this branch only records the node and never scrolls it; the update hook will not run because the row is active on its initial render. For example, handleProjectCreated appends a new project and immediately selects it while the sidebar stays mounted, so in a long sidebar the newly selected project can remain offscreen, regressing the previous mount-time scrollIntoView behavior. Consider scrolling here when sidebarScrollRestored is already true.
Useful? React with 👍 / 👎.
Summary
Testing