@floless/app 0.131.0 → 0.132.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.
Files changed (34) hide show
  1. package/dist/floless-server.cjs +2558 -1885
  2. package/dist/schemas/steel.model.v2.schema.json +3 -1
  3. package/dist/web/app.css +359 -0
  4. package/dist/web/app.js +22 -0
  5. package/dist/web/aware.js +62 -10
  6. package/dist/web/commands-filter.js +157 -0
  7. package/dist/web/commands-shell.js +1316 -0
  8. package/dist/web/commands-steel.js +1829 -0
  9. package/dist/web/commands-vector.js +154 -0
  10. package/dist/web/commands-vector3d.js +96 -0
  11. package/dist/web/commands.js +316 -0
  12. package/dist/web/grid-core.js +124 -23
  13. package/dist/web/index.html +269 -164
  14. package/dist/web/instructor-reporter.js +201 -0
  15. package/dist/web/instructor.js +1119 -0
  16. package/dist/web/reference-changes.js +55 -0
  17. package/dist/web/reference-geometry-worker.js +194 -0
  18. package/dist/web/steel-3d-core.js +454 -107
  19. package/dist/web/steel-3d-view.js +790 -165
  20. package/dist/web/steel-canvas-guidance.js +7 -4
  21. package/dist/web/steel-editor.html +2347 -1810
  22. package/dist/web/steel-filter-core.js +13 -5
  23. package/dist/web/steel-filter.html +36 -22
  24. package/dist/web/steel-model-adapter.js +17 -22
  25. package/dist/web/steel-model-commands.js +23 -10
  26. package/dist/web/steel-model-v2-client-validation.js +20 -3
  27. package/dist/web/steel-model-v2-commands.js +91 -3
  28. package/dist/web/steel-model-v2-projection.js +4 -5
  29. package/dist/web/steel-plan-transform.js +4 -8
  30. package/dist/web/steel-split-view.js +52 -0
  31. package/dist/web/vector-3d.html +19 -7
  32. package/dist/web/vector-editor.html +21 -8
  33. package/dist/web/workspaces.js +9 -24
  34. package/package.json +9 -1
@@ -169,7 +169,9 @@
169
169
  "role": { "enum": ["beam", "column"], "description": "Authored role. Defaults to beam when absent. NOT derived from geometry." },
170
170
  "memberType": { "type": "string", "description": "Member category driving the legend (beam, ledger, brace, …). 'brace' is excluded from every beam-only path." },
171
171
  "position": { "enum": ["top", "middle", "bottom"], "description": "Profile placement relative to the work-line — the section's depth position." },
172
- "positionH": { "enum": ["left", "middle", "right"], "description": "Profile placement ACROSS the work-line — the section's plan position, the horizontal companion to `position`. Named for where the LINE sits on the section, exactly as `position` is: left = the section's left face is on the line (so the steel is to its right), right = the mirror, middle = centred (the default, and what every member did before this field existed). Left/right are read looking from `from` to `to` with Z up — the same sense as reading the plan from above. Absent = middle. Ignored for a member with no plan direction (a plumb column or brace has no left or right) and for one with no resolved AISC designation (a CUSTOM / traced `section` box, whose section axes the viewer does not align to the plan). A width the section tables did not supply — a per-series ratio estimate — is NOT ignored: the member is already drawn and exported at that width, so flushing to the face it actually has is self-consistent, and the editor says the width is estimated." },
172
+ "positionH": { "enum": ["left", "middle", "right"], "description": "Profile placement ACROSS the work-line — the section's plan position, the horizontal companion to `position`. Named for where the LINE sits on the section, exactly as `position` is: left = the section's left face is on the line (so the steel is to its right), right = the mirror, middle = centred (the default, and what every member did before this field existed). Left/right are read looking from `from` to `to` with Z up — the same sense as reading the plan from above. Absent = middle. Ignored only when NO section dimensions resolve at all — neither an AISC designation nor a positive explicit `section` — because then there is no face to name. It is NOT ignored for a plumb column or brace: the member frame falls back to the coordinate system's own axes when the member is parallel to its normal, which is Tekla's column convention, so a plumb member has a determinate left and right after all. A width the section tables did not supply — a per-series ratio estimate — is NOT ignored: the member is already drawn and exported at that width, so flushing to the face it actually has is self-consistent, and the editor says the width is estimated." },
173
+ "positionOffset": { "type": "number", "description": "Millimetres along the section's own DEPTH axis, past the face `position` names. Added to that face's offset BEFORE the section is rolled by `rot`, so it stays measured on the section's own axis at every angle rather than becoming a world-space nudge a roll would send elsewhere. POSITIVE moves the section along its +depth axis — straight up for a level, unrolled member — which puts the reference line inside the steel rather than on the named face. Absent = 0. The named face and this number are ONE placement, not two: swapping the profile re-derives the face and keeps this offset past it, which is the whole reason the face is stored by name rather than as a distance." },
174
+ "positionHOffset": { "type": "number", "description": "Millimetres along the section's own WIDTH axis, past the face `positionH` names — the plan companion to `positionOffset`, with the same rule. POSITIVE moves the section along its +width axis, which is `up x memberAxis`: the member's LEFT, looking from `from` to `to` with Z up. Absent = 0." },
173
175
  "rot": { "type": "number", "description": "Section rotation about the member axis, degrees." },
