Skip to content

Unify Linear and task provider setup into guided flows - #11533

Merged
AmethystLiang merged 6 commits into
mainfrom
better-linear-guide
Jul 30, 2026
Merged

AmethystLiang merged 6 commits into
mainfrom
better-linear-guide

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #11328

Summary

Refactors task provider setup across Task Sources and Linear Settings into unified guided checklists instead of visibility-only toggles. Each provider now walks through setup (connect → skill for Linear → visibility) in one place, with progress tracking, incomplete setup warnings, and deep links to Integrations.

Changes

  • New guided flows: LinearAgentSkillGuide (3-step checklist), TaskSourceLinearSetup (Task Sources integration), and TaskSourceProviderCard (collapsible setup cards)
  • Setup state management: task-source-setup-state.ts tracks readiness across connection, skill install, and visibility; warns only about started-then-stalled setup
  • Shared setup wiring: use-linear-agent-skill-setup.ts and use-task-source-provider-readiness.ts prevent duplication
  • Sticky auto-expand: Keeps skill install terminals mounted across rechecks so users don't lose context
  • Integrations routing: "Manage keys" buttons route directly to Integrations pane via new sectionId parameter
  • Generic step badge: Renamed BrowserUseStepBadge → SetupStepBadge for reuse
  • Translations: Updated en.json and localized strings (es, ja, ko, zh) to describe setup flows, not just visibility

Testing

  • All new components and hooks have comprehensive test suites (LinearAgentSkillGuide, TaskSourceLinearSetup, TaskSourceProviderCard, task-source-setup-state, use-task-source-provider-readiness)
  • Existing LinearAgentSkillPane tests updated to verify guide + checklist layout
  • TasksPane tests verify incomplete-setup banner, sticky auto-expand, and provider card state transitions
  • Skill freshness and re-check notifications tested to avoid flashing status during in-flight rescans
  • Cross-browser platform shortcuts and locale handling unchanged

Consolidate Linear API connection, agent skill installation, and Tasks visibility into guided step-by-step workflows. Moves Linear setup from a hidden integrations link into expandable cards within Task Sources (first-time path) and a prominent checklist in the Linear settings pane. Adds reusable TaskSourceProviderCard and step components so GitHub, GitLab, and Jira follow the same pattern. Surfaces incomplete provider warnings and auto-expands the first unfinished provider to reduce friction.
Extract shared Linear skill setup logic into `useLinearAgentSkillSetup` hook so
Task Sources and LinearAgentSkillPane both follow the same configuration path.
Embed the skill install panel inside LinearAgentSkillGuide instead of placing it
after, eliminating duplicate "Agent skill" section headers. Introduce task
provider setup state helpers: distinguish fresh untouched providers from
started-then-stalled ones (only warn on the latter), keep auto-expanded cards
open across rechecks via sticky tracking, and handle unavailable/failed
preflight status. Rename BrowserUseStepBadge to SetupStepBadge (used by
multiple setup types now). Route connected credential management to Integrations
cards instead of re-opening dialogs. Add settled flag to skill discovery so
focus-triggered rescans don't flash UI on known results.
@greptile-apps

greptile-apps Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR replaces the flat checkbox list in Task Sources with guided, collapsible provider cards and adds a matching 3-step checklist in the Linear settings pane. Each provider now walks through connection → skill (Linear only) → visibility in a single flow, with progress badges, an incomplete-setup banner, and deep links into Integrations.

  • Setup state layer (task-source-setup-state.ts, use-task-source-provider-readiness.ts): computes per-provider readiness from preflight/Linear/Jira store slices plus skill discovery, memoizing the aggregated record. A "stalled setup" filter warns only about started-then-abandoned flows.
  • Sticky auto-expand (TasksPane.tsx, TaskSourceProviderCard.tsx): uses render-phase setState (not useEffect) to claim the first incomplete provider as the auto-expanded card and hold it sticky for the pane lifetime, preventing mounted terminals from being unmounted during in-flight rescans.
  • Skill sync refactor (useInstalledAgentSkills.ts, AgentSkillSetupPanel.tsx): introduces a lightweight REFRESHED_EVENT that triggers a cache-read-only rescan (force=false, showLoading=false) so sibling skill surfaces sync after a recheck without flashing their loading state; terminal-exit still fires the full CHANGED_EVENT for a proper re-discovery.

