dsh-better-workspace 0.36.11 → 0.36.13

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/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-better-workspace",
3
- "version": "0.36.11",
3
+ "version": "0.36.13",
4
4
  "main": "./src/index.js",
5
5
  "description": "侧边栏工作区树:按官方磁盘目录嵌套(官方 workspace-tree 语义),可选按名称中的 / 分组(默认关闭,设置里开启);新会话页的工作区选择器同树。Workspace tree for the DSH sidebar workspace list, nested by official disk folders with optional \"/\"-name grouping; the New Session workspace picker shows the same tree.",
6
6
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-better-workspace",
3
- "version": "0.36.11",
3
+ "version": "0.36.13",
4
4
  "description": "侧边栏工作区树:按官方磁盘目录嵌套(官方 workspace-tree 语义),可选按名称中的 / 分组(默认关闭,设置里开启);新会话页的工作区选择器同树(同一份视图选项即时同步);添加工作区走官方目录流。Workspace tree for the DSH sidebar: disk-path nesting (official workspace-tree semantics), with optional \"/\"-name grouping (off by default), and the same tree in the New Session workspace picker; add-workspace rides the official directory flow.",
5
5
  "type": "module",
6
6
  "repository": {
package/src/client.js CHANGED
@@ -7432,7 +7432,11 @@ window.__ModuleLoader__.load({
7432
7432
 
7433
7433
  const rows = React.useMemo(() => {
7434
7434
  const out = []
7435
- const flatMode = groupBy !== 'workspace-tree'
7435
+ // ONE view rule for every tree-shaped surface (sidebar memo, new-group
7436
+ // chooser, this picker): "workspaces" keeps the name tree whenever a
7437
+ // name layer is on — only a purely disk flat view or 'flat' collapses.
7438
+ const flatMode = groupBy === 'flat'
7439
+ || (groupBy === 'workspace' && workspaceGroupMode === 'disk')
7436
7440
  const isFolded = (key) => folded[key] === true
7437
7441
  const toggle = (key) => {
7438
7442
  setFolded((prev) => {
@@ -10191,6 +10195,17 @@ window.__ModuleLoader__.load({
10191
10195
  }
10192
10196
  const wsHasCurrent = (w) => !!currentId && !!w
10193
10197
  && ((w.sessionIds || []).includes(currentId) || subHasCurrent(w.sub))
10198
+ // Name groups (slash view) have no disk path to prefix-match; the
10199
+ // folder glyph lights up whenever its SUBTREE holds the current
10200
+ // session — the official ProjectRow rule, applied tree-wide.
10201
+ const nodeHoldsCurrent = (level) => {
10202
+ if (!level || !currentId) return false
10203
+ for (const item of levelSeqOf(level)) {
10204
+ if (item.kind === 'ws') { if (wsHasCurrent(item.entry)) return true }
10205
+ else if (nodeHoldsCurrent(item.node)) return true
10206
+ }
10207
+ return false
10208
+ }
10194
10209
  const currentWsPath = currentId
10195
10210
  ? ((items || []).find((w) => (w.sessionIds || []).includes(currentId)) || {}).path
10196
10211
  : undefined
@@ -10226,7 +10241,7 @@ window.__ModuleLoader__.load({
10226
10241
  custStyle: rowStyleOf('folder:' + idPath),
10227
10242
  iconMode: (styleEntry('folder:' + idPath) || {}).icon || 'solid',
10228
10243
  pulse: expanded ? null : folderPulseOf(node),
10229
- active: pathHoldsCurrent(currentWsPath, node.path),
10244
+ active: pathHoldsCurrent(currentWsPath, node.path) || nodeHoldsCurrent(node),
10230
10245
  t,
10231
10246
  })]
10232
10247
  if (expanded) {