@shellui/core 0.7.0-alpha.1 → 0.7.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/package.json +2 -2
  2. package/schemas/shellui.config.schema.json +37 -4
  3. package/src/components/ContentView.tsx +19 -8
  4. package/src/components/ui/drawer.tsx +47 -30
  5. package/src/components/ui/sheet.tsx +18 -12
  6. package/src/components/ui/sidebar.tsx +25 -11
  7. package/src/components/ui/tooltip.tsx +4 -2
  8. package/src/features/admin/AdminView.tsx +9 -6
  9. package/src/features/auth/AuthProvider.tsx +25 -4
  10. package/src/features/auth/appBackend/appBackendSessions.spec.ts +134 -0
  11. package/src/features/auth/appBackend/appBackendSessions.ts +168 -17
  12. package/src/features/auth/appBackend/childFrames.spec.ts +328 -0
  13. package/src/features/auth/appBackend/childFrames.ts +180 -0
  14. package/src/features/auth/appBackend/frameAuth.ts +47 -10
  15. package/src/features/auth/appBackend/silentSignIn.spec.ts +18 -0
  16. package/src/features/auth/appBackend/silentSignIn.ts +15 -1
  17. package/src/features/auth/appBackend/tokenExchange.spec.ts +98 -0
  18. package/src/features/auth/appBackend/tokenExchange.ts +76 -0
  19. package/src/features/auth/components/LoginButton.spec.tsx +155 -0
  20. package/src/features/auth/components/LoginButton.tsx +52 -27
  21. package/src/features/auth/components/LoginButtonIcons.tsx +4 -8
  22. package/src/features/auth/components/OAuthCallbackView.tsx +7 -5
  23. package/src/features/auth/utils/buildOAuthSessionRedirectTo.spec.ts +42 -1
  24. package/src/features/auth/utils/buildOAuthSessionRedirectTo.ts +23 -0
  25. package/src/features/auth/utils/canRestoreStoredSession.spec.ts +29 -0
  26. package/src/features/auth/utils/canRestoreStoredSession.ts +12 -0
  27. package/src/features/auth/utils/index.ts +7 -1
  28. package/src/features/auth/utils/resolveSdkLoginRedirectPath.spec.ts +41 -0
  29. package/src/features/auth/utils/resolveSdkLoginRedirectPath.ts +31 -0
  30. package/src/features/auth/utils/webPkce.spec.ts +23 -0
  31. package/src/features/auth/utils/webPkce.ts +23 -6
  32. package/src/features/chromeActions/ChromeActionsHost.tsx +5 -1
  33. package/src/features/chromeActions/computeActionInsets.ts +7 -4
  34. package/src/features/config/types.ts +30 -4
  35. package/src/features/layouts/OverlayShell.tsx +58 -40
  36. package/src/features/layouts/appbar/AppBarItemIcon.spec.tsx +45 -0
  37. package/src/features/layouts/appbar/AppBarItemIcon.tsx +19 -0
  38. package/src/features/layouts/appbar/AppBarLayout.tsx +115 -110
  39. package/src/features/layouts/appbar/appBarOverflow.spec.ts +27 -0
  40. package/src/features/layouts/appbar/appBarOverflow.ts +42 -0
  41. package/src/features/layouts/chrome/CollapsedDesktopTitlebar.tsx +13 -24
  42. package/src/features/layouts/chrome/ContentDragOverlay.tsx +5 -6
  43. package/src/features/layouts/chrome/DesktopChrome.tsx +37 -0
  44. package/src/features/layouts/chrome/DesktopHistoryButtons.tsx +15 -4
  45. package/src/features/layouts/chrome/MacStrip.tsx +33 -0
  46. package/src/features/layouts/chrome/constants.ts +36 -8
  47. package/src/features/layouts/chrome/index.ts +8 -0
  48. package/src/features/layouts/chrome/stripDragMap.ts +35 -0
  49. package/src/features/layouts/chrome/stripNoDrag.spec.tsx +103 -0
  50. package/src/features/layouts/chrome/useScrollHideChrome.ts +3 -8
  51. package/src/features/layouts/chrome/viewport.ts +11 -4
  52. package/src/features/layouts/filterNavigationForAuthState.spec.ts +5 -3
  53. package/src/features/layouts/floating/FloatingBottomDock.tsx +263 -43
  54. package/src/features/layouts/floating/FloatingLayout.tsx +14 -8
  55. package/src/features/layouts/floating/FloatingSidebar.tsx +165 -73
  56. package/src/features/layouts/floating/computeFloatingInsets.ts +22 -4
  57. package/src/features/layouts/floating/moreSections.spec.ts +28 -0
  58. package/src/features/layouts/floating/moreSections.ts +31 -0
  59. package/src/features/layouts/floating/useFloatingChrome.ts +3 -1
  60. package/src/features/layouts/floating/useSoftKeyboard.spec.ts +39 -0
  61. package/src/features/layouts/floating/useSoftKeyboard.ts +82 -0
  62. package/src/features/layouts/fullscreen/FullscreenLayout.spec.tsx +68 -0
  63. package/src/features/layouts/fullscreen/FullscreenLayout.tsx +47 -10
  64. package/src/features/layouts/sidebar/NavigationContent.tsx +17 -9
  65. package/src/features/layouts/sidebar/SidebarIcons.tsx +70 -9
  66. package/src/features/layouts/sidebar/SidebarInner.spec.tsx +109 -0
  67. package/src/features/layouts/sidebar/SidebarInner.tsx +94 -43
  68. package/src/features/layouts/sidebar/SidebarLayout.tsx +24 -17
  69. package/src/features/layouts/utils.ts +4 -3
  70. package/src/features/layouts/windows/DesktopDots.tsx +76 -0
  71. package/src/features/layouts/windows/WindowsLayout.tsx +251 -161
  72. package/src/features/layouts/windows/deskDots.spec.ts +54 -0
  73. package/src/features/layouts/windows/deskDots.ts +314 -0
  74. package/src/features/overlays/ResponsiveModal.tsx +5 -3
  75. package/src/features/overlays/overlaySize.spec.ts +56 -16
  76. package/src/features/overlays/overlaySize.ts +114 -31
  77. package/src/features/overlays/phoneDrawerAnchoring.spec.ts +187 -0
  78. package/src/features/overlays/useOverlayReportedSize.ts +8 -3
  79. package/src/features/settings/SettingsProvider.tsx +158 -2
  80. package/src/features/settings/utils/buildSettingsForPropagation.spec.ts +8 -7
  81. package/src/features/settings/utils/buildSettingsForPropagation.ts +4 -6
  82. package/src/features/theme/applyTheme.ts +8 -0
  83. package/src/features/theme/navContrast.spec.ts +49 -0
  84. package/src/features/theme/navContrast.ts +108 -0
  85. package/src/features/transfers/transferQueue.spec.ts +6 -2
  86. package/src/i18n/translations/en/common.json +26 -0
  87. package/src/i18n/translations/fr/common.json +26 -0
  88. package/src/index.css +1145 -77
  89. package/src/index.ts +1 -0
  90. package/src/routes/hooks/useNavigationItems.ts +14 -3
  91. package/src/routes/hooks/withShellSearch.spec.ts +13 -0
  92. package/src/service-worker/devCaches.spec.ts +32 -0
  93. package/src/service-worker/devCaches.ts +27 -0
  94. package/src/service-worker/sw-dev.ts +23 -23
