Skip to content

fix(staged): preserve project sidebar scroll position - #845

Merged
matt2e merged 2 commits into
mainfrom
project-list-shifts
Jul 2, 2026
Merged

fix(staged): preserve project sidebar scroll position#845
matt2e merged 2 commits into
mainfrom
project-list-shifts

Conversation

@matt2e

@matt2e matt2e commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Persist and restore the staged project sidebar scroll offset across navigation/render cycles.
  • Keep the selected project row visible after restoration without debug logging.

Testing

  • Push hooks: crates-fmt, crates-test, crates-lint, differ-ci, staged-ci.

matt2e added 2 commits July 2, 2026 16:12
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>
@matt2e
matt2e requested review from baxen and wesbillman as code owners July 2, 2026 07:23
@matt2e
matt2e merged commit 034b0b1 into main Jul 2, 2026
4 checks passed
@matt2e
matt2e deleted the project-list-shifts branch July 2, 2026 07:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +166 to +168
if (active) {
activeProjectRowEl = node;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant