fix(app): deduplicate diff summaries linearly#37414
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a performance bottleneck in the app’s session timeline construction by replacing the prior quadratic diff-summary deduplication with a Set-backed linear reverse scan, matching the legacy behavior while avoiding renderer hangs on large summary.diffs payloads.
Changes:
- Introduces
uniqueSummaryDiffs()to deduplicateSnapshotFileDiffentries in linear time while preserving legacy ordering and “last diff wins” semantics. - Updates timeline row construction to use the new helper instead of inline
reduceRight(... some(...))logic. - Adds unit tests verifying filtering, ordering, and object identity preservation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/app/src/pages/session/timeline/summary-diffs.ts | Adds Set-backed linear deduplication helper for summary diffs with legacy-compatible ordering. |
| packages/app/src/pages/session/timeline/summary-diffs.test.ts | Adds coverage for invalid entries, last-duplicate selection, display order, and identity preservation. |
| packages/app/src/pages/session/timeline/rows.ts | Replaces inline quadratic dedup logic with uniqueSummaryDiffs() and removes the local type guard. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
avion23
pushed a commit
to avion23/opencode
that referenced
this pull request
Jul 17, 2026
This was referenced Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #33106.
Verification
Full app unit run: 622 passed; the existing Arabic i18n parity failure remains outside the changed files.