dsh-workspace-session-filter 1.0.6 → 1.0.7
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/README.md +3 -2
- package/client.js +26 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ dsh plugin --profile desktop remove dsh-workspace-session-filter
|
|
|
86
86
|
|
|
87
87
|
卸载:`plugin_manager({ action: "remove_bundle", target: "dsh-workspace-session-filter" })`。
|
|
88
88
|
|
|
89
|
-
> 包名 `dsh-workspace-session-filter` 与仓库同名。截至 1.0.
|
|
89
|
+
> 包名 `dsh-workspace-session-filter` 与仓库同名。截至 1.0.7,npm registry、
|
|
90
90
|
> GitHub、release tarball、本地目录四种来源都能装;registry 上是 `npm publish` 发出的
|
|
91
91
|
> 正式版本,`repository` 字段指回本仓库。
|
|
92
92
|
|
|
@@ -106,7 +106,8 @@ dsh plugin --profile desktop remove dsh-workspace-session-filter
|
|
|
106
106
|
- **面板落位**:`sidebar.panellist` 的 `id` 与 `main` 的 `key` 复用同一个字符串
|
|
107
107
|
`session-filter`,侧边栏图标因此直接指向本面板;`order: 30` 排在插件、定时任务、
|
|
108
108
|
上下文之后。
|
|
109
|
-
-
|
|
109
|
+
- **导航图标可关**:开关出现在两处 —— `设置 → 内置插件 → 会话筛选` 标签页,以及底部筛选条
|
|
110
|
+
弹出的列表页脚(不打开设置也能拨);
|
|
110
111
|
偏好存 `localStorage`(键 `dsh-workspace-session-filter:nav.v1`,默认关),
|
|
111
112
|
开关变化时**注销/重建** `sidebar.panellist` 注册,因此关掉时不会留下一个空图标位。
|
|
112
113
|
- **筛选条落位**:注册在 `sidebar.footer.action`(设置按钮上方的一行槽位),整条占满宽度;
|
package/client.js
CHANGED
|
@@ -838,6 +838,10 @@ window.__ModuleLoader__.load({
|
|
|
838
838
|
view.loading
|
|
839
839
|
? h('div', { className: 'dwsf-empty' }, h('div', null, t('empty.loading')))
|
|
840
840
|
: h(Groups, { view, t, now, onOpen })
|
|
841
|
+
),
|
|
842
|
+
h('div', { className: 'dwsf-popFoot' },
|
|
843
|
+
h('span', { className: 'dwsf-popFootLabel' }, t('settings.nav')),
|
|
844
|
+
h(NavSwitch, { t })
|
|
841
845
|
)
|
|
842
846
|
)
|
|
843
847
|
: null
|
|
@@ -868,31 +872,36 @@ window.__ModuleLoader__.load({
|
|
|
868
872
|
* The plugin's own page inside Settings → Plugins. One switch owns the
|
|
869
873
|
* optional left-nav entry; the sidebar-foot filter bar is unaffected.
|
|
870
874
|
*/
|
|
871
|
-
function
|
|
872
|
-
const t = props.t
|
|
875
|
+
function NavSwitch(props) {
|
|
873
876
|
const [on, setOn] = useState(navVisible)
|
|
874
877
|
|
|
875
878
|
useEffect(() => subscribeNav((value) => setOn(value)), [])
|
|
876
879
|
|
|
880
|
+
return h('button', {
|
|
881
|
+
type: 'button',
|
|
882
|
+
role: 'switch',
|
|
883
|
+
className: 'dwsf-switch',
|
|
884
|
+
'aria-checked': on ? 'true' : 'false',
|
|
885
|
+
'aria-label': props.t('settings.nav'),
|
|
886
|
+
'data-on': on ? 'true' : 'false',
|
|
887
|
+
onClick: () => setNavVisible(!on),
|
|
888
|
+
},
|
|
889
|
+
h('span', { className: 'dwsf-switchTrack', 'data-on': on ? 'true' : 'false', 'aria-hidden': 'true' },
|
|
890
|
+
h('span', { className: 'dwsf-switchThumb' })
|
|
891
|
+
)
|
|
892
|
+
)
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
function SettingsPage(props) {
|
|
896
|
+
const t = props.t
|
|
897
|
+
|
|
877
898
|
return h('div', { className: 'dwsf-settings' },
|
|
878
899
|
h('div', { className: 'dwsf-settingRow' },
|
|
879
900
|
h('div', { className: 'dwsf-settingCopy' },
|
|
880
901
|
h('span', { className: 'dwsf-settingLabel' }, t('settings.nav')),
|
|
881
902
|
h('span', { className: 'dwsf-settingHint' }, t('settings.navHint'))
|
|
882
903
|
),
|
|
883
|
-
h(
|
|
884
|
-
type: 'button',
|
|
885
|
-
role: 'switch',
|
|
886
|
-
className: 'dwsf-switch',
|
|
887
|
-
'aria-checked': on ? 'true' : 'false',
|
|
888
|
-
'aria-label': t('settings.nav'),
|
|
889
|
-
'data-on': on ? 'true' : 'false',
|
|
890
|
-
onClick: () => setNavVisible(!on),
|
|
891
|
-
},
|
|
892
|
-
h('span', { className: 'dwsf-switchTrack', 'data-on': on ? 'true' : 'false', 'aria-hidden': 'true' },
|
|
893
|
-
h('span', { className: 'dwsf-switchThumb' })
|
|
894
|
-
)
|
|
895
|
-
)
|
|
904
|
+
h(NavSwitch, { t })
|
|
896
905
|
)
|
|
897
906
|
)
|
|
898
907
|
}
|
|
@@ -1017,6 +1026,8 @@ window.__ModuleLoader__.load({
|
|
|
1017
1026
|
.dwsf-switchThumb{width:16px;height:16px;border-radius:999px;background:var(--dsw-alias-bg-base);transition:transform .16s ease}
|
|
1018
1027
|
.dwsf-switchTrack[data-on="true"] .dwsf-switchThumb{transform:translateX(14px)}
|
|
1019
1028
|
.dwsf-pop{position:fixed;z-index:60;display:flex;flex-direction:column;width:min(340px,calc(100vw - 24px));max-height:60vh;border-radius:12px;background:var(--dsw-specific-menu);backdrop-filter:var(--dsw-menu-backdrop-filter);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-prominent);overflow:hidden}
|
|
1029
|
+
.dwsf-popFoot{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border-top:.5px solid var(--dsw-alias-border-l2);font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
|
|
1030
|
+
.dwsf-popFootLabel{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1020
1031
|
.dwsf-popHead{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:10px 12px 4px}
|
|
1021
1032
|
.dwsf-popTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500;line-height:20px}
|
|
1022
1033
|
.dwsf-popCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px;font-variant-numeric:tabular-nums}
|