@1outres/dsh-plugin-mobile 0.0.0-stage → 0.7.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.
- package/LICENSE +21 -0
- package/README.md +134 -2
- package/cordis.patch.yml +6 -0
- package/icon.svg +12 -0
- package/lib/client.js +1084 -0
- package/lib/index.js +32 -0
- package/locale/en.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +61 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 1outres
|
|
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.md
CHANGED
|
@@ -1,3 +1,135 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @1outres/dsh-plugin-mobile
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Adds phone refinements to the DeepSeek Harness Web UI. Harness `0.2.2` already
|
|
4
|
+
turns the sidebar into a modal navigation drawer below 768px, with its own
|
|
5
|
+
opener, mask, focus trap and close-on-navigation. This plugin supplies what is
|
|
6
|
+
still missing on a phone: the page follows the on-screen keyboard, Enter adds a
|
|
7
|
+
line, the keyboard stays closed until you tap the composer, edge swipes open
|
|
8
|
+
and close the shipped drawer, and the layout respects notches and touch.
|
|
9
|
+
|
|
10
|
+
Install just this plugin:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
dsh plugin add @1outres/dsh-plugin-mobile
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or install it with every plugin in the repository through the
|
|
17
|
+
[`@1outres/dsh-plugins`](../dsh-plugins) bundle. Enable one or the other: both
|
|
18
|
+
insert the same `mobile` row.
|
|
19
|
+
|
|
20
|
+
## On a phone
|
|
21
|
+
|
|
22
|
+
The phone refinements apply while the Harness uses its phone layout: below
|
|
23
|
+
768px and without a Windows caption bar.
|
|
24
|
+
|
|
25
|
+
- **On-screen keyboard.** The page shrinks to the area the keyboard leaves
|
|
26
|
+
visible, so the header stays at the top and the composer sits right above
|
|
27
|
+
the keyboard. The draft box grows to at most 30% of that area.
|
|
28
|
+
- **Enter adds a line.** On a touch screen Enter in the composer inserts a line
|
|
29
|
+
break and the send button sends. Enter that confirms an IME conversion, and
|
|
30
|
+
Enter in the slash-command or reference menu, keep working as before.
|
|
31
|
+
- **The keyboard opens only when you tap the input.** The Harness focuses the
|
|
32
|
+
composer when a composer button such as the model picker or Send is pressed,
|
|
33
|
+
which pops the keyboard over the conversation. On a touch screen the composer
|
|
34
|
+
takes focus only right after a tap on the input (or on the empty part of the
|
|
35
|
+
composer card, or the `+` command button) or a hardware key press; other
|
|
36
|
+
focuses are undone at once.
|
|
37
|
+
- **Swipe the drawer.** Swipe right from the left edge to open the Harness
|
|
38
|
+
navigation drawer, swipe left to close it. The Harness owns the drawer, its
|
|
39
|
+
menu button, its scrim and its close-on-navigation behavior.
|
|
40
|
+
- **Notches and the home indicator.** The page asks for the full screen
|
|
41
|
+
(`viewport-fit=cover`) and pads by the safe-area insets; the navigation
|
|
42
|
+
drawer and the composer clear the home indicator.
|
|
43
|
+
- **Compact composer.** The conversation keeps 8px side clearance and the
|
|
44
|
+
draft box caps its height against the visible area.
|
|
45
|
+
- **No accidental reloads.** Pull-to-refresh and overscroll bounce are off, so
|
|
46
|
+
scrolling up through a long conversation does not reload the page.
|
|
47
|
+
- **A full-screen Settings sheet.** The Harness Settings dialog becomes a
|
|
48
|
+
full-screen sheet with its section list scrolling sideways above the page.
|
|
49
|
+
|
|
50
|
+
On any touch screen (also a tablet wider than 768px):
|
|
51
|
+
|
|
52
|
+
- Text fields use at least 16px type, so iOS does not zoom in when one gets
|
|
53
|
+
focus.
|
|
54
|
+
- Tooltips, which stick after a tap, are hidden.
|
|
55
|
+
- One tap opens a session. iOS treats a tap that reveals content on `:hover`
|
|
56
|
+
as a hover and drops the click, and the sidebar rows reveal their buttons on
|
|
57
|
+
hover, so a row needed two taps. Rows no longer change on hover: the selected
|
|
58
|
+
session and every workspace keep their "..." menu and buttons visible, with
|
|
59
|
+
28px tap targets, and other sessions keep their time.
|
|
60
|
+
- No tap highlight flash and no double-tap zoom delay on buttons.
|
|
61
|
+
|
|
62
|
+
The plugin also patches the viewport metadata and adds the home-screen tags
|
|
63
|
+
(`apple-mobile-web-app-capable`, `mobile-web-app-capable`,
|
|
64
|
+
`apple-mobile-web-app-title`), so **Add to Home Screen** opens the Harness
|
|
65
|
+
without the browser bar. The Harness already ships the manifest and the
|
|
66
|
+
home-screen icon.
|
|
67
|
+
|
|
68
|
+
### With the other plugins in this repository
|
|
69
|
+
|
|
70
|
+
- [`@1outres/dsh-plugin-background`](../dsh-plugin-background) keeps the
|
|
71
|
+
Harness drawer, the Settings sheet and the fullscreen right panel opaque, so
|
|
72
|
+
the conversation does not show through them.
|
|
73
|
+
- [`@1outres/dsh-plugin-model-picker`](../dsh-plugin-model-picker) does not
|
|
74
|
+
focus its search field on a touch screen, fits above the keyboard, and stays
|
|
75
|
+
open when the keyboard is dismissed, so the Effort row stays reachable.
|
|
76
|
+
|
|
77
|
+
## Settings
|
|
78
|
+
|
|
79
|
+
Edit them in **Settings → Mobile**, or in the profile patch under the
|
|
80
|
+
`mobile` row. Every change applies immediately in every open page. The page
|
|
81
|
+
also says whether the Harness currently uses its phone layout, and at which
|
|
82
|
+
width.
|
|
83
|
+
|
|
84
|
+
| Field | Default | Meaning |
|
|
85
|
+
| -------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| `enterKey` | `newline` | Enter in the composer on a touch screen: `newline` adds a line, `send` keeps the Harness default. |
|
|
87
|
+
| `swipe` | `true` | Edge swipe opens the Harness navigation drawer, swipe left closes it. |
|
|
88
|
+
| `fitKeyboard` | `true` | Fit the page to the area the on-screen keyboard leaves visible. |
|
|
89
|
+
| `blockPullToRefresh` | `true` | Stop pull-to-refresh and overscroll bounce. |
|
|
90
|
+
| `autoFocusComposer` | `false` | Let a composer button or another Harness action focus the input (and open the keyboard). Off keeps the keyboard closed until you tap the input. |
|
|
91
|
+
|
|
92
|
+
The Harness fixes the drawer width at 768px; this plugin has no separate
|
|
93
|
+
breakpoint. The earlier `mode` and `breakpoint` fields are gone; an old profile
|
|
94
|
+
entry that still sets them is ignored.
|
|
95
|
+
|
|
96
|
+
## How it works
|
|
97
|
+
|
|
98
|
+
1. The browser half watches the frame's `data-sidebar-drawer` attribute and a
|
|
99
|
+
coarse-pointer media query, and sets `data-dsh-mobile` and `data-dsh-touch`
|
|
100
|
+
on `<html>`. One stylesheet, scoped under those attributes, does the layout
|
|
101
|
+
work.
|
|
102
|
+
2. The drawer belongs to the Harness. The plugin only calls
|
|
103
|
+
`ctx.layout.toggleSidebar()` for an edge swipe and reads the frame's
|
|
104
|
+
`data-sidebar-collapsed` attribute to know whether it is open.
|
|
105
|
+
3. The keyboard fit reads `window.visualViewport` and publishes its height as
|
|
106
|
+
`--dsh-mobile-vvh`; the page height follows it. iOS scrolls the whole
|
|
107
|
+
document to reveal a focused field, so that scroll is undone while the
|
|
108
|
+
keyboard is up.
|
|
109
|
+
4. Enter: a capturing `keydown` listener hides a plain Enter in the composer
|
|
110
|
+
from the composer's own handlers. The key's default action still runs, and
|
|
111
|
+
the editor turns the browser's paragraph break into a line break.
|
|
112
|
+
5. Focus: capturing `pointerdown` and `keydown` listeners remember what the
|
|
113
|
+
user last did; a `focusin` on the composer that no recent tap on it or key
|
|
114
|
+
press explains is blurred in the same event.
|
|
115
|
+
6. The Host half only declares the settings and turns off the
|
|
116
|
+
schema-generated form, since the plugin ships its own Settings page.
|
|
117
|
+
|
|
118
|
+
## Limits
|
|
119
|
+
|
|
120
|
+
- **It restyles shipped UI from the outside.** Host elements are found through
|
|
121
|
+
data attributes (`data-sidebar-drawer`, `data-sidebar-collapsed`,
|
|
122
|
+
`data-rightbar-col`, `data-composer-*`, `data-conversation-*`,
|
|
123
|
+
`data-shortcut-modal`) and ARIA roles. Two touch rules match Session row
|
|
124
|
+
parts by CSS-module class name. A Harness update within
|
|
125
|
+
`>=0.2.2-rc.1 <0.3.0` can rename any of them; the matching rule then stops
|
|
126
|
+
applying, and the page falls back to the shipped layout for that part.
|
|
127
|
+
- Enter relies on the composer being a plain-text editor that turns the
|
|
128
|
+
browser's paragraph insertion into a line break.
|
|
129
|
+
- The Harness owns the drawer breakpoint; the plugin follows the frame's
|
|
130
|
+
`data-sidebar-drawer` attribute rather than repeating the width.
|
|
131
|
+
- An edge swipe in Safari can also trigger the browser's own back gesture; the
|
|
132
|
+
home-screen app has none.
|
|
133
|
+
- Buttons and the Settings page are in English, Chinese and Japanese (the
|
|
134
|
+
Japanese copy shows only with a Japanese language pack); the field
|
|
135
|
+
descriptions in the profile schema are English.
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" fill="none" role="img" aria-labelledby="title">
|
|
2
|
+
<title id="title">Mobile</title>
|
|
3
|
+
<rect x="2" y="2" width="60" height="60" rx="14" fill="#3D7FC2"/>
|
|
4
|
+
<rect x="19" y="8" width="26" height="48" rx="6" fill="#FFFFFF" fill-opacity="0.95"/>
|
|
5
|
+
<rect x="27.5" y="11.5" width="9" height="2.4" rx="1.2" fill="#A9C9EA"/>
|
|
6
|
+
<rect x="19" y="8" width="9" height="48" rx="6" fill="#DCE9F6"/>
|
|
7
|
+
<rect x="24" y="8" width="4" height="48" fill="#DCE9F6"/>
|
|
8
|
+
<path d="M21.5 20H25.5M21.5 25H25.5M21.5 30H25.5" stroke="#7FAAD6" stroke-width="2" stroke-linecap="round"/>
|
|
9
|
+
<path d="M31.5 21H39.5C40.880 21 42 22.120 42 23.500V27.500C42 28.880 40.880 30 39.500 30H35L32 32.500V30H31.500C30.120 30 29 28.880 29 27.500V23.500C29 22.120 30.120 21 31.500 21Z" fill="#3D7FC2"/>
|
|
10
|
+
<rect x="29.5" y="45.5" width="12.5" height="6" rx="3" fill="#DCE9F6"/>
|
|
11
|
+
<circle cx="39" cy="48.5" r="1.8" fill="#3D7FC2"/>
|
|
12
|
+
</svg>
|