@sparkelf/dsh-patch-mobile-web-layout 0.1.0-rc.10
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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +9 -0
- package/README.zh.md +9 -0
- package/package.json +35 -0
- package/patches/mobile-web-layout.patch +76 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write patches/npm/mobile-web-layout/README.md
|
|
5
|
+
README.md: c5c346f2dc672ea67130d11d786c2889ab2393d4
|
|
6
|
+
README.zh.md: 42001dd3b650820e81bc353d485078fbf41c8ec9
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @sparkelf/dsh-patch-mobile-web-layout
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
This data-only package adds the remaining responsive gap in the official Web shell: at AppFrame widths up to 640px, a user-expanded main navigation column owns exactly half the measured frame, the conversation owns the other half, details stays closed, and the sidebar drag handle is absent. The collapsed 56px rail, tablet behavior, desktop drag preference, Session selection, and Workspace addition remain official and unchanged.
|
|
6
|
+
|
|
7
|
+
The target is the exact official source base `cd5ef8148158c3a752a658978873241fdf8e2bbc`. Later official composer-control and model-menu mobile fixes are inherited and are not duplicated in this payload. The package has no JavaScript entry, lifecycle script, or fallback variant.
|
|
8
|
+
|
|
9
|
+
Retire this package when official AppFrame ships equivalent phone half-width navigation.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @sparkelf/dsh-patch-mobile-web-layout
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
该data-only package补充official Web shell剩余的responsive gap:AppFrame width不超过640px时,user-expanded main navigation column占精确一半measured frame,conversation占另一半,details保持closed,且不显示sidebar drag handle。collapsed 56px rail、tablet behavior、desktop drag preference、Session selection与Workspace addition保持official且不变。
|
|
6
|
+
|
|
7
|
+
target是exact official source base `cd5ef8148158c3a752a658978873241fdf8e2bbc`。official后续composer-control与model-menu mobile fixes直接继承,不在payload中复制。本package没有JavaScript entry、lifecycle script或fallback variant。
|
|
8
|
+
|
|
9
|
+
official AppFrame发布等价phone half-width navigation后,retire本package。
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Data-only exact official-source patch keeping user-expanded phone navigation at half the AppFrame width",
|
|
3
|
+
"dshPatch": {
|
|
4
|
+
"formatVersion": 1,
|
|
5
|
+
"variants": [
|
|
6
|
+
{
|
|
7
|
+
"dsh": ">=0.1.2-alpha.1",
|
|
8
|
+
"file": "./patches/mobile-web-layout.patch",
|
|
9
|
+
"id": "mobile-web-half-width-navigation",
|
|
10
|
+
"target": {
|
|
11
|
+
"baseRevision": "cd5ef8148158c3a752a658978873241fdf8e2bbc",
|
|
12
|
+
"kind": "dsh-source",
|
|
13
|
+
"paths": [
|
|
14
|
+
"packages/client/ui-layout/"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"patches/*.patch"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"name": "@sparkelf/dsh-patch-mobile-web-layout",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"directory": "patches/npm/mobile-web-layout",
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
|
|
32
|
+
},
|
|
33
|
+
"type": "module",
|
|
34
|
+
"version": "0.1.0-rc.10"
|
|
35
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
diff --git a/packages/client/ui-layout/src/client/AppFrame.tsx b/packages/client/ui-layout/src/client/AppFrame.tsx
|
|
2
|
+
index cbef893aed..36c6a3ae1a 100644
|
|
3
|
+
--- a/packages/client/ui-layout/src/client/AppFrame.tsx
|
|
4
|
+
+++ b/packages/client/ui-layout/src/client/AppFrame.tsx
|
|
5
|
+
@@ -15,7 +15,7 @@ import type { ReactNode } from 'react'
|
|
6
|
+
import type {
|
|
7
|
+
PropsLocale, PropsRenderSlots, PropsRuntime, PropsStore,
|
|
8
|
+
} from '@deepseek-ai/dsh-client-ui-slots'
|
|
9
|
+
-import { computeColumns, SIDEBAR_AUTO_COLLAPSE, SIDEBAR_DEFAULT } from './columns.ts'
|
|
10
|
+
+import { computeColumns, computePhoneColumns, SIDEBAR_AUTO_COLLAPSE, SIDEBAR_DEFAULT, SIDEBAR_PHONE_MAX } from './columns.ts'
|
|
11
|
+
import { DocumentTitle } from './DocumentTitle.tsx'
|
|
12
|
+
import type { createLayoutStore } from './stores.ts'
|
|
13
|
+
import css from './AppFrame.module.css'
|
|
14
|
+
@@ -146,10 +146,13 @@ export function AppFrame({
|
|
15
|
+
const narrow = viewport < SIDEBAR_AUTO_COLLAPSE
|
|
16
|
+
useEffect(() => { actions.setNarrow(narrow) }, [actions, narrow])
|
|
17
|
+
const sidebarCollapsed = narrow ? !panels.narrowExpanded : panels.sidebar === 0
|
|
18
|
+
+ const phone = viewport <= SIDEBAR_PHONE_MAX
|
|
19
|
+
const sidebarPreference = sidebarCollapsed
|
|
20
|
+
? 0
|
|
21
|
+
: panels.sidebar === 0 ? SIDEBAR_DEFAULT : panels.sidebar
|
|
22
|
+
- const cols = computeColumns(viewport, sidebarPreference, detailsSession === undefined ? 0 : panels.details)
|
|
23
|
+
+ const cols = phone
|
|
24
|
+
+ ? computePhoneColumns(viewport, !sidebarCollapsed)
|
|
25
|
+
+ : computeColumns(viewport, sidebarPreference, detailsSession === undefined ? 0 : panels.details)
|
|
26
|
+
const colsRef = useRef(cols)
|
|
27
|
+
colsRef.current = cols
|
|
28
|
+
|
|
29
|
+
@@ -175,6 +178,7 @@ export function AppFrame({
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
ref={frameRef}
|
|
33
|
+
+ data-dsh-frame=""
|
|
34
|
+
className={css.frame}
|
|
35
|
+
style={{ gridTemplateColumns: `${cols.sidebar}px minmax(0, 1fr) ${cols.details}px` }}
|
|
36
|
+
data-sidebar-collapsed={sidebarCollapsed || undefined}
|
|
37
|
+
@@ -211,7 +215,7 @@ export function AppFrame({
|
|
38
|
+
{renderSlot('shell.overlay', {})}
|
|
39
|
+
</div>
|
|
40
|
+
{/* The collapsed rail is fixed-width: no resize handle while closed. */}
|
|
41
|
+
- {!sidebarCollapsed && <DragHandle side="sidebar" left={cols.sidebar} onStart={onSidebarStart} onDrag={onSidebarDrag} onEnd={onDragEnd} />}
|
|
42
|
+
+ {!sidebarCollapsed && !phone && <DragHandle side="sidebar" left={cols.sidebar} onStart={onSidebarStart} onDrag={onSidebarDrag} onEnd={onDragEnd} />}
|
|
43
|
+
{cols.details > 0 && <DragHandle side="details" left={viewport - cols.details} onStart={onDetailsStart} onDrag={onDetailsDrag} onEnd={onDragEnd} />}
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
46
|
+
diff --git a/packages/client/ui-layout/src/client/columns.ts b/packages/client/ui-layout/src/client/columns.ts
|
|
47
|
+
index 374ce64703..1f8d94a640 100644
|
|
48
|
+
--- a/packages/client/ui-layout/src/client/columns.ts
|
|
49
|
+
+++ b/packages/client/ui-layout/src/client/columns.ts
|
|
50
|
+
@@ -27,6 +27,8 @@ export const SIDEBAR_MAX = 420
|
|
51
|
+
export const SIDEBAR_DEFAULT = 280
|
|
52
|
+
/** Closed-sidebar rail: a 24px icon column between 16px horizontal paddings. */
|
|
53
|
+
export const SIDEBAR_COLLAPSED = 56
|
|
54
|
+
+/** Maximum frame width that renders a manually expanded sidebar at half width. */
|
|
55
|
+
+export const SIDEBAR_PHONE_MAX = 640
|
|
56
|
+
/** Viewport width below which the sidebar auto-collapses to the rail (deepsuite
|
|
57
|
+
* LG breakpoint); a manual toggle below it re-expands over the squeezed center
|
|
58
|
+
* (stores.ts narrowExpanded). */
|
|
59
|
+
@@ -49,6 +51,17 @@ export function clampWidth(px: number, min: number, max: number): number {
|
|
60
|
+
return Math.min(max, Math.max(min, Math.round(px)))
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
+/**
|
|
64
|
+
+ * Resolve the phone frame with half-width expanded navigation and no details.
|
|
65
|
+
+ * @param viewport - available frame width in px.
|
|
66
|
+
+ * @param sidebarExpanded - whether the user has manually expanded navigation.
|
|
67
|
+
+ * @returns the phone sidebar and conversation widths.
|
|
68
|
+
+ */
|
|
69
|
+
+export function computePhoneColumns(viewport: number, sidebarExpanded: boolean): Columns {
|
|
70
|
+
+ const sidebar = sidebarExpanded ? Math.round(viewport / 2) : SIDEBAR_COLLAPSED
|
|
71
|
+
+ return { sidebar, center: Math.max(0, viewport - sidebar), details: 0 }
|
|
72
|
+
+}
|
|
73
|
+
+
|
|
74
|
+
/**
|
|
75
|
+
* Solve the three column widths for one viewport frame. Pure: no hysteresis —
|
|
76
|
+
* the output is a function of (viewport, preferences) only, so recovery on
|