Skip to content

perf(web): avoid per-row sidebar project lookups#3

Merged
ronak-guliani merged 1 commit into
mainfrom
perf/sidebar-thread-cwd-map
May 27, 2026
Merged

perf(web): avoid per-row sidebar project lookups#3
ronak-guliani merged 1 commit into
mainfrom
perf/sidebar-thread-cwd-map

Conversation

@ronak-guliani

Copy link
Copy Markdown
Owner

Summary

  • Removes the per-row useStore(selectProjectByRef(...)) lookup from Sidebar thread rows.
  • Reuses the project group's existing scoped-project map to pass each row's owning project cwd directly.
  • Keeps git cwd resolution behavior unchanged: worktree path, then owning thread project cwd, then displayed project cwd fallback.

Performance impact

This targets the next Sidebar hot path from the audit: visible thread rows no longer create one store subscription and selector per row just to resolve the project cwd used for git-status/PR detection. The project-level memoized map is built once and reused while rendering rows.

Validation

  • cd apps/web && bun run test src/components/Sidebar.logic.test.ts
  • bun fmt apps/web/src/components/Sidebar.tsx apps/web/src/components/Sidebar.logic.ts apps/web/src/components/Sidebar.logic.test.ts
  • bun lint

Note: bun typecheck currently fails on the origin/main baseline in unrelated files (ChatView.browser.tsx, environmentApi.ts, store.ts); the Sidebar changes themselves are covered by the focused test above.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels May 27, 2026
@ronak-guliani ronak-guliani merged commit 632fd7d into main May 27, 2026
5 of 7 checks passed
@ronak-guliani ronak-guliani deleted the perf/sidebar-thread-cwd-map branch May 27, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant