Skip to content

perf(app): isolate sidebar from streaming updates and cache thread row derivation#426

Merged
Dimillian merged 2 commits intoDimillian:mainfrom
oliver-bowman:perf/app-sidebar-streaming-optimization
Feb 14, 2026
Merged

perf(app): isolate sidebar from streaming updates and cache thread row derivation#426
Dimillian merged 2 commits intoDimillian:mainfrom
oliver-bowman:perf/app-sidebar-streaming-optimization

Conversation

@oliver-bowman
Copy link
Contributor

@oliver-bowman oliver-bowman commented Feb 13, 2026

Summary

This PR reduces frontend render/compute overhead during thread streaming by isolating sidebar update paths and caching thread row derivation.

Problem

Streaming deltas were causing frequent app rerenders that repeatedly rebuilt sidebar thread structures and action props, creating unnecessary UI churn.

Changes

  • Added useSidebarLayoutActions to provide stable sidebar callback identities.
  • Replaced inline sidebar callbacks in App with memoized hook outputs.
  • Added cache-aware useThreadRows derivation keyed by workspace/expanded state with bounded per-key pin-version caching.
  • Plumbed pinnedThreadsVersion from threads storage through layout/sidebar/worktree/cycling paths to invalidate cache correctly on pin changes.
  • Added tests for thread-row cache behavior (including stale pin-version non-retention) and sidebar action stability.

Validation

  • npm run typecheck
  • npm run test
  • Targeted tests for new hooks/components
  • Tested locally on macos and ran tauri profiler to confirm

Risk

Low. This is internal frontend refactoring/perf work with no API/IPC/RPC contract changes and no intended behavior changes.

Docs

No docs updates required.

@oliver-bowman
Copy link
Contributor Author

@codex review this

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Dimillian
Copy link
Owner

@codex review and try to find regression and hehaviour difference from main

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Dimillian Dimillian merged commit 4fa81a6 into Dimillian:main Feb 14, 2026
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.

2 participants