Repository navigation
fix(tasks): make Linear list section headers collapsible - #21302
dev-isaacmello wants to merge 3 commits into
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Linear issue row model now carries section collapse state. The presentation hook tracks collapsed section keys by scope, resets stale state when the scope changes, and omits issue rows for collapsed sections. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The section-collapse behavior has no concrete remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 rough edge worth a look.
Reviewed changes
- Collapsible Linear section headers.
LinearIssueListRow's section variant gainscollapsed; the presentation hook owns aSetof collapsed keys plus a stabletoggleLinearSection, and omits a collapsed section's issue rows fromlinearIssueListRows. - Header becomes a real control.
IssueTablerenders the header as a native<button type="button">witharia-expanded, aChevronRight/ChevronDownswap, and the same hover and focus-visible treatment as the issue rows in the same file. - Tests. Seven
renderHookcases cover toggle, per-section isolation, header count retention, pagination survival, grouping-change reset, andGroup by: None. I ran the file — 7 passed — andpnpm run check:code-quality:changedagainst the PR base reports 0 findings across the 4 changed files.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Pushed On the one failing pre-merge check — Docstring Coverage 0.00% — I've deliberately not chased it, and wanted to flag that rather than leave it looking unnoticed. It reads as a generic threshold that points the opposite way from this repo's own convention:
Adding docstrings to these four files to reach 80% would make them the only ones in the family with them. The two non-obvious decisions in the diff are commented inline, one line each, which is what the guide asks for. Happy to add them if a maintainer would rather have the check green. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 9b72959a-5c91-4796-9edf-f02615955a33
📒 Files selected for processing (2)
src/renderer/src/components/use-task-page-linear-list-presentation.test.tssrc/renderer/src/components/use-task-page-linear-list-presentation.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Collapse reset scoped to the active Linear view. The reset effect no longer keys on
linearGroupByalone: a newlinearSectionScopeKeymemo encodes the active context (project:<id>when the project Issues tab is active,view:<id>for issue-model custom views, elselist:<linearMode>) plus the grouping, mirroring the precedence already used by the projection and selection hooks. A section collapsed in My Issues no longer renders collapsed in a project's Issues tab that shares the grouping. - Reset-effect comment corrected. The old rationale ("a stale collapse would hide an unrelated section") was untrue —
getLinearIssueGroupnamespaces keys per grouping — and now states what the reset actually protects against: keys repeat across views and groupings. - Tests expanded to 9 cases. Two new
renderHookcases cover a list→project switch under the same grouping and project A→project B; both fail if the effect is keyed onlinearGroupByalone, so the regression is pinned. Existing cases were updated to thread the active view through the harness.
I re-ran the new test file (9 passed) and pnpm run check:code-quality:changed (0 findings across the 4 changed files).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Scope-aware collapse reads.
collapsedLinearSectionKeysnow compares the storedscopeKeyagainst the currentlinearSectionScopeKeyand falls back to an empty set, so the first render after a view switch cannot paint the previous list's collapse. The effect then normalizes the stored state, so returning to a list always starts expanded. toggleLinearSectionrebuilds from the scoped set. The updater carriescurrent.keysforward only when the scope matches, so a toggle landing before the reset effect runs starts from empty rather than from a stale set. The callback is recreated per scope, which is what makes the closure'slinearSectionScopeKeyauthoritative.- Regression test added. A new case records
linearIssueListRowson every render and asserts no post-switch render hides rows; it fails if the scope guard is removed. The file is at 10 cases, all passing.
I re-ran the test file (10 passed) and pnpm run check:code-quality:changed (0 findings across the 4 changed files).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
In the Tasks window, when you look at Linear issues grouped by status (or team, assignee, priority), each group sits under a grey header row with a small arrow on it. The arrow made the header look like something you could click to fold the group away — but clicking it did nothing, because that header was only decoration with no handler behind it. Now clicking a header folds that group's issues out of sight, and clicking again brings them back. The arrow points down when the group is open and right when it is folded, which is how the Jira list in the same window already behaves.
What Changed
Before. Tasks → Issues, with Linear as the task source and any "Group by" other than
None: each category rendered as a staticdivcarrying a decorativeChevronDown. Clicking the header or the chevron did nothing, on every platform. The header was also not reachable by keyboard.After. The header is a real button. Clicking it — or tabbing to it and pressing Enter/Space — collapses that category: its issues leave the list and the chevron flips to
ChevronRight. Clicking again restores them. The issue count stays on the header, so a folded category still says how much is inside. Collapse is per-category (folding one leaves the others expanded) and it survives loading another page of issues. It belongs to the list in front of you: changing "Group by", or moving to another Linear view (a project's Issues tab, a custom view, back to My Issues), starts fresh — section keys likestatus:Donerepeat across views, so carrying a collapse over would fold a category you never touched there.Mechanism. Rows for this list are produced flat by
useTaskPageLinearListPresentationas[section, ...issues, section, ...issues], so there was nowhere to hang collapsed state and nothing that could hide a row. The hook now owns aSetof collapsed section keys plus a stabletoggleLinearSection(key)callback, stampscollapsedonto each section row, and omits a collapsed category's issue rows while buildinglinearIssueListRows. The set carries the scope it belongs to — a string identifying the active Linear context plus the grouping, reusing the precedence the projection already applies in three places (project-issues → custom-view-issue → default list). Reads ignore a set whose scope no longer matches, so a stale fold can never be painted, and an effect then drops it so returning to a list always starts expanded.IssueTablerenders the header as a<button>and readsrow.collapsedfor the chevron and foraria-expanded.Why
The header already carried a chevron, so it promised a disclosure control that the code never implemented — which is exactly the mismatch the issue reports. The Jira list (
task-page-jira-issue-list.tsx) already solves this with per-section collapse state, so this follows its shape rather than inventing a second pattern for the same job in the same window (docs/STYLEGUIDE.md, UX rule 2: adjacent siblings should read as one design).Alternatives considered:
Collapsible, exactly as the Jira list does. The Jira list renders nestedsection → issues; the Linear list is deliberately flat — onelinearIssueListRowsarray feeding a singlemap. Nesting it would have restructured the renderer for no user-visible gain. Filtering the flat row list keeps the change confined to state.<Button variant="ghost">like the Jira sibling. The repo'sshadcn/no-restylegate rejects the background, padding, radius and focus classes that this band needs when they appear on new lines, and adding a button variant for a single call site would change a shared primitive. A native<button>keeps the header's exact existing layout classes and adds only the hover andfocus-visibletreatment already used by the issue rows in the same file.orca.linear.issue-view.v1). Out of scope for a bug fix, and the Jira sibling does not persist either — keeping them identical avoids a seam between the two lists.Linked Issue
Closes #21228
Visual Proof
Captured with the repo's own Electron + Playwright harness against the mocked Linear IPC backend (the same fixture shape
tests/e2e/linear-issue-view-persistence.spec.tsinstalls), so these are the real rendered app, not a mockup. No Linear account was needed. Both columns are the identical scenario: Tasks → Issues, task source Linear, Group by: Status.The row that matters is the second one — the same click, on the same header.
main)TodoheaderBefore: the click does nothing — all three
Todoissues stay, the chevron stays pointing down. After:Todofolds away, the chevron flips to point right, the count3stays on the header, andIn ProgressandDoneare untouched.The capture spec asserted this mechanically rather than by eye — it probed whether the first
Todoissue was still visible after the header click:(The capture spec was a throwaway and is not part of this PR; only the four files in the diff are.)
Testing
Automated. New
src/renderer/src/components/use-task-page-linear-list-presentation.test.ts— 10renderHookcases over the presentation hook:collapsedpagedLinearIssues)Group byclears collapsed statelinearIssueListRowson every render, not just the settled one)Group by: Nonethere are no section rows and a toggle is a no-opThese are written to catch a regression, not to cover lines. As a check on that: loosening the reset effect so it also fires on pagination makes the pagination case fail; keying it on
linearGroupByalone (the first version of this PR) fails both view-scoping cases; stampingcollapsed: falseunconditionally fails the first two; and removing the scope guard on reads fails the stale-frame case.Manual. Drove the real app through Electron + Playwright (headless,
ORCA_BACKGROUND_LAUNCH=1, CDP screenshots of a hidden renderer) with the mocked Linear backend: opened Tasks → Issues → Linear, set Group by: Status, clicked a category header, and confirmed the section folds and unfolds and that the other categories do not move. See Visual Proof for the before/after and the mechanical probe.Platforms. Verified on Linux (Ubuntu 24.04, Electron headless). Not executed on macOS or Windows: the change is renderer-only React state plus a native
<button>with no platform-conditional code, no modifier-key handling and no path handling, so there is nothing that can diverge per OS. Not tested over SSH either — the toggle makes no IPC or host round-trip, so it cannot be affected by remote latency.Repo checks.
pnpm lint✅ ·pnpm typecheck✅ ·pnpm build✅ ·pnpm run check:code-quality:changed✅ (design-system and casting gates clean on the changed lines).pnpm test: 8871 files passed, 11 failed. Those 11 are not from this change — I re-ran exactly those files against a clean tree at the same base commit (09622f0c28) and 10 of them fail identically there (they need a real Claude CLI binary, a specificbash, FTS5, or a relay host). The 11th,palette-match-performance.test.ts, is a wall-clock budget test that fails only under full-suite load and passes on its own with this change applied. The new tests and every other renderer/component test pass.AI Disclosure
Claude Opus 5, via Claude Code.
Review
Code review summary from the agent that wrote the change:
<button>; it reads no modifier key, builds no path, and calls no platform API. Nothing here renders or behaves differently per OS.use-task-page-linear-board.tsbuilds its own sections fromgroupLinearIssuesand never readslinearIssueListRows, which has exactly two consumers — the hook that produces it andIssueTable.Group bychange. A review caught two things and both were right: the code comment's stated reason was false (getLinearIssueGroupnamespaces keys per grouping, so a stale key can never match another grouping's section), and collapse leaked across Linear views that share a grouping.ad00b08fixes the comment and scopes the reset to the active view. A second review then caught that an effect-only reset still lets the first render of a new view use the old set, so a section could flash collapsed in a list it was never collapsed in;88d060emakes reads scope-aware so that window does not exist.Set.hasper section (not per row) inside the existinguseMemo. The memo gains the collapsed set as a dependency, so it recomputes on toggle — which is the point of the change. A collapsed section skips constructing its issue row objects entirely, so folding a large category makes the render cheaper rather than more expensive.toggleLinearSectionisuseCallback-stable, and the grouping-change reset returns the sameSetwhen it is already empty, so it does not cause a render on mount.hover:bg-accentand thefocus-visiblering already used by the issue rows in this same file, so it reads consistently in light and dark mode. Chevron direction follows the Jira convention — down when open, right when collapsed. No new tokens, colors, sizes or shadow tiers.pnpm run check:code-quality:changed(which includes the design-system gate) passes on the changed lines.div; it is now a real button, so it is tab-reachable and Enter/Space activates it, andaria-expandedreports the state to assistive tech.dangerouslySetInnerHTML, no new dependency. No security surface.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
mobile/is untouched; this component does not ship there.collapsedis a new field on an internal renderer row type with two in-repo consumers, both updated here. Nothing persisted, nothing on the wire, no settings migration.Setlookup per section per recompute; collapsed sections skip row construction.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Author
X (Twitter) handle: N/A — contributor prefers not to share one.