@floless/app 0.134.0 → 0.134.2

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.
@@ -52,7 +52,74 @@
52
52
  interaction: 'instant',
53
53
  risk: [],
54
54
  guidance: 'on-demand',
55
- why: 'Everything you tick on this screen is held in memory until you press this. It stays off until something has actually changed.',
55
+ why: 'Everything you tick on this screen is held in memory until you press this. During a drawing read, it becomes available as soon as the filter selects valid drawing lines.',
56
+ });
57
+
58
+ def('filter.reload', {
59
+ label: 'Reload Drawing Filter',
60
+ actsOn: 'Reloads this Drawing Filter to recover from the message shown',
61
+ group: 'In a Drawing Filter message',
62
+ persistence: 'none',
63
+ interaction: 'instant',
64
+ risk: ['destructive'],
65
+ guidance: 'on-demand',
66
+ why: 'The message explains when the unsaved selection must be reviewed and applied again after reload.',
67
+ });
68
+
69
+ def('filter.dismiss-message', {
70
+ label: 'Dismiss message',
71
+ actsOn: 'Hides this Drawing Filter message',
72
+ group: 'In a Drawing Filter message',
73
+ persistence: 'none',
74
+ interaction: 'instant',
75
+ risk: [],
76
+ guidance: 'on-demand',
77
+ });
78
+
79
+ /* ── the exclusion sign-off, before a revision read's Save ─────────────── */
80
+
81
+ def('filter.signoff-approve', {
82
+ label: 'Approve these exclusions',
83
+ actsOn: 'Records that the switched-off values carry no steel',
84
+ group: 'In the Drawing Filter exclusion approval',
85
+ persistence: 'working',
86
+ interaction: 'instant',
87
+ risk: [],
88
+ guidance: 'on-demand',
89
+ why: 'Only appears when this read has something switched off — a layer, a line weight or a colour. Everything matching those values can then be dismissed as a group instead of element by element, so it is worth reading the list first. Values you leave on can never be dismissed this way. It waits until the count of what would be dismissed has arrived, because that number is the decision.',
90
+ });
91
+
92
+ def('filter.signoff-cancel', {
93
+ label: 'Cancel the exclusion approval',
94
+ actsOn: 'Closes the list without saving anything',
95
+ group: 'In the Drawing Filter exclusion approval',
96
+ persistence: 'none',
97
+ interaction: 'instant',
98
+ risk: [],
99
+ guidance: 'on-demand',
100
+ why: 'Nothing is written — not even the filter change. To change which values are listed, untick or re-tick them in the panel and press Save again.',
101
+ });
102
+
103
+ def('filter.signoff-close', {
104
+ label: 'Close the exclusion approval',
105
+ actsOn: 'Dismisses the message',
106
+ group: 'In the Drawing Filter exclusion approval',
107
+ persistence: 'none',
108
+ interaction: 'instant',
109
+ risk: [],
110
+ guidance: 'on-demand',
111
+ why: 'Only appears when an approval could not be recorded. The message says whether your filter changes were saved — closing it dismisses the message, it does not undo anything.',
112
+ });
113
+
114
+ def('filter.signoff-reload', {
115
+ label: 'Reload the page',
116
+ actsOn: 'Loads the Drawing Filter again',
117
+ group: 'In the Drawing Filter exclusion approval',
118
+ persistence: 'none',
119
+ interaction: 'instant',
120
+ risk: [],
121
+ guidance: 'on-demand',
122
+ why: 'Only appears when an approval could not be recorded. Reloading fetches what the server actually holds, so you can approve what is really there rather than a stale copy.',
56
123
  });
57
124
 
58
125
  /* ── the left panel: which elements are shown ───────────────────────────── */
@@ -76,11 +143,17 @@
76
143
  interaction: 'instant',
77
144
  risk: [],
78
145
  guidance: 'on-demand',
146
+ // Worth saying on THIS control specifically: on a revision read, switching a value off is what
147
+ // later lets its elements be dismissed as a group, and Save asks for that on the record.
148
+ why: 'On a revision read, everything you switch off here is what Save will ask you to approve as not steel — those elements can then be dismissed as a group, with no line-by-line reason.',
79
149
  });
