Skip to content

fix(app): improve desktop project switching performance#16251

Open
kunish wants to merge 1 commit intoanomalyco:devfrom
kunish:perf/desktop-project-switch
Open

fix(app): improve desktop project switching performance#16251
kunish wants to merge 1 commit intoanomalyco:devfrom
kunish:perf/desktop-project-switch

Conversation

@kunish
Copy link

@kunish kunish commented Mar 6, 2026

Issue for this PR

Closes #16256

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR improves desktop project switching responsiveness by reducing synchronous work on the switch path.

Main changes:

  • avoid full root-session sorting when only top/latest items are needed (topRootSessions, latestRootSession, nextRootStart)
  • optimize navigateToProject with fast-path logic and fewer blocking updates
  • make sidebar preview/workspace session calculations lazy and visibility-driven
  • reduce immediate session-page render cost by gating heavy timeline rendering behind existing defer behavior
  • improve project metadata enrichment so VCS-derived workspace controls behave correctly

How did you verify your code works?

  • bun typecheck (packages/app)
  • PLAYWRIGHT_PORT=4444 bun test:e2e -- e2e/projects/projects-switch.spec.ts
  • bun test:e2e:local -- e2e/projects/projects-switch.spec.ts

Screenshots / recordings

No UI visuals attached for this round.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@kunish kunish requested a review from adamdotdevin as a code owner March 6, 2026 01:36
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Hey! Your PR title perf(app): improve desktop project switch performance doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@kunish kunish changed the title perf(app): improve desktop project switch performance fix(app): improve desktop project switching performance Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Desktop project switching is slow and jittery in app

1 participant