Repository navigation
perf: index selected team IDs and choose primary team in one pass - #19504
Merged
Merged
Conversation
nwparker
marked this pull request as ready for review
September 8, 2026 04:53
Contributor
|
Warning Review limit reachedNext included review available in 26 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Algorithm rewrite —
resolveLinearIssueAttributeFilterPrimaryTeamnow builds aSetof selected IDs and finds both the name/id-minimum available team and the name/id-minimum selected team in a single linear pass, replacing two fullArray.prototype.sortcalls and an O(n²).includesscan. Return value (firstSelected ?? firstAvailable) is identical across all four original branches: empty teams, no selection, matched selection, and unmatched selection. - Tie-break parity — the strict
< 0comparison keeps the earliest team on equal (name, id), matching stablesortsemantics. - Complexity regression test — a new test uses a
Proxyto count selected-ID reads (<= 1000) and anamegetter to count comparator reads (< 5000). Both assertions fail under the previous O(n²)+sort implementation and pass under the new one, so the test pins real behavior rather than absorbing it.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
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.

ELI5
When you filter the Linear issue list by team, Orca has to pick one "main" team to show details for. It picks the alphabetically-first team you selected — or, if you selected none, the alphabetically-first team that exists.
The old way was like sorting an entire deck of cards just to find the lowest card, and checking each card against your whole wishlist one by one. The new way walks the deck once and simply remembers the lowest card seen so far.
Nothing about which team gets picked changes — same team, same alphabetical order, same tie-breaks. It just gets there with less work.
What Changed / Why
Array.sortcalls plus anArray.includesscan per team with a single linear pass and aSetlookup.Array.prototype.sortis stable, and the new min-scan uses a strict< 0comparison, so ties still resolve to the earliest team in the original list.This PR contains only this focused change and its regression coverage. It targets
mainindependently of the other desktop audit PRs. Measurements describe operation/allocation reductions, not end-to-end latency gains.Linked Issue
User-requested desktop performance audit; no issue supplied.
Visual Proof
N/A — no visual design change. Behavior and performance invariants are checked by automated regression tests.
Testing
pnpm tcpassed on this branch.git diff --cached --checkpassed.ORCA_BACKGROUND_LAUNCH=1. No visible test window was launched.Test files:
src/renderer/src/components/linear-issue-attribute-filter-primary-team.test.tsAgent skill upstream boundary
Checklist