@floless/app 0.140.0 → 0.141.1

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.
@@ -299,7 +299,7 @@
299
299
  });
300
300
 
301
301
  def('steel.apply-profile-label', {
302
- label: 'Apply profile {instance}',
302
+ label: 'Apply the {instance} profile',
303
303
  actsOn: 'Replaces the selected member’s profile with {instance}',
304
304
  group: 'On the drawing canvas',
305
305
  persistence: 'working',
@@ -1152,6 +1152,7 @@
1152
1152
  def('steel.member-end-history', {
1153
1153
  label: 'Member-end history',
1154
1154
  actsOn: '{instance} the newest member-end resolution',
1155
+ anyInstance: 'Undo or redo',
1155
1156
  group: 'In the Properties panel',
1156
1157
  persistence: 'working',
1157
1158
  interaction: 'instant',
@@ -1466,7 +1467,7 @@
1466
1467
  });
1467
1468
  def('steel.property-label-all', {
1468
1469
  label: "For all",
1469
- actsOn: "Labels every member in the view the {instance} menu edits, and turns off both selection scopes there",
1470
+ actsOn: "Labels every member in the view edited by the {instance} menu, and turns off both selection scopes there",
1470
1471
  group: "In the label menus",
1471
1472
  persistence: "working",
1472
1473
  interaction: "instant",
@@ -1475,7 +1476,7 @@
1475
1476
  });
1476
1477
  def('steel.property-label-selected', {
1477
1478
  label: "For selected",
1478
- actsOn: "Keeps labels on the members selected when turned on, in the view the {instance} menu edits",
1479
+ actsOn: "Keeps labels on the members selected when turned on, in the view edited by the {instance} menu",
1479
1480
  group: "In the label menus",
1480
1481
  persistence: "working",
1481
1482
  interaction: "instant",
@@ -1485,7 +1486,7 @@
1485
1486
  });
1486
1487
  def('steel.property-label-live', {
1487
1488
  label: "On selection",
1488
- actsOn: "Labels follow the current selection in the view the {instance} menu edits",
1489
+ actsOn: "Labels follow the current selection in the view edited by the {instance} menu",
1489
1490
  group: "In the label menus",
1490
1491
  persistence: "working",
1491
1492
  interaction: "instant",
@@ -1592,6 +1593,7 @@
1592
1593
  def('steel.toolbar-menu', {
1593
1594
  label: 'Toolbar menu',
1594
1595
  actsOn: 'Opens the {instance} options',
1596
+ anyInstance: 'toolbar menu’s',
1595
1597
  group: 'In the 3D toolbar',
1596
1598
  persistence: 'none',
1597
1599
  interaction: 'instant',
@@ -1604,6 +1606,7 @@
1604
1606
  def('steel.panel-menu', {
1605
1607
  label: 'Properties panel menu',
1606
1608
  actsOn: 'Opens the {instance} options',
1609
+ anyInstance: 'panel menu’s',
1607
1610
  group: 'In the Properties panel',
1608
1611
  persistence: 'none',
1609
1612
  interaction: 'instant',
@@ -1673,6 +1676,7 @@
1673
1676
  def('steel.view-cut-depth', {
1674
1677
  label: 'Cut depth',
1675
1678
  actsOn: 'Sets the {instance} depth of the view’s cut',
1679
+ anyInstance: 'chosen',
1676
1680
  group: 'In the Properties panel',
1677
1681
  persistence: 'working',
1678
1682
  interaction: 'instant',
@@ -1755,6 +1759,7 @@
1755
1759
  def('steel.view-direction', {
1756
1760
  label: 'Look direction',
1757
1761
  actsOn: 'Aims the section toward {instance} world X or Y',
1762
+ anyInstance: 'the direction you pick along',
1758
1763
  group: 'In the Generate views dialog',
1759
1764
  persistence: 'none',
1760
1765
  interaction: 'instant',
@@ -1765,6 +1770,7 @@
1765
1770
  def('steel.view-depth', {
1766
1771
  label: 'View depth',
1767
1772
  actsOn: 'Sets how far {instance} of the grid line the view reaches',
1773
+ anyInstance: 'ahead or behind',
1768
1774
  group: 'In the Generate views dialog',
1769
1775
  persistence: 'none',
1770
1776
  interaction: 'instant',
@@ -1876,6 +1882,7 @@
1876
1882
  def('steel.reference-select-all', {
1877
1883
  label: 'Select or clear all',
1878
1884
  actsOn: 'Ticks or unticks every {instance}',
1885
+ anyInstance: 'storey or type',
1879
1886
  group: 'In the reference-model dialogs',
1880
1887
  persistence: 'none',
1881
1888
  interaction: 'instant',
@@ -2117,7 +2124,7 @@
2117
2124
 
2118
2125
  def('steel.overwrite-save', { label: 'Overwrite and save', actsOn: 'Replaces the newer saved model with the version open here', group: 'In the steel editor dialogs', persistence: 'working', interaction: 'instant', risk: ['destructive'], guidance: 'on-demand', why: 'Only appears after a save conflict and asks for confirmation before the other saved version is replaced.' });
2119
2126
  def('steel.dimension-end-style', { label: 'Dimension end style', actsOn: 'Draws dimension ends as {instance}', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2120
- def('steel.dimension-label-position', { label: 'Dimension label position', actsOn: 'Places dimension text {instance}', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2127
+ def('steel.dimension-label-position', { label: 'Dimension label position', actsOn: 'Places dimension text {instance}', anyInstance: 'above or on the line', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2121
2128
  def('steel.dimension-label-background', { label: 'Label background', actsOn: 'Shows or hides the filled chip behind dimension text', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'With it off, a halo keeps the text readable while leaving more of the drawing visible.' });
2122
2129
  def('steel.dimension-clear-overrides', { label: 'Follow defaults again', actsOn: 'Removes every per-dimension style on this sheet', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Only appears when one or more dimensions override the shared defaults. Undo restores those overrides.' });
2123
2130
  def('steel.grid-level-visibility', { label: 'Level visibility', actsOn: 'Shows or hides the 3D grid for {instance}', group: 'In the grid panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
@@ -2136,13 +2143,13 @@
2136
2143
  def('steel.catalog-material', { label: 'Material choice', actsOn: 'Stages {instance} and shows its provider facts before anything is applied', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The model stays unchanged until Apply is pressed.' });
2137
2144
  def('steel.catalog-material-default', { label: 'Use profile default', actsOn: 'Stages omission of an explicit grade so each member follows its profile', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The model stays unchanged until the choice is applied.' });
2138
2145
  def('steel.catalog-material-current', { label: 'Keep current material', actsOn: 'Stages the project material that is not present in this provider catalog', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2139
- def('steel.catalog-custom', { label: 'Custom designation', actsOn: 'Edits a catalog-independent {instance} value for this choice', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2140
- def('steel.catalog-use-custom', { label: 'Stage custom value', actsOn: 'Stages the typed {instance} designation without changing the model yet', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2146
+ def('steel.catalog-custom', { label: 'Custom designation', actsOn: 'Edits a catalog-independent {instance} value for this choice', anyInstance: 'profile or material', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2147
+ def('steel.catalog-use-custom', { label: 'Stage custom value', actsOn: 'Stages the typed {instance} designation without changing the model yet', anyInstance: 'profile or material', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2141
2148
  def('steel.catalog-apply', { label: 'Apply catalog choice', actsOn: 'Writes {instance} to the member scope named at the top of this picker', group: 'In the steel editor dialogs', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2142
2149
  def('steel.catalog-cancel', { label: 'Cancel catalog choice', actsOn: 'Closes the picker and leaves the model unchanged', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2143
- def('steel.catalog-clear-search', { label: 'Clear catalog search', actsOn: 'Restores every available {instance} row in this picker', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2144
- def('steel.catalog-retry', { label: 'Retry catalog load', actsOn: 'Requests the {instance} provider again after a load failure', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2145
- def('steel.catalog-show-more', { label: 'Show more catalog rows', actsOn: 'Reveals the next page of matching {instance}', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2150
+ def('steel.catalog-clear-search', { label: 'Clear catalog search', actsOn: 'Restores every available {instance} row in this picker', anyInstance: 'catalog', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2151
+ def('steel.catalog-retry', { label: 'Retry catalog load', actsOn: 'Retries the {instance} provider after a load failure', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2152
+ def('steel.catalog-show-more', { label: 'Show more catalog rows', actsOn: 'Reveals the next page of matching {instance}', anyInstance: 'profiles', group: 'In the steel editor dialogs', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2146
2153
  def('steel.detail-placement-coordinate', { label: 'Detail coordinate', actsOn: 'Moves the selected reference detail along {instance}', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2147
2154
  def('steel.detail-placement-rotation', { label: 'Detail rotation', actsOn: 'Rotates the selected reference detail on its image plane', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2148
2155
  def('steel.detail-placement-size', { label: 'Detail size', actsOn: 'Sets the displayed size of the selected reference detail', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The placed image is reference-only; changing its size does not build steel.' });
@@ -2243,7 +2250,7 @@
2243
2250
  def('steel.selection-material', { label: 'Material grade', actsOn: 'Sets one material on every selected member', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2244
2251
  def('steel.selection-verified', { label: 'Verify selected members', actsOn: 'Marks or unmarks every selected member as human-confirmed', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Human confirmation contributes full confidence but does not invent a missing AISC size.' });
2245
2252
  def('steel.ends-swap', { label: 'Swap start and end', actsOn: 'Reverses the eligible selected beam members', group: 'In the Properties panel', key: 'Also: P', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Columns stay base-to-top, and braces use their separate lower-end display control.' });
2246
- def('steel.quick-dimension-anchor', { label: 'Spacing point', actsOn: 'Measures each selected beam at its {instance}', group: 'In the Properties panel', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
2253
+ def('steel.quick-dimension-anchor', { label: 'Spacing point', actsOn: 'Measures each selected beam at its {instance}', anyInstance: 'start, middle or end', group: 'In the Properties panel', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
2247
2254
  def('steel.members-delete', { label: 'Delete selected members', actsOn: 'Removes every selected member from this sheet', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Undo restores the members and their presentation references.' });
2248
2255
  def('steel.member-delete', { label: 'Delete member', actsOn: 'Removes the selected member from this sheet', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Undo restores the member and its presentation references.' });
2249
2256
  def('steel.detail-preview', { label: 'Open detail', actsOn: 'Shows the detail image assigned to {instance}', group: 'In the Properties panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
@@ -2259,7 +2266,7 @@
2259
2266
  def('steel.connection-stiffener', { label: 'Opposite stiffener', actsOn: 'Adds or removes the opposite support stiffener for {instance}', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2260
2267
  def('steel.connection-end-remove', { label: 'Remove end connection', actsOn: 'Deletes the plate connection at {instance}', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The member stays, and Undo restores the connection.' });
2261
2268
  def('steel.brace-type', { label: 'Brace type', actsOn: 'Draws the brace as {instance}', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Lateral uses the true work points; vertical can carry a display offset.' });
2262
- def('steel.brace-position', { label: 'Brace position', actsOn: 'Draws the brace {instance}', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'This changes the 2D symbol only; the member geometry does not move.' });
2269
+ def('steel.brace-position', { label: 'Brace position', actsOn: 'Draws the brace {instance}', anyInstance: 'above or below the floor', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'This changes the 2D symbol only; the member geometry does not move.' });
2263
2270
  def('steel.brace-offset', { label: 'Brace offset', actsOn: 'Offsets the brace symbol from its work-point line', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The steel itself never moves; this is a display-only plan offset.' });
2264
2271
  def('steel.brace-offset-flip', { label: 'Flip brace offset', actsOn: 'Draws the brace symbol on the opposite side of its work-point line', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2265
2272
  def('steel.brace-lower-end-swap', { label: 'Swap lower brace end', actsOn: 'Moves the double arrowhead to the opposite brace end', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Display only — neither work point nor elevation changes.' });
@@ -2273,11 +2280,11 @@
2273
2280
  def('steel.properties-pin', { label: 'Pin Properties', actsOn: 'Keeps the Properties popup open while the selection changes', group: 'In the Properties popup', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2274
2281
  def('steel.properties-clear', { label: 'Clear all properties', actsOn: 'Unchecks every property label', group: 'In the Properties popup', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Visibility can remain on with no property selected; no labels are drawn in that state.' });
2275
2282
  def('steel.properties-search', { label: 'Search properties', actsOn: 'Filters the property rows by name', group: 'In the Properties popup', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
2276
- def('steel.properties-placement', { label: 'Property label placement', actsOn: 'Anchors property labels at the member {instance}', group: 'In the Properties popup', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2283
+ def('steel.properties-placement', { label: 'Property label placement', actsOn: 'Anchors property labels at the member {instance}', anyInstance: 'start, middle or end', group: 'In the Properties popup', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2277
2284
  def('steel.property-label', { label: 'Property label', actsOn: 'Shows or hides the label for {instance}', group: 'In the Properties popup', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand' });
2278
2285
  def('steel.snap-override', { label: 'Snap override', actsOn: 'Restricts the current pick to {instance}', group: 'In the snap override menu', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The override clears when the current operation ends; running snap settings are unchanged.' });
2279
2286
  def('steel.dimension-value', { label: 'Dimension value', actsOn: 'Sets the selected dimension to a typed length', group: 'In the dimension value popup', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'Which linked end moves is controlled by the left and right buttons beside the value.' });
2280
- def('steel.dimension-driven-end', { label: 'Driven dimension end', actsOn: 'Lets the typed dimension value move the {instance}', group: 'In the dimension value popup', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'At least one end always remains selected; enabling both moves them symmetrically.' });
2287
+ def('steel.dimension-driven-end', { label: 'Driven dimension end', actsOn: 'Lets the typed dimension value move the {instance}', anyInstance: 'left or right end', group: 'In the dimension value popup', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'At least one end always remains selected; enabling both moves them symmetrically.' });
2281
2288
  def('steel.selection-type-filter', { label: 'Selection type', actsOn: 'Allows or blocks selecting {instance}', group: 'In the selection filter', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
2282
2289
  def('steel.selection-type-filter-all', { label: 'All selection types', actsOn: 'Allows or blocks every type under {instance}', group: 'In the selection filter', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
2283
2290
  def('steel.member-type', { label: 'Member type', actsOn: 'Sets the member category for {instance}', group: 'In the Properties panel', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand', why: 'The type controls role-specific editing and how the member is grouped in the legend.' });
@@ -2324,6 +2331,7 @@
2324
2331
  def('steel.position-face', {
2325
2332
  label: 'Profile position',
2326
2333
  actsOn: 'Puts the section {instance} — the work-line does not move',
2334
+ anyInstance: 'in the position you pick',
2327
2335
  group: 'In the Properties panel',
2328
2336
  persistence: 'working',
2329
2337
  interaction: 'instant',
@@ -141,6 +141,21 @@
141
141
  }
142
142
  }
143
143
 
144
+ /* anyInstance REPLACES the slot, so it must be prose, and it only means something on a
145
+ template that has a slot to fill. One on a template without `{instance}` is dead copy
146
+ that reads as if it were doing something. (#1442) */
147
+ if (meta.anyInstance != null) {
148
+ var slotted = String(meta.label || '').indexOf('{instance}') !== -1
149
+ || String(meta.actsOn || '').indexOf('{instance}') !== -1;
150
+ if (typeof meta.anyInstance !== 'string' || !meta.anyInstance.trim() || /[{}]/.test(meta.anyInstance)) {
151
+ fail(id, 'anyInstance must be a plain-English phrase with no braces');
152
+ ok = false;
153
+ } else if (!slotted) {
154
+ fail(id, 'anyInstance is set but neither label nor actsOn has an {instance} slot to fill');
155
+ ok = false;
156
+ }
157
+ }
158
+
144
159
  // A command that narrates steps must say what its steps are.
145
160
  if (meta.guidance === GUIDANCE_REQUIRING_STEPS && (!Array.isArray(meta.steps) || !meta.steps.length)) {
146
161
  fail(id, 'guidance "active-command" requires a non-empty steps array');
@@ -185,6 +200,10 @@
185
200
  // every command that can be abandoned — but wrong, and misleading, for one whose Esc still
186
201
  // commits something. A command that escapes differently says so once, here.
187
202
  escLabel: meta.escLabel || null,
203
+ // What `{instance}` reads as when no particular instance is known — the `?` sheet lists
204
+ // templates. Only for a slot "the one you pick" cannot fill (an adverb, a unit, a kind);
205
+ // instructor.js fillInstance() derives every other fallback from the words around it.
206
+ anyInstance: meta.anyInstance || null,
188
207
  why: meta.why || null,
189
208
  surface: currentSurface,
190
209
  tier: tierOf(meta),
@@ -0,0 +1,57 @@
1
+ /** A bounded, explicitly partial view for read-only Drawing Filter questions. */
2
+ export function rankFilterControls(controls, instruction, focusedControl) {
3
+ const upper = String(instruction || '').toUpperCase();
4
+ const words = upper.match(/[A-Z0-9]{3,}/g) || [];
5
+ const score = row => {
6
+ const label = String(row.label || '').toUpperCase();
7
+ const focused = focusedControl?.dimension === row.dimension
8
+ && (focusedControl.key !== undefined && (row.key !== undefined || row.value !== undefined)
9
+ ? focusedControl.key === (row.key ?? row.value)
10
+ : String(focusedControl.label).toUpperCase() === label);
11
+ return (focused ? 100 : 0)
12
+ + (label && upper.includes(label) ? 80 : 0)
13
+ + (words.some(word => label.includes(word)) ? 40 : 0)
14
+ + (/GRID|BEAM|STEL|STEEL|DIM|SECT|PROFILE|MARK/.test(label) ? 10 : 0)
15
+ + (row.checked ? 2 : 0);
16
+ };
17
+ return [...controls].sort((a, b) => score(b) - score(a));
18
+ }
19
+
20
+ export function readOnlyFilterContext(snapshot, instruction, scope) {
21
+ const facts = [
22
+ scope,
23
+ ('Current sheet: '+(snapshot.sheet || 'not loaded')+'; mode: '+(snapshot.mode || 'not loaded')+'. Checked properties must all match.').slice(0,500),
24
+ ];
25
+ const controls = snapshot.controls || [];
26
+ let represented = 0, part = '';
27
+ for (const row of controls) {
28
+ const entry = row.dimension+':'+JSON.stringify(row.label)+' '+(row.checked?'on':'off')+' ('+row.count+')'
29
+ +(row.notRead ? ' not read by FloLess and cannot be changed here' : '');
30
+ if (part && part.length + entry.length + 2 > 500) {
31
+ facts.push(part); part = '';
32
+ }
33
+ if (facts.length >= 10) break;
34
+ part += (part ? '; ' : '') + entry;
35
+ represented++;
36
+ }
37
+ if (part && facts.length < 10) facts.push(part);
38
+ const samples = snapshot.sheetTextSamples || [];
39
+ let sampleCount = 0, sampleFact = 'Text examples, not a complete read: ';
40
+ for (const row of samples) {
41
+ const entry = JSON.stringify(row.text)+' on '+JSON.stringify(row.layer)+' '+(row.selected?'selected':'excluded');
42
+ if (sampleFact.length + entry.length + 2 > 500) break;
43
+ sampleFact += (sampleCount ? '; ' : '') + entry;
44
+ sampleCount++;
45
+ }
46
+ if (sampleCount) facts.push(sampleFact);
47
+ facts.push('Partial drawing view: '+represented+' of '+(snapshot.controlTotal ?? controls.length)+' controls and '+sampleCount+' of '+(snapshot.textTotal ?? samples.length)+' text items are listed. More drawing content may exist. Do not claim a complete audit.');
48
+ return { subject:instruction, commandId:'filter.ask-ai-question', surface:'steel-filter', tone:'idle', facts };
49
+ }
50
+
51
+ /** Unsaved ticks and the current sheet are part of the Question's answer identity. */
52
+ export function filterViewFingerprint(sheet, selection) {
53
+ return JSON.stringify({ sheet, mode:selection.mode,
54
+ layers:[...selection.layers].sort(),
55
+ thicknesses:[...selection.thicknesses].sort((a,b)=>a-b),
56
+ colors:[...selection.colors].sort() });
57
+ }
@@ -0,0 +1,87 @@
1
+ import { FACET_DIMS, MODE_ORDER, canonicalMode, facetKey } from './steel-filter-core.js';
2
+
3
+ /** A not-read layer has no lines behind its checkbox, even if a duplicate row has the same key. */
4
+ export function filterAiBlockedLayerKeys(filter) {
5
+ const blocked = new Set();
6
+ for (const row of filter.layers || []) {
7
+ if (row.notRead !== true) continue;
8
+ const key = facetKey('layer', row.name);
9
+ if (key !== undefined) blocked.add(key);
10
+ }
11
+ return blocked;
12
+ }
13
+
14
+ export function filterAiTouchesUnreadLayer(proposal, filter) {
15
+ const blocked = filterAiBlockedLayerKeys(filter);
16
+ return (proposal.changes || []).some(item => item.dimension === 'layer'
17
+ && blocked.has(facetKey('layer', item.value)));
18
+ }
19
+
20
+ /** Reject malformed or contradictory suggestions before any surface presents them. */
21
+ export function parseFilterAiProposalShape(answer) {
22
+ if (typeof answer !== 'string' || answer.length > 8_000) throw new Error('AI returned a suggestion that is too large. Ask about fewer layers.');
23
+ let value;
24
+ try { value = JSON.parse(answer); }
25
+ catch { throw new Error('AI did not return a usable selection. Ask it to try again.'); }
26
+ if (!value || Array.isArray(value) || typeof value !== 'object'
27
+ || Object.keys(value).sort().join(',') !== 'changes,explanation,mode'
28
+ || typeof value.explanation !== 'string' || !value.explanation.trim() || value.explanation.length > 500
29
+ || !Array.isArray(value.changes) || value.changes.length > 30
30
+ || (value.mode !== null && (typeof value.mode !== 'string'
31
+ || !value.mode || value.mode !== canonicalMode(value.mode.split('+'))))) {
32
+ throw new Error('AI returned a suggestion this filter cannot use. Ask it to try again.');
33
+ }
34
+ const seen = new Set();
35
+ for (const item of value.changes) {
36
+ if (!item || Array.isArray(item) || typeof item !== 'object'
37
+ || Object.keys(item).sort().join(',') !== 'dimension,on,value'
38
+ || !MODE_ORDER.includes(item.dimension) || typeof item.on !== 'boolean') {
39
+ throw new Error('AI named a change this filter cannot use. Ask it to try again.');
40
+ }
41
+ if (item.dimension === 'thickness' && (typeof item.value !== 'number' || !Number.isFinite(item.value))) {
42
+ throw new Error('AI named a value that is missing from this filter. Ask it to try again.');
43
+ }
44
+ if (item.dimension !== 'thickness' && typeof item.value !== 'string') {
45
+ throw new Error('AI named a value that is missing from this filter. Ask it to try again.');
46
+ }
47
+ const key = item.value;
48
+ const canonical = facetKey(item.dimension, key);
49
+ const identity = item.dimension + '\0' + String(canonical);
50
+ if (canonical === undefined || seen.has(identity)) {
51
+ throw new Error('AI named a value that is missing from this filter. Ask it to try again.');
52
+ }
53
+ seen.add(identity);
54
+ }
55
+ return { explanation:value.explanation.trim(), changes:value.changes, mode:value.mode };
56
+ }
57
+
58
+ /**
59
+ * Accept only control values present in this filter and shown to this AI request.
60
+ * @param {string} answer
61
+ * @param {{ layers?: Array<{name:string}>, thicknesses?: Array<{w:number}>, colors?: Array<{hex:string}> }} filter
62
+ * @param {Set<string> | null} allowedControls
63
+ */
64
+ export function parseFilterAiProposal(answer, filter, allowedControls = null) {
65
+ const value = parseFilterAiProposalShape(answer);
66
+ const known = new Map();
67
+ const blockedLayers = filterAiBlockedLayerKeys(filter);
68
+ for (const dim of MODE_ORDER) {
69
+ const descriptor = FACET_DIMS[dim];
70
+ for (const row of filter[descriptor.control] || []) {
71
+ const key = facetKey(dim, row[descriptor.rowKey]);
72
+ if (key === undefined) continue;
73
+ if (dim === 'layer' && blockedLayers.has(key)) continue;
74
+ known.set(dim + '\0' + String(key), key);
75
+ }
76
+ }
77
+ const changes = [];
78
+ for (const item of value.changes) {
79
+ const canonical = facetKey(item.dimension, item.value);
80
+ const identity = item.dimension + '\0' + String(canonical);
81
+ if (!known.has(identity) || (allowedControls && !allowedControls.has(identity))) {
82
+ throw new Error('AI named a value that is missing from this filter. Ask it to try again.');
83
+ }
84
+ changes.push({ dimension:item.dimension, value:known.get(identity), on:item.on });
85
+ }
86
+ return { explanation:value.explanation, changes, mode:value.mode };
87
+ }
@@ -0,0 +1,8 @@
1
+ /* Shared front-door wording for the Drawing Filter and its review checkpoint. */
2
+ (function (root) {
3
+ 'use strict';
4
+ root.FilterGuidance = Object.freeze({
5
+ scope: 'Select steel plus the clues needed to read it: member marks, grids, dimensions, and relevant detail callouts.',
6
+ canvas: 'Bright items may be used in the read. The dim drawing is context only.',
7
+ });
8
+ })(window);
@@ -137,6 +137,12 @@
137
137
  <button id="run-btn" data-command-id="workflow.run" data-acts="Acts on the approved lock, against the live host" data-blocked-reason="Blocked until the workflow is compiled" data-tip="Run the workflow for real against the live host (uses the inputs; renders the report node in the HTML Viewer)">▶ Run workflow</button>
138
138
  <button id="stop-run-btn" class="run-stop-btn" type="button" data-command-id="workflow.stop" aria-label="Stop the current run" data-tip="Stop the in-flight run (always reachable, even with the HTML Viewer closed)" hidden>■ Stop run</button>
139
139
  </div>
140
+ <!-- The signed-in account, far right (floless.io puts its avatar menu in the same place).
141
+ Hidden until web/account-menu.js has read who is signed in. -->
142
+ <button data-command-id="shell.account-menu" id="account-btn" class="account-btn" type="button" hidden
143
+ aria-haspopup="menu" aria-expanded="false" aria-controls="account-menu" aria-label="Account menu">
144
+ <span class="account-initials" id="account-initials" aria-hidden="true"></span>
145
+ </button>
140
146
  </header>
141
147
 
142
148
  <aside class="chat combined-left-pane" id="chat-panel" data-group="In the left panel" aria-label="AI Chat and Model panel">
@@ -154,16 +160,10 @@
154
160
  <button type="button" class="left-section-close" data-left-section-close="narrative" data-command-id="shell.left-section#AI Chat" data-command-instance-label="AI Chat" aria-label="Hide AI Chat" data-tip="Hide AI Chat">×</button>
155
161
  </header>
156
162
  <div class="left-section-body narrative-section-body">
157
- <div class="ai-chat-controls" role="toolbar" aria-label="Chat controls">
163
+ <div class="ai-chat-controls">
158
164
  <span class="narrative-tabs" role="tablist" aria-label="AI Chat content">
159
165
  <button data-command-id="shell.narrative-tab" type="button" class="narrative-tab active sr-only" id="narrative-tab" role="tab" aria-selected="true" aria-controls="messages">Chat <span class="answer-unread" id="chat-unread" hidden></span></button>
160
166
  </span>
161
- <span class="ai-chat-tab-actions">
162
- <button data-command-id="shell.chat-history" type="button" class="ai-chat-icon" id="chat-history-toggle" aria-expanded="false" aria-controls="chat-history" data-tip="Conversation history" aria-label="Conversation history">☷</button>
163
- <button data-command-id="shell.chat-new" type="button" class="ai-chat-icon" id="chat-new" data-tip="New conversation" aria-label="New conversation">+</button>
164
- <button data-command-id="shell.chat-refresh" type="button" class="ai-chat-icon" id="chat-refresh" data-tip="Refresh this chat session" aria-label="Refresh this chat session">↻</button>
165
- <button data-command-id="shell.chat-settings" type="button" class="ai-chat-icon" id="chat-settings-toggle" aria-expanded="false" aria-controls="chat-settings" data-tip="Chat settings" aria-label="Chat settings">⚙</button>
166
- </span>
167
167
  </div>
168
168
  <div class="messages ai-chat-host" id="messages" role="tabpanel" aria-labelledby="narrative-tab">
169
169
  <section class="ai-chat-shell" id="ai-chat-shell" aria-label="AI Chat">
@@ -172,6 +172,13 @@
172
172
  <div class="ai-chat-title-line"><strong id="chat-title">AI Chat</strong><button data-command-id="shell.chat-rename" type="button" class="ai-chat-rename" id="chat-rename" aria-label="Rename conversation" data-tip="Rename conversation">✎</button></div>
173
173
  <span id="chat-scope">Open a project or workflow</span>
174
174
  </div>
175
+ <!-- One header row: the conversation's name on the left, its controls on the right. -->
176
+ <span class="ai-chat-tab-actions" role="toolbar" aria-label="Chat controls">
177
+ <button data-command-id="shell.chat-history" type="button" class="ai-chat-icon" id="chat-history-toggle" aria-expanded="false" aria-controls="chat-history" data-tip="Conversation history" aria-label="Conversation history">☷</button>
178
+ <button data-command-id="shell.chat-new" type="button" class="ai-chat-icon" id="chat-new" data-tip="New conversation" aria-label="New conversation">+</button>
179
+ <button data-command-id="shell.chat-refresh" type="button" class="ai-chat-icon" id="chat-refresh" data-tip="Refresh this chat session" aria-label="Refresh this chat session">↻</button>
180
+ <button data-command-id="shell.chat-settings" type="button" class="ai-chat-icon" id="chat-settings-toggle" aria-expanded="false" aria-controls="chat-settings" data-tip="Chat settings" aria-label="Chat settings">⚙</button>
181
+ </span>
175
182
  </div>
176
183
  <div class="ai-chat-settings" id="chat-settings" hidden>
177
184
  <div class="ai-chat-setting ai-chat-provider" id="chat-provider" data-tip="FloLess uses whichever account is signed in to the Claude Code or Codex CLI on this computer. Signing in to the Claude desktop app or claude.ai does not change it. Switch account signs that CLI out first, then opens a window where you sign in."><span>Provider</span><strong aria-live="polite">—</strong><button data-command-id="shell.chat-switch-account" type="button" class="ai-chat-provider-switch" id="chat-switch-account" hidden>Switch account…</button></div>
@@ -188,6 +195,9 @@
188
195
  <div class="ai-chat-picker" id="chat-picker" role="listbox" hidden></div>
189
196
  <div class="ai-chat-history" id="chat-history" hidden aria-label="Conversation history"></div>
190
197
  <div class="ai-chat-feed" id="chat-feed" tabindex="-1"></div>
198
+ <div class="ai-chat-offscreen-activity" id="chat-offscreen-activity" hidden aria-hidden="true">
199
+ <span class="ai-chat-live-dots" aria-hidden="true"><i></i><i></i><i></i></span>
200
+ </div>
191
201
  <div class="ai-chat-recovery" id="chat-recovery" hidden>
192
202
  <span id="chat-recovery-copy">FloLess needs to check the last AI response before sending another message.</span>
193
203
  <button data-command-id="shell.chat-stop" type="button" id="chat-recovery-stop">Stop response</button>
@@ -195,8 +205,16 @@
195
205
  </div>
196
206
  <div class="ai-chat-attachments" id="chat-attachments" hidden></div>
197
207
  <div class="ai-chat-skills" id="chat-skills" role="listbox" hidden></div>
208
+ <div class="ai-chat-approval-tray" id="chat-approval-tray"></div>
198
209
  <div class="ai-chat-composer" id="chat-composer">
210
+ <div class="ai-chat-tekla-context" id="chat-tekla-context" hidden></div>
199
211
  <textarea data-command-id="shell.chat-input" id="chat-input" rows="1" maxlength="131072" placeholder="Message AI…" aria-label="Message AI"></textarea>
212
+ <!-- The data-handling disclosure gets its OWN node in the composer, not a line in
213
+ #chat-compose-hint: that hint is one mutable string chosen by a priority chain,
214
+ so anything else needing the slot would silently overwrite the disclosure. This
215
+ sits in the composer's rigid grid row, so no conversation-area height can take
216
+ it away (#1501). -->
217
+ <p class="ai-chat-composer-disclosure" id="chat-composer-disclosure" hidden>Messages and attachments are sent to Claude or Codex through your account.</p>
200
218
  <div class="ai-chat-compose-actions">
201
219
  <input data-command-id="shell.chat-attach-input" id="chat-file" type="file" accept="image/png,image/jpeg,image/webp,application/pdf" multiple hidden>
202
220
  <button data-command-id="shell.chat-attach" type="button" class="ai-chat-icon" id="chat-attach" data-tip="Attach image or PDF" aria-label="Attach image or PDF">+</button>
@@ -204,7 +222,9 @@
204
222
  <button data-command-id="shell.chat-stop" type="button" class="ai-chat-stop" id="chat-stop" hidden>Stop</button>
205
223
  <button data-command-id="shell.chat-send" type="button" class="ai-chat-send" id="chat-send">Send</button>
206
224
  </div>
207
- <div class="ai-chat-compose-context" id="chat-compose-context" aria-live="polite"></div>
225
+ <!-- What goes with each message is the Send tooltip, and is read to screen readers, rather than a
226
+ line of text under the composer. -->
227
+ <div class="ai-chat-compose-context sr-only" id="chat-compose-context" aria-live="polite"></div>
208
228
  </div>
209
229
  <span class="sr-only" id="chat-status" role="status" aria-live="polite"></span>
210
230
  </section>
@@ -746,6 +766,38 @@
746
766
  <button data-command-id="shell.theme#the dark theme" class="theme-btn" data-theme="dark" data-tip="Dark">☾</button>
747
767
  </div>
748
768
  </div>
769
+ <!-- Quit sits last, below its own divider — the conventional place for it, apart from the
770
+ preferences above. Tinted as the one row that ends something; it always asks first
771
+ (web/leave-guard.js checks for unsaved work before the server is told to stop). -->
772
+ <div class="menu-divider"></div>
773
+ <button class="menu-item menu-item-danger" data-action="stop-app" data-command-id="menu.stop-app" id="menu-stop-app" role="menuitem">
774
+ <span class="menu-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 2v10"/><path d="M18.4 6.6a9 9 0 1 1-12.77.04"/></svg></span>
775
+ <span class="menu-label">Stop FloLess</span>
776
+ </button>
777
+ </div>
778
+
779
+ <!-- Account menu — the avatar at the far right of the header opens it. Mirrors floless.io's own
780
+ avatar dropdown: name, email, Profile, Settings, Sign Out. Filled in and un-hidden by
781
+ web/account-menu.js only while someone is signed in. -->
782
+ <div class="menu account-menu" id="account-menu" role="menu" aria-labelledby="account-btn" data-group="In the account menu" data-reveal-by="#account-btn">
783
+ <div class="account-id" role="presentation">
784
+ <div class="account-name" id="account-name"></div>
785
+ <div class="account-email" id="account-email"></div>
786
+ </div>
787
+ <div class="menu-divider" role="separator"></div>
788
+ <a class="menu-item" id="account-profile" data-command-id="account.profile" role="menuitem" target="_blank" rel="noopener">
789
+ <span class="menu-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg></span>
790
+ <span class="menu-label">Profile</span>
791
+ </a>
792
+ <a class="menu-item" id="account-settings" data-command-id="account.settings" role="menuitem" target="_blank" rel="noopener">
793
+ <span class="menu-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg></span>
794
+ <span class="menu-label">Settings</span>
795
+ </a>
796
+ <div class="menu-divider" role="separator"></div>
797
+ <button class="menu-item" id="account-sign-out" data-command-id="account.sign-out" role="menuitem">
798
+ <span class="menu-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" x2="9" y1="12" y2="12"/></svg></span>
799
+ <span class="menu-label">Sign Out</span>
800
+ </button>
749
801
  </div>
750
802
 
751
803
  <!-- ── The `?` command sheet ──────────────────────────────────────────────
@@ -905,9 +957,24 @@
905
957
  </div>
906
958
  <div class="project-setup-note">The standard is fixed for this project. Display units can be changed later.</div>
907
959
  </fieldset>
960
+ <!-- Which AI answers this project's conversation (#1605). The same Claude / Codex choice the
961
+ AI Chat empty state asks, with each one's own sign-in underneath; it defaults to the AI
962
+ FloLess would pick, so Create project & start chat stays one click. Hidden with that
963
+ button when no AI is installed, and for a Revit project, which starts no chat. -->
964
+ <fieldset class="project-setup-field project-setup-provider" id="project-setup-provider" hidden>
965
+ <legend class="project-setup-label">AI Chat</legend>
966
+ <div class="project-setup-provider-options">
967
+ <button type="button" data-chat-provider="claude" data-command-id="shell.project-chat-provider#Claude" aria-pressed="false">Claude</button>
968
+ <button type="button" data-chat-provider="codex" data-command-id="shell.project-chat-provider#Codex" aria-pressed="false">Codex</button>
969
+ </div>
970
+ <div class="project-setup-provider-accounts" aria-live="polite">
971
+ <span data-chat-provider-status="claude"></span>
972
+ <span data-chat-provider-status="codex"></span>
973
+ </div>
974
+ <div class="project-setup-note">This project’s conversation stays with the AI you choose here.</div>
975
+ </fieldset>
908
976
  </div>
909
977
  <div class="project-setup-storage-note">FloLess stores this project, its AI Chat history, Knowledge and project workflows in this folder. AI starts here too.</div>
910
- <div class="project-setup-chat-meta" id="project-setup-chat-meta" hidden></div>
911
978
  <div class="project-setup-error" id="project-setup-error" role="alert" aria-live="assertive" hidden></div>
912
979
  <div class="modal-actions">
913
980
  <button type="button" id="project-setup-cancel" data-command-id="shell.dialog-cancel#project setup">Cancel</button>
@@ -1020,6 +1087,27 @@
1020
1087
  </div>
1021
1088
  </div>
1022
1089
 
1090
+ <!-- "Is everything saved?" — asked before Stop FloLess and Sign Out (web/leave-guard.js). Its own
1091
+ dialog in the #confirm-modal look; lists each unsaved item in plain words. -->
1092
+ <div class="modal-backdrop" id="leave-guard-modal" role="dialog" aria-modal="true"
1093
+ aria-labelledby="leave-guard-title" aria-describedby="leave-guard-sub">
1094
+ <div class="modal leave-guard">
1095
+ <div class="modal-title" id="leave-guard-title">Stop FloLess?</div>
1096
+ <div class="modal-sub" id="leave-guard-sub"></div>
1097
+ <div class="leave-guard-unsaved" id="leave-guard-unsaved" hidden>
1098
+ <ul class="leave-guard-list" id="leave-guard-list" aria-label="Unsaved work"></ul>
1099
+ </div>
1100
+ <p class="leave-guard-note" id="leave-guard-note" role="alert" hidden></p>
1101
+ <p class="leave-guard-running" id="leave-guard-running" hidden></p>
1102
+ <div class="modal-actions">
1103
+ <button data-command-id="leave.discard" id="leave-guard-discard" class="danger" hidden>Stop without saving</button>
1104
+ <button data-command-id="shell.dialog-cancel#the stop or sign-out prompt" id="leave-guard-cancel">Cancel</button>
1105
+ <button data-command-id="leave.save" id="leave-guard-save" class="primary" hidden>Save and stop</button>
1106
+ <button data-command-id="leave.confirm" id="leave-guard-confirm" class="primary">Stop FloLess</button>
1107
+ </div>
1108
+ </div>
1109
+ </div>
1110
+
1023
1111
  <div class="modal-backdrop" id="add-fav-modal">
1024
1112
  <div class="modal">
1025
1113
  <div class="modal-title" id="add-fav-title">Save as Template</div>
@@ -1158,9 +1246,9 @@
1158
1246
  <div class="modal-title" id="request-help-title">Drawing read ready to start</div>
1159
1247
  <div class="modal-sub" id="request-help-sub" aria-live="polite">Your drawing was added to Requests, and the instructions were copied to your clipboard.</div>
1160
1248
  <div class="request-help-steps" id="request-help-steps">
1161
- <div class="request-help-step"><span>1</span><p>Open Claude Code, Codex, or OpenCode in your project folder.</p></div>
1249
+ <div class="request-help-step"><span>1</span><p>Open Claude Code or Codex in your project folder.</p></div>
1162
1250
  <div class="request-help-step"><span>2</span><p>Paste the copied request. It will read the drawing and prepare the Drawing Filter.</p></div>
1163
- <div class="request-help-step"><span>3</span><p>When it stops, open Drawing Filter, review the selected lines, then press Save filter in the top-right corner.</p></div>
1251
+ <div class="request-help-step"><span>3</span><p>When it stops, open Drawing Filter. Check steel, member marks, grids, dimensions, and relevant callouts; ask in AI Chat on the left if you are unsure. Then press Save filter in the top-right corner.</p></div>
1164
1252
  </div>
1165
1253
  <!-- Replaces the three steps above once floless has started the work itself: they describe
1166
1254
  things the user must do, and after "Run it for me" there is nothing left for them to do.
@@ -1470,12 +1558,15 @@
1470
1558
  <script src="app.js"></script>
1471
1559
  <script src="renderers.js"></script>
1472
1560
  <script src="aware-update-client.js"></script>
1561
+ <script src="leave-guard.js"></script>
1473
1562
  <script src="aware.js"></script>
1474
1563
  <script src="panels.js"></script>
1564
+ <script src="filter-guidance.js"></script>
1475
1565
  <script src="workspaces.js"></script>
1476
1566
  <script src="left-pane.js"></script>
1477
1567
  <script src="chat.js"></script>
1478
1568
  <script src="local-discovery.js"></script>
1569
+ <script src="account-menu.js"></script>
1479
1570
  <script src="commands-shell.js"></script>
1480
1571
  <!-- The steel editor's capabilities load HERE as well as in steel-editor.html, and that is
1481
1572
  deliberate: the shell is the sole guidance producer, so it must be able to resolve a