Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('cookie-import Google disclosure footer', () => {
<BrowserUseCookieImportStep
cookiesImported={false}
isImportingDefault={false}
step3Blocked={false}
disabled={false}
sourceLabel={null}
/>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { describe, expect, it } from 'vitest'
import { getDefaultAgentCapabilitySetupSelection } from './agent-capability-setup-status'
import {
getDefaultAgentCapabilitySetupSelection,
isAgentCapabilityReadinessComplete
} from './agent-capability-setup-status'

const READY_INPUT = {
browserUseSkillInstalled: true,
Expand Down Expand Up @@ -67,3 +70,31 @@ describe('getDefaultAgentCapabilitySetupSelection', () => {
})
})
})

describe('isAgentCapabilityReadinessComplete', () => {
it('is complete when every skill is ready, or Computer Use cannot run here', () => {
expect(isAgentCapabilityReadinessComplete(READY_INPUT)).toBe(true)
expect(
isAgentCapabilityReadinessComplete({
...READY_INPUT,
computerUseReady: false,
computerUseUnavailable: true
})
).toBe(true)
})

it('is incomplete while Computer Use still needs macOS access or a skill is missing', () => {
expect(isAgentCapabilityReadinessComplete({ ...READY_INPUT, computerUseReady: false })).toBe(
false
)
expect(
isAgentCapabilityReadinessComplete({ ...READY_INPUT, orchestrationSkillInstalled: false })
).toBe(false)
})

it('does not claim completion while install probes are still running', () => {
expect(
isAgentCapabilityReadinessComplete({ ...READY_INPUT, browserUseSkillLoading: true })
).toBe(false)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Button } from '@/components/ui/button'
import { cn } from '@/lib/utils'
import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime'
import { useAppStore } from '@/store'
import { AgentCapabilityStatusNote, AgentCapabilityStatusPill } from './AgentCapabilityStatusBadges'
import { FeatureSetupInlineTerminal } from '../onboarding/FeatureSetupInlineTerminal'
import type { OnboardingFeatureSetupRuntimeContext } from '../onboarding/onboarding-feature-setup-runtime'
import {
Expand All @@ -15,13 +16,12 @@ import {
type OnboardingFeatureSetupSelection
} from '../onboarding/onboarding-feature-setup'
import {
getAgentCapabilityStatusClassName,
getDefaultAgentCapabilitySetupSelection,
isAgentCapabilityReadinessChecking,
isAgentCapabilityReadinessComplete,
useAgentCapabilitySetupStatus,
type AgentCapabilityInstallStatus
} from './agent-capability-setup-status'
import { FullDiskAccessSetupPrompt } from './FullDiskAccessSetupPrompt'
import { translate } from '@/i18n/i18n'

export function AgentCapabilitiesSetupAction(props: {
Expand Down Expand Up @@ -140,6 +140,7 @@ export function AgentCapabilitiesSetupAction(props: {
featureSetupRuntime={featureSetupRuntime}
setupBusyLabel={setupBusyLabel}
onStartFeatureSetup={() => void handleStartFeatureSetup()}
allReady={isAgentCapabilityReadinessComplete(readiness)}
installStatus={capabilitySetupStatus.installStatus}
/>
</div>
Expand Down Expand Up @@ -212,10 +213,13 @@ function AgentCapabilitySetupControls(props: {
featureSetupRuntime: OnboardingFeatureSetupRuntimeContext | null
setupBusyLabel: string | null
onStartFeatureSetup: () => void
allReady: boolean
installStatus: Record<OnboardingFeatureSetupId, AgentCapabilityInstallStatus>
}): React.JSX.Element {
const hasSelectedFeatures = hasSelectedOnboardingFeatureSetup(props.featureSetup)
const showSetupAction = !props.featureSetupCommand
// Why: a disabled install button is noise once everything is set up.
const showAllReady = props.allReady && !hasSelectedFeatures && !props.setupBusyLabel

return (
<>
Expand All @@ -224,8 +228,15 @@ function AgentCapabilitySetupControls(props: {
onChange={props.onFeatureSetupChange}
installStatus={props.installStatus}
/>
<FullDiskAccessSetupPrompt />
{showSetupAction ? (
{showSetupAction && showAllReady ? (
<p className="mt-6 flex items-center gap-1.5 text-sm text-muted-foreground">
<Check className="size-4" />
{translate(
'auto.components.feature.wall.AgentCapabilitiesSetupAction.allInstalled',
'All skills installed'
)}
</p>
Comment on lines +231 to +238

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '60,165p' src/renderer/src/components/feature-wall/AgentCapabilitiesSetupAction.tsx
sed -n '210,345p' src/renderer/src/components/feature-wall/AgentCapabilitiesSetupAction.tsx
sed -n '205,255p' src/renderer/src/components/onboarding/onboarding-feature-setup.ts
sed -n '1,85p' src/renderer/src/components/onboarding/onboarding-cli-registration.ts

Repository: stablyai/orca

Length of output: 13226


🏁 Script executed:

set -eu
printf '%s\n' '--- feature action imports/state ---'
sed -n '1,125p' src/renderer/src/components/feature-wall/AgentCapabilitiesSetupAction.tsx
printf '%s\n' '--- readiness/runtime/selection symbols ---'
rg -n -C 4 "isAgentCapabilityReadinessComplete|getDefaultAgentCapabilitySetupSelection|activeSkillRuntime|cliRequired|AgentCapabilityReadiness|installStatus|selectedOnboardingFeatureSetupIds|registerOnboardingCliIfRequired|runOnboardingFeatureSetup" src/renderer/src/components src/renderer/src/lib src/renderer/src -g '*.ts' -g '*.tsx' | head -n 320
printf '%s\n' '--- setup runner remainder and related tests ---'
sed -n '1,240p' src/renderer/src/components/onboarding/onboarding-feature-setup.ts
rg -n -C 5 "AgentCapabilitiesSetupAction|allInstalled|runOnboardingFeatureSetup|registerOnboardingCliIfRequired|WSL|wsl|pathConfigured" src/renderer/src -g '*test*' -g '*.spec.*' -g '*.test.*' | head -n 260

Repository: stablyai/orca

Length of output: 41820


🏁 Script executed:

set -eu
printf '%s\n' '--- readiness implementation ---'
cat -n src/renderer/src/components/feature-wall/agent-capability-setup-status.ts | sed -n '1,190p'
printf '%s\n' '--- active runtime hook and resolver ---'
fd -i 'useActiveProjectSkillRuntime' src/renderer/src
rg -n -C 8 "function useActiveProjectSkillRuntime|useActiveProjectSkillRuntime|resolve.*SkillRuntime|ProjectAgentSkillRuntime|discoveryTarget|installDisabledReason" src/renderer/src/hooks src/renderer/src/lib src/renderer/src/components/onboarding -g '*.ts' -g '*.tsx' | head -n 360
printf '%s\n' '--- onboarding runtime mapping ---'
cat -n src/renderer/src/components/onboarding/onboarding-feature-setup-runtime.ts
printf '%s\n' '--- focused readiness/setup tests ---'
rg -l "isAgentCapabilityReadinessComplete|getDefaultAgentCapabilitySetupSelection|runOnboardingFeatureSetup|AgentCapabilitiesSetupAction" src/renderer/src -g '*test*' -g '*.spec.*' -g '*.test.*' | while read -r f; do echo "### $f"; rg -n -C 10 "isAgentCapabilityReadinessComplete|getDefaultAgentCapabilitySetupSelection|runOnboardingFeatureSetup|AgentCapabilitiesSetupAction|wsl|WSL|cli" "$f"; done | head -n 500

Repository: stablyai/orca

Length of output: 42258


🏁 Script executed:

set -eu
printf '%s\n' '--- active runtime hook ---'
cat -n src/renderer/src/hooks/useActiveProjectSkillRuntime.ts
printf '%s\n' '--- runtime type/resolution references ---'
rg -n -C 10 "useActiveProjectSkillRuntime|ProjectAgentSkillRuntime|resolveProject.*Runtime|localWindowsRuntimePreference|discoveryTarget" src/renderer/src/hooks src/renderer/src/lib src/renderer/src/store -g '*.ts' -g '*.tsx' | head -n 420
printf '%s\n' '--- CLI prerequisite binding ---'
cat -n src/renderer/src/lib/agent-skill-cli-prerequisite.ts | sed -n '1,180p'
printf '%s\n' '--- card rendering and setup branch exact lines ---'
cat -n src/renderer/src/components/feature-wall/AgentCapabilitiesSetupAction.tsx | sed -n '220,315p'

Repository: stablyai/orca

Length of output: 42322


Keep WSL CLI registration reachable until registration is complete.

The success state checks skill readiness, not CLI registration. With an empty selection, the runner returns before registration. The checklist remains selectable, so selecting any installed capability restores the button and provides a workaround. However, users must select an unrelated capability to reach registration.

Include WSL CLI registration readiness in the success condition, or provide a dedicated registration action.

) : showSetupAction ? (
<div className="mt-6 flex items-center">
<Button
type="button"
Expand All @@ -241,8 +252,8 @@ function AgentCapabilitySetupControls(props: {
)}
{props.setupBusyLabel ??
translate(
'auto.components.feature.wall.AgentCapabilitiesSetupAction.c89534cbe9',
'Install CLI & Skills'
'auto.components.feature.wall.AgentCapabilitiesSetupAction.installSkills',
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
'Install skills'
)}
</Button>
</div>
Expand Down Expand Up @@ -277,35 +288,32 @@ function AgentCapabilitySetupChecklist(props: {
aria-checked={selected}
aria-label={`${selected ? 'Disable' : 'Enable'} ${row.title}`}
className={cn(
'flex min-h-24 flex-col rounded-lg border px-4 py-3 text-left transition-colors',
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
selected
? 'border-ring bg-accent text-foreground ring-2 ring-ring/25'
: 'border-border bg-muted/20 text-muted-foreground hover:bg-muted/40'
'flex min-h-24 flex-col rounded-lg border px-4 py-3.5 text-left transition-colors',
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
selected ? 'border-foreground/60 bg-accent' : 'border-border hover:bg-accent/60'
)}
onClick={() => props.onChange({ ...props.value, [row.id]: !selected })}
>
<span className="flex items-start justify-between gap-3">
<span
className={cn(
'flex size-8 items-center justify-center rounded-lg border',
selected
? 'border-border bg-background text-foreground'
: 'border-border bg-muted/40'
)}
>
<span className="grid size-7 place-items-center rounded-md bg-muted text-foreground">
{row.icon}
</span>
<span
aria-hidden
className={cn(
'flex size-5 items-center justify-center rounded-full border transition-colors',
selected
? 'border-primary bg-primary text-primary-foreground'
: 'border-border bg-background'
)}
>
{selected ? <Check className="size-3" strokeWidth={3} /> : null}
<span className="flex items-center gap-2">
<AgentCapabilityStatusPill status={installStatus} />
{/* Why: an empty circle on an installed card reads as "not done"; show it only when it means something. */}
{selected || !installStatus.installed ? (
<span
aria-hidden
className={cn(
'flex size-5 items-center justify-center rounded-full border transition-colors',
selected
? 'border-foreground bg-foreground text-background'
: 'border-border'
)}
>
{selected ? <Check className="size-3" strokeWidth={3} /> : null}
</span>
) : null}
</span>
</span>
<span className="mt-3 text-sm font-medium text-foreground">{row.title}</span>
Expand All @@ -320,41 +328,3 @@ function AgentCapabilitySetupChecklist(props: {
</section>
)
}

function AgentCapabilityStatusNote(props: {
status: AgentCapabilityInstallStatus
}): React.JSX.Element {
if (props.status.installed) {
return (
<span className="mt-2 flex flex-wrap items-center gap-1.5">
<span className="rounded-full border border-green-500/45 bg-green-500/10 px-2 py-0.5 text-[11px] font-semibold leading-none text-green-700 dark:text-green-300">
{translate(
'auto.components.feature.wall.AgentCapabilitiesSetupAction.b8dc9dd8a2',
'Installed'
)}
</span>
{props.status.tone !== 'ready' ? (
<span
className={cn(
'text-xs font-medium',
getAgentCapabilityStatusClassName(props.status.tone)
)}
>
{props.status.label}
</span>
) : null}
</span>
)
}

return (
<span
className={cn(
'mt-1 text-xs font-medium',
getAgentCapabilityStatusClassName(props.status.tone)
)}
>
{props.status.label}
</span>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Check } from 'lucide-react'
import { cn } from '@/lib/utils'
import { translate } from '@/i18n/i18n'
import {
getAgentCapabilityStatusClassName,
type AgentCapabilityInstallStatus
} from './agent-capability-setup-status'

// Why: pills sit top-right so they line up across cards regardless of description length.
export function AgentCapabilityStatusPill(props: {
status: AgentCapabilityInstallStatus
}): React.JSX.Element | null {
if (props.status.tone === 'unavailable') {
return (
<span className="text-[11px] font-medium text-muted-foreground">{props.status.label}</span>
)
}
if (!props.status.installed) {
return null
}
return (
<span className="flex items-center gap-1 text-[11px] font-medium text-muted-foreground">
<Check className="size-3" />
{translate(
'auto.components.feature.wall.AgentCapabilitiesSetupAction.b8dc9dd8a2',
'Installed'
)}
</span>
)
}

/** Secondary status text (checking, errors, pending actions); installed/unavailable live in the pill. */
export function AgentCapabilityStatusNote(props: {
status: AgentCapabilityInstallStatus
}): React.JSX.Element | null {
if (props.status.tone === 'ready' || props.status.tone === 'unavailable') {
return null
}
return (
<span
className={cn(
'mt-2 text-xs font-medium',
getAgentCapabilityStatusClassName(props.status.tone)
)}
>
{props.status.label}
</span>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ import {
ORCA_CLI_SKILL_NAME,
ORCA_CLI_SKILL_UPDATE_COMMAND
} from '@/lib/agent-feature-install-commands'
import {
AGENT_SKILL_CLI_PREREQUISITE_NOTICE,
ensureOrcaCliAvailableForAgentSkillTerminal
} from '@/lib/agent-skill-cli-prerequisite'
import { BROWSER_USE_ENABLED_STORAGE_KEY } from '@/lib/browser-use-setup-state'
import type { InstalledAgentSkillState } from '@/hooks/useInstalledAgentSkills'
import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime'
import { AgentSkillSetupPanel } from '@/components/settings/AgentSkillSetupPanel'
import {
buildSkillCommandForRuntime,
ensureWslCliAvailableForAgentSkillTerminal,
getWslCliDistroRequest
} from '@/components/settings/CliSkillRuntimeSetup'
import { buildSkillCommandForRuntime } from '@/components/settings/CliSkillRuntimeSetup'
import { useAppStore } from '@/store'
import { translate } from '@/i18n/i18n'

Expand All @@ -34,11 +26,8 @@ export function BrowserUseSkillSetupCard(props: {
? buildSkillCommandForRuntime(ORCA_CLI_SKILL_UPDATE_COMMAND, activeSkillRuntime.agentRuntime)
: ORCA_CLI_SKILL_UPDATE_COMMAND

const handleBeforeOpenTerminal = async (): Promise<void> => {
const handleBeforeOpenTerminal = (): void => {
useAppStore.getState().recordFeatureInteraction('agent-browser-setup')
await (activeSkillRuntime.agentRuntime?.runtime === 'wsl'
? ensureWslCliAvailableForAgentSkillTerminal(activeSkillRuntime.agentRuntime)
: ensureOrcaCliAvailableForAgentSkillTerminal())
localStorage.setItem(BROWSER_USE_ENABLED_STORAGE_KEY, '1')
}

Expand All @@ -65,14 +54,6 @@ export function BrowserUseSkillSetupCard(props: {
error={activeSkillRuntime.installDisabledReason ?? skill.error}
installDisabled={Boolean(activeSkillRuntime.installDisabledReason)}
terminalHeightPx={terminalHeightPx}
preInstallNotice={AGENT_SKILL_CLI_PREREQUISITE_NOTICE}
getPrerequisiteStatus={() =>
activeSkillRuntime.agentRuntime?.runtime === 'wsl'
? window.api.cli.getWslInstallStatus(
getWslCliDistroRequest(activeSkillRuntime.agentRuntime)
)
: window.api.cli.getInstallStatus()
}
onBeforeOpenTerminal={handleBeforeOpenTerminal}
showRecheckWhenInstalled={false}
onRecheck={skill.refresh}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ const BROWSER_ONLY_FEATURE_SETUP: OnboardingFeatureSetupSelection = {
linearTickets: false
}

// The grab→agent flow relies on the Orca CLI and browser skill, so offer the same
// install action the Enable Orca CLI step uses, scoped to just browser use.
// The grab→agent flow relies on the browser skill, so offer the same install action
// the agent skills step uses, scoped to just browser use.
function BrowserSkillInstallButton(): React.JSX.Element {
const recordFeatureInteraction = useAppStore((s) => s.recordFeatureInteraction)
const [command, setCommand] = useState<string | null>(null)
Expand Down Expand Up @@ -186,10 +186,7 @@ function BrowserSkillInstallButton(): React.JSX.Element {
'auto.components.feature.wall.FeatureWallBrowserAction.5f97caf76b',
'Installing…'
)
: translate(
'auto.components.feature.wall.FeatureWallBrowserAction.c2df599513',
'Install CLI & Skill'
)}
: translate('auto.components.skills.SkillInstallDialog.39acb9e8f4', 'Install skill')}
</Button>
)
}
8 changes: 4 additions & 4 deletions src/renderer/src/components/feature-wall/FeatureWallRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ export function FeatureWallRail(props: {
>
<span
className={cn(
'flex size-7 shrink-0 items-center justify-center rounded-sm border font-mono text-xs',
'flex size-7 shrink-0 items-center justify-center rounded-sm border text-xs tabular-nums',
isDone
? 'border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-300'
? 'border-foreground bg-foreground text-background'
: 'border-border bg-card text-muted-foreground'
)}
aria-label={
Expand Down Expand Up @@ -157,9 +157,9 @@ export function FeatureWallRail(props: {
>
<span
className={cn(
'flex size-5 shrink-0 items-center justify-center rounded-sm border font-mono text-[10px]',
'flex size-5 shrink-0 items-center justify-center rounded-sm border text-[10px] tabular-nums',
isStepDone
? 'border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-300'
? 'border-foreground bg-foreground text-background'
: 'border-border bg-card text-muted-foreground'
)}
aria-label={
Expand Down
Loading
Loading