Skip to content

Fixes selection highlight delay when selecting composer commits with large commits#5001

Merged
ramin-t merged 4 commits intomainfrom
bugs/composer-commit-select-delay
Mar 2, 2026
Merged

Fixes selection highlight delay when selecting composer commits with large commits#5001
ramin-t merged 4 commits intomainfrom
bugs/composer-commit-select-delay

Conversation

@ramin-t
Copy link
Contributor

@ramin-t ramin-t commented Feb 23, 2026

Closes #4872

Reduces the time needed to highlight a commit in the commits panel of the composer when it is selected or shift-selected.

Does this by:

  1. Using caching/memoization to reduce redundant calculations of commits and hunks and diff/file counts in both the app and commits panel.
  2. Delaying the event firing from the commits panel to the app using double-RAF
  3. Fixing some redundant processing that happens on diff files when initially loaded, and uses scheduling for updates
  4. Removing the transition from commit highlighting when selected

@ramin-t ramin-t requested review from d13 and eamodio February 23, 2026 21:16
@augmentcode
Copy link

augmentcode bot commented Feb 23, 2026

🤖 Augment PR Summary

Summary: Improves Composer commit selection responsiveness when working with very large diffs by decoupling selection highlight rendering from expensive diff/file processing.

Changes:

  • Memoizes `updateHunkAssignments` in ComposerApp to avoid recomputing assignments when hunks/commits references are unchanged.
  • Adds internal selection state to gl-commits-panel so the highlight updates immediately on click, then dispatches selection events after paint.
  • Introduces a double-requestAnimationFrame helper to delay event dispatch until the selection frame has been rendered.
  • Caches per-commit additions/deletions and file counts, recomputing only when commits or hunks change.
  • Defers gl-diff-file diff parsing via scheduled macrotasks and reprocesses when the element becomes visible to reduce main-thread blocking.
  • Removes the selection transition to eliminate perceived highlight lag.

Technical Notes: The delayed dispatch pattern ensures UI feedback is painted before the details panel begins heavy diff rendering, and scheduled diff parsing reduces work in Lit’s microtask update batch.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@ramin-t ramin-t force-pushed the bugs/composer-commit-select-delay branch from 5aebdfb to b4f6333 Compare March 2, 2026 15:55
@ramin-t
Copy link
Contributor Author

ramin-t commented Mar 2, 2026

augment review

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@ramin-t
Copy link
Contributor Author

ramin-t commented Mar 2, 2026

augment review

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copy link
Member

@d13 d13 left a comment

Choose a reason for hiding this comment

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

Looks good, but was curious about using double requestAnimationFrame versus using setTimeout(0).

@ramin-t ramin-t removed the request for review from eamodio March 2, 2026 19:36
@ramin-t ramin-t merged commit 3cef977 into main Mar 2, 2026
6 checks passed
@ramin-t ramin-t deleted the bugs/composer-commit-select-delay branch March 2, 2026 19:38
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.

Recompose performance degrades when each commit is selected

3 participants