dsh-session-matrix 0.16.3 → 0.16.4

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.
Files changed (2) hide show
  1. package/lib/client.js +17 -6
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -2032,6 +2032,14 @@ window.__ModuleLoader__.load({
2032
2032
  }
2033
2033
 
2034
2034
  const MAX_PANES = 4
2035
+ /**
2036
+ * First-run layout: the full 2×2 grid with every cell empty.
2037
+ *
2038
+ * The panel's job on entry is to let you choose; auto-opening a session
2039
+ * also made "four empty cells" unreachable, because any all-empty row was
2040
+ * immediately snapped back to a filled one.
2041
+ */
2042
+ const EMPTY_PANES = [null, null, null, null]
2035
2043
 
2036
2044
  function WorkspaceView({
2037
2045
  sessions, projects, filter, setFilter, panes, setPanes, onOpenNative, railW, onRailW, kit, th, flashId,
@@ -2811,7 +2819,7 @@ window.__ModuleLoader__.load({
2811
2819
  const [panes, setPanes] = React.useState(() => {
2812
2820
  try {
2813
2821
  const raw = JSON.parse(localStorage.getItem('aw.panes') || '[]')
2814
- if (!Array.isArray(raw)) return [null]
2822
+ if (!Array.isArray(raw)) return EMPTY_PANES
2815
2823
  const kept = []
2816
2824
  for (const v of raw) {
2817
2825
  if (v === null) { kept.push(null); continue }
@@ -2821,8 +2829,8 @@ window.__ModuleLoader__.load({
2821
2829
  if (kept.includes(v)) continue
2822
2830
  kept.push(v)
2823
2831
  }
2824
- return kept.slice(0, MAX_PANES).length ? kept.slice(0, MAX_PANES) : [null]
2825
- } catch { return [null] }
2832
+ return kept.slice(0, MAX_PANES).length ? kept.slice(0, MAX_PANES) : EMPTY_PANES
2833
+ } catch { return EMPTY_PANES }
2826
2834
  })
2827
2835
 
2828
2836
  React.useEffect(() => {
@@ -2965,9 +2973,12 @@ window.__ModuleLoader__.load({
2965
2973
  const ids = new Set(sessions.map(s => s.id))
2966
2974
  setPanes(prev => {
2967
2975
  const pruned = prev.map(id => (id && ids.has(id) ? id : null))
2968
- const next = pruned.some(Boolean) ? pruned : [sessions[0].id]
2969
- const same = next.length === prev.length && next.every((v, i) => v === prev[i])
2970
- return same ? prev : next
2976
+ // An all-empty row is a legitimate state now: the user walks in,
2977
+ // sees the grid, and picks. Auto-filling the busiest session made
2978
+ // "four empty cells" unreachable — adding panes always snapped the
2979
+ // first one to a session.
2980
+ const same = pruned.length === prev.length && pruned.every((v, i) => v === prev[i])
2981
+ return same ? prev : pruned
2971
2982
  })
2972
2983
  }, [sessions, setPanes])
2973
2984
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-matrix",
3
- "version": "0.16.3",
3
+ "version": "0.16.4",
4
4
  "description": "A multi-agent workspace for DeepSeek Harness: run parallel sessions, visualize agent relationships, monitor context usage, and manage task handoffs.",
5
5
  "keywords": [
6
6
  "deepseek-harness",