Confidence Score: 5/5

Safe to merge — purely a renderer-layer settings UI refactor with comprehensive new test coverage and no mutations to persistence, network, or auth paths.

All state changes are local to the settings pane. The render-phase setState patterns converge correctly and are a documented React idiom. The skill sync split (lightweight REFRESHED_EVENT vs full CHANGED_EVENT) fixes a pre-existing notification ordering bug rather than introducing new risk.

Files Needing Attention: useActiveProjectSkillRuntime.ts — the JSON.stringify identity comparison runs on every render of each consumer; worth revisiting if profiling shows cost on low-end hardware.

Important Files Changed

Filename Overview
src/renderer/src/components/settings/task-source-setup-state.ts New state helpers for readiness/status computation; logic is clean and well-commented with correct guard ordering
src/renderer/src/components/settings/use-task-source-provider-readiness.ts Aggregates per-provider readiness into a stable memoized record; all useMemo deps are correctly included
src/renderer/src/components/settings/TasksPane.tsx Replaces checkbox list with guided provider cards; render-phase setState for sticky auto-expand correctly replaces the post-commit useEffect approach flagged in the previous review
src/renderer/src/components/settings/TaskSourceProviderCard.tsx Collapsible card with correct one-way auto-expand: only opens on prop transition, never force-closes, preserving in-progress terminals
src/renderer/src/components/settings/use-linear-agent-skill-setup.ts Extracts shared Linear skill install/update wiring; correctly exposes skillChecking as a settled-aware flag to prevent status flashing
src/renderer/src/hooks/useInstalledAgentSkills.ts Adds settled flag and showLoading parameter; new REFRESHED_EVENT triggers cheap cache-read sync to avoid flashing sibling surfaces
src/renderer/src/hooks/useActiveProjectSkillRuntime.ts Adds identity-stable wrapper via render-phase setState; the pattern is valid but JSON.stringify runs on every render of every consumer
src/renderer/src/components/settings/AgentSkillSetupPanel.tsx Recheck button now fires notifyInstalledAgentSkillsRefreshed after onRecheck() resolves (not before), fixing a pre-existing race in the notification ordering
src/renderer/src/components/settings/LinearAgentSkillPane.tsx Replaced standalone skill panel with LinearAgentSkillGuide checklist; re-export cleanly removed since all callers already import directly from the source module
src/renderer/src/components/settings/TaskSourceLinearSetup.tsx New 3-step guided flow for Linear within Tasks pane; skill panel conditionally hidden to avoid flashing 'connect first' over an already-installed skill
src/renderer/src/components/settings/LinearAgentSkillGuide.tsx 3-step checklist for the Linear settings pane; completed count computed from durable states to avoid counter flashing during rescans

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    TS[TasksPane] --> UTPR[useTaskSourceProviderReadiness]
    UTPR --> |GitHub/GitLab| PS[preflightStatus store]
    UTPR --> |Jira| JS[jiraStatus store]
    UTPR --> |Linear connection| LC[useLinearProviderConnected]
    UTPR --> |Linear skill| IAS[useInstalledAgentSkillNames]
    TS --> |readinessByProvider| RSAE[resolveStickyAutoExpandedTaskProvider]
    RSAE --> |once claimed| STICKY[previousAutoExpanded sticky]
    TS --> |for each provider| TPC[TaskSourceProviderCard]
    TPC --> |linear| TSLS[TaskSourceLinearSetup]
    TPC --> |jira| JiraSetupSteps
    TPC --> |github/gitlab| CodeHostSetupSteps
    TSLS --> ASP[AgentSkillSetupPanel]
    TSLS --> ULAS[useLinearAgentSkillSetup]
    ULAS --> IAS
    ASP --> |on recheck .then| NR[notifyInstalledAgentSkillsRefreshed]
    ASP --> |on terminal exit| NC[notifyInstalledAgentSkillsChanged]
    NR --> |refresh false,false| IAS
    NC --> |refresh true,true| IAS
    LASP[LinearAgentSkillPane] --> LAG[LinearAgentSkillGuide]
    LASP --> ULAS
    LAG --> |step 3 button| TS