174
176
  "section": {
175
177
  "type": "object",
package/dist/web/app.css CHANGED
@@ -1772,6 +1772,35 @@
1772
1772
  color: var(--text-muted);
1773
1773
  }
1774
1774
  .status { display: flex; align-items: center; gap: 14px; }
1775
+ /* A permanent route to the existing report dialog. Quiet utility styling keeps it visible
1776
+ without turning every screen into an error state; the label collapses before the action does. */
1777
+ .footer-report-issue {
1778
+ flex: none;
1779
+ display: inline-flex;
1780
+ align-items: center;
1781
+ justify-content: center;
1782
+ gap: 7px;
1783
+ height: 34px;
1784
+ padding: 0 10px;
1785
+ background: transparent;
1786
+ border: 1px solid var(--border-strong);
1787
+ border-radius: 5px;
1788
+ color: var(--text-muted);
1789
+ font-size: 11px;
1790
+ white-space: nowrap;
1791
+ }
1792
+ .footer-report-issue svg {
1793
+ width: 15px;
1794
+ height: 15px;
1795
+ flex: none;
1796
+ fill: none;
1797
+ stroke: currentColor;
1798
+ stroke-width: 1.7;
1799
+ stroke-linecap: round;
1800
+ stroke-linejoin: round;
1801
+ }
1802
+ .footer-report-issue:hover { background: var(--surface-2); border-color: var(--accent-dim); color: var(--text); }
1803
+ .footer-report-issue:active { background: var(--accent-soft); }
1775
1804
  .stat { display: inline-flex; align-items: center; gap: 6px; }
1776
1805
  .dot {
1777
1806
  width: 6px;
@@ -1791,6 +1820,10 @@
1791
1820
  between the two versions, which a `+`-adjacency ::before could not span. Flex `gap`
1792
1821
  on .version-info spaces it on both sides. */
1793
1822
  .ver-sep { font-size: 11px; }
1823
+ @media (max-width: 960px) {
1824
+ .footer-report-issue { width: 34px; padding: 0; }
1825
+ .report-issue-trigger-label { display: none; }
1826
+ }
1794
1827
 
1795
1828
  /* ========== TOOLTIPS (styled, app-themed; replaces native title="") ========== */
1796
1829
  #tooltip {
@@ -2728,6 +2761,191 @@
2728
2761
  background: var(--border);
2729
2762
  margin: 5px 4px;
2730
2763
  }
