codeassembly-agent-logic 0.7.0 → 0.8.0

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.
@@ -1,4 +1,26 @@
1
1
  [
2
+ {
3
+ "version": "0.8.0",
4
+ "date": "2026-11-21",
5
+ "sections": [
6
+ {
7
+ "title": "🎉 Features",
8
+ "audience": "all",
9
+ "items": [
10
+ {
11
+ "description": "Changes the mouse wheel on the statechart canvas from zooming to panning, with Cmd+wheel on macOS, Ctrl+wheel elsewhere, and a trackpad pinch still zooming. (#2303)",
12
+ "hash": "0d95c949fa9683f2ce95d83a2141f3e9619f02b1",
13
+ "entry": 1
14
+ },
15
+ {
16
+ "description": "Names the zoom shortcut in the labels and tooltips of the canvas's Zoom In and Zoom Out buttons: `Cmd+scroll` on macOS and `Ctrl+scroll` elsewhere. (#2303)",
17
+ "hash": "0d95c949fa9683f2ce95d83a2141f3e9619f02b1",
18
+ "entry": 2
19
+ }
20
+ ]
21
+ }
22
+ ]
23
+ },
2
24
  {
3
25
  "version": "0.7.0",
4
26
  "date": "2026-11-21",
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.8.0 — 2026-11-21
6
+
7
+ ### 🎉 Features
8
+
9
+ - Changes the mouse wheel on the statechart canvas from zooming to panning, with Cmd+wheel on macOS, Ctrl+wheel elsewhere, and a trackpad pinch still zooming. (#2303)
10
+ - Names the zoom shortcut in the labels and tooltips of the canvas's Zoom In and Zoom Out buttons: `Cmd+scroll` on macOS and `Ctrl+scroll` elsewhere. (#2303)
11
+
5
12
  ## 0.7.0 — 2026-11-21
6
13
 
7
14
  ### 🎉 Features
package/README.md CHANGED
@@ -1,13 +1,10 @@
1
1
  <!-- section:release-notes -->
2
- ## Release notes — v0.7.0 (2026-11-21)
2
+ ## Release notes — v0.8.0 (2026-11-21)
3
3
 
4
4
  ### 🎉 Features
5
5
 
6
- - Sets each Markdown heading in `PromptPane` by its level, with its `#` marker muted even when the heading is selected, and adds a `heading` field to `PromptSegment` that records the level and whether the segment is the marker. (#2299)
7
-
8
- ### 🐛 Bug fixes
9
-
10
- - Fixes the issue that `PromptPane` marked Markdown heading lines, list markers, and front matter as "Not used", by adding the `structure` value to the exported `Coverage` union, which `buildPromptSegments` assigns to that syntax and the pane leaves unmarked. (#2299)
6
+ - Changes the mouse wheel on the statechart canvas from zooming to panning, with Cmd+wheel on macOS, Ctrl+wheel elsewhere, and a trackpad pinch still zooming. (#2303)
7
+ - Names the zoom shortcut in the labels and tooltips of the canvas's Zoom In and Zoom Out buttons: `Cmd+scroll` on macOS and `Ctrl+scroll` elsewhere. (#2303)
11
8
  <!-- /section:release-notes -->
12
9
 
13
10
  <!-- readme-type: library -->
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Background, Controls, EdgeChangeset, getNodesBounds, NodeChangeset, ReactFlow, ReactFlowProvider, useReactFlow, useReactFlowStoreApi, useViewportStore, } from '@xyflow/react';
3
3
  import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
4
4
  import { AmbientSelectionContext } from "./AmbientSelectionContext.js";
5
+ import { buildAriaLabelConfig } from "./build-aria-label-config.js";
5
6
  import { DetailLevelContext } from "./DetailLevelContext.js";
6
7
  import { findElementBox } from "./find-element-box.js";
7
8
  import { findViewCentre, readView } from "./find-view-centre.js";
@@ -20,12 +21,6 @@ const fitViewOptions = {
20
21
  maxZoom: READING_ZOOM,
21
22
  };
22
23
  const MAX_ZOOM = 2;
23
- const STATE_DESCRIPTION = "Press Enter or Space to select. Press Right arrow to move to the state's outgoing transitions, when it has any.";
24
- const ariaLabelConfig = {
25
- 'node.a11yDescription.default': STATE_DESCRIPTION,
26
- 'node.a11yDescription.keyboardDisabled': STATE_DESCRIPTION,
27
- 'edge.a11yDescription.default': 'Press Enter or Space to select. Press Up or Down arrow to move between transitions from the same state, or Left arrow to return to that state.',
28
- };
29
24
  const DRAG_THRESHOLD = 3;
30
25
  export function StatechartCanvas({ elements, renderKey, ...props }) {
31
26
  const marks = useMemo(() => listChartMarks(elements), [elements]);
@@ -97,6 +92,7 @@ function StatechartFlow({ elements, selectedPath, onSelect, onViewportChange })
97
92
  const height = useViewportStore((state) => state.height);
98
93
  const bounds = useMemo(() => getNodesBounds(elements.nodes.filter(({ parentId }) => parentId === undefined)), [elements.nodes]);
99
94
  const fitZoom = findFitZoom(bounds, width, height);
95
+ const ariaLabelConfig = useMemo(() => buildAriaLabelConfig(), []);
100
96
  const detailLevel = useViewportStore((state) => findDetailLevel(state.transform[2]));
101
97
  const isFitted = useRef(true);
102
98
  const markMoved = useCallback(() => {
@@ -160,7 +156,7 @@ function StatechartFlow({ elements, selectedPath, onSelect, onViewportChange })
160
156
  return (_jsx(DetailLevelContext.Provider, { value: detailLevel, children: _jsx(AmbientSelectionContext.Provider, { value: ambientSelection, children: _jsxs(ReactFlow, { className: `statechart-canvas__flow--${detailLevel}`, nodes: shownNodes, edges: shownEdges, nodeTypes: nodeTypes, edgeTypes: edgeTypes, onNodesChange: handleNodesChange, onEdgesChange: handleEdgesChange, onNodeClick: handleNodeClick, onMoveStart: (event) => {
161
157
  if (event !== null)
162
158
  markMoved();
163
- }, ...(onViewportChange === undefined ? {} : { onMove: onViewportChange }), nodesDraggable: false, nodesConnectable: false, multiSelectionKeyCode: null, fitView: true, fitViewOptions: fitViewOptions, autoPanOnNodeFocus: false, ariaLabelConfig: ariaLabelConfig, minZoom: fitZoom, maxZoom: MAX_ZOOM, children: [_jsx(Background, {}), _jsx(ArrowheadDefs, {}), _jsx(Controls, { showInteractive: false, fitViewOptions: fitViewOptions, onFitView: () => {
159
+ }, ...(onViewportChange === undefined ? {} : { onMove: onViewportChange }), nodesDraggable: false, nodesConnectable: false, multiSelectionKeyCode: null, panOnScroll: true, fitView: true, fitViewOptions: fitViewOptions, autoPanOnNodeFocus: false, ariaLabelConfig: ariaLabelConfig, minZoom: fitZoom, maxZoom: MAX_ZOOM, children: [_jsx(Background, {}), _jsx(ArrowheadDefs, {}), _jsx(Controls, { showInteractive: false, fitViewOptions: fitViewOptions, onFitView: () => {
164
160
  isFitted.current = true;
165
161
  }, onZoomIn: markMoved, onZoomOut: markMoved }), _jsx(SelectionSync, { selectedPath: selectedPath, reportRef: reportRef, onCentre: markMoved }), _jsx(EdgeDragPan, { onPan: markMoved }), _jsx(FocusNavigation, { onCentre: markMoved }), _jsx(ZoomProperty, {})] }) }) }));
166
162
  }
@@ -0,0 +1,6 @@
1
+ import type { AriaLabelConfig } from '@xyflow/react';
2
+ /**
3
+ * Returns the canvas's labels, naming the zoom shortcut on the zoom buttons. The key is the one that React Flow's
4
+ * default `zoomActivationKeyCode` picks, by the same user-agent test.
5
+ */
6
+ export declare function buildAriaLabelConfig(): Partial<AriaLabelConfig>;
@@ -0,0 +1,14 @@
1
+ const STATE_DESCRIPTION = "Press Enter or Space to select. Press Right arrow to move to the state's outgoing transitions, when it has any.";
2
+ const baseAriaLabelConfig = {
3
+ 'node.a11yDescription.default': STATE_DESCRIPTION,
4
+ 'node.a11yDescription.keyboardDisabled': STATE_DESCRIPTION,
5
+ 'edge.a11yDescription.default': 'Press Enter or Space to select. Press Up or Down arrow to move between transitions from the same state, or Left arrow to return to that state.',
6
+ };
7
+ export function buildAriaLabelConfig() {
8
+ const zoomKey = typeof navigator !== 'undefined' && navigator.userAgent.includes('Mac') ? 'Cmd' : 'Ctrl';
9
+ return {
10
+ ...baseAriaLabelConfig,
11
+ 'controls.zoomIn.ariaLabel': `Zoom In (${zoomKey}+scroll)`,
12
+ 'controls.zoomOut.ariaLabel': `Zoom Out (${zoomKey}+scroll)`,
13
+ };
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeassembly-agent-logic",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Model of an agent prompt's states and transitions, with React and server entries for the apps that present it",
5
5
  "keywords": [
6
6
  "agents",
@@ -84,7 +84,7 @@
84
84
  "@williamthorsen/toolbelt.acp": "0.3.3",
85
85
  "@williamthorsen/toolbelt.llm": "0.2.1",
86
86
  "eslint": "10.15.0",
87
- "eslint-plugin-jest-dom": "5.10.2",
87
+ "eslint-plugin-jest-dom": "5.11.0",
88
88
  "eslint-plugin-react": "7.37.5",
89
89
  "eslint-plugin-react-hooks": "7.1.1",
90
90
  "eslint-plugin-testing-library": "7.16.2",