Loading

Reviews (5): Last reviewed commit: "fix: stop mutating refs during render fo..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change introduces a guided task-provider setup hub with readiness tracking, provider cards, visibility controls, connection flows, retries, and sticky expansion. Linear setup is composed from reusable skill setup, checklist, notes, and task-source components. Installed-skill discovery gains caching and refreshed notifications. Integration cards expose section identifiers, shared setup badges are adopted, and Linear-related copy is updated across supported locales.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers summary, changes, and testing, but it omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, including screenshots/no visual change, AI review findings, security audit summary, and notes.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: unifying Linear and task provider setup into guided flows.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch better-linear-guide

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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/hooks/useInstalledAgentSkills.ts (1)

155-206: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

loading can latch on when refresh modes interleave. Every refresh bumps refreshGenerationRef, but only showLoading: true requests clear loading; a REFRESHED-driven refresh(false, false) therefore supersedes an in-flight loading refresh and never resets the flag, leaving spinners and disabled={loading} controls stuck.

  • src/renderer/src/hooks/useInstalledAgentSkills.ts#L155-L206: let the winning generation always clear loading in the finally block (or track loading ownership separately from the generation guard).
  • src/renderer/src/hooks/useInstalledAgentSkills.react.test.tsx#L250-L310: add a test that dispatches focus, then calls notifyInstalledAgentSkillsRefreshed() while the forced scan is still pending, and asserts loading returns to false.
🧹 Nitpick comments (6)
src/renderer/src/hooks/useInstalledAgentSkills.react.test.tsx (1)

250-310: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add a regression test for a REFRESHED event arriving during a loading refresh.

Both new tests exercise the two refresh modes in isolation. The interleaving (focus rescan in flight → notifyInstalledAgentSkillsRefreshed() from another surface) is the case that can leave loading stuck true; see the note on src/renderer/src/hooks/useInstalledAgentSkills.ts Line 155-206.

src/renderer/src/hooks/useInstalledAgentSkills.test.ts (1)

227-250: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused window.CustomEvent stub.

notifyInstalledAgentSkillsRefreshed() dispatches a module-global new CustomEvent(...), while this test runs in the declared Node v24 environment. The stubbed window.CustomEvent property is not consulted, so it is misleading.

src/renderer/src/components/settings/LinearAgentSkillPane.tsx (1)

68-96: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated Linear skill-panel wiring vs. TaskSourceLinearSetup.tsx.

This <AgentSkillSetupPanel> block (title/description/command/terminal props all sourced from skillSetup) is structurally identical to the one in TaskSourceLinearSetup.tsx (per cross-file evidence), differing only in terminalWorktreeId and a couple of translate keys. Consider extracting a shared LinearAgentSkillInstallPanel({ worktreeId, titleKey })-style helper so both setup entry points stay in sync as the skill-install flow evolves.

src/renderer/src/components/settings/TaskSourceProviderCard.tsx (1)

126-140: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Visibility control disappears when a card is expanded without children.

children is optional, but the header visibility button is only rendered while collapsed, relying on the expanded setup steps to provide it. Current callers always pass setup steps, so this is only a latent trap for future cards.

