fix: address review findings (#4919)
This commit is contained in:
@@ -27,12 +27,16 @@ import { NotificationStep } from '../onboarding/NotificationStep'
|
||||
import { useAppStore } from '@/store'
|
||||
import type { TuiAgent } from '../../../../shared/types'
|
||||
|
||||
type FeatureWallSetupChecklistLayout = 'modal' | 'embedded'
|
||||
|
||||
type FeatureWallSetupChecklistProps = {
|
||||
activeStep: FeatureWallSetupStep | null
|
||||
progress: FeatureWallSetupProgress
|
||||
onSelectStep: (id: FeatureWallSetupStepId) => void
|
||||
onOrchestrationSkillInstalledChange: (installed: boolean) => void
|
||||
onBrowserUseSkillInstalledChange: (installed: boolean) => void
|
||||
/** Modal keeps a compact rail; embedded (settings pane) gets more column breathing room. */
|
||||
layout?: FeatureWallSetupChecklistLayout
|
||||
}
|
||||
|
||||
function SetupStepRow(props: {
|
||||
@@ -41,19 +45,29 @@ function SetupStepRow(props: {
|
||||
active: boolean
|
||||
ordinal: number
|
||||
onSelect: () => void
|
||||
layout: FeatureWallSetupChecklistLayout
|
||||
}): React.JSX.Element {
|
||||
const { step, done, active, ordinal, onSelect } = props
|
||||
const { step, done, active, ordinal, onSelect, layout } = props
|
||||
const isEmbedded = layout === 'embedded'
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onSelect}
|
||||
aria-current={active ? 'step' : undefined}
|
||||
className={cn(
|
||||
'relative flex w-full items-center gap-3 rounded-md border px-3 py-2.5 text-left transition-colors',
|
||||
'relative flex w-full items-center gap-3 text-left transition-colors',
|
||||
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
||||
active
|
||||
? 'border-border bg-accent text-accent-foreground'
|
||||
: 'border-border bg-background hover:bg-accent'
|
||||
isEmbedded
|
||||
? cn(
|
||||
'rounded-lg px-3 py-2',
|
||||
active ? 'bg-accent text-accent-foreground' : 'hover:bg-accent'
|
||||
)
|
||||
: cn(
|
||||
'rounded-md border px-3 py-2.5',
|
||||
active
|
||||
? 'border-border bg-accent text-accent-foreground'
|
||||
: 'border-border bg-background hover:bg-accent'
|
||||
)
|
||||
)}
|
||||
>
|
||||
{active ? (
|
||||
@@ -69,8 +83,8 @@ function SetupStepRow(props: {
|
||||
>
|
||||
{done ? <Check className="size-3" /> : <span className="text-xs">{ordinal}</span>}
|
||||
</span>
|
||||
<span className="min-w-0">
|
||||
<span className="block text-[15px] font-medium leading-tight text-foreground">
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block text-[15px] font-medium leading-snug text-foreground">
|
||||
{step.name}
|
||||
</span>
|
||||
</span>
|
||||
@@ -85,6 +99,7 @@ function SetupSection(props: {
|
||||
activeStepId: FeatureWallSetupStepId | null
|
||||
progress: FeatureWallSetupProgress
|
||||
onSelectStep: (id: FeatureWallSetupStepId) => void
|
||||
layout: FeatureWallSetupChecklistLayout
|
||||
}): React.JSX.Element {
|
||||
const doneCount = props.steps.filter((step) => props.progress.stepDone[step.id]).length
|
||||
return (
|
||||
@@ -105,6 +120,7 @@ function SetupSection(props: {
|
||||
done={props.progress.stepDone[step.id]}
|
||||
active={props.activeStepId === step.id}
|
||||
ordinal={props.startOrdinal + index}
|
||||
layout={props.layout}
|
||||
onSelect={() => props.onSelectStep(step.id)}
|
||||
/>
|
||||
))}
|
||||
@@ -238,7 +254,8 @@ function TaskSourcesAction(): React.JSX.Element {
|
||||
export function FeatureWallSetupChecklist(
|
||||
props: FeatureWallSetupChecklistProps
|
||||
): React.JSX.Element {
|
||||
const { activeStep, progress, onSelectStep } = props
|
||||
const { activeStep, progress, onSelectStep, layout = 'modal' } = props
|
||||
const isEmbedded = layout === 'embedded'
|
||||
const activeDone = activeStep ? progress.stepDone[activeStep.id] : false
|
||||
// Only steps with a visual constrain the caption to a narrow column so the
|
||||
// illustration can sit beside it; captionless steps let the copy run full width.
|
||||
@@ -248,10 +265,27 @@ export function FeatureWallSetupChecklist(
|
||||
activeStep?.id === 'add-two-repos'
|
||||
const parallelWorkSteps = getFeatureWallSetupStepsForSection('parallel-work')
|
||||
const setupSteps = getFeatureWallSetupStepsForSection('setup')
|
||||
const visualBreakpoint = isEmbedded ? 'xl' : 'sm'
|
||||
const visualGridClass =
|
||||
visualBreakpoint === 'xl'
|
||||
? 'gap-8 xl:grid-cols-[minmax(0,1fr)_auto] xl:gap-12'
|
||||
: 'gap-8 sm:grid-cols-[minmax(0,48ch)_auto] sm:gap-10'
|
||||
|
||||
return (
|
||||
<div className="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] gap-5 lg:grid-cols-[minmax(200px,300px)_minmax(0,1fr)] lg:grid-rows-[minmax(0,1fr)]">
|
||||
<div className="scrollbar-sleek min-h-0 space-y-5 overflow-y-auto pr-1">
|
||||
<div
|
||||
className={cn(
|
||||
'grid h-full min-h-0',
|
||||
isEmbedded
|
||||
? 'grid-rows-[auto_minmax(0,1fr)] gap-10 lg:grid-cols-[minmax(15rem,17rem)_minmax(0,1fr)] lg:grid-rows-[minmax(0,1fr)] lg:gap-16'
|
||||
: 'grid-rows-[auto_minmax(0,1fr)] gap-5 lg:grid-cols-[minmax(200px,300px)_minmax(0,1fr)] lg:grid-rows-[minmax(0,1fr)]'
|
||||
)}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
'scrollbar-sleek min-h-0 space-y-5 overflow-y-auto',
|
||||
isEmbedded ? 'pr-4' : 'pr-1'
|
||||
)}
|
||||
>
|
||||
<SetupSection
|
||||
title="Milestones"
|
||||
steps={parallelWorkSteps}
|
||||
@@ -259,6 +293,7 @@ export function FeatureWallSetupChecklist(
|
||||
activeStepId={activeStep?.id ?? null}
|
||||
progress={progress}
|
||||
onSelectStep={onSelectStep}
|
||||
layout={layout}
|
||||
/>
|
||||
<SetupSection
|
||||
title="Setup"
|
||||
@@ -267,12 +302,20 @@ export function FeatureWallSetupChecklist(
|
||||
activeStepId={activeStep?.id ?? null}
|
||||
progress={progress}
|
||||
onSelectStep={onSelectStep}
|
||||
layout={layout}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<section className="scrollbar-sleek min-h-0 overflow-y-auto border-t border-border pt-5 lg:border-l lg:border-t-0 lg:pl-7 lg:pt-0">
|
||||
<section
|
||||
className={cn(
|
||||
'scrollbar-sleek min-h-0 overflow-y-auto',
|
||||
isEmbedded
|
||||
? 'pt-10 lg:border-l lg:border-border/50 lg:pl-14 lg:pt-0'
|
||||
: 'border-t border-border pt-5 lg:border-l lg:border-t-0 lg:pl-7 lg:pt-0'
|
||||
)}
|
||||
>
|
||||
{activeStep ? (
|
||||
<div className="flex h-full flex-col gap-5">
|
||||
<div className={cn('flex h-full flex-col', isEmbedded ? 'gap-7' : 'gap-5')}>
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div className="min-w-0">
|
||||
<div className="text-2xl font-semibold leading-tight text-foreground">
|
||||
@@ -292,15 +335,16 @@ export function FeatureWallSetupChecklist(
|
||||
</div>
|
||||
<div
|
||||
className={cn(
|
||||
'grid max-w-3xl items-start',
|
||||
hasStepVisual ? 'gap-8 sm:grid-cols-[minmax(0,48ch)_auto] sm:gap-10' : 'gap-5'
|
||||
'grid items-start',
|
||||
hasStepVisual ? visualGridClass : 'max-w-3xl gap-5',
|
||||
!hasStepVisual && isEmbedded ? 'max-w-none' : null
|
||||
)}
|
||||
>
|
||||
<div className="min-w-0">
|
||||
<p
|
||||
className={cn(
|
||||
'text-base leading-normal text-muted-foreground',
|
||||
hasStepVisual ? 'pr-4 sm:pr-6' : null
|
||||
'text-base leading-relaxed text-muted-foreground',
|
||||
hasStepVisual && !isEmbedded ? 'pr-4 sm:pr-6' : null
|
||||
)}
|
||||
>
|
||||
{activeStep.description}
|
||||
@@ -312,7 +356,7 @@ export function FeatureWallSetupChecklist(
|
||||
) : null}
|
||||
{/* Action lives under the caption, not after the grid, so it sits just
|
||||
below the copy instead of being pushed down by the taller visual. */}
|
||||
<div className="mt-7 min-w-0">
|
||||
<div className={cn('min-w-0', isEmbedded ? 'mt-8' : 'mt-7')}>
|
||||
<SelectedStepAction {...props} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -882,6 +882,8 @@ function Settings(): React.JSX.Element {
|
||||
const isSectionMounted = (sectionId: string): boolean => neededSectionIds.has(sectionId)
|
||||
const isFocusedShortcutsPane =
|
||||
activeSectionId === 'shortcuts' && settingsSearchQuery.trim() === ''
|
||||
const isFocusedSetupGuidePane =
|
||||
activeSectionId === 'setup-guide' && settingsSearchQuery.trim() === ''
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -910,8 +912,9 @@ function Settings(): React.JSX.Element {
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
'mx-auto flex w-full max-w-4xl flex-col gap-10 px-8 pt-10',
|
||||
isFocusedShortcutsPane ? 'h-full pb-6' : 'pb-24'
|
||||
'mx-auto flex w-full flex-col gap-10 px-8 pt-10',
|
||||
isFocusedShortcutsPane ? 'h-full pb-6' : 'pb-24',
|
||||
isFocusedSetupGuidePane ? 'max-w-6xl' : 'max-w-4xl'
|
||||
)}
|
||||
>
|
||||
{visibleNavSections.length === 0 ? (
|
||||
@@ -995,7 +998,7 @@ function Settings(): React.JSX.Element {
|
||||
title="Onboarding checklist"
|
||||
description="Finish the core workflows that make Orca useful for parallel agent work."
|
||||
searchEntries={getSectionSearchEntries('setup-guide')}
|
||||
bodyClassName="overflow-hidden p-0"
|
||||
bodyClassName="overflow-hidden rounded-none border-0 bg-transparent p-0 shadow-none"
|
||||
>
|
||||
{isSectionMounted('setup-guide') ? <SettingsSetupGuidePane /> : null}
|
||||
</SettingsSection>
|
||||
|
||||
@@ -45,8 +45,9 @@ export function SettingsSetupGuidePane(): React.JSX.Element {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="h-[min(740px,calc(100vh-14rem))] min-h-[540px] p-5">
|
||||
<div className="h-[min(740px,calc(100vh-14rem))] min-h-[540px] px-7 py-6">
|
||||
<FeatureWallSetupChecklist
|
||||
layout="embedded"
|
||||
activeStep={activeStep}
|
||||
progress={progress}
|
||||
onSelectStep={handleSelectStep}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { RefObject } from 'react'
|
||||
import { ArrowLeft, Search, Server } from 'lucide-react'
|
||||
import logo from '../../../../../resources/logo.svg'
|
||||
import type { RepoIcon } from '../../../../shared/repo-icon'
|
||||
import type { SettingsNavIcon, SettingsNavInstallStatus } from '@/lib/settings-navigation-types'
|
||||
import type { GitHubRepositoryIdentity } from '../../../../shared/types'
|
||||
@@ -91,24 +90,15 @@ function SettingsSetupGuideNavRow({
|
||||
: 'text-worktree-sidebar-foreground/60 hover:bg-worktree-sidebar-foreground/8 hover:text-worktree-sidebar-foreground'
|
||||
)}
|
||||
>
|
||||
<img
|
||||
src={logo}
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
'size-4 shrink-0 object-contain invert dark:invert-0',
|
||||
setupActive ? 'opacity-75' : 'opacity-45'
|
||||
)}
|
||||
<SetupGuideProgressRing
|
||||
done={progress.doneCount}
|
||||
total={progress.total}
|
||||
sizeClassName="size-4"
|
||||
tooltipLabel={`${progress.doneCount}/${progress.total} complete`}
|
||||
/>
|
||||
<span className="flex min-w-0 flex-1 flex-col">
|
||||
<span className="truncate text-[13px] font-medium leading-4">Onboarding checklist</span>
|
||||
</span>
|
||||
<SetupGuideProgressRing
|
||||
done={progress.doneCount}
|
||||
total={progress.total}
|
||||
className="ml-auto shrink-0"
|
||||
tooltipLabel={`${progress.doneCount}/${progress.total} complete`}
|
||||
/>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { createElement } from 'react'
|
||||
import type { LucideProps } from 'lucide-react'
|
||||
import logo from '../../../../../resources/logo.svg'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
export function OrcaLogoSettingsIcon({ className }: LucideProps): React.JSX.Element {
|
||||
return createElement('img', {
|
||||
src: logo,
|
||||
alt: '',
|
||||
'aria-hidden': true,
|
||||
className: cn('object-contain invert dark:invert-0', className)
|
||||
})
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from 'react'
|
||||
import { EyeOff } from 'lucide-react'
|
||||
import logo from '../../../../../resources/logo.svg'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { useAppStore } from '@/store'
|
||||
import {
|
||||
@@ -81,22 +80,14 @@ export function SetupGuideSidebarEntry(): React.JSX.Element | null {
|
||||
: 'text-worktree-sidebar-foreground/60 hover:bg-worktree-sidebar-foreground/8'
|
||||
)}
|
||||
>
|
||||
<img
|
||||
src={logo}
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
'size-4 shrink-0 object-contain invert dark:invert-0',
|
||||
setupActive ? 'opacity-75' : 'opacity-30'
|
||||
)}
|
||||
<SetupGuideProgressRing
|
||||
done={setupProgress.coreDoneCount}
|
||||
total={setupProgress.coreTotal}
|
||||
sizeClassName="size-4"
|
||||
/>
|
||||
<span className="flex min-w-0 flex-1 flex-col">
|
||||
<span className="truncate">Onboarding checklist</span>
|
||||
</span>
|
||||
<SetupGuideProgressRing
|
||||
done={setupProgress.coreDoneCount}
|
||||
total={setupProgress.coreTotal}
|
||||
/>
|
||||
</button>
|
||||
</ContextMenuTrigger>
|
||||
<ContextMenuContent>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* oxlint-disable max-lines */
|
||||
import { createElement, useMemo } from 'react'
|
||||
import { useMemo } from 'react'
|
||||
// Why: this registry mirrors the Settings sidebar in one neutral module so
|
||||
// Cmd+J and Settings visibility cannot drift. Keep it free of Settings pane UI
|
||||
// imports; the boundary is enforced by a focused architecture test.
|
||||
@@ -31,8 +31,7 @@ import {
|
||||
UserCog,
|
||||
Wrench
|
||||
} from 'lucide-react'
|
||||
import type { LucideProps } from 'lucide-react'
|
||||
import logo from '../../../../resources/logo.svg'
|
||||
import { OrcaLogoSettingsIcon } from '@/components/settings/orca-logo-settings-icon'
|
||||
import type { Repo } from '../../../shared/types'
|
||||
import { getRepoKindLabel } from '../../../shared/repo-kind'
|
||||
import { useAppStore } from '@/store'
|
||||
@@ -69,21 +68,11 @@ import { SHORTCUTS_PANE_SEARCH_ENTRIES } from '@/components/settings/shortcuts-s
|
||||
import { STATS_PANE_SEARCH_ENTRIES } from '@/components/stats/stats-search'
|
||||
import { EXPERIMENTAL_PANE_SEARCH_ENTRIES } from '@/components/settings/experimental-search'
|
||||
import { getRepositoryPaneSearchEntries } from '@/components/settings/repository-search'
|
||||
import { cn } from '@/lib/utils'
|
||||
import {
|
||||
getCachedWindowsTerminalCapabilities,
|
||||
getWindowsTerminalCapabilityOwnerKey
|
||||
} from '@/lib/windows-terminal-capabilities'
|
||||
|
||||
function OrcaLogoSettingsIcon({ className }: LucideProps) {
|
||||
return createElement('img', {
|
||||
src: logo,
|
||||
alt: '',
|
||||
'aria-hidden': true,
|
||||
className: cn('object-contain invert dark:invert-0', className)
|
||||
})
|
||||
}
|
||||
|
||||
export function isWebClientLocation(): boolean {
|
||||
return (
|
||||
Boolean((window as unknown as { __ORCA_WEB_CLIENT__?: boolean }).__ORCA_WEB_CLIENT__) ||
|
||||
|
||||
Reference in New Issue
Block a user