@@ -30,19 +30,28 @@ import { cn } from '../../../lib/utils';
30
30
  import { Z_INDEX } from '../../../lib/z-index';
31
31
  import { LoginButton } from '../../auth/components/LoginButton';
32
32
  import { useAuth } from '../../auth/hooks/useAuth';
33
- import { ExternalLinkIcon, NavIcon } from '../sidebar/SidebarIcons';
33
+ import { ExternalLinkIcon, NavIcon, SettingsIcon } from '../sidebar/SidebarIcons';
34
+ import { AppBarTooltip, TooltipProvider } from '../../../components/ui/tooltip';
35
+ import urls from '../../../constants/urls';
34
36
  import { getExternalFaviconUrl, isAppIcon } from '../sidebar/sidebarUtils';
35
37
  import { AppBrandIcon } from '../branding/AppBrandIcon';
36
38
  import { useIsMobile } from '../../../hooks/use-mobile';
37
39
  import { readSafeAreaInsetBottom, readSafeAreaInsetTop } from '../chrome/viewport';
38
40
  import {
39
41
  DESKTOP_TITLEBAR_HEIGHT_PX,
40
- DESKTOP_TITLEBAR_PAD_TOP_PX,
41
- MAC_TRAFFIC_LIGHTS_WIDTH_PX,
42
+ SHELL_HEADER_HEIGHT_PX,
43
+ SHELL_HEADER_PAD_TOP_PX,
42
44
  } from '../chrome/constants';
43
45
  import { DesktopHistoryButtons } from '../chrome/DesktopHistoryButtons';
44
- import { useIsTauriClient, useIsTauriRuntime, useMacTrafficLights } from '../chrome/runtime';
46
+ import {
47
+ useIsTauriClient,
48
+ useIsTauriRuntime,
49
+ useMacOverlayChrome,
50
+ useMacTrafficLights,
51
+ } from '../chrome/runtime';
52
+ import { MAC_DRAG_REGION_PROPS, MacLightsSafeArea, MacStripSpacer } from '../chrome/MacStrip';
45
53
  import { WindowTitleBarActions } from '../../chromeActions';
54
+ import { DesktopDots } from './DesktopDots';
46
55
 