♻️ Optional guard
-          {!expanded ? (
+          {!expanded || !children ? (
src/renderer/src/components/settings/TasksPane.tsx (1)

245-263: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Sentence assembled from three fragments plus an inline button.

integrationsHint + link + skillHint (which starts with a bare .) forces translators into English word order and leaves the punctuation stranded in a separate key. A single key with an interpolated link component (or Trans-style rendering) would localize cleanly.

src/renderer/src/components/settings/TaskSourceLinearSetup.tsx (1)

153-155: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Borrowing TasksPane's Linear key from this component.

auto.components.settings.TasksPane.09ae2d7c51 is reused here (and in TaskSourceSimpleSetup.tsx for Jira), so the copy is now owned by a file that no longer renders it. A shared provider-label accessor (or per-file keys) keeps catalog ownership traceable.

Based on learnings, settings localization prefers keys under the appropriate component namespace.

Source: Learnings


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aeb8a77f-3dfa-4656-83c3-42cefba6deb8

📥 Commits

Reviewing files that changed from the base of the PR and between d0d8695 and 7b3e084.

📒 Files selected for processing (58)
  • src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideSteps.tsx
  • src/renderer/src/components/emulator-pane/mobile-emulator-agent-setup-cli-state.ts
  • src/renderer/src/components/integration-status-pill.tsx
  • src/renderer/src/components/settings/AgentSkillSetupPanel.test.tsx
  • src/renderer/src/components/settings/AgentSkillSetupPanel.tsx
  • src/renderer/src/components/settings/BrowserUseCliStep.tsx
  • src/renderer/src/components/settings/BrowserUseCookieImportStep.tsx
  • src/renderer/src/components/settings/BrowserUseSkillStep.tsx
  • src/renderer/src/components/settings/LinearAgentSkillGuide.test.tsx
  • src/renderer/src/components/settings/LinearAgentSkillGuide.tsx
  • src/renderer/src/components/settings/LinearAgentSkillNotes.test.tsx
  • src/renderer/src/components/settings/LinearAgentSkillNotes.tsx
  • src/renderer/src/components/settings/LinearAgentSkillPane.test.tsx
  • src/renderer/src/components/settings/LinearAgentSkillPane.tsx
  • src/renderer/src/components/settings/MobileEmulatorAgentControlRow.tsx
  • src/renderer/src/components/settings/Settings.tsx
  • src/renderer/src/components/settings/SetupStepBadge.tsx
  • src/renderer/src/components/settings/TaskSourceLinearSetup.test.tsx
  • src/renderer/src/components/settings/TaskSourceLinearSetup.tsx
  • src/renderer/src/components/settings/TaskSourceProviderCard.test.tsx
  • src/renderer/src/components/settings/TaskSourceProviderCard.tsx
  • src/renderer/src/components/settings/TaskSourceShowInTasksStep.test.tsx
  • src/renderer/src/components/settings/TaskSourceShowInTasksStep.tsx
  • src/renderer/src/components/settings/TaskSourceSimpleSetup.test.tsx
  • src/renderer/src/components/settings/TaskSourceSimpleSetup.tsx
  • src/renderer/src/components/settings/TaskSourceStepRow.tsx
  • src/renderer/src/components/settings/TasksPane.test.tsx
  • src/renderer/src/components/settings/TasksPane.tsx
  • src/renderer/src/components/settings/agent-skill-installed-command-callers.test.ts
  • src/renderer/src/components/settings/integration-card-shell.tsx
  • src/renderer/src/components/settings/jira-integration-card.test.tsx
  • src/renderer/src/components/settings/jira-integration-card.tsx
  • src/renderer/src/components/settings/linear-agent-skill-guide-content.ts
  • src/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsx
  • src/renderer/src/components/settings/linear-agent-skill-install-cta.tsx
  • src/renderer/src/components/settings/linear-agent-skill-search.ts
  • src/renderer/src/components/settings/task-provider-integration-section-ids.ts
  • src/renderer/src/components/settings/task-source-setup-state.test.ts
  • src/renderer/src/components/settings/task-source-setup-state.ts
  • src/renderer/src/components/settings/task-tracker-integration-cards.test.tsx
  • src/renderer/src/components/settings/task-tracker-integration-cards.tsx
  • src/renderer/src/components/settings/tasks-search.ts
  • src/renderer/src/components/settings/use-linear-agent-skill-setup.ts
  • src/renderer/src/components/settings/use-task-source-provider-readiness.test.tsx
  • src/renderer/src/components/settings/use-task-source-provider-readiness.ts
  • src/renderer/src/hooks/installed-agent-skill-discovery.ts
  • src/renderer/src/hooks/installed-agent-skills-change-event.ts
  • src/renderer/src/hooks/useActiveProjectSkillRuntime.ts
  • src/renderer/src/hooks/useInstalledAgentSkills.react.test.tsx
  • src/renderer/src/hooks/useInstalledAgentSkills.test.ts
  • src/renderer/src/hooks/useInstalledAgentSkills.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/linear-usage-examples.ts

Comment thread src/renderer/src/i18n/locales/ko.json Resolved
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai[bot] resolved

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@AmethystLiang: Thanks for resolving this. 🐇


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

When a silent refresh supersedes an in-flight focus rescan, the losing
rescan's finally block writes are dropped by the generation guard. Only
the winning generation clears loading, so it must clear regardless of
its own showLoading setting. Also move TasksPane auto-expanded tracking
from effect to render phase to prevent layout-effect re-renders from
seeing an unclaimed slot and collapsing the card.
Replace render-time ref writes in TasksPane sticky auto-expand and
active project skill runtime identity caching with setState-during-render
so static analysis can pass without changing behavior.
@AmethystLiang
AmethystLiang merged commit 35c76ba into main Jul 30, 2026
41 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* refactor(settings): unify Linear setup into guided flows across Task Sou

Consolidate Linear API connection, agent skill installation, and Tasks visibility into guided step-by-step workflows. Moves Linear setup from a hidden integrations link into expandable cards within Task Sources (first-time path) and a prominent checklist in the Linear settings pane. Adds reusable TaskSourceProviderCard and step components so GitHub, GitLab, and Jira follow the same pattern. Surfaces incomplete provider warnings and auto-expands the first unfinished provider to reduce friction.

* refactor(settings): unify Linear setup into guided flows across Task Sou

Extract shared Linear skill setup logic into `useLinearAgentSkillSetup` hook so
Task Sources and LinearAgentSkillPane both follow the same configuration path.
Embed the skill install panel inside LinearAgentSkillGuide instead of placing it
after, eliminating duplicate "Agent skill" section headers. Introduce task
provider setup state helpers: distinguish fresh untouched providers from
started-then-stalled ones (only warn on the latter), keep auto-expanded cards
open across rechecks via sticky tracking, and handle unavailable/failed
preflight status. Rename BrowserUseStepBadge to SetupStepBadge (used by
multiple setup types now). Route connected credential management to Integrations
cards instead of re-opening dialogs. Add settled flag to skill discovery so
focus-triggered rescans don't flash UI on known results.

* chore: credit task source guidance contribution

Co-authored-by: Chen <[email protected]>

* fix: clear loading state regardless of generation's showLoading flag

When a silent refresh supersedes an in-flight focus rescan, the losing
rescan's finally block writes are dropped by the generation guard. Only
the winning generation clears loading, so it must clear regardless of
its own showLoading setting. Also move TasksPane auto-expanded tracking
from effect to render phase to prevent layout-effect re-renders from
seeing an unclaimed slot and collapsing the card.

* fix: stop mutating refs during render for React Doctor

Replace render-time ref writes in TasksPane sticky auto-expand and
active project skill runtime identity caching with setState-during-render
so static analysis can pass without changing behavior.

---------

Co-authored-by: Chen <[email protected]>
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.

UX: Task Sources toggle for Linear (and other providers) does not make clear that Integrations setup is still required

1 participant