@allbluecn/web-app 0.22.3 → 0.22.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allbluecn/web-app",
3
- "version": "0.22.3",
3
+ "version": "0.22.4",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "files": [
@@ -15,6 +15,7 @@
15
15
  // You should have received a copy of the GNU Affero General Public License
16
16
  // along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
 
18
+ import { useEffect, useState } from "react";
18
19
  import {
19
20
  Sidebar,
20
21
  SidebarContent,
@@ -37,7 +38,8 @@ import { PresenceAvatarStack } from "@/components/layout/sidebar-03/presence-ava
37
38
  import { SidebarSearchTrigger } from "@/components/layout/sidebar-03/nav-search-trigger"
38
39
  import { NavSecondary } from "@/components/layout/sidebar-03/nav-secondary"
39
40
  import { PluginNavItems } from '@/components/plugin-slots/plugin-nav-items'
40
- import { isDesktopEdition } from "@/lib/edition-desktop"
41
+ import { isDesktopEdition } from "@/lib/edition-desktop";
42
+ import { getDesktopBridge } from "@/lib/desktop-bridge-types";
41
43
 
42
44
  // presence 渲染工厂(§8.2 消费者两文件之一):nav-main 按 route.id 查
43
45
  // MODULE_ROUTES 得 module key 后回调;module 级单例 map,identity 稳定。
@@ -53,21 +55,33 @@ export function DashboardSidebar() {
53
55
  // 「第一行红绿灯让位 + 右侧按钮组(整行可拖动窗口)、第二行 logo」。
54
56
  // web/云端 SaaS 布局不变(isDesktopEdition 为构建期常量,死分支消除)。
55
57
  const isDesktop = isDesktopEdition();
58
+ // macOS 全屏兼容:全屏时系统隐藏红绿灯,布局回退 SaaS/OSS 原形态
59
+ // (logo 上移填充原红绿灯行),退出全屏恢复红绿灯双行布局。
60
+ // 旧壳无 onFullscreenChange API 时恒 false(保持桌面布局)。
61
+ const [isFullscreen, setIsFullscreen] = useState(false);
62
+ useEffect(() => {
63
+ if (!isDesktop) return;
64
+ const bridge = getDesktopBridge();
65
+ if (!bridge?.onFullscreenChange) return;
66
+ return bridge.onFullscreenChange(setIsFullscreen);
67
+ }, [isDesktop]);
68
+ const showTrafficLightRow = isDesktop && !isFullscreen;
56
69
 
57
70
  return (
58
71
  <Sidebar variant="floating" collapsible="icon">
59
72
  <SidebarHeader
60
73
  className={cn(
61
74
  "flex flex-col items-center justify-center gap-2 py-2",
62
- !isCollapsed && !isDesktop && "flex-row justify-between py-2 md:pt-3.5",
63
- // 桌面展开态:整块 header 为拖动区(第二行 logo 左对齐),按钮逐个 no-drag
64
- !isCollapsed && isDesktop && "app-region-drag w-full items-stretch justify-start gap-0 py-1",
65
- isCollapsed && isDesktop && "app-region-drag pt-8",
75
+ !isCollapsed && !showTrafficLightRow && "flex-row justify-between py-2 md:pt-3.5",
76
+ // 桌面展开态:整块 header 为拖动区(第二行 logo 左对齐),按钮逐个 no-drag;
77
+ // gap-2 拉开红绿灯行与 logo 行间距(用户调校 2026-10-31)
78
+ !isCollapsed && showTrafficLightRow && "app-region-drag w-full items-stretch justify-start gap-2 py-1",
79
+ isCollapsed && isDesktop && !isFullscreen && "app-region-drag pt-8",
66
80
  )}
67
81
  >
68
82
  {isCollapsed ? (
69
83
  <div className="flex flex-col items-center gap-2">
70
- <div className={cn("flex flex-col items-center gap-2", isDesktop && "app-region-no-drag")}>
84
+ <div className={cn("flex flex-col items-center gap-2", showTrafficLightRow && "app-region-no-drag")}>
71
85
  <img
72
86
  src="/logo/allblue-logo-dark.svg"
73
87
  alt="AllBlue"
@@ -79,12 +93,12 @@ export function DashboardSidebar() {
79
93
  className="hidden h-6 w-6 dark:block"
80
94
  />
81
95
  </div>
82
- <div className={cn("flex flex-col-reverse items-center gap-1", isDesktop && "app-region-no-drag")}>
96
+ <div className={cn("flex flex-col-reverse items-center gap-1", showTrafficLightRow && "app-region-no-drag")}>
83
97
  <NotificationsBell />
84
98
  <SidebarTrigger />
85
99
  </div>
86
100
  </div>
87
- ) : isDesktop ? (
101
+ ) : showTrafficLightRow ? (
88
102
  <>
89
103
  {/* 第一行:左侧让位 macOS 红绿灯(hiddenInset + trafficLightPosition
90
104
  y=18 → 圆心 24px,与 h-8 行中心 8+16=24 对齐),右侧按钮组;
@@ -120,7 +120,7 @@ export const SDK_GROUPS: SdkGroup[] = [
120
120
  "items": [
121
121
  {
122
122
  "name": "@allbluecn/web-app",
123
- "version": "v0.22.3",
123
+ "version": "v0.22.4",
124
124
  "lastUpdate": "Oct 31, 2026",
125
125
  "source": "apps/web/package.json",
126
126
  "docsUrl": "https://github.com/allbluecn/allblue"
@@ -16,6 +16,8 @@ export interface DesktopBridgeApi {
16
16
  onOnlineChanged: (cb: (online: boolean) => void) => () => void
17
17
  onSyncState: (cb: (state: unknown) => void) => () => void
18
18
  onRenamed: (cb: (info: { table: string; from: string; to: string }) => void) => () => void
19
+ /** macOS 全屏态切换(enter/leave-full-screen);旧壳无此 API 时 undefined */
20
+ onFullscreenChange?: (cb: (fullscreen: boolean) => void) => () => void
19
21
  }
20
22
 
21
23
  declare global {