@co0ontty/wand 4.70.0 → 4.71.0

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.
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 侧栏两种形态的统一判定:停靠(推开主内容)⟷ 抽屉(覆盖主内容)。
3
+ *
4
+ * 历史实现只看视口宽度 ≤ 768:iPad 竖屏(768)、安卓平板竖屏(712)以及
5
+ * 640–768 宽的桌面窗口都被当成手机,侧栏变成覆盖式抽屉 + 全屏模糊背板,
6
+ * 右边区域整块被盖住(用户反馈「打开侧边栏,右边的区域直接被盖住了,没有压缩」)。
7
+ *
8
+ * 现在的规则与原生端一致(ios/Wand/NativeRootView.swift 的 `usesWideListDetail`、
9
+ * android/…/ui/WandApp.kt 的 `WideLayoutMinWidth/MinHeight` 同为 640×480):
10
+ * 宽度够(≥ 640px)就停靠,把主内容按侧栏宽度推开;更窄的才是手机抽屉。
11
+ * 触摸设备另加高度门槛——横屏手机高度不足 480px,两栏都放不下,仍然走抽屉;
12
+ * 桌面上的矮窗口(例如分屏出来的 1200×420)不受影响,依旧停靠。
13
+ *
14
+ * 涉及布局宽度的 CSS 断点必须与此保持一致(`src/web-ui/content/styles.css`):
15
+ * `.main-layout.sidebar-pinned` 的 padding 在 `min-width: 640px` 生效、
16
+ * 在 `max-width: 639.98px` 归零,成对出现,不能各自为政——否则会出现
17
+ * 「JS 认为停靠、CSS 不补 padding」的覆盖态。
18
+ */
19
+ /** 停靠所需的最小宽度,与 CSS `min-width: 640px` 断点一致。 */
20
+ export declare const SIDEBAR_PUSH_MIN_WIDTH = 640;
21
+ /** 触摸设备停靠所需的最小高度,与原生端 `usesWideListDetail` 一致。 */
22
+ export declare const SIDEBAR_PUSH_MIN_HEIGHT = 480;
23
+ export interface SidebarLayoutViewport {
24
+ readonly width: number;
25
+ readonly height: number;
26
+ /** `(pointer: coarse)`:触摸优先设备。 */
27
+ readonly coarsePointer: boolean;
28
+ }
29
+ /** true = 抽屉(覆盖主内容);false = 停靠(推开主内容)。 */
30
+ export declare function usesSidebarDrawer(viewport: SidebarLayoutViewport): boolean;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 侧栏两种形态的统一判定:停靠(推开主内容)⟷ 抽屉(覆盖主内容)。
3
+ *
4
+ * 历史实现只看视口宽度 ≤ 768:iPad 竖屏(768)、安卓平板竖屏(712)以及
5
+ * 640–768 宽的桌面窗口都被当成手机,侧栏变成覆盖式抽屉 + 全屏模糊背板,
6
+ * 右边区域整块被盖住(用户反馈「打开侧边栏,右边的区域直接被盖住了,没有压缩」)。
7
+ *
8
+ * 现在的规则与原生端一致(ios/Wand/NativeRootView.swift 的 `usesWideListDetail`、
9
+ * android/…/ui/WandApp.kt 的 `WideLayoutMinWidth/MinHeight` 同为 640×480):
10
+ * 宽度够(≥ 640px)就停靠,把主内容按侧栏宽度推开;更窄的才是手机抽屉。
11
+ * 触摸设备另加高度门槛——横屏手机高度不足 480px,两栏都放不下,仍然走抽屉;
12
+ * 桌面上的矮窗口(例如分屏出来的 1200×420)不受影响,依旧停靠。
13
+ *
14
+ * 涉及布局宽度的 CSS 断点必须与此保持一致(`src/web-ui/content/styles.css`):
15
+ * `.main-layout.sidebar-pinned` 的 padding 在 `min-width: 640px` 生效、
16
+ * 在 `max-width: 639.98px` 归零,成对出现,不能各自为政——否则会出现
17
+ * 「JS 认为停靠、CSS 不补 padding」的覆盖态。
18
+ */
19
+ /** 停靠所需的最小宽度,与 CSS `min-width: 640px` 断点一致。 */
20
+ export const SIDEBAR_PUSH_MIN_WIDTH = 640;
21
+ /** 触摸设备停靠所需的最小高度,与原生端 `usesWideListDetail` 一致。 */
22
+ export const SIDEBAR_PUSH_MIN_HEIGHT = 480;
23
+ /** true = 抽屉(覆盖主内容);false = 停靠(推开主内容)。 */
24
+ export function usesSidebarDrawer(viewport) {
25
+ if (!(viewport.width >= SIDEBAR_PUSH_MIN_WIDTH))
26
+ return true;
27
+ return viewport.coarsePointer && viewport.height < SIDEBAR_PUSH_MIN_HEIGHT;
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@co0ontty/wand",
3
- "version": "4.70.0",
3
+ "version": "4.71.0",
4
4
  "description": "A web console for Claude Code, Codex, OpenCode, and other local CLI tools.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,6 +24,7 @@
24
24
  "check": "node scripts/bundle-tailwind.js && node scripts/bundle-xterm.js && node scripts/bundle-browser.js && npm run generate:web-assets && tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p tsconfig.react.json",
25
25
  "test": "node --test --import tsx tests/*.test.ts",
26
26
  "check:bundle-budget": "node scripts/check-bundle-budget.js",
27
+ "audit:remnants": "node scripts/audit-legacy-remnants.js",
27
28
  "prepublishOnly": "VER=${WAND_PUBLISH_VERSION:-$(git tag --sort=-v:refname --list 'v*' | head -1)} && VER=${VER#v} && npm version \"$VER\" --no-git-tag-version --allow-same-version && npm run build",
28
29
  "bundle:tailwind": "node scripts/bundle-tailwind.js"
29
30
  },