2764
+ /* Instructor ON/OFF — a menuitemcheckbox, not the .menu-theme switch: checked state reads via the
2765
+ app's existing accent-active dialect (.code-wrap-btn.active, .tf-chip.active) rather than a new
2766
+ control. The icon recolors to accent-bright and a trailing check confirms it — mirroring the
2767
+ trailing .menu-kbd slot the action items already reserve on the right, so the row stays in the
2768
+ same visual family. visibility (not display) keeps the row's width stable between states.
2769
+ No native <input type=checkbox>: the button already IS the checkbox via ARIA, so nesting one
2770
+ would add a second hit target and a control needing its own theming, for no signal the SVG
2771
+ check does not already carry. */
2772
+ .menu-item[role="menuitemcheckbox"][aria-checked="true"] .menu-icon { color: var(--accent-bright); }
2773
+ .menu-check {
2774
+ width: 15px;
2775
+ flex-shrink: 0;
2776
+ display: inline-flex;
2777
+ align-items: center;
2778
+ justify-content: center;
2779
+ color: var(--accent-bright);
2780
+ }
2781
+ .menu-check svg {
2782
+ width: 13px;
2783
+ height: 13px;
2784
+ fill: none;
2785
+ stroke: currentColor;
2786
+ stroke-width: 2;
2787
+ stroke-linecap: round;
2788
+ stroke-linejoin: round;
2789
+ }
2790
+ .menu-item[aria-checked="false"] .menu-check { visibility: hidden; }
2791
+ /* The same footgun .menu-startup and #menu-fullscreen document: .instructor is display:flex, so
2792
+ the `hidden` attribute alone does not hide it (app.css has no global [hidden] rule). Without
2793
+ this, turning the Instructor OFF would leave the band laid out into an IMPLICIT grid row —
2794
+ exactly the reserved space the setting exists to reclaim. */
2795
+ #instructor[hidden] { display: none; }
2796
+
2797
+ /* ── The `?` command sheet ──────────────────────────────────────────────────
2798
+ Built on .modal-backdrop/.modal rather than a new overlay: same backdrop,
2799
+ blur, fade and z-index band, so it stacks and reads like every other dialog
2800
+ here. Only the size and the list are new — this one is a browsable inventory,
2801
+ not a 480px confirmation. And .modal-backdrop is display:flex when shown, so
2802
+ it needs the same explicit [hidden] rule the Instructor band does. */
2803
+ #command-sheet[hidden] { display: none; }
2804
+ .cmd-sheet-backdrop.show { display: flex; }
2805
+ .cmd-sheet {
2806
+ width: 620px;
2807
+ max-width: 94vw;
2808
+ /* Bounded so the list scrolls INSIDE the dialog rather than growing the page —
2809
+ which is also what makes the themed scrollbar below load-bearing. */
2810
+ max-height: min(76vh, 640px);
2811
+ display: flex;
2812
+ flex-direction: column;
2813
+ padding: 18px 18px 12px;
2814
+ }
2815
+ .cmd-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
2816
+ .cmd-sheet-head .modal-sub { margin-bottom: 12px; }
2817
+ .cmd-sheet-close {
2818
+ flex: none;
2819
+ background: none;
2820
+ border: none;
2821
+ color: var(--text-dim);
2822
+ font-size: 14px;
2823
+ line-height: 1;
2824
+ padding: 2px 4px;
2825
+ cursor: pointer;
2826
+ }
2827
+ .cmd-sheet-close:hover { color: var(--text); }
2828
+
2829
+ .cmd-sheet-filter {
2830
+ width: 100%;
2831
+ background: var(--surface-2);
2832
+ border: 1px solid var(--border-strong);
2833
+ border-radius: 5px;
2834
+ color: var(--text);
2835
+ font-family: var(--ui);
2836
+ font-size: 12px;
2837
+ padding: 7px 9px;
2838
+ margin-bottom: 10px;
2839
+ }
2840
+ .cmd-sheet-filter::placeholder { color: var(--text-dim); }
2841
+
2842
+ /* THE scroll container — and deliberately NOT hand-themed. The global `*` rule
2843
+ further down this file (search "Scrollbars — BOTH engines, globally") already
2844
+ gives every scroll container the themed bar, and its comment records that
2845
+ per-container patching is exactly how 20 of 39 containers ended up drawing
2846
+ Firefox's native light bar through the dark theme. A bespoke rule here would
2847
+ re-add the divergence that rule exists to end. overflow-y is all it needs. */
2848
+ .cmd-sheet-list {
2849
+ overflow-y: auto;
2850
+ min-height: 0;
2851
+ flex: 1 1 auto;
2852
+ }
2853
+
2854
+ .cmd-group {
2855
+ font-family: var(--mono);
2856
+ font-size: 9px;
2857
+ letter-spacing: 0.14em;
2858
+ text-transform: uppercase;
2859
+ color: var(--text-dim);
2860
+ padding: 12px 4px 5px;
2861
+ position: sticky;
2862
+ top: 0;
2863
+ background: var(--surface);
2864
+ }
2865
+ /* The one divider between what is on screen and what is not. Deliberately NOT
2866
+ styled as a .cmd-group: an uppercase mono eyebrow would read as a sixth
2867
+ equal-weight surface heading, when the whole point is that everything below
2868
+ it is somewhere else. A sentence, italic, behind a dashed rule — all existing
2869
+ tokens and idioms, no new colour or font. Not sticky: it is passed once on
2870
+ the way down, and a second sticky element would fight .cmd-group for the top. */
2871
+ .cmd-elsewhere {
2872
+ font-size: 11px;
2873
+ font-style: italic;
2874
+ color: var(--text-dim);
2875
+ padding: 14px 4px 4px;
2876
+ margin-top: 8px;
2877
+ border-top: 1px dashed var(--border-strong);
2878
+ }
2879
+ /* When a search matches nothing on the current screen the divider is the FIRST
2880
+ row, and its rule would sit immediately under the search box — reading as part
2881
+ of the input rather than as a boundary between two halves of the list. There is
2882
+ nothing above it to divide, so the rule goes. */
2883
+ .cmd-elsewhere:first-child {
2884
+ border-top: none;
2885
+ margin-top: 0;
2886
+ padding-top: 10px;
2887
+ }
2888
+ .cmd-group:first-child { padding-top: 2px; }
2889
+
2890
+ .cmd-row {
2891
+ display: flex;
2892
+ align-items: baseline;
2893
+ gap: 9px;
2894
+ width: 100%;
2895
+ text-align: left;
2896
+ background: none;
2897
+ border: none;
2898
+ border-radius: 5px;
2899
+ padding: 6px 8px;
2900
+ color: var(--text);
2901
+ font-family: var(--ui);
2902
+ font-size: 12px;
2903
+ cursor: pointer;
2904
+ }
2905
+ .cmd-row:hover, .cmd-row.active { background: var(--surface-2); }
2906
+ .cmd-row-label { flex: none; font-weight: 500; }
2907
+ /* No Echo: this half carries only what the label does NOT already say — what it
2908
+ acts on, and whether it costs or destroys something. */
2909
+ .cmd-row-facts { color: var(--text-muted); font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2910
+ .cmd-row-key {
2911
+ flex: none;
2912
+ margin-left: auto;
2913
+ font-family: var(--mono);
2914
+ font-size: 10px;
2915
+ color: var(--text-dim);
2916
+ background: var(--surface-2);
2917
+ border: 1px solid var(--border);
2918
+ padding: 1px 5px;
2919
+ border-radius: 3px;
2920
+ }
2921
+ /* T1 says how many steps, in the same muted mono register .wf-option-meta uses.
2922
+ T2 gets a pill on the existing warn/err semantic tokens — the same recipe as
2923
+ .req-run-badge-warn / .req-run-badge-err, so no new colour enters the theme.
2924
+ T3 gets NOTHING, and that is the design: it is roughly two-thirds of the
2925
+ list, and badging the majority is its own kind of noise. */
2926
+ .cmd-row-tier {
2927
+ flex: none;
2928
+ font-family: var(--mono);
2929
+ font-size: 10px;
2930
+ color: var(--text-dim);
2931
+ }
2932
+ .cmd-row-tag {
2933
+ flex: none;
2934
+ font-size: 9.5px;
2935
+ font-weight: 600;
2936
+ padding: 2px 7px;
2937
+ border-radius: 999px;
2938
+ }
2939
+ .cmd-row-tag[data-tone="destructive"] { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }
2940
+ .cmd-row-tag[data-tone="costly"] { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
2941
+
2942
+ .cmd-sheet-empty { padding: 18px 8px; font-size: 12px; color: var(--text-muted); }
2943
+ .cmd-sheet-empty b { color: var(--text); font-weight: 500; }
2944
+
2945
+ .ix-hint-sep { margin: 0 6px; color: var(--text-dim); }
2946
+ .ix-hint-link { color: var(--accent-bright); }
2947
+ button.ix-hint { background: none; border: none; cursor: pointer; font-family: var(--ui); }
2948
+ button.ix-hint:hover .ix-hint-link { text-decoration: underline; }
2731
2949
  /* Cursor-anchored node context menu (right-click a card). Reuses .menu/.menu-item; only
2732
2950
  the fixed 280px width is wrong for it — the pointer anchor (top/left) is set inline. */
2733
2951
  .menu.context-menu { width: auto; min-width: 168px; }
@@ -3840,6 +4058,137 @@ body {
3840
4058
  .aware-version.relnotes-reopen, .app-version.relnotes-reopen { cursor: pointer; }
3841
4059
  .aware-version.relnotes-reopen:hover, .app-version.relnotes-reopen:hover { color: var(--accent-bright); }
3842
4060
 
4061
+ /* ── The Instructor band ────────────────────────────────────────────────────
4062
+ A row above the footer, inserted by .has-instructor — same technique as
4063
+ .has-whats-new below. Collapsed it keeps a thin rail so the layout height
4064
+ never jumps between two very different sizes mid-command. */
4065
+ .app.has-instructor {
4066
+ grid-template-rows: 60px 1fr auto 44px;
4067
+ grid-template-areas:
4068
+ "header header header"
4069
+ "chat canvas inspect"
4070
+ "instructor instructor instructor"
4071
+ "footer footer footer";
4072
+ }
4073
+ /* Both rows present: the Instructor sits below What's-new, directly on the footer. */
4074
+ .app.has-instructor.has-whats-new {
4075
+ grid-template-rows: 60px 1fr auto auto 44px;
4076
+ grid-template-areas:
4077
+ "header header header"
4078
+ "chat canvas inspect"
4079
+ "whats-new whats-new whats-new"
4080
+ "instructor instructor instructor"
4081
+ "footer footer footer";
4082
+ }
4083
+
4084
+ .instructor {
4085
+ grid-area: instructor;
4086
+ display: flex;
4087
+ align-items: center;
4088
+ gap: 8px;
4089
+ height: 34px;
4090
+ padding: 0 14px;
4091
+ background: var(--surface-2);
4092
+ border-top: 1px solid var(--border-strong);
4093
+ font-size: 12px;
4094
+ color: var(--text-muted);
4095
+ overflow: hidden;
4096
+ white-space: nowrap;
4097
+ }
4098
+ .instructor.collapsed { height: 22px; }
4099
+ .instructor.collapsed .ix-chip,
4100
+ .instructor.collapsed .ix-parts,
4101
+ .instructor.collapsed .ix-hint,
4102
+ .instructor.collapsed .ix-ask { display: none; }
4103
+
4104
+ .instructor.tone-blocked {
4105
+ background: color-mix(in srgb, var(--err) 8%, var(--surface-2));
4106
+ border-top-color: var(--err);
4107
+ }
4108
+ /* An armed command owns the band until it finishes or is cancelled. */
4109
+ .instructor.tone-armed {
4110
+ background: color-mix(in srgb, var(--warn) 8%, var(--surface-2));
4111
+ border-top-color: var(--warn);
4112
+ }
4113
+ .instructor.tone-armed .ix-chip {
4114
+ background: color-mix(in srgb, var(--warn) 16%, transparent);
4115
+ border-color: color-mix(in srgb, var(--warn) 40%, transparent);
4116
+ color: var(--warn);
4117
+ }
4118
+
4119
+ .ix-toggle {
4120
+ display: flex;
4121
+ align-items: center;
4122
+ gap: 6px;
4123
+ flex: none;
4124
+ background: none;
4125
+ border: none;
4126
+ padding: 2px 4px;
4127
+ color: var(--text-dim);
4128
+ font-family: var(--mono);
4129
+ font-size: 10px;
4130
+ letter-spacing: 0.1em;
4131
+ text-transform: uppercase;
4132
+ cursor: pointer;
4133
+ }
4134
+ .ix-toggle:hover { color: var(--text); }
4135
+ .ix-caret { transition: transform 0.15s ease-out; display: inline-block; }
4136
+ .instructor.collapsed .ix-caret { transform: rotate(-90deg); }
4137
+
4138
+ .ix-chip {
4139
+ flex: none;
4140
+ font-family: var(--mono);
4141
+ font-size: 10px;
4142
+ letter-spacing: 0.08em;
4143
+ text-transform: uppercase;
4144
+ padding: 2px 7px;
4145
+ border-radius: 4px;
4146
+ background: var(--surface-3);
4147
+ border: 1px solid var(--border-strong);
4148
+ color: var(--text-muted);
4149
+ }
4150
+ .instructor.tone-blocked .ix-chip {
4151
+ background: color-mix(in srgb, var(--err) 16%, transparent);
4152
+ border-color: color-mix(in srgb, var(--err) 40%, transparent);
4153
+ color: var(--err);
4154
+ }
4155
+ .ix-chip[hidden] { display: none; }
4156
+
4157
+ .ix-parts { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; }
4158
+ .ix-val { color: var(--text); font-weight: 500; flex: none; }
4159
+ .ix-seg { flex: none; }
4160
+ .ix-sep { color: var(--text-dim); flex: none; }
4161
+ .ix-grow { flex: 1 1 auto; min-width: 8px; }
4162
+
4163
+ .ix-hint { flex: none; color: var(--text-dim); font-size: 11px; }
4164
+ .ix-hint kbd {
4165
+ font-family: var(--mono);
4166
+ font-size: 10px;
4167
+ padding: 1px 5px;
4168
+ border: 1px solid var(--border-strong);
4169
+ border-bottom-width: 2px;
4170
+ border-radius: 3px;
4171
+ background: var(--surface-3);
4172
+ color: var(--text-muted);
4173
+ }
4174
+
4175
+ .ix-ask {
4176
+ flex: none;
4177
+ font-size: 11px;
4178
+ padding: 3px 9px;
4179
+ border-radius: 5px;
4180
+ border: 1px solid var(--border-strong);
4181
+ background: var(--surface);
4182
+ color: var(--text-muted);
4183
+ cursor: pointer;
4184
+ }
4185
+ .ix-ask:hover { border-color: var(--accent-dim); color: var(--accent-bright); }
4186
+ .ix-ask[hidden] { display: none; }
4187
+
4188
+ @media (prefers-reduced-motion: reduce) {
4189
+ .ix-caret { transition: none; }
4190
+ }
4191
+
3843
4192
  /* ── What's-new panel (floless.app post-update) ─────────────────────────────
3844
4193
  A 4th grid row above the footer — NOT absolutely positioned. .has-whats-new
3845
4194
  inserts an `auto` row + a full-width `whats-new` area between the body and footer. */
@@ -4147,6 +4496,16 @@ body {
4147
4496
  @media (max-width: 760px) {
4148
4497
  html, body { overflow: auto; }
4149
4498
  .app { height: auto; min-height: 100vh; grid-template-rows: auto 1fr 44px; }
4499
+ /* The `auto` first row above is (3) — the wrapped header needs to size to its
4500
+ content. But `.app` is specificity (0,1,0) and `.app.has-instructor` is
4501
+ (0,2,0), so the extra-row rules win here no matter the source order and pin
4502
+ the header back to 60px, overflowing the wrapped content into the panels.
4503
+ The Instructor is ON by default, so without these two lines that is the
4504
+ phone layout for everyone. .has-whats-new carries the same defect but is
4505
+ transient post-update state; this one would have been permanent. */
4506
+ .app.has-instructor { grid-template-rows: auto 1fr auto 44px; }
4507
+ .app.has-instructor.has-whats-new { grid-template-rows: auto 1fr auto auto 44px; }
4508
+ .app.has-whats-new { grid-template-rows: auto 1fr auto 44px; }
4150
4509
  header { flex-wrap: wrap; gap: 8px; padding: 8px 14px; }
4151
4510
  select, .wf-combo { min-width: 0; }
4152
4511
  }
package/dist/web/app.js CHANGED
@@ -1149,9 +1149,17 @@ function handleMenuAction(action) {
1149
1149
  case 'routines': openRoutines(); break;
1150
1150
  case 'report-issue': openReportIssue(); break;
1151
1151
  case 'fullscreen': toggleFullscreen(); break;
1152
+ // The Instructor owns its own persisted state and the menu item's aria-checked,
1153
+ // so this only asks it to flip — no read-modify-write here, and one place that
1154
+ // knows whether the strip is on.
1155
+ case 'toggle-instructor': if (window.Instructor) window.Instructor.toggleEnabled(); break;
1152
1156
  }
1153
1157
  }
1154
1158
 
1159
+ // Keep the always-visible footer entry and the hamburger item on one action path. The footer
1160
+ // does not synthesize a menu click: it delegates to the same dispatcher directly.
1161
+ document.getElementById('report-issue-trigger').addEventListener('click', () => handleMenuAction('report-issue'));
1162
+
1155
1163
  /* ============= ACTIONS ============= */
1156
1164
  // "New" and local-file "Open" were removed: a workflow is an installed AWARE app,
1157
1165
  // not a file the UI authors. doOpen is reassigned in aware.js to focus the workflow
@@ -1749,6 +1757,20 @@ function themeSelect(sel) {
1749
1757
  // value) — the pairing a native select gives for free. A select carrying its own aria-label
1750
1758
  // (the hour/minute pair) hands that over instead.
1751
1759
  const field = document.querySelector(`label[for="${CSS.escape(sel.id || '')}"]`);
1760
+ /* The command id MOVES to the trigger, for the same reason data-tip does below:
1761
+ from here on the <select> is display:none, so it can never be hovered, focused,
1762
+ or reached by the `?` sheet's "Enter - go to it". The trigger is a SIBLING, not
1763
+ a descendant, so Commands.resolve()'s closest('[data-command-id]') finds nothing
1764
+ from the control the user actually points at.
1765
+
1766
+ MOVED, not copied - two carriers would count as two live instances in
1767
+ Commands.inventory() while only one of them is reachable. (Code review.) */
1768
+ const cmdId = sel.getAttribute('data-command-id');
1769
+ if (cmdId) {
1770
+ trigger.setAttribute('data-command-id', cmdId);
1771
+ sel.removeAttribute('data-command-id');
1772
+ }
1773
+
1752
1774
  const ownLabel = sel.getAttribute('aria-label');
1753
1775
  if (ownLabel) {
1754
1776
  trigger.setAttribute('aria-label', ownLabel);
package/dist/web/aware.js CHANGED
@@ -541,6 +541,23 @@
541
541
  'Cancelling…': 'The current run is being cancelled.',
542
542
  };
543
543
  $runState.dataset.tip = activeTips[status.label] || gateTips[app.runState] || '';
544
+
545
+ // Push a snapshot to the Instructor band. One-way: the band renders what it
546
+ // is handed and never reaches back into workflow state.
547
+ if (window.Instructor) {
548
+ const inputs = Array.isArray(app.inputs) ? app.inputs : [];
549
+ const values = typeof currentInputs === 'function' ? currentInputs() || {} : {};
550
+ window.Instructor.setWorkflow({
551
+ name: app.name || app.id,
552
+ runState: app.runState,
553
+ statusLabel: status.label,
554
+ totalInputs: inputs.length,
555
+ inputsSet: inputs.filter((i) => {
556
+ const v = values[i.name];
557
+ return v !== undefined && v !== null && String(v).trim() !== '';
558
+ }).length,
559
+ });
560
+ }
544
561
  }
545
562
 
546
563
  function paintGate(app) {
@@ -1257,13 +1274,17 @@
1257
1274
  // <button>s without nesting interactive elements (#85). Selection stays driven by
1258
1275
  // the delegated $wfList click + comboMove highlight (aria-activedescendant).
1259
1276
  const aid = escapeAttr(a.id);
1260
- html += `<div class="wf-option" role="option" id="wf-opt-${aid}" data-id="${aid}" data-baked="${a.baked ? '1' : ''}" data-search="${escapeAttr((a.id + ' ' + p).toLowerCase())}" tabindex="-1" aria-selected="false">`
1277
+ // PHASE 0b: generated rows carry a PARAMETERIZED command id,
1278
+ // `<template>#<instance>`. The template is registered once (see
1279
+ // web/commands-shell.js); instances register nothing, so the
1280
+ // registry never churns with workflow data.
1281
+ html += `<div class="wf-option" role="option" id="wf-opt-${aid}" data-id="${aid}" data-command-id="workflow.select#${escapeAttr(aid)}" data-baked="${a.baked ? '1' : ''}" data-search="${escapeAttr((a.id + ' ' + p).toLowerCase())}" tabindex="-1" aria-selected="false">`
1261
1282
  + `<span class="wf-option-name">${escapeHtml(a.id)}</span><span class="wf-option-meta">${meta}</span>`
1262
1283
  + (a.forked ? `<span class="wf-fork-badge" data-tip="You forked this workflow — it no longer receives FloLess updates. You own its output.">yours</span>` : '')
1263
1284
  + `<span class="wf-option-actions">`
1264
- + `<button type="button" class="wf-act act-edit" data-wf-act="rename" data-id="${aid}" tabindex="-1" data-tip="Rename" aria-label="Rename ${aid}">✎</button>`
1265
- + `<button type="button" class="wf-act act-dup" data-wf-act="duplicate" data-id="${aid}" tabindex="-1" data-tip="Duplicate" aria-label="Duplicate ${aid}">⧉</button>`
1266
- + `<button type="button" class="wf-act act-del" data-wf-act="delete" data-id="${aid}" tabindex="-1" data-tip="Delete" aria-label="Delete ${aid}">×</button>`
1285
+ + `<button type="button" class="wf-act act-edit" data-wf-act="rename" data-command-id="workflow.rename#${escapeAttr(aid)}" data-id="${aid}" tabindex="-1" data-tip="Rename" aria-label="Rename ${aid}">✎</button>`
1286
+ + `<button type="button" class="wf-act act-dup" data-wf-act="duplicate" data-command-id="workflow.duplicate#${escapeAttr(aid)}" data-id="${aid}" tabindex="-1" data-tip="Duplicate" aria-label="Duplicate ${aid}">⧉</button>`
1287
+ + `<button type="button" class="wf-act act-del" data-wf-act="delete" data-command-id="workflow.delete#${escapeAttr(aid)}" data-id="${aid}" tabindex="-1" data-tip="Delete" aria-label="Delete ${aid}">×</button>`
1267
1288
  + `</span></div>`;
1268
1289
  }
1269
1290
  html += '</div>';
@@ -1276,6 +1297,7 @@
1276
1297
  function comboVisibleOptions() {
1277
1298
  return [...$wfList.querySelectorAll('.wf-option')].filter((o) => !o.hidden && !o.closest('.wf-group').hidden);
1278
1299
  }
1300
+
1279
1301
  function comboClearHighlight() {
1280
1302
  $wfList.querySelectorAll('.wf-option.highlighted').forEach((o) => o.classList.remove('highlighted'));
1281
1303
  comboHi = -1;
@@ -2146,7 +2168,7 @@
2146
2168
  // Only offer the action when a renderer is actually registered for the type — otherwise
2147
2169
  // openContractEditor() returns false and the click would silently do nothing.
2148
2170
  if (contractType && window.CONTRACT_RENDERERS && window.CONTRACT_RENDERERS[contractType]) {
2149
- // Approving a migrated project bakes THAT PROJECT's model into this workflow's shared .flo, so
2171
+ // Approving a project publication bakes THAT PROJECT's model into this workflow's shared .flo, so
2150
2172
  // every action below asks for a contract this workflow does not own and fails on click. Say so
2151
2173
  // once, before the buttons, and dim them — rather than leaving five lit affordances that each
2152
2174
  // cost a click, a wait, and a raw failure toast to discover.
@@ -9394,9 +9416,16 @@
9394
9416
  let riSubmitting = false;
9395
9417
  let riAppVersion = ''; // captured from /api/health on open so the report actually carries
9396
9418
  let riAwareVersion = ''; // the versions the modal promises ("sent automatically: …")
9419
+ let riReturnFocus = null;
9397
9420
 
9398
9421
  const riSyncSend = () => { $riSend.disabled = !($riTitle.value.trim() && $riDesc.value.trim()); };
9399
- const riClose = () => { if (!riSubmitting) hideModal($riModal); };
9422
+ function riHideAndRestoreFocus() {
9423
+ hideModal($riModal);
9424
+ const returnFocus = riReturnFocus;
9425
+ riReturnFocus = null;
9426
+ if (returnFocus && returnFocus.isConnected) returnFocus.focus();
9427
+ }
9428
+ const riClose = () => { if (!riSubmitting) riHideAndRestoreFocus(); };
9400
9429
  const riSetCategory = (cat) => {
9401
9430
  riCategory = cat;
9402
9431
  $riModal.querySelectorAll('#ri-category .rtn-mode-btn').forEach((b) => {
@@ -9446,6 +9475,10 @@
9446
9475
  };
9447
9476
 
9448
9477
  openReportIssue = function openReportIssueReal() {
9478
+ // The menu closes before its action dispatches, but its clicked item remains focused. Return
9479
+ // that path to the hamburger; a persistent/footer trigger returns to itself.
9480
+ riReturnFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
9481
+ if ($menu.contains(riReturnFocus)) riReturnFocus = $menuBtn;
9449
9482
  riSubmitting = false;
9450
9483
  $riForm.hidden = false;
9451
9484
  $riState.hidden = true;
@@ -9485,7 +9518,7 @@
9485
9518
  wrap.append(icon, msg);
9486
9519
  const actions = document.createElement('div');
9487
9520
  actions.className = 'modal-actions';
9488
- const done = riButton('ri-done', 'Done', true, () => hideModal($riModal));
9521
+ const done = riButton('ri-done', 'Done', true, () => riClose());
9489
9522
  actions.append(done);
9490
9523
  riShowState(wrap, actions);
9491
9524
  done.focus();
@@ -9497,10 +9530,10 @@
9497
9530
  sub.textContent = 'Sign in to send a report — your session has expired.';
9498
9531
  const actions = document.createElement('div');
9499
9532
  actions.className = 'modal-actions';
9500
- const close = riButton('ri-signin-close', 'Close', false, () => hideModal($riModal));
9533
+ const close = riButton('ri-signin-close', 'Close', false, () => riClose());
9501
9534
  const signin = riButton('ri-signin-btn', 'Sign in', true, async () => {
9502
9535
  try { await api('/api/license/start', { method: 'POST' }); } catch { /* surfaced via license polling */ }
9503
- hideModal($riModal);
9536
+ riClose();
9504
9537
  });
9505
9538
  actions.append(close, signin);
9506
9539
  riShowState(sub, actions);
@@ -9556,7 +9589,26 @@
9556
9589
  $riCancel.onclick = () => riClose();
9557
9590
  onBackdropDismiss($riModal, () => riClose());
9558
9591
  $riModal.querySelectorAll('#ri-category .rtn-mode-btn').forEach((b) => { b.onclick = () => riSetCategory(b.dataset.cat); });
9559
- document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && $riModal.classList.contains('show')) riClose(); });
9592
+ const riFocusable = () => Array.from($riModal.querySelectorAll(
9593
+ 'button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',
9594
+ )).filter((el) => !el.hidden && el.offsetParent !== null);
9595
+ document.addEventListener('keydown', (e) => {
9596
+ if (!$riModal.classList.contains('show')) return;
9597
+ if (e.key === 'Escape') { e.preventDefault(); riClose(); return; }
9598
+ if (e.key !== 'Tab') return;
9599
+ const controls = riFocusable();
9600
+ if (!controls.length) { e.preventDefault(); return; }
9601
+ const active = document.activeElement;
9602
+ const first = controls[0];
9603
+ const last = controls[controls.length - 1];
9604
+ if (e.shiftKey && (active === first || !$riModal.contains(active))) {
9605
+ e.preventDefault();
9606
+ last.focus();
9607
+ } else if (!e.shiftKey && (active === last || !$riModal.contains(active))) {
9608
+ e.preventDefault();
9609
+ first.focus();
9610
+ }
9611
+ });
9560
9612
 
9561
9613
  // ── init (after app.js bootstrap) ────────────────────────────────────────────
9562
9614
  // app.js already stored the ORIGINAL functions as .onclick/.oninput before we