47
56
  interface WindowsLayoutProps {
48
57
  title?: string;
@@ -219,11 +228,15 @@ function AppWindow({
219
228
  /** Used to cascade normal size when leaving mobile. */
220
229
  cascadeIndex: number;
221
230
  }) {
231
+ const { t } = useTranslation();
222
232
  const windowLabel = resolveNavLabel(navItem.label, currentLanguage);
223
233
  const tauriRuntime = useIsTauriRuntime();
224
234
  const isTauriEnv = useIsTauriClient();
225
235
  const trafficLights = useMacTrafficLights();
226
- const topInset = trafficLights ? DESKTOP_TITLEBAR_HEIGHT_PX : 0;
236
+ const macOverlay = useMacOverlayChrome();
237
+ // macOS: 32px strip on top (also in native fullscreen); windows clamp below it.
238
+ const macStrip = trafficLights || macOverlay;
239
+ const topInset = macStrip ? DESKTOP_TITLEBAR_HEIGHT_PX : 0;
227
240
  const topInsetRef = useRef(topInset);
228
241
  topInsetRef.current = topInset;
229
242
  const [frameUuid, setFrameUuid] = useState<string | null>(null);
@@ -263,7 +276,7 @@ function AppWindow({
263
276
  )
264
277
  : clampBounds(win.bounds, topInset),
265
278
  );
266
- const containerRef = useRef<HTMLDivElement>(null);
279
+ const containerRef = useRef<HTMLElement>(null);
267
280
  const dragRef = useRef<{
268
281
  startX: number;
269
282
  startY: number;
@@ -391,6 +404,7 @@ function AppWindow({
391
404
  if (el) {
392
405
  el.style.transform = '';
393
406
  el.style.willChange = '';
407
+ el.removeAttribute('data-interacting');
394
408
  }
395
409
  const finalBounds = clampBounds(
396
410
  {
@@ -423,6 +437,7 @@ function AppWindow({
423
437
  };
424
438
  const el = containerRef.current;
425
439
  if (el) {
440
+ el.setAttribute('data-interacting', 'true');
426
441
  el.setPointerCapture(e.pointerId);
427
442
  el.addEventListener('pointermove', onPointerMove, { passive: true });
428
443
  el.addEventListener('pointerup', onPointerUp as (e: Event) => void);
@@ -490,6 +505,7 @@ function AppWindow({
490
505
  el.removeEventListener('pointermove', onResizePointerMove as (e: Event) => void);
491
506
  el.removeEventListener('pointerup', onResizePointerUp as (e: Event) => void);
492
507
  el.releasePointerCapture(e.pointerId);
508
+ el.removeAttribute('data-interacting');
493
509
  }
494
510
  resizeRef.current = null;
495
511
  },
@@ -510,6 +526,7 @@ function AppWindow({
510
526
  };
511
527
  const el = containerRef.current;
512
528
  if (el) {
529
+ el.setAttribute('data-interacting', 'true');
513
530
  el.setPointerCapture(e.pointerId);
514
531
  el.addEventListener('pointermove', onResizePointerMove as (e: Event) => void, {
515
532
  passive: true,
@@ -528,13 +545,16 @@ function AppWindow({
528
545
  const z = isFocused ? maxZIndex : zIndex;
529
546
 
530
547
  return (
531
- <div
548
+ <section
532
549
  ref={containerRef}
550
+ aria-label={windowLabel}
551
+ data-shellui-window=""
552
+ data-focused={isFocused ? 'true' : 'false'}
553
+ data-maximized={lockedChrome ? 'true' : 'false'}
533
554
  className={cn(
534
- 'absolute flex flex-col overflow-hidden bg-card',
535
- mobileFullscreen
536
- ? 'rounded-none border-0 shadow-none'
537
- : 'rounded-lg border border-border shadow-lg',
555
+ 'shellui-win absolute flex flex-col overflow-hidden',
556
+ isFocused && 'is-focused',
557
+ mobileFullscreen && 'is-flat',
538
558
  )}
539
559
  style={{
540
560
  left: bounds.x,
@@ -549,20 +569,23 @@ function AppWindow({
549
569
  {/* Title bar: pointer capture so drag continues when cursor is over iframe or outside window */}
550
570
  <div
551
571
  className={cn(
552
- 'flex items-center gap-2 pr-1 bg-muted/80 border-b border-border select-none shrink-0',
553
- flushTitlebar ? 'box-border' : 'py-1 pl-2',
572
+ 'shellui-win-titlebar flex items-center gap-2 pr-1 select-none shrink-0',
573
+ flushTitlebar ? 'box-border' : 'pl-2.5',
554
574
  lockedChrome ? 'cursor-default' : 'cursor-move',
555
575
  )}
556
576
  style={
557
577
  flushTitlebar
558
578
  ? {
559
- height: DESKTOP_TITLEBAR_HEIGHT_PX,
560
- paddingTop: DESKTOP_TITLEBAR_PAD_TOP_PX,
561
- paddingLeft: trafficLights ? MAC_TRAFFIC_LIGHTS_WIDTH_PX : 8,
579
+ // Maximized under a native caption bar (Windows / Linux). macOS keeps its strip.
580
+ height: SHELL_HEADER_HEIGHT_PX,
581
+ paddingTop: SHELL_HEADER_PAD_TOP_PX,
582
+ paddingLeft: 8,
562
583
  }
563
584
  : undefined
564
585
  }
565
- {...(flushTitlebar ? { 'data-shellui-drag-region': '', 'data-tauri-drag-region': '' } : {})}
586
+ {...(flushTitlebar
587
+ ? { 'data-shellui-drag-region': '', 'data-tauri-drag-region': '' }
588
+ : { 'data-shellui-no-drag': '' })}
566
589
  onPointerDown={handleTitlePointerDown}
567
590
  >
568
591
  {win.icon && (
@@ -570,7 +593,7 @@ function AppWindow({
570
593
  src={win.icon}
571
594
  alt=""
572
595
  className={cn(
573
- 'h-4 w-4 shrink-0 rounded-sm object-cover',
596
+ 'shellui-win-tile shrink-0 rounded-sm object-cover',
574
597
  isAppIcon(win.icon) && 'opacity-90 dark:opacity-100 dark:invert',
575
598
  )}
576
599
  />
@@ -587,13 +610,13 @@ function AppWindow({
587
610
  e.stopPropagation();
588
611
  handleMaximizeToggle();
589
612
  }}
590
- className="p-1 rounded cursor-pointer text-muted-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
591
- aria-label={isMaximized ? 'Restore' : 'Maximize'}
613
+ className="shellui-win-control shellui-chrome-focus"
614
+ aria-label={isMaximized ? t('windows.restore') : t('windows.maximize')}
592
615
  >
593
616
  {isMaximized ? (
594
- <RestoreIcon className="h-4 w-4" />
617
+ <RestoreIcon className="size-3.5" />
595
618
  ) : (
596
- <MaximizeIcon className="h-4 w-4" />
619
+ <MaximizeIcon className="size-3.5" />
597
620
  )}
598
621
  </button>
599
622
  )}
@@ -603,14 +626,14 @@ function AppWindow({
603
626
  e.stopPropagation();
604
627
  onClose();
605
628
  }}
606
- className="p-1 rounded cursor-pointer text-muted-foreground hover:bg-destructive/20 hover:text-destructive transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
607
- aria-label="Close"
629
+ className="shellui-win-control shellui-win-close shellui-chrome-focus"
630
+ aria-label={t('windows.close')}
608
631
  >
609
- <CloseIcon className="h-4 w-4" />
632
+ <CloseIcon className="size-3.5" />
610
633
  </button>
611
634
  </div>
612
635
  {/* Content */}
613
- <div className="flex-1 min-h-0 relative bg-background">
636
+ <div className="shellui-win-body flex-1 min-h-0 relative bg-background">
614
637
  {/* When not focused, overlay captures clicks to bring window to front */}
615
638
  {!isFocused && (
616
639
  <div
@@ -664,7 +687,7 @@ function AppWindow({
664
687
  onPointerDown={(e) => handleResizePointerDown(e, edge)}
665
688
  />
666
689
  ))}
667
- </div>
690
+ </section>
668
691
  );
669
692
  }
670
693
 
@@ -771,13 +794,17 @@ function getBrowserTimezone(): string {
771
794
 
772
795
  export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: WindowsLayoutProps) {
773
796
  const location = useLocation();
774
- const { i18n } = useTranslation();
797
+ const { t, i18n } = useTranslation();
775
798
  const { isAuthenticated, isLoading: isAuthLoading } = useAuth();
776
799
  const { settings } = useSettings();
777
800
  /** Fullscreen phone chrome — includes iPhone landscape (wide but short). */
778
801
  const phoneMode = useWindowsPhoneMode();
779
802
  const trafficLights = useMacTrafficLights();
780
- const topInset = trafficLights ? DESKTOP_TITLEBAR_HEIGHT_PX : 0;
803
+ const isTauriEnv = useIsTauriClient();
804
+ const macOverlay = useMacOverlayChrome();
805
+ // macOS: 32px strip on top (also in native fullscreen); windows clamp below it.
806
+ const macStrip = trafficLights || macOverlay;
807
+ const topInset = macStrip ? DESKTOP_TITLEBAR_HEIGHT_PX : 0;
781
808
  const currentLanguage = i18n.language || 'en';
782
809
  const hasCustomLoginNav = useMemo(() => hasLoginNavigationItem(navigation), [navigation]);
783
810
  const authAwareNavigation = useMemo(
@@ -811,13 +838,24 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
811
838
  const [startMenuOpen, setStartMenuOpen] = useState(false);
812
839
  const [now, setNow] = useState(() => new Date());
813
840
  const startPanelRef = useRef<HTMLDivElement>(null);
841
+ const startButtonRef = useRef<HTMLButtonElement>(null);
842
+ const startMenuRef = useRef<HTMLDivElement>(null);
843
+ const desktopRef = useRef<HTMLDivElement>(null);
814
844
  const initialOpenFromUrlDoneRef = useRef(false);
815
845
  const openPaths = useMemo(() => new Set(windows.map((w) => w.path)), [windows]);
816
846
 
817
- // Update date/time every second for taskbar clock
847
+ // Taskbar clock shows hours and minutes: tick on each minute boundary, not every second.
818
848
  useEffect(() => {
819
- const interval = setInterval(() => setNow(new Date()), 1000);
820
- return () => clearInterval(interval);
849
+ let timer: ReturnType<typeof setTimeout>;
850
+ const schedule = () => {
851
+ const current = new Date();
852
+ setNow(current);
853
+ const msToNextMinute =
854
+ 60_000 - (current.getSeconds() * 1000 + current.getMilliseconds()) + 50;
855
+ timer = setTimeout(schedule, msToNextMinute);
856
+ };
857
+ schedule();
858
+ return () => clearTimeout(timer);
821
859
  }, []);
822
860
 
823
861
  /** Highest z-index: front window always gets this so it stays on top. */
@@ -898,12 +936,29 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
898
936
  useEffect(() => {
899
937
  if (!startMenuOpen) return;
900
938
  const onDocClick = (e: MouseEvent) => {
939
+ // The footer account menu renders in a portal: clicks there stay in the start menu.
940
+ if (e.target instanceof Element && e.target.closest('[data-auth-menu-content]')) return;
901
941
  if (startPanelRef.current && !startPanelRef.current.contains(e.target as Node)) {
902
942
  setStartMenuOpen(false);
903
943
  }
904
944
  };
945
+ const onKeyDown = (e: KeyboardEvent) => {
946
+ if (e.key !== 'Escape') return;
947
+ // Escape closes the open account menu first.
948
+ if (document.querySelector('[data-auth-menu-content][data-state="open"]')) return;
949
+ e.preventDefault();
950
+ setStartMenuOpen(false);
951
+ startButtonRef.current?.focus();
952
+ };
905
953
  document.addEventListener('mousedown', onDocClick);
906
- return () => document.removeEventListener('mousedown', onDocClick);
954
+ document.addEventListener('keydown', onKeyDown);
955
+ // Move focus to the first row so keyboard users land inside the menu.
956
+ const first = startMenuRef.current?.querySelector<HTMLElement>('.shellui-start-row');
957
+ first?.focus({ preventScroll: true });
958
+ return () => {
959
+ document.removeEventListener('mousedown', onDocClick);
960
+ document.removeEventListener('keydown', onKeyDown);
961
+ };
907
962
  }, [startMenuOpen]);
908
963
 
909
964
  const handleNavClick = useCallback(
@@ -938,37 +993,49 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
938
993
  [openWindow, windows, focusWindow, phoneMode],
939
994
  );
940
995
 
996
+ const frontWindowLabel = useMemo(() => {
997
+ const front = windows.find((w) => w.id === frontWindowId);
998
+ if (!front) return null;
999
+ const navItem = navigationItems.find((n) => n.path === front.path);
1000
+ return navItem ? resolveNavLabel(navItem.label, currentLanguage) : front.label;
1001
+ }, [windows, frontWindowId, navigationItems, currentLanguage]);
1002
+
941
1003
  return (
942
1004
  <>
943
1005
  <div
1006
+ ref={desktopRef}
944
1007
  data-shellui-windows-layout=""
945
1008
  className="fixed inset-0 overflow-hidden bg-background"
946
1009
  style={{ paddingBottom: TASKBAR_SLOT_CSS }}
947
1010
  >
948
- {/* Organic primary wash behind windows — follows --primary with the active theme. */}
1011
+ {/* Desktop: two low primary washes at the bottom, under the dot field. */}
949
1012
  <div
950
1013
  aria-hidden
951
- className="pointer-events-none absolute inset-0"
952
- style={{
953
- backgroundImage: [
954
- 'radial-gradient(ellipse 95% 70% at 18% 108%, color-mix(in oklch, var(--primary) 32%, transparent), transparent 58%)',
955
- 'radial-gradient(ellipse 70% 55% at 78% 118%, color-mix(in oklch, var(--primary) 22%, transparent), transparent 62%)',
956
- 'radial-gradient(ellipse 55% 40% at 52% 92%, color-mix(in oklch, var(--primary) 14%, transparent), transparent 70%)',
957
- 'radial-gradient(ellipse 40% 30% at 92% 78%, color-mix(in oklch, var(--primary) 10%, transparent), transparent 68%)',
958
- 'radial-gradient(ellipse 35% 28% at 8% 72%, color-mix(in oklch, var(--primary) 8%, transparent), transparent 65%)',
959
- ].join(', '),
960
- }}
1014
+ className="shellui-desk-wash pointer-events-none absolute inset-0"
961
1015
  />
1016
+ <DesktopDots watchRoot={desktopRef} />
962
1017
 
963
- {trafficLights ? (
1018
+ {macStrip ? (
1019
+ /* macOS strip: safe area 80, back, forward, drag spacer, focused title centred. */
964
1020
  <div
965
1021
  data-shellui-windows-titlebar=""
966
- data-shellui-drag-region=""
967
- data-tauri-drag-region=""
968
- aria-hidden
969
- className="absolute inset-x-0 top-0 border-b border-border bg-sidebar-background"
1022
+ data-shellui-mac-strip=""
1023
+ {...MAC_DRAG_REGION_PROPS}
1024
+ className="shellui-windows-strip absolute inset-x-0 top-0 flex items-center select-none"
970
1025
  style={{ height: DESKTOP_TITLEBAR_HEIGHT_PX, zIndex: Z_INDEX.WINDOWS_TITLEBAR }}
971
- />
1026
+ >
1027
+ <MacLightsSafeArea />
1028
+ {isTauriEnv ? <DesktopHistoryButtons strip /> : null}
1029
+ <MacStripSpacer />
1030
+ {frontWindowLabel ? (
1031
+ <span
1032
+ aria-hidden
1033
+ className="shellui-windows-strip-title truncate"
1034
+ >
1035
+ {frontWindowLabel}
1036
+ </span>
1037
+ ) : null}
1038
+ </div>
972
1039
  ) : null}
973
1040
 
974
1041
  {/* Desktop area: windows */}
@@ -998,7 +1065,11 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
998
1065
 
999
1066
  {/* Taskbar */}
1000
1067
  <div
1001
- className="fixed left-0 right-0 bottom-0 flex items-center gap-1 px-2 border-t border-border bg-sidebar-background"
1068
+ role="region"
1069
+ aria-label={t('windows.taskbar')}
1070
+ data-shellui-taskbar=""
1071
+ data-phone={phoneMode ? 'true' : undefined}
1072
+ className="shellui-taskbar fixed left-0 right-0 bottom-0 flex items-center gap-1 px-2"
1002
1073
  style={{
1003
1074
  height: TASKBAR_SLOT_CSS,
1004
1075
  paddingBottom: 'var(--shellui-safe-area-bottom, 0px)',
@@ -1019,17 +1090,13 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
1019
1090
  ref={startPanelRef}
1020
1091
  >
1021
1092
  <button
1093
+ ref={startButtonRef}
1022
1094
  type="button"
1023
1095
  onClick={() => setStartMenuOpen((o) => !o)}
1024
- className={cn(
1025
- 'flex items-center gap-2 h-9 px-3 rounded cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
1026
- startMenuOpen
1027
- ? 'bg-sidebar-accent text-sidebar-accent-foreground'
1028
- : 'text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground',
1029
- )}
1096
+ className={cn('shellui-start shellui-chrome-focus', startMenuOpen && 'is-open')}
1030
1097
  aria-expanded={startMenuOpen}
1031
- aria-haspopup="true"
1032
- aria-label="Start"
1098
+ aria-haspopup="dialog"
1099
+ aria-label={title || t('windows.start')}
1033
1100
  >
1034
1101
  {appIcon ? (
1035
1102
  <AppBrandIcon
@@ -1041,32 +1108,33 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
1041
1108
  ) : (
1042
1109
  <StartIcon className="h-5 w-5" />
1043
1110
  )}
1044
- <span className="font-semibold text-sm hidden sm:inline">{title || 'Start'}</span>
1111
+ <span className="shellui-start-name hidden sm:inline">
1112
+ {title || t('windows.start')}
1113
+ </span>
1045
1114
  </button>
1046
1115
  {/* Start menu panel */}
1047
1116
  {startMenuOpen && (
1048
1117
  <div
1049
- className="absolute bottom-full left-0 mb-2 flex w-[22rem] max-h-[min(72vh,34rem)] flex-col overflow-hidden rounded-xl border border-border/80 bg-popover/95 text-popover-foreground shadow-xl backdrop-blur-md"
1118
+ ref={startMenuRef}
1119
+ className="shellui-start-menu absolute bottom-full left-0 mb-2 flex w-[22rem] max-h-[min(72vh,34rem)] flex-col overflow-hidden text-popover-foreground"
1050
1120
  style={{ zIndex: Z_INDEX.MODAL_CONTENT }}
1051
- role="menu"
1052
- aria-label={title || 'Applications'}
1121
+ role="dialog"
1122
+ aria-label={t('windows.applications')}
1053
1123
  >
1054
- <div className="shrink-0 border-b border-border/60 px-4 py-3">
1124
+ <div className="shellui-start-head shrink-0 px-4 py-3">
1055
1125
  <p
1056
- className="text-sm font-semibold tracking-tight"
1126
+ className="shellui-start-title"
1057
1127
  style={{ fontFamily: 'var(--heading-font-family, inherit)' }}
1058
1128
  >
1059
- {title || 'Applications'}
1060
- </p>
1061
- <p className="mt-0.5 text-xs text-muted-foreground">
1062
- Choose an app to open in a window
1129
+ {title || t('windows.applications')}
1063
1130
  </p>
1131
+ <p className="shellui-start-hint text-muted-foreground">{t('windows.chooseApp')}</p>
1064
1132
  </div>
1065
1133
 
1066
1134
  <div className="min-h-0 flex-1 space-y-4 overflow-y-auto px-2 py-3">
1067
1135
  {menuSections.length === 0 ? (
1068
1136
  <p className="px-2 py-6 text-center text-sm text-muted-foreground">
1069
- No applications available
1137
+ {t('windows.noApps')}
1070
1138
  </p>
1071
1139
  ) : (
1072
1140
  menuSections.map((section, sectionIndex) => {
@@ -1089,16 +1157,10 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
1089
1157
  ? 'end-items'
1090
1158
  : `items-${sectionIndex}`
1091
1159
  }
1092
- className={cn(
1093
- 'space-y-1.5',
1094
- isEndSection && 'border-t border-border/60 pt-3',
1095
- )}
1160
+ className={cn('space-y-1.5', isEndSection && 'shellui-start-foot pt-3')}
1096
1161
  >
1097
1162
  {categoryLabel ? (
1098
- <h2
1099
- className="px-2.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground"
1100
- style={{ fontFamily: 'var(--heading-font-family, inherit)' }}
1101
- >
1163
+ <h2 className="shellui-start-label px-2.5 text-xs font-semibold text-muted-foreground">
1102
1164
  {categoryLabel}
1103
1165
  </h2>
1104
1166
  ) : null}
@@ -1114,23 +1176,13 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
1114
1176
  <button
1115
1177
  key={item.path}
1116
1178
  type="button"
1117
- role="menuitem"
1118
1179
  onClick={() => handleNavClick(item)}
1119
1180
  className={cn(
1120
- 'group flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors',
1121
- 'cursor-pointer text-popover-foreground',
1122
- 'hover:bg-accent hover:text-accent-foreground',
1123
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover',
1124
- isOpen && 'bg-accent/50',
1181
+ 'shellui-start-row shellui-chrome-focus group',
1182
+ isOpen && 'is-open',
1125
1183
  )}
1126
1184
  >
1127
- <span
1128
- className={cn(
1129
- 'flex size-9 shrink-0 items-center justify-center rounded-md',
1130
- 'bg-muted/70 text-foreground ring-1 ring-border/50',
1131
- 'group-hover:bg-background/80 group-hover:ring-border',
1132
- )}
1133
- >
1185
+ <span className="shellui-start-tile">
1134
1186
  <NavIcon
1135
1187
  src={icon}
1136
1188
  className="size-4"
@@ -1142,12 +1194,15 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
1142
1194
  </span>
1143
1195
  {isOpen && !isOverlay && !isExternal ? (
1144
1196
  <span className="mt-0.5 block text-[11px] text-muted-foreground">
1145
- Open
1197
+ {t('windows.open')}
1146
1198
  </span>
1147
1199
  ) : null}
1148
1200
  </span>
1149
1201
  {isExternal ? (
1150
- <ExternalLinkIcon className="size-3.5 shrink-0 opacity-50 group-hover:opacity-80" />
1202
+ <>
1203
+ <ExternalLinkIcon className="size-3.5 shrink-0 opacity-50 group-hover:opacity-80" />
1204
+ <span className="sr-only">{t('shellChrome.externalLink')}</span>
1205
+ </>
1151
1206
  ) : isOpen && !isOverlay ? (
1152
1207
  <span
1153
1208
  className="size-1.5 shrink-0 rounded-full bg-primary"
@@ -1163,13 +1218,40 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
1163
1218
  })
1164
1219
  )}
1165
1220
  </div>
1221
+ {/* Footer: account and settings (spec). */}
1222
+ <div
1223
+ data-shellui-start-footer=""
1224
+ className="shellui-start-foot flex shrink-0 items-center gap-1 px-2 py-1.5"
1225
+ >
1226
+ <div className="min-w-0 flex-1">
1227
+ <LoginButton
1228
+ variant="sidebar"
1229
+ hideWhenLoggedOut={hasCustomLoginNav}
1230
+ />
1231
+ </div>
1232
+ <button
1233
+ type="button"
1234
+ className="shellui-start-settings shellui-chrome-focus"
1235
+ aria-label={t('settings')}
1236
+ title={t('settings')}
1237
+ onClick={() => {
1238
+ setStartMenuOpen(false);
1239
+ shellui.openModal(urls.settings);
1240
+ }}
1241
+ >
1242
+ <SettingsIcon className="size-4" />
1243
+ </button>
1244
+ </div>
1166
1245
  </div>
1167
1246
  )}
1168
1247
  </div>
1169
1248
 
1170
1249
  {/* Window list — desktop only; phone switches via the start menu */}
1171
1250
  {!phoneMode && (
1172
- <div className="flex-1 flex items-center gap-1 min-w-0 overflow-x-auto">
1251
+ <ul
1252
+ aria-label={t('windows.openApps')}
1253
+ className="shellui-task-list flex-1 flex items-center gap-1 min-w-0 overflow-x-auto"
1254
+ >
1173
1255
  {windows.map((win) => {
1174
1256
  const navItem = navigationItems.find((n) => n.path === win.path);
1175
1257
  const windowLabel = navItem
@@ -1177,77 +1259,86 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
1177
1259
  : win.label;
1178
1260
  const isFocused = win.id === frontWindowId;
1179
1261
  return (
1180
- <button
1262
+ <li
1181
1263
  key={win.id}
1182
- type="button"
1183
- onClick={() => focusWindow(win.id)}
1184
- onContextMenu={(e) => {
1185
- e.preventDefault();
1186
- closeWindow(win.id);
1187
- }}
1188
- className={cn(
1189
- 'flex items-center gap-2 h-8 px-2 rounded min-w-0 max-w-[140px] shrink-0 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
1190
- isFocused
1191
- ? 'bg-sidebar-accent text-sidebar-accent-foreground'
1192
- : 'text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground',
1193
- )}
1194
- title={windowLabel}
1264
+ className="shrink-0"
1195
1265
  >
1196
- {win.icon ? (
1197
- <img
1198
- src={win.icon}
1199
- alt=""
1200
- className={cn(
1201
- 'h-4 w-4 shrink-0 rounded-sm object-cover',
1202
- isAppIcon(win.icon) && 'opacity-90 dark:opacity-100 dark:invert',
1203
- )}
1204
- />
1205
- ) : (
1206
- <span className="h-4 w-4 shrink-0 rounded-sm bg-muted" />
1207
- )}
1208
- <span className="text-xs truncate">{windowLabel}</span>
1209
- </button>
1266
+ <button
1267
+ type="button"
1268
+ aria-current={isFocused ? 'true' : undefined}
1269
+ onClick={() => focusWindow(win.id)}
1270
+ onContextMenu={(e) => {
1271
+ e.preventDefault();
1272
+ closeWindow(win.id);
1273
+ }}
1274
+ className={cn('shellui-task shellui-chrome-focus', isFocused && 'is-focused')}
1275
+ title={windowLabel}
1276
+ >
1277
+ {win.icon ? (
1278
+ <img
1279
+ src={win.icon}
1280
+ alt=""
1281
+ className={cn(
1282
+ 'h-4 w-4 shrink-0 rounded-sm object-cover',
1283
+ isAppIcon(win.icon) && 'opacity-90 dark:opacity-100 dark:invert',
1284
+ )}
1285
+ />
1286
+ ) : (
1287
+ <span className="h-4 w-4 shrink-0 rounded-sm bg-muted" />
1288
+ )}
1289
+ <span className="truncate">{windowLabel}</span>
1290
+ </button>
1291
+ </li>
1210
1292
  );
1211
1293
  })}
1212
- </div>
1294
+ </ul>
1213
1295
  )}
1214
1296
  {phoneMode && <div className="flex-1 min-w-0" />}
1215
1297
 
1216
1298
  {/* End navigation items (right side of taskbar) — desktop only; phone uses start menu */}
1217
1299
  {!phoneMode && endNavItems.length > 0 && (
1218
- <div className="flex items-center gap-0.5 shrink-0 border-l border-sidebar-border pl-2 ml-1">
1219
- {endNavItems.map((item) => {
1220
- const label =
1221
- typeof item.label === 'string'
1222
- ? item.label
1223
- : resolveNavLabel(item.label, currentLanguage);
1224
- const icon =
1225
- item.icon ?? (item.openIn === 'external' ? getExternalFaviconUrl(item.url) : null);
1226
- return (
1227
- <button
1228
- key={item.path}
1229
- type="button"
1230
- onClick={() => handleNavClick(item)}
1231
- className="flex items-center gap-2 h-8 px-2 rounded cursor-pointer text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
1232
- title={label}
1233
- >
1234
- {icon ? (
1235
- <img
1236
- src={icon}
1237
- alt=""
1238
- className={cn(
1239
- 'h-4 w-4 shrink-0 rounded-sm object-cover',
1240
- isAppIcon(icon) && 'opacity-90 dark:opacity-100 dark:invert',
1241
- )}
1242
- />
1243
- ) : (
1244
- <span className="h-4 w-4 shrink-0 rounded-sm bg-muted" />
1245
- )}
1246
- <span className="text-xs truncate max-w-[100px]">{label}</span>
1247
- </button>
1248
- );
1249
- })}
1250
- </div>
1300
+ <TooltipProvider
1301
+ delayDuration={200}
1302
+ skipDelayDuration={0}
1303
+ >
1304
+ <div
1305
+ data-shellui-taskbar-end=""
1306
+ className="ml-1 flex shrink-0 items-center gap-0.5 border-l border-sidebar-border pl-2"
1307
+ >
1308
+ {endNavItems.map((item) => {
1309
+ const label =
1310
+ typeof item.label === 'string'
1311
+ ? item.label
1312
+ : resolveNavLabel(item.label, currentLanguage);
1313
+ const icon =
1314
+ item.icon ??
1315
+ (item.openIn === 'external' ? getExternalFaviconUrl(item.url) : null);
1316
+ return (
1317
+ <AppBarTooltip
1318
+ key={item.path}
1319
+ label={label}
1320
+ side="top"
1321
+ >
1322
+ <button
1323
+ type="button"
1324
+ onClick={() => handleNavClick(item)}
1325
+ className="shellui-task shellui-task-icon shellui-chrome-focus"
1326
+ aria-label={
1327
+ item.openIn === 'external'
1328
+ ? `${label} (${t('shellChrome.externalLink')})`
1329
+ : label
1330
+ }
1331
+ >
1332
+ <NavIcon
1333
+ src={icon}
1334
+ className="size-4"
1335
+ />
1336
+ </button>
1337
+ </AppBarTooltip>
1338
+ );
1339
+ })}
1340
+ </div>
1341
+ </TooltipProvider>
1251
1342
  )}
1252
1343
 
1253
1344
  <div className="flex items-center shrink-0 border-l border-sidebar-border pl-2 ml-1">
@@ -1259,30 +1350,29 @@ export function WindowsLayout({ title, appIcon, logo: _logo, navigation }: Windo
1259
1350
 
1260
1351
  {/* Date and time (extreme bottom right, OS-style); uses region timezone from settings */}
1261
1352
  <div
1262
- className="flex flex-col items-end justify-center shrink-0 px-3 py-1 text-sidebar-foreground border-l border-sidebar-border ml-1 min-w-0"
1353
+ className="shellui-clock flex flex-col items-end justify-center shrink-0 px-3 py-1 ml-1 min-w-0"
1263
1354
  style={{ paddingRight: 'max(0.75rem, env(safe-area-inset-right))' }}
1264
1355
  role="timer"
1265
1356
  aria-live="off"
1266
1357
  aria-label={new Intl.DateTimeFormat(currentLanguage, {
1267
1358
  timeZone,
1268
1359
  dateStyle: 'full',
1269
- timeStyle: 'medium',
1360
+ timeStyle: 'short',
1270
1361
  }).format(now)}
1271
1362
  >
1272
1363
  <time
1273
1364
  dateTime={now.toISOString()}
1274
- className="text-xs leading-tight tabular-nums whitespace-nowrap"
1365
+ className="shellui-clock-time tabular-nums whitespace-nowrap"
1275
1366
  >
1276
1367
  {new Intl.DateTimeFormat(currentLanguage, {
1277
1368
  timeZone,
1278
1369
  hour: '2-digit',
1279
1370
  minute: '2-digit',
1280
- second: '2-digit',
1281
1371
  }).format(now)}
1282
1372
  </time>
1283
1373
  <time
1284
1374
  dateTime={now.toISOString()}
1285
- className="text-[10px] leading-tight whitespace-nowrap text-sidebar-foreground/90"
1375
+ className="shellui-clock-date whitespace-nowrap"
1286
1376
  >
1287
1377
  {new Intl.DateTimeFormat(currentLanguage, {
1288
1378
  timeZone,