Repository navigation
perf(mobile): reuse Linear ordering for list and board grouping - #20314
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (12)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe change centralizes task and Linear issue sorting. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The sorting and grouping refactor preserves the established ordering behavior and is covered by parity, grouping, and isolation tests. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
ℹ️ No critical issues — one copy/paste nit inline.
Reviewed changes
- New sorted-input grouping API —
groupSortedLinearIssuesaccepts a pre-sortedreadonly LinearIssue[]andgroupLinearIssuesnow delegates to a sharedgroupOrderedLinearIssuesafter sorting, inmobile-tasks-reviewer-linear.ts. - Both projection sites switched —
linearIssueSectionsandlinearBoardSectionsconsume the already-sortedlinearIssuesForView, removing the redundant sort per projection. - Tests & benchmark — new
mobile-linear-group-sorted.test.tsplus updated refactor-parity hashes, and a standalone benchmark script.
Verified: focused mobile tests pass (11), check-changed-code-quality.mjs reports 0 findings across 5 files, and the benchmark runs clean with its assert.deepEqual(after, before) parity check intact across 25/200/1000 issues. Ordering equivalence holds because linearIssuesForView uses the same compareLinearIssues(..., linearOrderBy) comparator the old path used and sort is stable.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Grouping now composes with the batch sorter — this branch merged base #20249, and
groupLinearIssuesnow delegates to the sharedgroupOrderedLinearIssues(sortLinearIssues(issues, orderBy), groupBy)instead of the old per-comparisoncompareLinearIssues. - Projection reuses the already-sorted view —
linearIssuesForViewis built withsortLinearIssues(items, linearOrderBy); bothlinearIssueSectionsandlinearBoardSectionscallgroupSortedLinearIssuesand no longer re-sort. - Prior nit fixed — the benchmark usage string now names
mobile-linear-group-sorted-benchmark.mjs, and itsassert.deepEqual(after, before)parity check is intact. - Tests and parity hashes refreshed — the sorted-grouping test and benchmark switched to
sortLinearIssues; the refactor-parity declaration count is 194 with updated statement/semantics/hook hashes.
groupSortedLinearIssues(sorted, ...) copies its input and both grouping paths share one implementation, so section order, ties, row identity, and array independence are preserved. check-changed-code-quality.mjs reports 0 findings across 12 changed files, and the previous review thread is resolved.
openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
584dc8d to
0c195c9
Compare
85028c4 to
b61b242
Compare
|
Too many files changed for review (184 files, 100 file limit). Bypass the limit by tagging |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Board reuses the list sections for every grouping except
none—linearBoardSectionsnow returnslinearIssueSectionsfor grouped views instead of groupinglinearIssuesForViewa second time;nonestill builds its own status split for board columns. - Projection memos tightened —
linearIssueSectionsandlinearBoardSectionsdrop the now-unneededlinearOrderBydependency, and the board memo keys onlinearIssueSections. - Test mock and parity hashes refreshed — the view-projection test mocks
groupSortedLinearIssuesand updates its work-count assertions to the single-grouping shape; refactor-parity hook/statement hashes and declaration count were refreshed.
Verified 28 focused mobile tests pass (use-mobile-tasks-provider-view-projection.test.tsx, mobile-linear-group-sorted.test.ts, mobile-tasks-refactor-parity.test.ts). The board/list identity sharing is safe: mobile-tasks-linear-list.tsx only reads sections, and the list still renders through linearListEntries, so no consumer mutates a shared section.issues.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
Mobile Tasks sorted Linear issues for the view, then sorted the same issues again for both list and board groups. Reuse the ordering the view already established.
What Changed
Add
groupSortedLinearIssueswith an explicit sorted-input contract and use it for the two view projections. Both grouping APIs reuse the existing grouping implementation.groupLinearIssuesstill sorts unsorted inputs. Keep memo dependencies, fresh result arrays, group metadata, input/object identity, and stable ties intact.Why
The view already orders
linearIssuesForViewusing the selected order. Grouping only needs to consume that sequence. This deletes two redundant sorts per projection without caching.Counterbalanced full sort/list-group/board-group pipeline benchmark, macOS/Node 24, 8 pairs with 10 calls per arm and GC outside samples (wall medians):
At 200 issues after #20249, updated ordering improves from 0.104 to 0.053 ms. These are Node computation measurements, not Hermes/device or rendered UI timings.
Linked Issue
User-requested performance audit; no linked issue. Independent baseline branch, not stacked on #20249. Both PRs touch the grouping module, view projection, and computation fingerprints; preserve both changes when reconciling them.
Visual Proof
N/A — pure computation change with identical sections, ordering, labels, and display behavior.
Testing
ORCA_BACKGROUND_LAUNCH=1.node --expose-gc config/scripts/mobile-linear-group-sorted-benchmark.mjs 20ab9950654. Appendnwparker/perf-mobile-linear-sort-keysto measure the incremental gain after perf(mobile): precompute Linear issue sort keys #20249.Review
Self-reviewed the sorted-input guarantee, array ownership and unchanged memo dependencies. Desktop grouping has a different comparator and remains separate.
Agent skill upstream boundary
Checklist
Merge order
Stacked on #20249, which follows #20233. Merge prerequisites first, then retarget this PR to
main. Both sorting and grouping optimizations are preserved; 23 combined tests, lint, formatting and benchmark parity pass. Benchmark usage text is corrected.