Skip to content

fix(linear): union filter options across every selected team - #10042

Merged
nwparker merged 1 commit into
stablyai:mainfrom
innocarpe:fix/linear-multi-team-filter-options
Jul 24, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
innocarpe:fix/linear-multi-team-filter-options

Conversation

@innocarpe

@innocarpe innocarpe commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On Tasks → Linear issues, selecting multiple teams (or "All teams") now lists Filter → Status / Assignee / Label options from every selected team, deduped by id, instead of only the primary team's.

ELI5

Each Linear team has its own statuses, labels, and people. If you pick two teams, the filter menu should show both teams' options — but Orca only asked the first team. Now it asks every selected team and merges the lists.

Root cause & fix

The attribute filter dropdowns resolved a single primaryTeam and loaded metadata only for that team, showing an "Options from {team}" banner while ignoring the rest of the multi-select. The fix adds resolveLinearIssueAttributeFilterTeamIds() (name-stable ordering, falls back to the primary team on empty selection, drops ids absent from availableTeams) and unionLinearMetadataById() (dedupe by id, first-seen order), plus useTeamsStates/useTeamsLabels/useTeamsMembers hooks that fan out through the existing per-team cache stores and union the results. TaskPage now passes selectedTeamIds + availableTeams, active filter pills prune against the unioned option set, and the stale banner is removed.

Evidence

Validated & rebased onto latest main during a bug-bash triage on 2026-07-23.

(a) On branch:  Test Files 2 passed (2), Tests 11 passed (11)
(b) Reverted:   Test Files 2 failed (2), Tests 1 failed | 4 passed (5)
      useIssueMetadata.test.tsx › unions workflow states across every
      selected team (#8739): TypeError: useTeamsStates is not a function

Trade-offs

None — pure fix. Filter lists grow under multi-team selection, which is the intended behavior; results are deduped by id and reuse the same per-team TTL cache as the single-team hooks.

Regression risk

Effectively zero. The change is additive (new module + new hooks); single-team paths keep their behavior via the empty-selection fallback, and the pre-existing single-team cache/TTL tests stay green. useTeamsMetadataList keys effects on a joined cache key so freshly-passed arrays don't thrash, and an active-key ref guards stale async results.

Credit to original author @innocarpe. Validated, rebased, and (where applicable) hardened via automated bug-bash review; original fix design preserved.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@nwparker, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cf33eb44-b010-49f0-bceb-a57884e83039

📥 Commits

Reviewing files that changed from the base of the PR and between 34dbadfb60f1524621e61f08f76ec8fc14ea523f and 9c99c23.

📒 Files selected for processing (6)
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/components/linear-issue-attribute-filter-dropdowns.tsx
  • src/renderer/src/components/linear-issue-attribute-filter-team-ids.test.ts
  • src/renderer/src/components/linear-issue-attribute-filter-team-ids.ts
  • src/renderer/src/hooks/useIssueMetadata.test.tsx
  • src/renderer/src/hooks/useIssueMetadata.ts
📝 Walkthrough

Walkthrough

Linear issue attribute filters now receive selected team IDs and available teams. New helpers resolve valid team IDs and union metadata by ID. Multi-team hooks load and combine states, labels, and members across selected teams, while the dropdown updates active-team handling and filter pruning for team sets. Tests cover team resolution, metadata unioning, and multi-team workflow state loading.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR matches #8739 by unioning status, assignee, and label metadata across every selected team, including All teams.
Out of Scope Changes check ✅ Passed The added helpers, hook changes, UI updates, and tests all support the Linear multi-team filter fix and appear in scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed Title clearly summarizes the main change: unioning Linear filter options across all selected teams.
Description check ✅ Passed Description is detailed and covers summary, root cause, evidence, and tests, but omits the template's screenshots, AI review, security audit, and notes sections.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 94867968-f84d-4102-8c55-bd6cb441a524

📥 Commits

Reviewing files that changed from the base of the PR and between 0326594 and 34dbadfb60f1524621e61f08f76ec8fc14ea523f.

📒 Files selected for processing (6)
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/components/linear-issue-attribute-filter-dropdowns.tsx
  • src/renderer/src/components/linear-issue-attribute-filter-team-ids.test.ts
  • src/renderer/src/components/linear-issue-attribute-filter-team-ids.ts
  • src/renderer/src/hooks/useIssueMetadata.test.tsx
  • src/renderer/src/hooks/useIssueMetadata.ts

Linear attribute filters (status / assignee / label) only loaded metadata
for the primary selected team, so multi-team and All-teams views dropped
other teams' options. Load every selected team (sharing the per-team
metadata cache), union by id, and drop the single-team-only banner.
@nwparker
nwparker force-pushed the fix/linear-multi-team-filter-options branch from 34dbadf to 9c99c23 Compare July 23, 2026 11:49
@AmethystLiang
AmethystLiang self-requested a review July 23, 2026 20:28
@nwparker
nwparker merged commit 4274dbc into stablyai:main Jul 24, 2026
@nwparker

Copy link
Copy Markdown
Contributor

Thanks so much for this, @innocarpe — union filter options across every selected team. Reviewed, rebased on latest main, and merged. Really appreciate the contribution! 🙏

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.

2 participants