UX updates (#2137)
This commit is contained in:
+35
-32
@@ -47,6 +47,7 @@ import { StarNagCard } from './components/StarNagCard'
|
||||
import { FeatureTourNudge } from './components/feature-wall/FeatureTourNudge'
|
||||
import { TelemetryFirstLaunchSurface } from './components/TelemetryFirstLaunchSurface'
|
||||
import { ZoomOverlay } from './components/ZoomOverlay'
|
||||
import { onOnboardingReopened } from './components/onboarding/show-onboarding-event'
|
||||
import { shouldShowOnboarding } from './components/onboarding/should-show-onboarding'
|
||||
import { SshPassphraseDialog } from './components/settings/SshPassphraseDialog'
|
||||
import DeleteWorktreeDialog from './components/sidebar/DeleteWorktreeDialog'
|
||||
@@ -387,6 +388,10 @@ function App(): React.JSX.Element {
|
||||
useGlobalFileDrop()
|
||||
useAutoAckViewedAgent()
|
||||
|
||||
useEffect(() => {
|
||||
return onOnboardingReopened(setOnboarding)
|
||||
}, [])
|
||||
|
||||
// Why: sidebar open/close flips width instantaneously. useLayoutEffect
|
||||
// runs synchronously after React commits the DOM but before paint, so
|
||||
// dispatching SYNC_FIT_PANES_EVENT here lets the terminal reflow in the
|
||||
@@ -1477,51 +1482,49 @@ function App(): React.JSX.Element {
|
||||
</>
|
||||
) : null}
|
||||
<StatusBar floatingTerminalOpen={floatingTerminalOpen} />
|
||||
{/* Why: NewWorkspaceComposerCard renders Radix <Tooltip>s that crash
|
||||
when mounted outside a TooltipProvider ancestor. Keep the global
|
||||
composer modal inside this provider so the card renders safely
|
||||
whether triggered from Cmd+J or any future entry point. */}
|
||||
{/* Why: root overlays can render Radix <Tooltip>s; keep them inside
|
||||
the shared provider so lazy surfaces mount safely from any entry point. */}
|
||||
<Suspense fallback={null}>
|
||||
{mountedLazyModalIds.has('new-workspace-composer') ? <NewWorkspaceComposerModal /> : null}
|
||||
{mountedLazyModalIds.has('workspace-cleanup') ? <WorkspaceCleanupDialog /> : null}
|
||||
</Suspense>
|
||||
</TooltipProvider>
|
||||
<Suspense fallback={null}>
|
||||
{mountedLazyModalIds.has('quick-open') ? <QuickOpen /> : null}
|
||||
{mountedLazyModalIds.has('worktree-palette') ? <WorktreeJumpPalette /> : null}
|
||||
{mountedLazyModalIds.has('feature-wall') ? <FeatureWallModal /> : null}
|
||||
</Suspense>
|
||||
{/* Why: mount PetOverlay only when the experimental flag is on AND
|
||||
<Suspense fallback={null}>
|
||||
{mountedLazyModalIds.has('quick-open') ? <QuickOpen /> : null}
|
||||
{mountedLazyModalIds.has('worktree-palette') ? <WorktreeJumpPalette /> : null}
|
||||
{mountedLazyModalIds.has('feature-wall') ? <FeatureWallModal /> : null}
|
||||
</Suspense>
|
||||
{/* Why: mount PetOverlay only when the experimental flag is on AND
|
||||
the user hasn't hit "Hide pet" in the status-bar menu. Both
|
||||
conditions must be true — see design doc (pet-overlay.md) on why
|
||||
the two toggles are kept independent. */}
|
||||
{petEnabled && petVisible ? (
|
||||
<Suspense fallback={null}>
|
||||
<PetOverlay />
|
||||
</Suspense>
|
||||
) : null}
|
||||
<UpdateCard />
|
||||
<FeatureTourNudge />
|
||||
<StarNagCard />
|
||||
{/* Why: the existing-user opt-in banner mounts at App root so it
|
||||
{petEnabled && petVisible ? (
|
||||
<Suspense fallback={null}>
|
||||
<PetOverlay />
|
||||
</Suspense>
|
||||
) : null}
|
||||
<UpdateCard />
|
||||
<FeatureTourNudge />
|
||||
<StarNagCard />
|
||||
{/* Why: the existing-user opt-in banner mounts at App root so it
|
||||
renders once per renderer session, not per view. It gates
|
||||
internally on the cohort markers populated by the migration,
|
||||
so it only shows for users who installed before the telemetry
|
||||
release and have not yet resolved consent. New users get no
|
||||
first-launch surface — see telemetry-plan.md §First-launch
|
||||
experience. */}
|
||||
<TelemetryFirstLaunchSurface />
|
||||
<ZoomOverlay />
|
||||
<SshPassphraseDialog />
|
||||
<DeleteWorktreeDialog />
|
||||
<CrashReportDialog />
|
||||
{onboarding && shouldShowOnboarding(onboarding) ? (
|
||||
<Suspense fallback={null}>
|
||||
<OnboardingFlow onboarding={onboarding} onOnboardingChange={setOnboarding} />
|
||||
</Suspense>
|
||||
) : null}
|
||||
<DictationController />
|
||||
<RecentTabSwitcher />
|
||||
<TelemetryFirstLaunchSurface />
|
||||
<ZoomOverlay />
|
||||
<SshPassphraseDialog />
|
||||
<DeleteWorktreeDialog />
|
||||
<CrashReportDialog />
|
||||
{onboarding && shouldShowOnboarding(onboarding) ? (
|
||||
<Suspense fallback={null}>
|
||||
<OnboardingFlow onboarding={onboarding} onOnboardingChange={setOnboarding} />
|
||||
</Suspense>
|
||||
) : null}
|
||||
<DictationController />
|
||||
<RecentTabSwitcher />
|
||||
</TooltipProvider>
|
||||
<Toaster closeButton toastOptions={{ className: 'font-sans text-sm' }} />
|
||||
{/* Why: rendered last so it sits after all -webkit-app-region:drag elements
|
||||
in DOM order. Electron's hit-test for drag regions is DOM-order-based and
|
||||
|
||||
@@ -269,7 +269,7 @@ export default function NewWorkspaceComposerCard({
|
||||
<div className="min-w-0 space-y-4 pt-3">
|
||||
<div className="space-y-1">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<label className="text-xs font-medium text-muted-foreground">Repository</label>
|
||||
<label className="text-xs font-medium text-muted-foreground">Project</label>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
@@ -293,7 +293,7 @@ export default function NewWorkspaceComposerCard({
|
||||
value={repoId}
|
||||
onValueChange={onRepoChange}
|
||||
onValueSelected={focusNameInput}
|
||||
placeholder="Choose repository"
|
||||
placeholder="Choose project"
|
||||
// Why: programmatic .focus() from the Dialog's onOpenAutoFocus
|
||||
// handler does not reliably trigger :focus-visible in Chromium.
|
||||
// Mirror the Input component's standard ring (border-ring +
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useEffect } from 'react'
|
||||
import { ChevronLeft, Loader2 } from 'lucide-react'
|
||||
import { ChevronLeft, CornerDownLeft, Loader2 } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { isEditableTarget } from '@/lib/editable-target'
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
|
||||
import type { OnboardingState } from '../../../../shared/types'
|
||||
import { AgentStep } from './AgentStep'
|
||||
import { ThemeStep } from './ThemeStep'
|
||||
@@ -11,8 +12,6 @@ import { STEPS, useOnboardingFlow } from './use-onboarding-flow'
|
||||
import logo from '../../../../../resources/logo.svg'
|
||||
|
||||
const isMac = navigator.userAgent.includes('Mac')
|
||||
// Why: AGENTS.md mandates `Ctrl+Enter` style on non-Mac; bare `Ctrl↵` reads as one glyph.
|
||||
const enterLabel = isMac ? '⌘↵' : 'Ctrl+Enter'
|
||||
|
||||
const stepCopy = {
|
||||
agent: {
|
||||
@@ -35,6 +34,13 @@ const stepCopy = {
|
||||
}
|
||||
} as const
|
||||
|
||||
const stepTooltipLabels = {
|
||||
agent: 'Default Agent',
|
||||
theme: 'Appearance',
|
||||
notifications: 'Agent tools',
|
||||
repo: 'Create project'
|
||||
} as const
|
||||
|
||||
type OnboardingFlowProps = {
|
||||
onboarding: OnboardingState
|
||||
onOnboardingChange: (state: OnboardingState) => void
|
||||
@@ -79,7 +85,7 @@ export default function OnboardingFlow({
|
||||
}, [currentStep.id, flowNext, flowOpenFolder])
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-[100] overflow-auto bg-background text-foreground">
|
||||
<div className="scrollbar-sleek fixed inset-0 z-[100] overflow-auto bg-background text-foreground">
|
||||
<div
|
||||
aria-hidden
|
||||
className="pointer-events-none absolute inset-0 opacity-70 dark:opacity-70"
|
||||
@@ -105,23 +111,37 @@ export default function OnboardingFlow({
|
||||
</div>
|
||||
|
||||
<div className="mt-12 flex items-center gap-2">
|
||||
{STEPS.map((step, idx) => {
|
||||
const isActive = idx === stepIndex
|
||||
const isDone = idx < stepIndex
|
||||
return (
|
||||
<div
|
||||
key={step.id}
|
||||
className={cn(
|
||||
'h-1 rounded-full transition-all duration-300',
|
||||
isActive
|
||||
? 'w-10 bg-foreground'
|
||||
: isDone
|
||||
? 'w-6 bg-muted-foreground/70'
|
||||
: 'w-6 bg-muted'
|
||||
)}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
<TooltipProvider delayDuration={0} skipDelayDuration={0}>
|
||||
{STEPS.map((step, idx) => {
|
||||
const isActive = idx === stepIndex
|
||||
const isDone = idx < stepIndex
|
||||
return (
|
||||
<Tooltip key={step.id}>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
className={cn(
|
||||
// Why: the visible bars stay 4px tall, but the invisible
|
||||
// hit area makes hover/click/tooltip targeting reliable.
|
||||
'relative h-1 rounded-full outline-none transition-all duration-300 before:absolute before:-inset-y-2 before:-inset-x-1 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',
|
||||
isActive
|
||||
? 'w-10 bg-foreground'
|
||||
: isDone
|
||||
? 'w-6 bg-muted-foreground/70 hover:bg-foreground/80'
|
||||
: 'w-6 bg-muted hover:bg-muted-foreground/60'
|
||||
)}
|
||||
aria-label={`Go to onboarding step ${step.stepNumber}: ${stepCopy[step.id].title}`}
|
||||
aria-current={isActive ? 'step' : undefined}
|
||||
onClick={() => flow.jumpToStep(idx)}
|
||||
/>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={8} style={{ zIndex: 110 }}>
|
||||
{stepTooltipLabels[step.id]}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)
|
||||
})}
|
||||
</TooltipProvider>
|
||||
<span className="ml-3 text-xs font-medium text-muted-foreground">
|
||||
{stepIndex + 1} of {STEPS.length}
|
||||
</span>
|
||||
@@ -188,33 +208,14 @@ export default function OnboardingFlow({
|
||||
</div>
|
||||
|
||||
<footer className="mt-10 flex items-center justify-between border-t border-border pt-5">
|
||||
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<kbd className="rounded-md border border-border bg-muted/60 px-1.5 py-0.5 font-mono text-[11px] text-foreground">
|
||||
{enterLabel}
|
||||
</kbd>
|
||||
<span>
|
||||
{currentStep.id === 'repo'
|
||||
? 'open folder'
|
||||
: currentStep.id === 'notifications' &&
|
||||
flow.hasSelectedFeatureSetup &&
|
||||
!flow.featureSetupTerminalCommand
|
||||
? 'set up'
|
||||
: 'continue'}
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
className="rounded-md px-3 py-2 text-sm text-muted-foreground hover:text-foreground disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:text-muted-foreground"
|
||||
disabled={Boolean(busyLabel)}
|
||||
onClick={() => void flow.skip()}
|
||||
>
|
||||
Skip all onboarding
|
||||
</button>
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
className={cn(
|
||||
currentStep.id === 'repo'
|
||||
? 'rounded-md border border-foreground/20 bg-muted px-3 py-2 text-sm font-medium text-foreground hover:bg-muted-foreground/10'
|
||||
: 'rounded-md px-3 py-2 text-sm text-muted-foreground hover:text-foreground',
|
||||
'disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:text-muted-foreground'
|
||||
)}
|
||||
disabled={Boolean(busyLabel)}
|
||||
onClick={() => void flow.skip()}
|
||||
>
|
||||
{currentStep.id === 'repo' ? "I'll add one later" : 'Skip'}
|
||||
</button>
|
||||
{stepIndex > 0 && (
|
||||
<button
|
||||
className="inline-flex items-center gap-1 rounded-md border border-border bg-muted/60 px-3 py-2 text-sm text-foreground hover:bg-muted disabled:opacity-60"
|
||||
@@ -234,6 +235,10 @@ export default function OnboardingFlow({
|
||||
>
|
||||
{busyLabel ? <Loader2 className="size-4 animate-spin" /> : null}
|
||||
{primaryActionLabel}
|
||||
<span className="ml-1 inline-flex items-center gap-0.5 rounded border border-primary-foreground/20 px-1.5 py-0.5 text-[10px] font-medium leading-none text-current/80">
|
||||
<span>{isMac ? '⌘' : 'Ctrl'}</span>
|
||||
<CornerDownLeft className="size-3" />
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import type { OnboardingState } from '../../../../shared/types'
|
||||
|
||||
const ONBOARDING_REOPENED_EVENT = 'orca:onboarding-reopened'
|
||||
|
||||
export async function showOnboardingFromRenderer(): Promise<void> {
|
||||
const nextOnboarding = await window.api.onboarding.update({
|
||||
closedAt: null,
|
||||
outcome: null,
|
||||
lastCompletedStep: -1,
|
||||
// Why: this is a manual re-open of the wizard, not a reset of the
|
||||
// user's activation history. Only clear the dismissed UI flag.
|
||||
checklist: { dismissed: false }
|
||||
})
|
||||
window.dispatchEvent(
|
||||
new CustomEvent<OnboardingState>(ONBOARDING_REOPENED_EVENT, { detail: nextOnboarding })
|
||||
)
|
||||
}
|
||||
|
||||
export function onOnboardingReopened(callback: (state: OnboardingState) => void): () => void {
|
||||
const listener = (event: Event): void => {
|
||||
callback((event as CustomEvent<OnboardingState>).detail)
|
||||
}
|
||||
window.addEventListener(ONBOARDING_REOPENED_EVENT, listener)
|
||||
return () => window.removeEventListener(ONBOARDING_REOPENED_EVENT, listener)
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
type OnboardingFeatureSetupSelection
|
||||
} from './onboarding-feature-setup'
|
||||
import { STEPS, type StepNumber } from './use-onboarding-flow-types'
|
||||
import { persistStep, useCloseWith, usePersistCurrentStep } from './use-onboarding-flow-persistence'
|
||||
import { useCloseWith, usePersistCurrentStep } from './use-onboarding-flow-persistence'
|
||||
import { callRuntimeRpc, getActiveRuntimeTarget } from '@/runtime/runtime-rpc-client'
|
||||
|
||||
export { STEPS } from './use-onboarding-flow-types'
|
||||
@@ -506,11 +506,10 @@ export function useOnboardingFlow(
|
||||
if (busyLabel) {
|
||||
return
|
||||
}
|
||||
// Why: skip has no keyboard path today, so `advanced_via` is always
|
||||
// `'button'`. Including the field keeps the shape uniform with the
|
||||
// completed/dismissed events and lets a future keyboard-skip arrive
|
||||
// without a schema migration.
|
||||
const durationMs = consumeStepDurationMs()
|
||||
// Why: skip has no keyboard path today, so `advanced_via` is always
|
||||
// `'button'`. Keep the current step event before the all-onboarding
|
||||
// dismissal so the funnel still records where the user bailed.
|
||||
track('onboarding_step_skipped', {
|
||||
step: currentStep.stepNumber,
|
||||
duration_ms: durationMs,
|
||||
@@ -522,29 +521,16 @@ export function useOnboardingFlow(
|
||||
setTheme(settings.theme)
|
||||
applyDocumentTheme(settings.theme)
|
||||
}
|
||||
if (currentStep.id === 'repo') {
|
||||
await closeWith('dismissed', {}, currentStep.stepNumber, undefined, {
|
||||
advancedVia: 'button',
|
||||
durationMs
|
||||
})
|
||||
return
|
||||
}
|
||||
// Why: persistence-only path — does NOT trigger requestPermission, so
|
||||
// skipping step 3 never fires the OS permission prompt.
|
||||
try {
|
||||
onOnboardingChange(await persistStep(currentStep.stepNumber))
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : String(err))
|
||||
return
|
||||
}
|
||||
setStepIndex((idx) => Math.min(idx + 1, STEPS.length - 1))
|
||||
await closeWith('dismissed', {}, currentStep.stepNumber, undefined, {
|
||||
advancedVia: 'button',
|
||||
durationMs
|
||||
})
|
||||
}, [
|
||||
busyLabel,
|
||||
closeWith,
|
||||
consumeStepDurationMs,
|
||||
currentStep.id,
|
||||
currentStep.stepNumber,
|
||||
onOnboardingChange,
|
||||
settings
|
||||
])
|
||||
|
||||
@@ -552,6 +538,10 @@ export function useOnboardingFlow(
|
||||
setStepIndex((idx) => Math.max(idx - 1, 0))
|
||||
}, [])
|
||||
|
||||
const jumpToStep = useCallback((idx: number) => {
|
||||
setStepIndex(Math.min(Math.max(idx, 0), STEPS.length - 1))
|
||||
}, [])
|
||||
|
||||
return {
|
||||
settings,
|
||||
updateSettings,
|
||||
@@ -581,6 +571,7 @@ export function useOnboardingFlow(
|
||||
next,
|
||||
skip,
|
||||
back,
|
||||
jumpToStep,
|
||||
openFolder,
|
||||
clone
|
||||
}
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
import React, { useState } from 'react'
|
||||
import {
|
||||
BookOpen,
|
||||
Boxes,
|
||||
CircleHelp,
|
||||
ExternalLink,
|
||||
FolderPlus,
|
||||
Github,
|
||||
HardDrive,
|
||||
MessageSquareText,
|
||||
School,
|
||||
Settings,
|
||||
Smartphone
|
||||
} from 'lucide-react'
|
||||
import { useAppStore } from '@/store'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Tooltip, TooltipTrigger, TooltipContent } from '@/components/ui/tooltip'
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger
|
||||
} from '@/components/ui/dropdown-menu'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -21,10 +32,12 @@ import {
|
||||
import { cn } from '@/lib/utils'
|
||||
import { toast } from 'sonner'
|
||||
import type { GitHubViewer } from '../../../../shared/types'
|
||||
import { showOnboardingFromRenderer } from '../onboarding/show-onboarding-event'
|
||||
|
||||
const GITHUB_ISSUES_URL = 'https://github.com/stablyai/orca/issues/'
|
||||
const DISCORD_URL = 'https://discord.gg/fzjDKHxv8Q'
|
||||
const X_URL = 'https://x.com/orca_build'
|
||||
const DOCS_URL = 'https://www.onorca.dev/docs'
|
||||
|
||||
type SubmitIdentity = {
|
||||
githubLogin: string | null
|
||||
@@ -241,7 +254,19 @@ const SidebarToolbar = React.memo(function SidebarToolbar() {
|
||||
const openModal = useAppStore((s) => s.openModal)
|
||||
const openSettingsPage = useAppStore((s) => s.openSettingsPage)
|
||||
const openSettingsTarget = useAppStore((s) => s.openSettingsTarget)
|
||||
const openSkillsPage = useAppStore((s) => s.openSkillsPage)
|
||||
const openSpacePage = useAppStore((s) => s.openSpacePage)
|
||||
const [feedbackOpen, setFeedbackOpen] = useState(false)
|
||||
const lastShowOnboardingAtRef = React.useRef(0)
|
||||
|
||||
const handleShowOnboarding = (): void => {
|
||||
const now = Date.now()
|
||||
if (now - lastShowOnboardingAtRef.current < 500) {
|
||||
return
|
||||
}
|
||||
lastShowOnboardingAtRef.current = now
|
||||
void showOnboardingFromRenderer()
|
||||
}
|
||||
|
||||
const openMobileSettings = (): void => {
|
||||
openSettingsTarget({ pane: 'mobile', repoId: null })
|
||||
@@ -268,37 +293,78 @@ const SidebarToolbar = React.memo(function SidebarToolbar() {
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<div className="flex items-center gap-1">
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-xs"
|
||||
onClick={openMobileSettings}
|
||||
aria-label="Open Orca Mobile settings"
|
||||
className="text-muted-foreground"
|
||||
>
|
||||
<DropdownMenu modal={false}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-xs"
|
||||
type="button"
|
||||
aria-label="Toolbox"
|
||||
className="text-muted-foreground"
|
||||
>
|
||||
<Boxes className="size-3.5" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={4}>
|
||||
Toolbox
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<DropdownMenuContent side="top" align="start" sideOffset={8} className="w-44">
|
||||
<DropdownMenuItem onSelect={openMobileSettings}>
|
||||
<Smartphone className="size-3.5" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={4}>
|
||||
Orca Mobile
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-xs"
|
||||
onClick={() => setFeedbackOpen(true)}
|
||||
className="text-muted-foreground"
|
||||
Orca Mobile
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={openSkillsPage}>
|
||||
<BookOpen className="size-3.5" />
|
||||
Skills
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={openSpacePage}>
|
||||
<HardDrive className="size-3.5" />
|
||||
Space Analyzer
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<DropdownMenu modal={false}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-xs"
|
||||
type="button"
|
||||
aria-label="Help"
|
||||
className="text-muted-foreground"
|
||||
>
|
||||
<CircleHelp className="size-3.5" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={4}>
|
||||
Help
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<DropdownMenuContent side="top" align="start" sideOffset={8} className="w-48">
|
||||
<DropdownMenuItem
|
||||
className="whitespace-nowrap"
|
||||
onClick={handleShowOnboarding}
|
||||
onSelect={handleShowOnboarding}
|
||||
>
|
||||
<School className="size-3.5" />
|
||||
Show Onboarding
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={() => setFeedbackOpen(true)}>
|
||||
<MessageSquareText className="size-3.5" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={4}>
|
||||
Send feedback
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
Send feedback
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={() => openExternalUrl(DOCS_URL)}>
|
||||
<ExternalLink className="size-3.5" />
|
||||
Docs
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
|
||||
@@ -420,11 +420,6 @@ const WorktreeContextMenu = React.memo(function WorktreeContextMenu({
|
||||
{worktree.isPinned ? <PinOff className="size-3.5" /> : <Pin className="size-3.5" />}
|
||||
{worktree.isPinned ? 'Unpin' : 'Pin'}
|
||||
</DropdownMenuItem>
|
||||
{/* Why: consolidated 'Rename'/'Link GH Issue'/'Add Comment' into single 'Update' (reuses Pencil edit icon + rename handler) for simplified workspace right-click menu */}
|
||||
<DropdownMenuItem onSelect={handleRename} disabled={isDeleting}>
|
||||
<Pencil className="size-3.5" />
|
||||
Update
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={handleToggleRead} disabled={isDeleting}>
|
||||
{worktree.isUnread ? (
|
||||
<BellOff className="size-3.5" />
|
||||
@@ -487,6 +482,12 @@ const WorktreeContextMenu = React.memo(function WorktreeContextMenu({
|
||||
</DropdownMenuRadioGroup>
|
||||
</DropdownMenuSubContent>
|
||||
</DropdownMenuSub>
|
||||
{!isMultiContext && (
|
||||
<DropdownMenuItem onSelect={handleRename} disabled={isDeleting}>
|
||||
<Pencil className="size-3.5" />
|
||||
Update
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
<DropdownMenuSeparator />
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { BookOpen, Clock, FolderOpen, Loader2, RefreshCw, Search, X } from 'lucide-react'
|
||||
import { ArrowLeft, BookOpen, Clock, FolderOpen, Loader2, RefreshCw, Search } from 'lucide-react'
|
||||
import { toast } from 'sonner'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
@@ -198,6 +198,49 @@ export default function SkillsPage(): React.JSX.Element {
|
||||
void loadSkills()
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
const hasVisibleOverlay = (): boolean =>
|
||||
Array.from(
|
||||
document.querySelectorAll('[role="dialog"], [role="listbox"], [role="menu"]')
|
||||
).some((element) => {
|
||||
if (!(element instanceof HTMLElement)) {
|
||||
return false
|
||||
}
|
||||
if (element.closest('[aria-hidden="true"]')) {
|
||||
return false
|
||||
}
|
||||
const style = window.getComputedStyle(element)
|
||||
return (
|
||||
style.display !== 'none' &&
|
||||
style.visibility !== 'hidden' &&
|
||||
element.getClientRects().length > 0
|
||||
)
|
||||
})
|
||||
|
||||
const handleKeyDown = (event: KeyboardEvent): void => {
|
||||
if (event.key !== 'Escape') {
|
||||
return
|
||||
}
|
||||
// Why: menus and dialogs own Escape before page-level navigation.
|
||||
if (hasVisibleOverlay()) {
|
||||
return
|
||||
}
|
||||
const target = event.target as HTMLElement | null
|
||||
if (
|
||||
target?.matches('input, textarea, select, [contenteditable="true"], [contenteditable=""]')
|
||||
) {
|
||||
return
|
||||
}
|
||||
event.preventDefault()
|
||||
closeSkillsPage()
|
||||
}
|
||||
|
||||
// Why: tooltips can consume Escape before bubble listeners see it. Capture
|
||||
// keeps page-level back navigation reliable when no overlay is active.
|
||||
window.addEventListener('keydown', handleKeyDown, { capture: true })
|
||||
return () => window.removeEventListener('keydown', handleKeyDown, { capture: true })
|
||||
}, [closeSkillsPage])
|
||||
|
||||
const skills = result?.skills ?? EMPTY_SKILLS
|
||||
const visibleSkills = useMemo(() => filterSkills(skills, filters), [filters, skills])
|
||||
const sourceCounts = useMemo(() => countSkillsBySource(skills), [skills])
|
||||
@@ -206,6 +249,10 @@ export default function SkillsPage(): React.JSX.Element {
|
||||
return (
|
||||
<main className="flex min-h-0 flex-1 flex-col bg-background">
|
||||
<header className="flex shrink-0 items-center gap-3 border-b border-border px-5 py-3">
|
||||
<Button variant="outline" size="sm" onClick={closeSkillsPage} className="shrink-0 gap-1.5">
|
||||
<ArrowLeft className="size-3.5" />
|
||||
Back
|
||||
</Button>
|
||||
<div className="flex min-w-0 flex-1 items-center gap-3">
|
||||
<BookOpen className="size-4 text-muted-foreground" />
|
||||
<div className="min-w-0">
|
||||
@@ -218,15 +265,6 @@ export default function SkillsPage(): React.JSX.Element {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
onClick={closeSkillsPage}
|
||||
aria-label="Close Skills"
|
||||
>
|
||||
<X className="size-4" />
|
||||
</Button>
|
||||
</header>
|
||||
|
||||
<section className="flex shrink-0 flex-col gap-3 border-b border-border px-5 py-4">
|
||||
|
||||
@@ -214,7 +214,7 @@ export default function SparseCheckoutPresetSelect({
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
align="start"
|
||||
className="w-[var(--radix-popover-trigger-width)] max-w-[calc(100vw-2rem)] p-0"
|
||||
className="popover-scroll-content max-h-[min(var(--radix-popover-content-available-height),24rem)] w-[var(--radix-popover-trigger-width)] max-w-[calc(100vw-2rem)] overflow-y-auto p-0"
|
||||
onOpenAutoFocus={(event) => event.preventDefault()}
|
||||
>
|
||||
{draft ? (
|
||||
|
||||
@@ -4,7 +4,6 @@ states stay consistent across Claude and Codex. */
|
||||
import {
|
||||
AlertTriangle,
|
||||
Activity,
|
||||
BookOpen,
|
||||
ChevronDown,
|
||||
ChevronRight,
|
||||
RefreshCw,
|
||||
@@ -730,7 +729,6 @@ function StatusBarInner({ floatingTerminalOpen }: StatusBarProps): React.JSX.Ele
|
||||
// statusBarItems checkbox would double-toggle the surface). It is driven
|
||||
// purely by the experimentalPet settings flag.
|
||||
const petEnabled = useAppStore((s) => s.settings?.experimentalPet === true)
|
||||
const openSkillsPage = useAppStore((s) => s.openSkillsPage)
|
||||
const toggleStatusBarItem = useAppStore((s) => s.toggleStatusBarItem)
|
||||
const containerRef = useRef<HTMLDivElement>(null)
|
||||
const [isRefreshing, setIsRefreshing] = useState(false)
|
||||
@@ -899,21 +897,6 @@ function StatusBarInner({ floatingTerminalOpen }: StatusBarProps): React.JSX.Ele
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<UpdateStatusSegment compact={compact} iconOnly={iconOnly} />
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
className="inline-flex size-5 cursor-pointer items-center justify-center rounded border border-border bg-secondary text-secondary-foreground shadow-xs transition-colors hover:bg-accent hover:text-accent-foreground"
|
||||
aria-label="Open Skills"
|
||||
onClick={openSkillsPage}
|
||||
>
|
||||
<BookOpen className="size-3.5" />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={6}>
|
||||
Skills
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
{petEnabled && <PetStatusSegment />}
|
||||
{showResourceUsage && <ResourceUsageStatusSegment compact={compact} iconOnly={iconOnly} />}
|
||||
{showSsh && <SshStatusSegment compact={compact} iconOnly={iconOnly} />}
|
||||
|
||||
Reference in New Issue
Block a user