diff --git a/packages/ui/src/components/layout/ContextPanelRail.tsx b/packages/ui/src/components/layout/ContextPanelRail.tsx index 5d522e5c..43692cbb 100644 --- a/packages/ui/src/components/layout/ContextPanelRail.tsx +++ b/packages/ui/src/components/layout/ContextPanelRail.tsx @@ -24,18 +24,23 @@ import { useDeviceInfo } from '@/lib/device'; import { isVSCodeRuntime } from '@/lib/desktop'; import { useI18n } from '@/lib/i18n'; import { + getVisibleContextRailSurfaces, sortContextSurfaces, type ContextSurfaceDescriptor, } from '@/lib/surfaces/registry'; +import { + getEffectiveShortcutPrefix, + isShortcutPrefixHeld, +} from '@/lib/shortcuts'; import { cn } from '@/lib/utils'; import { useFeatureFlagsStore } from '@/stores/useFeatureFlagsStore'; import { useGitStatus } from '@/stores/useGitStore'; import { normalizeContextPanelDirectoryKey, useUIStore } from '@/stores/useUIStore'; const RAIL_TOOLTIP_DELAY_MS = 150; -// Tablet width and up: below this the walkthrough cannot show a stop and its -// code side by side, which is the whole point of the surface. -const WALKTHROUGH_MIN_WIDTH = 768; +// Hold the surface-switch modifier for this long before revealing the order +// number badges on the rail icons. +const RAIL_NUMBER_HOLD_DELAY_MS = 500; const EMPTY_TABS: never[] = []; type RailItemProps = { @@ -44,6 +49,8 @@ type RailItemProps = { showActivityDot: boolean; label: string; description: string; + orderNumber?: number | null; + showOrderNumber?: boolean; onSelect: (surface: ContextSurfaceDescriptor) => void; }; @@ -53,6 +60,8 @@ const ContextPanelRailItem: React.FC = ({ showActivityDot, label, description, + orderNumber, + showOrderNumber, onSelect, }) => { const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ @@ -86,12 +95,20 @@ const ContextPanelRailItem: React.FC = ({ ) : ( )} - {showActivityDot ? ( + {showActivityDot && !showOrderNumber ? (