dsh-asuta-hide-new-session 0.0.0-stage → 0.1.2
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 +8 -2
- package/client.js +45 -0
- package/cordis.patch.yml +4 -0
- package/icon.svg +6 -0
- package/index.js +10 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +56 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Asuta and contributors
|
|
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,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 隐藏新会话按钮
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hide the New Session button at the top of the sidebar. · 隐藏侧边栏顶部的「新会话」按钮。
|
|
4
|
+
|
|
5
|
+
安装命令:
|
|
6
|
+
|
|
7
|
+
dsh plugin --profile desktop add dsh-asuta-hide-new-session
|
|
8
|
+
|
|
9
|
+
也可安装 dsh-asuta-cdx-plus 获得全部功能,在插件页面独立开启或关闭此组件。
|
package/client.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client half of the hide-new-session bundle.
|
|
3
|
+
*
|
|
4
|
+
* The New Session control at the top of the sidebar is drawn by the shipped
|
|
5
|
+
* ui-sidebar shell itself — it is not a slot occupant, so there is no seat to
|
|
6
|
+
* leave empty and no registration that could switch it off. The one stable
|
|
7
|
+
* handle on it is its CSS-module class name: the shell writes
|
|
8
|
+
* `className: SidebarRoot_module_css_default.newSession`, and the build emits
|
|
9
|
+
* that as `<hash>_newSession` (the hash changes between builds, the local name
|
|
10
|
+
* does not). Matching the local-name suffix therefore keeps working across
|
|
11
|
+
* rebuilds without pinning a hash.
|
|
12
|
+
*
|
|
13
|
+
* Only the button is targeted: the same rule also matches the label/shortcut
|
|
14
|
+
* spans nested inside it, which is harmless because the parent is not rendered.
|
|
15
|
+
* The collapsed rail icon and the Windows titlebar variant are the same button,
|
|
16
|
+
* so both states are covered.
|
|
17
|
+
*
|
|
18
|
+
* The shell's own brand row remains a New Session shortcut and the keyboard
|
|
19
|
+
* shortcut still works; this plugin only removes the button from view.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
window.__ModuleLoader__.load({
|
|
23
|
+
id: 'dsh-asuta-hide-new-session',
|
|
24
|
+
factory() {
|
|
25
|
+
const CSS = 'button[class*="newSession"] { display: none !important; }'
|
|
26
|
+
const TAG_ID = 'dsh-asuta-hide-new-session/hide-new-session.css'
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
apply(ctx) {
|
|
30
|
+
ctx.effect(() => {
|
|
31
|
+
// Idempotent across HMR re-activation: reuse an existing tag.
|
|
32
|
+
const existing = document.querySelector(`style[data-plugin-css=${JSON.stringify(TAG_ID)}]`)
|
|
33
|
+
if (existing !== null) return () => { existing.remove() }
|
|
34
|
+
|
|
35
|
+
const tag = document.createElement('style')
|
|
36
|
+
tag.dataset.plugin = 'dsh-asuta-hide-new-session'
|
|
37
|
+
tag.dataset.pluginCss = TAG_ID
|
|
38
|
+
tag.textContent = CSS
|
|
39
|
+
document.head.appendChild(tag)
|
|
40
|
+
return () => { tag.remove() }
|
|
41
|
+
}, 'hide-new-session: styles')
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
})
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
|
|
2
|
+
<rect x="5" y="9" width="54" height="46" rx="12" fill="#EEF2F8" stroke="#8A94A6" stroke-width="3"/>
|
|
3
|
+
<path d="M21 10v44" stroke="#8A94A6" stroke-width="3"/>
|
|
4
|
+
<path d="M40 24v16M32 32h16" stroke="#2F6FEB" stroke-width="4" stroke-linecap="round"/>
|
|
5
|
+
<path d="M26 44 54 16" stroke="#E5484D" stroke-width="5" stroke-linecap="round"/>
|
|
6
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host half of the hide-new-session bundle.
|
|
3
|
+
*
|
|
4
|
+
* Nothing runs on the Host: the whole effect is one CSS rule that the Client
|
|
5
|
+
* half injects. The row still exists so the bundle has an inventory entry and
|
|
6
|
+
* the Client module has an owning fiber to attach to.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** No Host-side work. */
|
|
10
|
+
export function apply() {}
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-asuta-hide-new-session",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Hide the New Session button at the top of the sidebar. · 隐藏侧边栏顶部的「新会话」按钮。",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./client": "./client.js",
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
"./locale/*.json": "./locale/*.json",
|
|
11
|
+
"./cordis.patch.yml": "./cordis.patch.yml"
|
|
12
|
+
},
|
|
13
|
+
"icon": "./icon.svg",
|
|
14
|
+
"files": [
|
|
15
|
+
"index.js",
|
|
16
|
+
"client.js",
|
|
17
|
+
"cordis.patch.yml",
|
|
18
|
+
"icon.svg",
|
|
19
|
+
"locale/*.json",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE*",
|
|
22
|
+
"NOTICE*",
|
|
23
|
+
"THIRD_PARTY_NOTICES.md"
|
|
24
|
+
],
|
|
25
|
+
"dsh": {
|
|
26
|
+
"bundle": {
|
|
27
|
+
"patch": "./cordis.patch.yml"
|
|
28
|
+
},
|
|
29
|
+
"client": {
|
|
30
|
+
"platform": "web",
|
|
31
|
+
"immediately": true,
|
|
32
|
+
"inject": [
|
|
33
|
+
"@deepseek-ai/dsh-client-ui-sidebar"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/Asuta/dsh-cdx-plus.git",
|
|
43
|
+
"directory": "packages/hide-new-session"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/Asuta/dsh-cdx-plus/tree/main/packages/hide-new-session",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/Asuta/dsh-cdx-plus/issues"
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"dsh-plugin",
|
|
51
|
+
"deepseek-harness"
|
|
52
|
+
],
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": "^22.19.0 || >=24",
|
|
55
|
+
"dsh": "0.2.2-rc.2"
|
|
56
|
+
},
|
|
57
|
+
"license": "MIT"
|
|
58
|
+
}
|