80
150
 
81
151
  def('filter.facet-all', {
82
152
  label: 'Select all in a facet',
83
- actsOn: 'Ticks every value in that list',
153
+ // "usable": a hand-edited or third-party filter can list a value this page cannot express, and
154
+ // the control then ticks the rest and says so. Promising "every value" would contradict
155
+ // both the button's own tooltip and what the user watches happen.
156
+ actsOn: 'Ticks every usable value in that list',
84
157
  group: 'In the Drawing Filter panel',
85
158
  persistence: 'local',
86
159
  interaction: 'instant',
@@ -90,7 +163,7 @@
90
163
 
91
164
  def('filter.facet-none', {
92
165
  label: 'Clear a facet',
93
- actsOn: 'Unticks every value in that list',
166
+ actsOn: 'Unticks every usable value in that list',
94
167
  group: 'In the Drawing Filter panel',
95
168
  persistence: 'local',
96
169
  interaction: 'instant',
@@ -135,13 +208,17 @@
135
208
 
136
209
  def('filter.eyedropper-add', {
137
210
  label: 'Add a sampled value to the filter',
138
- actsOn: 'Ticks the sampled layer, thickness or colour',
211
+ actsOn: 'Ticks the sampled layer, thickness or colour when the filter can express it',
139
212
  group: 'On the Drawing Filter canvas',
140
213
  persistence: 'local',
141
214
  interaction: 'instant',
142
215
  risk: [],
143
216
  guidance: 'on-demand',
144
- why: 'Add one criterion at a time, or all three at once — the fastest way to build a filter from an element you can already see.',
217
+ // "every usable one", not "all three": a picked element can carry a value this filter cannot
218
+ // express (a hand-edited or third-party drawing set), and the control then says so and takes only
219
+ // the rest. Instructor narrating "all three at once" over a button reading "Add the 2 usable
220
+ // values" would contradict what the user is looking at.
221
+ why: 'Add one criterion at a time, or every usable one at once — the fastest way to build a filter from an element you can already see.',
145
222
  });
146
223
 
147
224
  def('filter.pan-zoom', {
@@ -622,6 +622,48 @@
622
622
  why: 'Your terminal AI compares it with what is already here and tells you what changed.',
623
623
  });
624
624
 
625
+ def('shell.revision-filter-open', {
626
+ label: 'Open Drawing Filter',
627
+ actsOn: 'Moves focus to the next required Drawing Filter action for this drawing read',
628
+ group: 'In the project workspace',
629
+ persistence: 'none',
630
+ interaction: 'instant',
631
+ risk: [],
632
+ guidance: 'on-demand',
633
+ why: 'The drawing read is paused until you review the selected lines and press Save filter.',
634
+ });
635
+
636
+ def('shell.revision-request-copy', {
637
+ label: 'Copy drawing-read request',
638
+ actsOn: 'Copies the waiting drawing-read instruction for your terminal AI',
639
+ group: 'In the project workspace',
640
+ persistence: 'none',
641
+ interaction: 'instant',
642
+ risk: [],
643
+ guidance: 'on-demand',
644
+ });
645
+
646
+ def('shell.revision-review-open', {
647
+ label: 'Review drawing changes',
648
+ actsOn: 'Opens the completed drawing read so you can choose what may change',
649
+ group: 'In the project workspace',
650
+ persistence: 'none',
651
+ interaction: 'dialog',
652
+ risk: [],
653
+ guidance: 'on-demand',
654
+ });
655
+
656
+ def('shell.revision-failure-dismiss', {
657
+ label: 'Dismiss failed drawing read',
658
+ actsOn: 'Removes this failed drawing-read request from the project workspace',
659
+ group: 'In the project workspace',
660
+ persistence: 'working',
661
+ interaction: 'instant',
662
+ risk: ['destructive'],
663
+ guidance: 'on-demand',
664
+ why: 'The failed read has no review to keep; attach the drawing set again when you are ready to retry.',
665
+ });
666
+
625
667
  def('shell.add-knowledge', {
626
668
  label: 'Add knowledge',
627
669
  actsOn: 'Adds a document to this project’s knowledge',
@@ -676,11 +718,56 @@
676
718
  why: 'An answer outlives the run that wrote it, so a question asked once stays readable here instead of scrolling away in the terminal.',
677
719
  });
678
720
 
721
+ def('shell.requests-open', {
722
+ label: 'Open Requests', actsOn: 'Opens the requests waiting for your terminal AI',
723
+ group: 'In the footer', persistence: 'none', interaction: 'dialog', risk: [], guidance: 'on-demand',
724
+ });
725
+
679
726
  def('shell.requests-run', {
680
- label: 'Run this request', actsOn: 'Starts this queued request headlessly in the selected terminal AI',
727
+ label: 'Start this request automatically', actsOn: 'Starts {instance} automatically in the selected terminal AI',
681
728
  group: 'In the requests list', persistence: 'external', interaction: 'instant', risk: ['costs-time'], guidance: 'on-demand',
682
729
  });
683
730
 
731
+ def('shell.requests-stop', {
732
+ label: 'Stop this run', actsOn: 'Stops the terminal AI currently working on {instance}',
733
+ group: 'In the requests list', persistence: 'external', interaction: 'instant', risk: ['destructive'], guidance: 'on-demand',
734
+ });
735
+
736
+ def('shell.requests-copy', {
737
+ label: 'Copy this request', actsOn: 'Copies {instance} so you can paste it into your terminal AI',
738
+ group: 'In the requests list', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
739
+ });
740
+
741
+ def('shell.requests-clear', {
742
+ label: 'Clear this request', actsOn: 'Removes {instance} from the list',
743
+ group: 'In the requests list', persistence: 'local', interaction: 'instant', risk: ['destructive'], guidance: 'on-demand',
744
+ });
745
+
746
+ def('shell.requests-technical', {
747
+ label: 'Show technical instructions', actsOn: 'Expands the exact terminal-AI handoff for {instance}',
748
+ group: 'In the requests list', persistence: 'none', interaction: 'mode', risk: [], guidance: 'on-demand',
749
+ });
750
+
751
+ def('shell.requests-desktop-open', {
752
+ label: 'Open in desktop AI', actsOn: 'Opens this exact request recovery in {instance}',
753
+ group: 'In the requests list', persistence: 'external', interaction: 'dialog', risk: ['costs-time'], guidance: 'on-demand',
754
+ });
755
+
756
+ def('shell.requests-desktop-release', {
757
+ label: 'Release desktop recovery', actsOn: 'Releases the desktop claim for {instance}',
758
+ group: 'In the requests list', persistence: 'external', interaction: 'dialog', risk: ['destructive'], guidance: 'on-demand',
759
+ });
760
+
761
+ def('shell.requests-handoff-copy', {
762
+ label: 'Copy desktop handoff', actsOn: 'Copies the exact desktop recovery handoff for {instance}',
763
+ group: 'In the requests list', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
764
+ });
765
+
766
+ def('shell.requests-resume-copy', {
767
+ label: 'Copy terminal fallback', actsOn: 'Copies the exact terminal resume command for {instance}',
768
+ group: 'In the requests list', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
769
+ });
770
+
684
771
  def('shell.requests-runtime', {
685
772
  label: 'Which terminal AI', actsOn: 'Chooses the terminal AI used for this queued request',
686
773
  group: 'In the run request dialog', persistence: 'none', interaction: 'dialog', risk: [], guidance: 'on-demand',
@@ -1069,19 +1156,19 @@
1069
1156
  });
1070
1157
 
1071
1158
  def('shell.request-clear', {
1072
- label: 'Clear the requests',
1073
- actsOn: 'Empties the list',
1159
+ label: 'Clear available requests',
1160
+ actsOn: 'Removes visible requests that are ready to clear and keeps running or saved sessions',
1074
1161
  group: 'In the requests list',
1075
1162
  persistence: 'local',
1076
1163
  interaction: 'instant',
1077
1164
  risk: ['destructive'],
1078
1165
  guidance: 'on-demand',
1079
- why: 'The record of what you asked for is gone — the work it produced is not.',
1166
+ why: 'Only removable request records are cleared. Running work and sessions saved to continue stay in the list.',
1080
1167
  });
1081
1168
 
1082
1169
  def('shell.request-copy', {
1083
- label: 'Copy the requests',
1084
- actsOn: 'Puts the list on your clipboard',
1170
+ label: 'Copy available requests',
1171
+ actsOn: 'Copies only visible requests that are still ready for terminal handoff and reports anything skipped',
1085
1172
  group: 'In the requests list',
1086
1173
  persistence: 'none',
1087
1174
  interaction: 'instant',
@@ -1132,7 +1219,7 @@
1132
1219
  });
1133
1220
 
1134
1221
  def('shell.request-help-keep', {
1135
- label: 'Keep the request',
1222
+ label: 'Leave in Requests',
1136
1223
  actsOn: 'Leaves it in the list for later',
1137
1224
  group: 'In the requests list',
1138
1225
  persistence: 'local',
@@ -1142,7 +1229,7 @@
1142
1229
  });
1143
1230
 
1144
1231
  def('shell.request-help-open', {
1145
- label: 'Open the request',
1232
+ label: 'View request details',
1146
1233
  actsOn: 'Shows the request in full',
1147
1234
  group: 'In the requests list',
1148
1235
  persistence: 'none',
@@ -1152,14 +1239,14 @@
1152
1239
  });
1153
1240
 
1154
1241
  def('shell.request-help-run', {
1155
- label: 'Run the request',
1156
- actsOn: 'Hands the request to your terminal AI',
1242
+ label: 'Start automatically',
1243
+ actsOn: 'Starts the request in your selected terminal AI and project folder',
1157
1244
  group: 'In the requests list',
1158
1245
  persistence: 'external',
1159
1246
  interaction: 'instant',
1160
1247
  risk: ['costs-time'],
1161
1248
  guidance: 'on-demand',
1162
- why: 'Opens your AI terminal in the project folder and pastes the request in.',
1249
+ why: 'Runs the mechanical handoff unattended on this machine; the Requests row reports progress.',
1163
1250
  });
1164
1251
 
1165
1252
  def('shell.request-help-options', {
@@ -28,8 +28,9 @@
28
28
  Note what is NOT here: modifier legends (Shift=straight, Alt=no snap), live
29
29
  counts, and axis-lock state. Those are affordance detail about the surface,
30
30
  not narration of the command's step, and they stay beside the surface that
31
- owns them. The producer appends the cancel route, so "Esc to cancel" is not
32
- repeated on 28 entries.
31
+ owns them. The producer appends the escape route, so "Esc to cancel" is not
32
+ repeated on 28 entries — a command whose Esc does something else names it once
33
+ with `escLabel`.
33
34
  ────────────────────────────────────────────────────────────────────────── */
34
35
  (function () {
35
36
  'use strict';
@@ -102,7 +103,7 @@
102
103
  risk: [],
103
104
  guidance: 'active-command',
104
105
  steps: ['Click the base point', 'Click the destination'],
105
- why: 'Type a distance after the base pick for an exact value instead of clicking.',
106
+ why: 'Type a distance after the base pick for an exact value instead of clicking. Moving a member re-checks the connections on it: one whose supporting member has moved away is removed, and one that now frames into a different member is re-seated onto it — the editor says which.',
106
107
  });
107
108
 
108
109
  def('steel.copy', {
@@ -161,7 +162,7 @@
161
162
  risk: [],
162
163
  guidance: 'active-command',
163
164
  steps: ['Click the target member, segment or grid line'],
164
- why: 'Each selected member’s nearer end moves to where it meets the target. Braces are skipped — their work point must stay on the column centreline.',
165
+ why: 'Each selected member’s nearer end moves to where it meets the target. Braces are skipped — their work point must stay on the column centreline. Moving a member re-checks the connections on it: one whose supporting member has moved away is removed, and one that now frames into a different member is re-seated onto it — the editor says which.',
165
166
  });
166
167
 
167
168
  def('steel.split', {
@@ -319,6 +320,23 @@
319
320
  steps: ['Click the framing level to trim the base to'],
320
321
  });
321
322
 
323
+ def('steel.connection-members', {
324
+ label: 'Name the members this connection joins',
325
+ actsOn: 'Records which steel an imported connection sits on, so you are told when that steel moves',
326
+ group: 'On the steel canvas',
327
+ persistence: 'working',
328
+ interaction: 'mode',
329
+ risk: [],
330
+ guidance: 'active-command',
331
+ // Esc SKIPS: the geometry is already placed by the time this pick is armed, so it commits the
332
+ // connection with no members named rather than undoing anything.
333
+ escLabel: 'Esc to skip',
334
+ steps: [
335
+ 'Click each member this connection joins, then press Enter',
336
+ 'Press Enter to confirm, or keep clicking to add and remove members',
337
+ ],
338
+ });
339
+
322
340
  def('steel.insert-detail', {
323
341
  label: 'Place a detail',
324
342
  actsOn: 'Places the chosen detail where you click',
@@ -734,7 +752,7 @@
734
752
  interaction: 'dialog',
735
753
  risk: [],
736
754
  guidance: 'on-demand',
737
- why: 'Asks for the destination level instead of two clicks, so the members land at an exact elevation.',
755
+ why: 'Asks for the destination level instead of two clicks, so the members land at an exact elevation. Moving a member re-checks the connections on it: one whose supporting member has moved away is removed, and one that now frames into a different member is re-seated onto it — the editor says which.',
738
756
  });
739
757
 
740
758
  def('steel.copy-to-level', {
@@ -756,7 +774,7 @@
756
774
  interaction: 'instant',
757
775
  risk: [],
758
776
  guidance: 'on-demand',
759
- why: 'Off by default so a member cannot be nudged by accident — a click only selects. The Move and Copy tools work either way.',
777
+ why: 'Off by default so a member cannot be nudged by accident — a click only selects. The Move and Copy tools work either way. Moving a member re-checks the connections on it: one whose supporting member has moved away is removed, and one that now frames into a different member is re-seated onto it — the editor says which.',
760
778
  });
761
779
 
762
780
  /* ── the ⋯ menu ─────────────────────────────────────────────────────────────
@@ -879,13 +897,13 @@
879
897
 
880
898
  def('steel.position-gizmo', {
881
899
  label: 'Position handle',
882
- actsOn: 'Shows a drag handle on the selected member for setting its Profile Position in 3D',
900
+ actsOn: 'Shows a drag handle on the selected member for moving it and rolling its section in 3D',
883
901
  group: 'In the ⋯ menu — Display',
884
902
  persistence: 'local',
885
903
  interaction: 'instant',
886
- risk: [],
904
+ risk: [], // the toggle only SHOWS the handle; the consequence of dragging one is narrated in `why`, where a reader can act on it. `risk` is a closed vocabulary describing this command's own act.
887
905
  guidance: 'on-demand',
888
- why: 'Turns on a Tekla-style handle at the selected member’s start point: drag the blue arrow to set the depth offset, the green arrow to set the width offset, and the red arc to set the rotation — all read in the Edit frame shown above Profile Position, the same values the Inspect panel sets, here by hand in the 3D view. Double-click a handle to type an exact value instead (it bypasses the snap). The handle works whatever coordinate system is active, and it hides the coordinate-system gizmo while it is up (and vice-versa) so their blue/green axes never clash. The reference line never moves; ¼" and 5° snaps apply unless you hold Shift, and Esc cancels a drag.',
906
+ why: 'Turns on a Tekla-style handle at the selected member’s start point. Five of its six grips MOVE THE MEMBER, and one turns its section. The three arrows translate the whole reference line — both work points together, so the length and the direction never change: blue along the section’s depth axis, green along its width axis, red along the member’s own axis. The two arcs re-aim it: the blue arc swings it in plan about its start point and the green arc tilts it up or down, and in both only the far end moves. The red arc rolls the section about the reference line, which is the Rotation the Inspect panel shows, read in the Edit frame named above Profile Position. Because every grip but the roll moves the member, the connections framing into it are re-checked when you let go: one whose supporting member has moved away is removed, one that now frames into a different valid member is re-seated, and you are told in plain English which. A column offers no swing, because a column stays plumb, and neither does a member that is already plumb — there is no direction to swing it from. The two Profile Position offsets — how far the profile sits off its own reference line — are set in the Inspect panel, not dragged; when one is set, a faint line from the amber start point to the section shows it. Double-click any grip to type an exact value instead (it bypasses the snap, but not the geometry — a typed angle that would swing the member through plumb is refused rather than quietly rewritten). The handle works whatever coordinate system is active, and it hides the coordinate-system gizmo while it is up (and vice-versa) so their blue/green axes never clash. ¼" and 5° snaps apply unless you hold Shift, and Esc cancels a drag.',
889
907
  });
890
908
 
891
909
  def('steel.show-property-labels', {
@@ -1855,7 +1873,17 @@
1855
1873
  def('steel.connection-delete', { label: 'Delete connection', actsOn: 'Removes the selected connection from the model', group: 'In the Inspect panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The member stays in place, and Undo restores the connection.' });
1856
1874
  def('steel.connection-favourite', { label: 'Save to Favourites', actsOn: 'Saves or edits the selected connection as a reusable favourite', group: 'In the Inspect panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
1857
1875
  def('steel.connection-edit-member', { label: 'Edit connection parameters', actsOn: 'Selects the parent member where the connection parameters live', group: 'In the Inspect panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
1876
+ def('steel.connection-sign-off', { label: 'Mark connection reviewed', actsOn: 'Records that this imported connection was checked against the steel it sits on now', group: 'In the Inspect panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'This is a sign-off record rather than a model edit, so Ctrl+Z will not undo it — use Reopen review instead. It is refused if the model changed while it was being saved.' });
1877
+ def('steel.connection-reopen', { label: 'Reopen connection review', actsOn: 'Clears the sign-off so this connection asks to be checked again', group: 'In the Inspect panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'It is offered only on a connection someone actually signed off, and like the sign-off it is a record rather than a model edit, so Ctrl+Z will not undo it.' });
1878
+ // ONE step, and an Esc that is true of it. This narrates the CROSSHAIR only: once the point is
1879
+ // accepted, `steel.connection-members` takes over and already owns "click each member … Esc to skip".
1880
+ // The first cut claimed both stages, so it promised two steps it never reached and an escLabel that
1881
+ // was false where it was shown — at the crosshair, Esc cancels and nothing has moved. (Found by review.)
1882
+ def('steel.connection-replace', { label: 'Place connection again', actsOn: 'Re-places this imported connection so what it joins can be recorded afresh', group: 'In the Inspect panel', persistence: 'working', interaction: 'mode', risk: [], guidance: 'active-command', steps: ['Click where the connection should sit'], escLabel: 'Esc cancels — nothing moves', why: 'This is the only way to start watching a connection that is not being watched. It stops being watched the moment it moves and starts again only once the members are named, so a re-placement that goes wrong leaves it unwatched rather than wrongly reported as checked.' });
1858
1883
  def('steel.connections-delete', { label: 'Delete connections', actsOn: 'Removes every selected connection from the model', group: 'In the Inspect panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Their parent members remain. Undo restores the whole selection.' });
1884
+ def('steel.review-list', { label: 'Connections needing review', actsOn: 'Lists the imported connections whose steel has moved since they were placed', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Listing them changes nothing in the model; picking one selects the steel it is watching.' });
1885
+ def('steel.untracked-list', { label: 'Connections not being watched', actsOn: 'Lists the imported connections that are not being watched for moved steel', group: 'In the steel editor header', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Every connection placed before this feature existed is untracked. It is not a fault.' });
1886
+ def('steel.review-select', { label: 'Select this connection', actsOn: 'Selects {instance} from the review list', group: 'In the review list', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'A watched connection selects the members it watches; an unwatched one opens the 3D view and selects the connection itself.' });
1859
1887
  def('steel.connection-part-back', { label: 'Back to connection', actsOn: 'Selects the whole connection that owns this part', group: 'In the Inspect panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
1860
1888
  def('steel.connection-part-edit', { label: 'Edit on parent member', actsOn: 'Selects the member that owns this connection part', group: 'In the Inspect panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
1861
1889
  def('steel.quick-dimension-place', { label: 'Place spacing dimensions', actsOn: 'Arms a running dimension row for the current selection', group: 'In the Inspect panel', persistence: 'working', interaction: 'mode', risk: [], guidance: 'active-command', steps: ['Click where the spacing dimension row should sit'], why: 'The dimensions stay attached to the selected members or grid lines.' });
@@ -178,6 +178,10 @@
178
178
  risk: meta.risk || [],
179
179
  guidance: meta.guidance,
180
180
  steps: meta.steps || null,
181
+ // How you LEAVE this command. Defaulted by the narrators to 'Esc to cancel', which is right for
182
+ // every command that can be abandoned — but wrong, and misleading, for one whose Esc still
183
+ // commits something. A command that escapes differently says so once, here.
184
+ escLabel: meta.escLabel || null,
181
185
  why: meta.why || null,
182
186
  surface: currentSurface,
183
187
  tier: tierOf(meta),
@@ -0,0 +1,120 @@
1
+ /*
2
+ * connection-review-client.js — the client's review watermark: how one observation of the review state
3
+ * is ordered against the one already on screen, and when a refresh cycle is allowed to stop.
4
+ *
5
+ * WHY THIS IS A MODULE AND NOT INLINE IN steel-editor.html
6
+ * Because it is the part that was got wrong repeatedly, and inline code in that file cannot be unit
7
+ * tested. Five successive drafts of this rule shipped a hole during plan review, every one of them the
8
+ * same shape: someone enumerated the cases they could picture and a real one fell through. Pulling the
9
+ * decision out as a pure function makes the totality of it assertable, which is the only thing that
10
+ * actually stops the sixth hole.
11
+ *
12
+ * THE STATE BEING ORDERED IS A PAIR, NOT A COUNTER
13
+ * `reviewRevision` alone cannot order a summary. It moves only when the sidecar rows change
14
+ * (server/connection-review-transition.ts), while the summary is derived from live geometry — so an
15
+ * ordinary member move changes what the summary SAYS without moving the revision at all. Two different
16
+ * summaries can both be revision R. The identity of an observation is therefore the pair
17
+ * (storeRevision, reviewRevision), and ordering is a partial order over that pair, not a comparison.
18
+ */
19
+
20
+ /**
21
+ * One observation's identity. Both axes, always — see the header for why the revision alone cannot order.
22
+ * @typedef {{ storeRevision: number, reviewRevision: number }} ReviewAt
23
+ * @typedef {'equal' | 'advancing' | 'dominated' | 'incomparable'} ReviewShape
24
+ * @typedef {{ state: 'pending' | 'normal' | 'unavailable', retry: boolean, nextCycleBounds: ReviewAt | null }} CycleOutcome
25
+ */
26
+
27
+ /** The server's "could not derive this at all" sentinel. Never an ordinary generation. */
28
+ export const REVIEW_UNAVAILABLE_REVISION = -1;
29
+
30
+ /**
31
+ * How many fetches one dirty cycle may spend before it must conclude something.
32
+ *
33
+ * TWO, and the exact number matters less than the fact that there IS one. An earlier design said "keep
34
+ * trailing until the bounds are satisfied", which is only as terminal as the last enumeration of ways
35
+ * bounds can fail to be satisfied — and three review rounds each found a new one (a retained watermark
36
+ * under the -1 sentinel, a dominated pair after a lost sidecar, an equal pair below a raised bound).
37
+ * A counter is terminal by construction and does not care which of those it is looking at.
38
+ */
39
+ export const REVIEW_MAX_ATTEMPTS = 2;
40
+
41
+ /**
42
+ * True only for the derivation-failure sentinel. Revision 0 is a REAL generation — an empty sidecar.
43
+ * @param {number} reviewRevision
44
+ * @returns {boolean}
45
+ */
46
+ export function isUnavailableRevision(reviewRevision) {
47
+ return reviewRevision === REVIEW_UNAVAILABLE_REVISION;
48
+ }
49
+
50
+ const sign = (n) => (n < 0 ? -1 : n > 0 ? 1 : 0);
51
+
52
+ /**
53
+ * Classify an incoming pair against the one currently held. TOTAL over both axes.
54
+ *
55
+ * The nine (ds, dr) sign combinations partition completely into four shapes, so there is no fifth to
56
+ * discover later:
57
+ *
58
+ * equal (0,0) the same observation — common, because a quiet reconnect returns it
59
+ * advancing neither negative, at least one positive
60
+ * dominated neither positive, at least one negative (ONE OR BOTH axes lower)
61
+ * incomparable (+,-) and (-,+) one axis forward, the other back
62
+ *
63
+ * `dominated` is not hypothetical and is not announced by the -1 sentinel: readReviewFile answers an
64
+ * absent, unreadable or invalid sidecar with a VALID empty generation at revision 0 rather than throwing,
65
+ * so a client holding (S,R5) that loses its sidecar simply starts seeing (S,R0).
66
+ *
67
+ * @param {ReviewAt} incoming
68
+ * @param {ReviewAt} held
69
+ * @returns {ReviewShape}
70
+ */
71
+ export function classifyReviewPair(incoming, held) {
72
+ const ds = sign(incoming.storeRevision - held.storeRevision);
73
+ const dr = sign(incoming.reviewRevision - held.reviewRevision);
74
+ if (ds === 0 && dr === 0) return 'equal';
75
+ if (ds >= 0 && dr >= 0) return 'advancing';
76
+ if (ds <= 0 && dr <= 0) return 'dominated';
77
+ return 'incomparable';
78
+ }
79
+
80
+ /**
81
+ * Does `pair` reach the lower bounds a cycle captured? Both axes, or it has not caught up.
82
+ * @param {ReviewAt} pair
83
+ * @param {ReviewAt} bounds
84
+ * @returns {boolean}
85
+ */
86
+ export function satisfiesBounds(pair, bounds) {
87
+ return pair.storeRevision >= bounds.storeRevision && pair.reviewRevision >= bounds.reviewRevision;
88
+ }
89
+
90
+ /**
91
+ * Decide what a refresh cycle does next: retry, or conclude — and if it concludes, whether the surface
92
+ * it leaves behind is trustworthy.
93
+ *
94
+ * TWO PROPERTIES, TWO MECHANISMS, DELIBERATELY SEPARATE. Termination comes from `attempts` reaching
95
+ * REVIEW_MAX_ATTEMPTS. Not-losing-an-update comes from `arrivedAfterFinalAttempt` being handed to a
96
+ * fresh cycle instead of being cleared with this one. Every earlier draft loaded both properties onto a
97
+ * single rule and failed at one of them: first the satisfaction check (terminated only if the failure
98
+ * enumeration happened to be complete), then a bare counter (always terminated, but could silently drop
99
+ * a sign-off committed in another tab).
100
+ *
101
+ * The bounds check on settlement is what stops the second failure being invisible. A cycle that advanced
102
+ * a little but never reached its bounds has NOT caught up, and rendering its number as if it had is worse
103
+ * than admitting ignorance: nothing on screen would mark it stale, and no further trigger is guaranteed.
104
+ *
105
+ * @param {{ installed: ReviewAt, bounds: ReviewAt, attempts: number, arrivedAfterFinalAttempt?: ReviewAt | null }} input
106
+ * @returns {CycleOutcome}
107
+ */
108
+ export function settleCycle({ installed, bounds, attempts, arrivedAfterFinalAttempt = null }) {
109
+ if (attempts < REVIEW_MAX_ATTEMPTS && !satisfiesBounds(installed, bounds)) {
110
+ return { state: 'pending', retry: true, nextCycleBounds: null };
111
+ }
112
+ // A trigger that landed after the last attempt was already reading belongs to nobody yet. It must
113
+ // start its own cycle: this one cannot go back and look again, and clearing it would lose the event.
114
+ const nextCycleBounds = arrivedAfterFinalAttempt || null;
115
+ return {
116
+ state: satisfiesBounds(installed, bounds) ? 'normal' : 'unavailable',
117
+ retry: false,
118
+ nextCycleBounds,
119
+ };
120
+ }