Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
272 changes: 272 additions & 0 deletions .agents/notes/implemented/feature/2026-09-10-ui-choice-controls.md

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,16 @@
"@posthog/react": "^1.10.3",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-alert-dialog": "^1.1.14",
"@radix-ui/react-checkbox": "^1.3.2",
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-context-menu": "^2.2.15",
"@radix-ui/react-dialog": "^1.1.14",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-menubar": "^1.1.15",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-radio-group": "^1.3.7",
"@radix-ui/react-scroll-area": "^1.2.9",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toggle": "^1.1.9",
"@radix-ui/react-tooltip": "^1.2.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next';
import { ImageIcon } from 'lucide-react';
import type { ConversationMessage } from '@lody/shared';
import { Button } from '@lody/ui/button';
import { Checkbox } from '@/ui/checkbox';
import { Checkbox } from '@lody/ui/checkbox';
import { ConversationColumn } from '@/components/shared/conversation-column';

type SelectionGesture = {
Expand Down
11 changes: 3 additions & 8 deletions packages/components/src/components/archive/archive-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import type { LucideIcon } from 'lucide-react';
import { cn } from '@/lib/utils';
import { Button } from '@lody/ui/button';
import { Checkbox } from '@/ui/checkbox';
import { Checkbox } from '@lody/ui/checkbox';
import {
Dialog,
DialogContent,
Expand Down Expand Up @@ -895,12 +895,6 @@ export function ArchivedSessionGroupSection({
const allSelected = selectedInGroup === group.sessions.length && group.sessions.length > 0;
const someSelected = selectedInGroup > 0 && !allSelected;

const groupCheckboxState: boolean | 'indeterminate' = allSelected
? true
: someSelected
? 'indeterminate'
: false;

const showHeader = !hideGroupHeader;
const showSessions = hideGroupHeader || !group.collapsed;
const sessionTree = useMemo(() => buildArchivedSessionTree(group.sessions), [group.sessions]);
Expand Down Expand Up @@ -928,7 +922,8 @@ export function ArchivedSessionGroupSection({
}}
>
<Checkbox
checked={groupCheckboxState}
checked={allSelected}
indeterminate={someSelected}
onCheckedChange={() => onToggleGroupSelect(groupKey, groupSessionIds)}
aria-label={`Select all in ${label}`}
/>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/loro-app-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import {
DialogTitle,
} from '@/ui/dialog';
import { Button } from '@lody/ui/button';
import { Checkbox } from '@/ui/checkbox';
import { Checkbox } from '@lody/ui/checkbox';
import {
ContextMenu,
ContextMenuContent,
Expand Down Expand Up @@ -354,7 +354,7 @@ export function RemoveLocalProjectDialog({
className="mt-0.5"
checked={cleanupWorktrees}
disabled={!canCleanupWorktrees || isRemoving}
onCheckedChange={(checked) => void setCleanup(checked === true)}
onCheckedChange={(checked) => void setCleanup(checked)}
/>
<span>
<span className="block font-medium text-foreground">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Loader2, CheckCircle2, AlertCircle, Download, ExternalLink } from 'luci
import type { ElectronUpdaterPhase } from '@lody/shared';
import { useAtom } from 'jotai';
import { Button } from '@lody/ui/button';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import {
developerModeEnabledAtom,
inboxBetaEnabledAtom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
} from '@/atoms/focus-layer';
import { buildSessionRowOpenedByTreeSlot } from '@/components/sidebar-row-shared';
import { cn } from '@/lib/utils';
import { Checkbox } from '@/ui/checkbox';
import { Checkbox } from '@lody/ui/checkbox';
import {
AlertDialog,
AlertDialogAction,
Expand Down Expand Up @@ -1428,7 +1428,7 @@ function SelectionToolbar({
onClick={onToggleAll}
className="inline-flex items-center gap-2 text-sm font-medium text-foreground"
>
<Checkbox checked={allSelected} tabIndex={-1} className="pointer-events-none h-4 w-4" />
<Checkbox checked={allSelected} tabIndex={-1} className="pointer-events-none" />
<span>{countLabel}</span>
</button>
<div className="flex items-center gap-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
} from '@lody/shared';
import { useAtom, useAtomValue } from 'jotai';
import { Loading } from '@/ui';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { toast } from 'sonner';
import {
autoArchiveOnPrClosedAtom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { currentWorkspaceSlugAtom } from '@/atoms';
import { cloudOperations } from '@/lib/cloud-api-operations';
import { cn } from '@/lib/utils';
import { useAppCapability } from '@/lib/app-platform';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Input } from '@lody/ui/input';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { toast } from 'sonner';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { useAtomValue } from 'jotai';
import { machineSupportsLocalProjectRemovalProtocol, type MachineId } from '@lody/shared';
import { ChevronRight, Loader2, Wrench } from 'lucide-react';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { TooltipProvider } from '@/ui/tooltip';
import { currentWorkspaceIdAtom } from '@/atoms';
import { getMachineMetaMapAtom } from '@/atoms/machines';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { isNativeAppShell } from '@/lib/native-platform';
import { consumeMobileBackNavigation } from '@/lib/mobile-back-navigation';
import { cn } from '@/lib/utils';
import { useLongPress } from '@/hooks/use-long-press';
import { Checkbox } from '@/ui/checkbox';
import { Checkbox } from '@lody/ui/checkbox';
import { CachedAvatarImg } from '@/components/cached-avatar-img';
import { WorktreeIcon } from '@/components/icons/worktree-icon';
import {
Expand Down Expand Up @@ -563,7 +563,7 @@ export function ConversationRow({
<Checkbox
checked={isSelected}
tabIndex={-1}
className="pointer-events-none h-4 w-4"
className="pointer-events-none"
aria-hidden="true"
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ChevronRight, Folder, FolderOpen, FolderPlus, Github, Loader2 } from 'lucide-react';
import type { MachineId } from '@lody/shared';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { TooltipProvider } from '@/ui/tooltip';
import { cn } from '@/lib/utils';
import { useOnlineMachineIds } from '@/hooks/use-machine-online-status';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Loader2, X } from 'lucide-react';

import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerTitle } from '@/ui/drawer';
import { Button } from '@lody/ui/button';
import { Checkbox } from '@/ui/checkbox';
import { Checkbox } from '@lody/ui/checkbox';
import { cn } from '@/lib/utils';

export type MobileRemoveLocalProjectSheetProps = {
Expand Down Expand Up @@ -197,7 +197,7 @@ export function MobileRemoveLocalProjectSheet({
className="mt-0.5"
checked={cleanupWorktrees}
disabled={!canCleanupWorktrees || isRemoving}
onCheckedChange={(checked) => void handleCleanupChange(checked === true)}
onCheckedChange={(checked) => void handleCleanupChange(checked)}
/>
<span>
<span className="block font-medium text-foreground">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { openExternalUrl } from '@/lib/native-browser';
import { useKeyboardAwareSheet } from '@/hooks/use-keyboard-aware-scroll-into-view';
import { cn } from '@/lib/utils';
import { Drawer, DrawerContent, DrawerDescription, DrawerTitle } from '@/ui/drawer';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import {
classifyPermissionModeFace,
getAgentRoleEmoji,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import type { SessionId, SessionMeta } from '@lody/shared';
import { DropdownMenuItem, DropdownMenuSeparator } from '@/ui/dropdown-menu';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Popover, PopoverContent, PopoverTrigger } from '@/ui/popover';
import { reviewAgentFeatureEnabledAtom } from '@/atoms/settings';
import { useAutoReview } from '@/hooks/use-auto-review';
Expand Down Expand Up @@ -126,7 +126,7 @@ export function AutoReviewMenuItem({
</Popover>
<Switch
checked={enabled}
className="pointer-events-none scale-75"
className="pointer-events-none"
aria-label={t('sessions.autoReview.menuLabel', 'Auto review and merge')}
/>
</DropdownMenuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Field as UiField } from '@lody/ui/field';
import { Input } from '@lody/ui/input';
import { Button } from '@lody/ui/button';
import { copyChatShareImage, exportChatShareImage } from '@/lib/chat-share-image-export';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ui/select';
import {
ChatShareCard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
import { cn } from '@/lib/utils';
import { useOnlineMachines } from '@/hooks/use-online-machines';
import { Badge } from '@/ui/badge';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/ui/tooltip';
import {
DropdownMenu,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useAtom } from 'jotai';
import { Loader2, CheckCircle2, AlertCircle, Download, ExternalLink } from 'lucide-react';
import type { ElectronUpdaterPhase } from '@lody/shared';
import { Button } from '@lody/ui/button';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { BetaFeaturesSection } from './beta-features-setting';
import { CompactRow, CompactSection } from './compact-layout';
import { settingContainerClass } from '.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Input } from '@lody/ui/input';
import { Field as UiField } from '@lody/ui/field';
import { Popover, PopoverContent, PopoverTrigger } from '@/ui/popover';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ui/select';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Textarea } from '@lody/ui/textarea';
import { Field, Section } from './form-primitives';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useAtom } from 'jotai';
import { useTranslation } from 'react-i18next';
import { autoArchiveOnPrClosedAtom, autoArchiveOnPrMergedAtom } from '@/atoms';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { CompactRow, CompactSection } from './compact-layout';

export function AutoArchiveSection() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useAtom, useAtomValue } from 'jotai';
import { useTranslation } from 'react-i18next';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import {
developerModeEnabledAtom,
inboxBetaEnabledAtom,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useAtom, useAtomValue } from 'jotai';
import { useTranslation } from 'react-i18next';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import {
experimentalFeaturesEnabledAtom,
reviewAgentExperimentEnabledAtom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
import { Trash2 } from 'lucide-react';
import { Loading } from '@/ui';
import { Button } from '@lody/ui/button';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ui/select';
import { toast } from 'sonner';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { cloudOperations } from '@/lib/cloud-api-operations';
import { cn } from '@/lib/utils';
import { useAppCapability } from '@/lib/app-platform';
import { ScrollArea } from '@/ui/scroll-area';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Input } from '@lody/ui/input';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { toast } from 'sonner';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import { Badge } from '@/ui/badge';
import { Button } from '@lody/ui/button';
import { Input } from '@lody/ui/input';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import {
DropdownMenu,
DropdownMenuContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { cn } from '@/lib/utils';
import { Button } from '@lody/ui/button';
import { Input } from '@lody/ui/input';
import { Field as UiField } from '@lody/ui/field';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Textarea } from '@lody/ui/textarea';
import { Field, Section } from './form-primitives';

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/settings/mcp-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import { Badge } from '@/ui/badge';
import { Button } from '@lody/ui/button';
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/ui/dialog';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/ui/tooltip';
import { settingContainerClass } from '.';
import { McpConnectionForm, type McpConnectionFormValue } from './mcp-connection-form';
Expand Down Expand Up @@ -310,7 +310,7 @@ export function McpServerRow({
</span>
</button>
<div className="flex shrink-0 items-center gap-2 py-2 pl-2 pr-2">
{/* The switch keeps its own Radix `data-state`, so the label sits
{/* The switch carries its own state attributes, so the label sits
beside it rather than wrapping it in a tooltip trigger. */}
<label
className="flex cursor-pointer items-center gap-1.5 text-[11px] text-muted-foreground"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Bot, Folder } from 'lucide-react';
import type { AgentConfigMeta, MachineId } from '@lody/shared';
import { useLocalProjectsAdmin } from '@/hooks/use-local-projects-admin';
import { Button } from '@lody/ui/button';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import type { ProjectSettingsRow } from './project-settings';

export type MachineConnectedProject = {
Expand Down
13 changes: 5 additions & 8 deletions packages/components/src/components/settings/project-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ import { useIsMobile } from '@/hooks/use-mobile';
import { useLocalProjectsAdmin } from '@/hooks/use-local-projects-admin';
import { useOnlineMachineIds } from '@/hooks/use-machine-online-status';
import { Button, type ButtonProps } from '@lody/ui/button';
import { Checkbox } from '@/ui/checkbox';
import { Checkbox } from '@lody/ui/checkbox';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/ui/dropdown-menu';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { CachedAvatarImg } from '@/components/cached-avatar-img';
import { getGitHubOwnerAvatarUrl } from '@/lib/github-avatar';
import { Textarea } from '@lody/ui/textarea';
Expand Down Expand Up @@ -1528,11 +1528,7 @@ export function ProjectHistoryImportPanel({
const someSelectableSelected = selectableSessions.some((session) =>
selectedSet.has(session.acpSessionId)
);
const selectAllChecked = allSelectableSelected
? true
: someSelectableSelected
? 'indeterminate'
: false;
const someButNotAllSelected = someSelectableSelected && !allSelectableSelected;
const lastListedAtDate =
typeof state.catalog?.lastListedAt === 'number' ? new Date(state.catalog.lastListedAt) : null;
const statusLabel = lastListedAtDate
Expand Down Expand Up @@ -1685,7 +1681,8 @@ export function ProjectHistoryImportPanel({
}}
>
<Checkbox
checked={selectAllChecked}
checked={allSelectableSelected}
indeterminate={someButNotAllSelected}
disabled={selectableSessions.length === 0 || !canManageCatalog}
onCheckedChange={toggleSelectAll}
onClick={(event) => event.stopPropagation()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
import { MobileSettingsRow, MobileSettingsSection } from '@/components/mobile/mobile-settings-row';
import { Button } from '@lody/ui/button';
import { Input } from '@lody/ui/input';
import { Switch } from '@/ui/switch';
import { Switch } from '@lody/ui/switch';
import { Textarea } from '@lody/ui/textarea';
import { cn } from '@/lib/utils';
import { CompactRow, CompactSection } from './compact-layout';
Expand Down
Loading
Loading