Repository navigation
Unify Linear and task provider setup into guided flows - #11533
Conversation
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 SummaryThis 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.
Confidence Score: 5/5Safe 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.
|
| 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
Reviews (5): Last reviewed commit: "fix: stop mutating refs during render fo..." | Re-trigger Greptile
📝 WalkthroughWalkthroughThe 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)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
⚔️ Resolve merge conflicts 💡
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.
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
loadingcan latch on when refresh modes interleave. EveryrefreshbumpsrefreshGenerationRef, but onlyshowLoading: truerequests clearloading; aREFRESHED-drivenrefresh(false, false)therefore supersedes an in-flight loading refresh and never resets the flag, leaving spinners anddisabled={loading}controls stuck.
src/renderer/src/hooks/useInstalledAgentSkills.ts#L155-L206: let the winning generation always clearloadingin thefinallyblock (or track loading ownership separately from the generation guard).src/renderer/src/hooks/useInstalledAgentSkills.react.test.tsx#L250-L310: add a test that dispatchesfocus, then callsnotifyInstalledAgentSkillsRefreshed()while the forced scan is still pending, and assertsloadingreturns tofalse.
🧹 Nitpick comments (6)
src/renderer/src/hooks/useInstalledAgentSkills.react.test.tsx (1)
250-310: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAdd a regression test for a
REFRESHEDevent 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 leaveloadingstuck true; see the note onsrc/renderer/src/hooks/useInstalledAgentSkills.tsLine 155-206.src/renderer/src/hooks/useInstalledAgentSkills.test.ts (1)
227-250: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the unused
window.CustomEventstub.
notifyInstalledAgentSkillsRefreshed()dispatches a module-globalnew CustomEvent(...), while this test runs in the declared Nodev24environment. The stubbedwindow.CustomEventproperty is not consulted, so it is misleading.src/renderer/src/components/settings/LinearAgentSkillPane.tsx (1)
68-96: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated Linear skill-panel wiring vs.
TaskSourceLinearSetup.tsx.This
<AgentSkillSetupPanel>block (title/description/command/terminal props all sourced fromskillSetup) is structurally identical to the one inTaskSourceLinearSetup.tsx(per cross-file evidence), differing only interminalWorktreeIdand a couple of translate keys. Consider extracting a sharedLinearAgentSkillInstallPanel({ 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 valueVisibility control disappears when a card is expanded without
children.
childrenis 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 valueSentence 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 valueBorrowing
TasksPane'sLinearkey from this component.
auto.components.settings.TasksPane.09ae2d7c51is reused here (and inTaskSourceSimpleSetup.tsxforJira), 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
📒 Files selected for processing (58)
src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideSteps.tsxsrc/renderer/src/components/emulator-pane/mobile-emulator-agent-setup-cli-state.tssrc/renderer/src/components/integration-status-pill.tsxsrc/renderer/src/components/settings/AgentSkillSetupPanel.test.tsxsrc/renderer/src/components/settings/AgentSkillSetupPanel.tsxsrc/renderer/src/components/settings/BrowserUseCliStep.tsxsrc/renderer/src/components/settings/BrowserUseCookieImportStep.tsxsrc/renderer/src/components/settings/BrowserUseSkillStep.tsxsrc/renderer/src/components/settings/LinearAgentSkillGuide.test.tsxsrc/renderer/src/components/settings/LinearAgentSkillGuide.tsxsrc/renderer/src/components/settings/LinearAgentSkillNotes.test.tsxsrc/renderer/src/components/settings/LinearAgentSkillNotes.tsxsrc/renderer/src/components/settings/LinearAgentSkillPane.test.tsxsrc/renderer/src/components/settings/LinearAgentSkillPane.tsxsrc/renderer/src/components/settings/MobileEmulatorAgentControlRow.tsxsrc/renderer/src/components/settings/Settings.tsxsrc/renderer/src/components/settings/SetupStepBadge.tsxsrc/renderer/src/components/settings/TaskSourceLinearSetup.test.tsxsrc/renderer/src/components/settings/TaskSourceLinearSetup.tsxsrc/renderer/src/components/settings/TaskSourceProviderCard.test.tsxsrc/renderer/src/components/settings/TaskSourceProviderCard.tsxsrc/renderer/src/components/settings/TaskSourceShowInTasksStep.test.tsxsrc/renderer/src/components/settings/TaskSourceShowInTasksStep.tsxsrc/renderer/src/components/settings/TaskSourceSimpleSetup.test.tsxsrc/renderer/src/components/settings/TaskSourceSimpleSetup.tsxsrc/renderer/src/components/settings/TaskSourceStepRow.tsxsrc/renderer/src/components/settings/TasksPane.test.tsxsrc/renderer/src/components/settings/TasksPane.tsxsrc/renderer/src/components/settings/agent-skill-installed-command-callers.test.tssrc/renderer/src/components/settings/integration-card-shell.tsxsrc/renderer/src/components/settings/jira-integration-card.test.tsxsrc/renderer/src/components/settings/jira-integration-card.tsxsrc/renderer/src/components/settings/linear-agent-skill-guide-content.tssrc/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsxsrc/renderer/src/components/settings/linear-agent-skill-install-cta.tsxsrc/renderer/src/components/settings/linear-agent-skill-search.tssrc/renderer/src/components/settings/task-provider-integration-section-ids.tssrc/renderer/src/components/settings/task-source-setup-state.test.tssrc/renderer/src/components/settings/task-source-setup-state.tssrc/renderer/src/components/settings/task-tracker-integration-cards.test.tsxsrc/renderer/src/components/settings/task-tracker-integration-cards.tsxsrc/renderer/src/components/settings/tasks-search.tssrc/renderer/src/components/settings/use-linear-agent-skill-setup.tssrc/renderer/src/components/settings/use-task-source-provider-readiness.test.tsxsrc/renderer/src/components/settings/use-task-source-provider-readiness.tssrc/renderer/src/hooks/installed-agent-skill-discovery.tssrc/renderer/src/hooks/installed-agent-skills-change-event.tssrc/renderer/src/hooks/useActiveProjectSkillRuntime.tssrc/renderer/src/hooks/useInstalledAgentSkills.react.test.tsxsrc/renderer/src/hooks/useInstalledAgentSkills.test.tssrc/renderer/src/hooks/useInstalledAgentSkills.tssrc/renderer/src/hooks/useSettingsNavigationMetadata.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/linear-usage-examples.ts
|
@coderabbitai[bot] resolved |
|
Tip For best results, initiate chat on the files or code changes.
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. |
Co-authored-by: Chen <[email protected]>
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.
* 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]>
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
LinearAgentSkillGuide(3-step checklist),TaskSourceLinearSetup(Task Sources integration), andTaskSourceProviderCard(collapsible setup cards)task-source-setup-state.tstracks readiness across connection, skill install, and visibility; warns only about started-then-stalled setupuse-linear-agent-skill-setup.tsanduse-task-source-provider-readiness.tsprevent duplicationsectionIdparameterBrowserUseStepBadge→SetupStepBadgefor reuseTesting