@ch4acko3/dsh-turn-fold 0.4.2 → 0.4.3

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/inline-source.cjs CHANGED
@@ -318,6 +318,7 @@ function __ch4acko3DshTurnFoldActivityGroup(props) {
318
318
  "data-ch4acko3-dsh-turn-fold-activity-open": open ? "true" : "false",
319
319
  "data-dsh-fold-owner": "@ch4acko3/dsh-turn-fold",
320
320
  "data-dsh-fold-scope": "activity-run",
321
+ "data-dsh-fold-keys": JSON.stringify(props.nodeKeys),
321
322
  "data-state": state,
322
323
  children: [
323
324
  react_jsx_runtime.jsx(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
@@ -871,7 +872,10 @@ function __ch4acko3DshTurnFoldRenderEntries(entries, nodeStore, renderNode, sess
871
872
  activityEntries.push(next);
872
873
  j++;
873
874
  }
874
- var selected = activityEntries.some(function (activityEntry) { return interactionKeys.has(activityEntry.key); });
875
+ var foldKey = "activity:" + String(sessionId) + ":" + String(turn) + ":" + String(entry.key);
876
+ // Focus inside an already-open group belongs to its native disclosure rows.
877
+ // Keep their parent stable when a streaming Session snapshot renders again.
878
+ var selected = !__ch4acko3DshTurnFoldOpenKeys.has(foldKey) && activityEntries.some(function (activityEntry) { return interactionKeys.has(activityEntry.key); });
875
879
  if (turn === null || activityEntries.length < 2 || selected) {
876
880
  for (var k = 0; k < activityEntries.length; k++) out.push(__ch4acko3DshTurnFoldRenderNativeEntry(activityEntries[k], renderNode, false));
877
881
  } else {
@@ -891,11 +895,11 @@ function __ch4acko3DshTurnFoldRenderEntries(entries, nodeStore, renderNode, sess
891
895
  }
892
896
  if (__ch4acko3DshTurnFoldHasVisibleNonReasoning(entry.node)) out.push(__ch4acko3DshTurnFoldRenderNativeEntry(entry, renderNode, true));
893
897
  var facts = __ch4acko3DshTurnFoldToolFacts(toolKeys, nodeStore);
894
- var foldKey = "activity:" + String(sessionId) + ":" + String(turn) + ":" + String(entry.key);
895
898
  out.push(react_jsx_runtime.jsx(__ch4acko3DshTurnFoldActivityGroup, {
896
899
  failed: facts.failed,
897
900
  foldKey: foldKey,
898
901
  items: items,
902
+ nodeKeys: activityEntries.map(function (activityEntry) { return activityEntry.key; }),
899
903
  renderNode: renderNode,
900
904
  running: facts.running,
901
905
  t: t
@@ -982,6 +986,7 @@ function __ch4acko3DshTurnFoldDisclosure(props) {
982
986
  "data-ch4acko3-dsh-turn-fold-open": expanded ? "true" : "false",
983
987
  "data-dsh-fold-owner": "@ch4acko3/dsh-turn-fold",
984
988
  "data-dsh-fold-scope": "turn",
989
+ "data-dsh-fold-keys": JSON.stringify(activity),
985
990
  children: [
986
991
  react_jsx_runtime.jsx("button", {
987
992
  type: "button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ch4acko3/dsh-turn-fold",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Codex-style turn folding for the DSH WebUI conversation, implemented as a dsh-harmony provider.",
5
5
  "main": "./index.cjs",
6
6
  "engines": {