@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.
@@ -203,11 +203,12 @@
203
203
  </div>
204
204
  <div class="tabs ws-step-tabs" id="ws-step-tabs" role="tablist" aria-label="Project steps">
205
205
  <button data-command-id="shell.workspace-step#knowledge" type="button" data-step="knowledge" role="tab" aria-selected="false">Knowledge</button>
206
- <button data-command-id="shell.workspace-step#drawings" type="button" data-step="drawings" role="tab" aria-selected="false">Drawings</button>
206
+ <button data-command-id="shell.workspace-step#Drawing Filter" type="button" data-step="drawings" role="tab" aria-selected="false">Drawing Filter</button>
207
207
  <button data-command-id="shell.workspace-step#model" type="button" data-step="model" class="active" role="tab" aria-selected="true">Model</button>
208
208
  <button data-command-id="shell.workspace-step#exports" type="button" data-step="exports" role="tab" aria-selected="false">Exports</button>
209
209
  <button data-command-id="shell.workspace-step#history" type="button" data-step="history" role="tab" aria-selected="false">History</button>
210
210
  </div>
211
+ <div class="ws-stage-guidance" id="ws-stage-guidance" hidden aria-live="polite"></div>
211
212
  <!-- Drawings step: a shell toolbar band + revision-read status card ABOVE the filter iframe
212
213
  (chrome around it, never inside — the filter owns its own layout). Shown only on Drawings. -->
213
214
  <div class="ws-drawings-bar" id="ws-drawings-bar" hidden>
@@ -363,7 +364,7 @@
363
364
  <span class="stat"><span class="stat-key">templates</span><span class="stat-val" id="fav-count">0</span></span>
364
365
  </span>
365
366
  <span class="sep">·</span>
366
- <span class="stat stat-requests" id="req-stat" data-tip="Changes queued for your terminal AI — click to view & manage"><span class="stat-key">requests</span><span class="stat-val" id="req-count">0</span></span>
367
+ <span class="stat stat-requests" id="req-stat" role="button" tabindex="0" data-command-id="shell.requests-open" aria-label="Open Requests" aria-haspopup="dialog" aria-controls="requests-modal" data-tip="Changes queued for your terminal AI — click to view & manage"><span class="stat-key">requests</span><span class="stat-val" id="req-count">0</span></span>
367
368
  </div>
368
369
  <span class="version-info">
369
370
  <span class="aware-version" id="aware-version" data-tip="AWARE runtime version — the aware CLI/npm package this app drives"></span>
@@ -573,7 +574,12 @@
573
574
  <span class="menu-label" data-tip="Starts the FloLess server automatically when you sign in, so your browser reconnects on its own">Start on startup</span>
574
575
  <!-- The id sits on the label, not the checkbox it wraps: accessibleNameOf() reads the element
575
576
  the id is on, and the label is what carries the name here. Same shape as the 3D view
576
- toggles in the steel editor and the Drawing Filter's match-on rows (#779). -->
577
+ toggles in the steel editor (#779).
578
+ NOT the Drawing Filter's match-on rows any more: #805 Phase D moved those onto their
579
+ inputs, because Instructor's activate() focuses the carrier it finds and a <label> cannot
580
+ take focus, so pressing Enter from the ? sheet could never reach the control. This one is
581
+ unchanged only because that slice had no business editing this surface; the same move is
582
+ available here whenever someone owns it. -->
577
583
  <label class="rtn-toggle" data-command-id="shell.open-at-startup" aria-label="Start FloLess on startup">
578
584
  <input type="checkbox" id="startup-toggle" role="switch">
579
585
  <span class="rtn-toggle-track"></span>
@@ -842,9 +848,10 @@
842
848
  </div>
843
849
 
844
850
  <div class="modal-backdrop" id="requests-modal">
845
- <div class="modal requests">
846
- <div class="modal-title">Requests for your terminal AI</div>
847
- <div class="modal-sub">The UI can’t edit workflows itself — these are the changes it queued for your terminal AI (Claude Code / Codex / OpenCode) to apply. Copy one to paste, or clear ones already handled.</div>
851
+ <div class="modal requests" role="dialog" aria-modal="true" aria-labelledby="requests-title" tabindex="-1">
852
+ <div class="modal-title" id="requests-title">Requests waiting for your terminal AI</div>
853
+ <div class="modal-sub">These are jobs FloLess has queued for Claude Code, Codex, or OpenCode. Copy a job into your terminal AI to start it, or clear jobs that are already handled.</div>
854
+ <div class="req-guidance" id="requests-guidance" role="status" aria-live="polite" aria-atomic="true" hidden></div>
848
855
  <!-- Scope + search. The scope row is hidden when nothing is open to scope TO (the
849
856
  Workspaces landing, or Workflows with no workflow selected) — a filter with one
850
857
  possible answer is noise. Labels/counts are written per-render in aware.js. -->
@@ -856,7 +863,7 @@
856
863
  <div class="requests-list" id="requests-list"></div>
857
864
  <div class="modal-actions">
858
865
  <button data-command-id="shell.request-clear" id="requests-clear">Clear all</button>
859
- <button data-command-id="shell.request-copy" id="requests-copy">Copy all</button>
866
+ <button data-command-id="shell.request-copy" id="requests-copy">Copy available</button>
860
867
  <button data-command-id="shell.dialog-close#the requests list" id="requests-close" class="primary">Close</button>
861
868
  </div>
862
869
  </div>
@@ -865,12 +872,12 @@
865
872
  <div class="modal-backdrop" id="request-help-modal">
866
873
  <div class="modal request-help" role="dialog" aria-modal="true" aria-labelledby="request-help-title" aria-describedby="request-help-sub request-help-steps" tabindex="-1">
867
874
  <div class="guide-eyebrow">Requests</div>
868
- <div class="modal-title" id="request-help-title">Request queued</div>
869
- <div class="modal-sub" id="request-help-sub" aria-live="polite">Your drawing was added to Requests, and the terminal instructions were copied to your clipboard.</div>
875
+ <div class="modal-title" id="request-help-title">Drawing read ready to start</div>
876
+ <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>
870
877
  <div class="request-help-steps" id="request-help-steps">
871
- <div class="request-help-step"><span>1</span><p>Open the terminal agent.</p></div>
872
- <div class="request-help-step"><span>2</span><p>Paste the copied instructions.</p></div>
873
- <div class="request-help-step"><span>3</span><p>Return here to track progress in Requests.</p></div>
878
+ <div class="request-help-step"><span>1</span><p>Open Claude Code, Codex, or OpenCode in your project folder.</p></div>
879
+ <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>
880
+ <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>
874
881
  </div>
875
882
  <!-- Replaces the three steps above once floless has started the work itself: they describe
876
883
  things the user must do, and after "Run it for me" there is nothing left for them to do.
@@ -884,16 +891,16 @@
884
891
  <p class="rhrs-sub">This can take a few minutes, and you don’t need to wait. Keep working — the row in Requests updates as it goes.</p>
885
892
  </div>
886
893
  </div>
887
- <div class="request-help-note" id="request-help-note">The web UI queues the request; your terminal agent applies it and reports progress back here.</div>
894
+ <div class="request-help-note" id="request-help-note">FloLess cannot start the first read automatically yet: your terminal AI must create the starting project checkpoint, then wait for you to review and save the Drawing Filter. After you save, tell the terminal AI to continue.</div>
888
895
  <div class="modal-actions">
889
896
  <button data-command-id="shell.request-help-copy" id="request-help-copy" hidden>Copy instruction</button>
890
- <button data-command-id="shell.request-help-keep" id="request-help-keep">Keep working</button>
891
- <button data-command-id="shell.request-help-open" id="request-help-open">Open Requests</button>
897
+ <button data-command-id="shell.request-help-keep" id="request-help-keep">Leave in Requests</button>
898
+ <button data-command-id="shell.request-help-open" id="request-help-open">View request details</button>
892
899
  <!-- The §E4 split: ▶ runs with the current default, ▾ opens folder + which terminal AI for
893
900
  THIS run only. Hidden outright when no runtime is installed or this request's type
894
901
  can't run headless — hide, never disable. -->
895
902
  <span class="run-split" id="request-help-run-split" hidden>
896
- <button data-command-id="shell.request-help-run" id="request-help-run" class="primary run-split-main">▶ Run it for me</button>
903
+ <button data-command-id="shell.request-help-run" id="request-help-run" class="primary run-split-main">▶ Start automatically</button>
897
904
  <button data-command-id="shell.request-help-options" id="request-help-run-opts" class="primary run-split-caret" aria-label="Choose folder and terminal AI" data-tip="Choose the folder and which terminal AI to use">▾</button>
898
905
  </span>
899
906
  </div>
@@ -91,8 +91,11 @@
91
91
  }
92
92
 
93
93
  // Appended once here rather than repeated on every registration: how you get
94
- // out of an armed command is the producer's business, not each command's.
95
- parts.push('Esc to cancel');
94
+ // out of an armed command is the producer's business. A command whose Esc does
95
+ // something OTHER than cancel (it commits, say) overrides the wording with
96
+ // `escLabel` — the route is still appended here, only its name comes from the
97
+ // registry.
98
+ parts.push(meta.escLabel || 'Esc to cancel');
96
99
 
97
100
  return { tone: 'armed', chip: chip, parts: parts, ask: meta.label, commandId: id, surface: child.surface || 'shell' };
98
101
  }
@@ -237,7 +240,7 @@
237
240
 
238
241
  function focusFor(el) {
239
242
  if (!el || el === document.body) return null;
240
- var target = el.closest('button, [role="button"], [role="treeitem"], a[href], input, select, textarea');
243
+ var target = el.closest('button, summary, [role="button"], [role="treeitem"], a[href], input, select, textarea');
241
244
  if (!target) return null;
242
245
 
243
246
  var tip = target.getAttribute('data-tip') || '';
@@ -247,10 +250,13 @@
247
250
  // A registered template supplies the facts; the instance key supplies the
248
251
  // subject, so one authored entry serves every generated row.
249
252
  if (cmd && cmd.meta) {
253
+ // Parameterized command ids keep opaque request/lease keys for exact activation. Narration may
254
+ // provide a separate plain-English subject so `?` never reads implementation ids aloud.
255
+ var narratedInstance = target.getAttribute('data-command-instance-label') || cmd.instance;
250
256
  return {
251
257
  label: cmd.meta.label || accessibleName(target),
252
- acts: cmd.instance && cmd.meta.actsOn
253
- ? cmd.meta.actsOn.replace('{instance}', cmd.instance)
258
+ acts: narratedInstance && cmd.meta.actsOn
259
+ ? cmd.meta.actsOn.replace('{instance}', narratedInstance)
254
260
  : cmd.meta.actsOn || null,
255
261
  group: cmd.meta.group || groupOf(target),
256
262
  key: cmd.meta.key || target.getAttribute('data-key'),
@@ -463,7 +469,13 @@
463
469
 
464
470
  function sheetEntries() {
465
471
  if (!window.Commands) return [];
466
- return window.Commands.all().slice().sort(function (a, b) {
472
+ var entries = [];
473
+ window.Commands.all().forEach(function (cmd) {
474
+ var instances = visibleCommandInstances(cmd);
475
+ if (instances.length) Array.prototype.push.apply(entries, instances);
476
+ else entries.push(cmd);
477
+ });
478
+ return entries.sort(function (a, b) {
467
479
  // What is on screen comes first. Nothing is hidden — the sheet is also how
468
480
  // you find out what FloLess can do somewhere else, and its zero-result copy
469
481
  // calls a miss "a gap worth reporting", which would be a lie if the
@@ -480,6 +492,36 @@
480
492
  });
481
493
  }
482
494
 
495
+ /* A command-sheet row for a runtime-built control must retain the exact instance it describes.
496
+ Otherwise two request rows sharing one template both navigate to whichever carrier happens to
497
+ appear first in the DOM. Read attributes instead of interpolating instance data into a selector:
498
+ request ids and member labels are data, and may legitimately contain selector punctuation. */
499
+ function visibleCommandInstances(cmd) {
500
+ var found = [], seen = {};
501
+ function collect(doc, origin) {
502
+ if (!doc || !doc.querySelectorAll) return;
503
+ Array.prototype.forEach.call(doc.querySelectorAll('[data-command-id]'), function (el) {
504
+ if ((el.closest && el.closest('#command-sheet'))
505
+ || !(el.offsetParent || (el.getClientRects && el.getClientRects().length))) return;
506
+ var raw = el.getAttribute('data-command-id') || '';
507
+ var parts = window.Commands.split ? window.Commands.split(raw) : null;
508
+ if (!parts || parts.template !== cmd.id || !parts.instance || seen[raw]) return;
509
+ seen[raw] = true;
510
+ found.push(Object.assign({}, cmd, {
511
+ commandId: raw,
512
+ instance: parts.instance,
513
+ instanceLabel: el.getAttribute('data-command-instance-label') || accessibleName(el),
514
+ originSurface: origin,
515
+ }));
516
+ });
517
+ }
518
+ collect(document, 'shell');
519
+ if (activeReporterWindow && snapshot.child) {
520
+ try { collect(activeReporterWindow.document, snapshot.child.surface || 'shell'); } catch (e) { /* torn down */ }
521
+ }
522
+ return found;
523
+ }
524
+
483
525
  /* What a row says BESIDES its label. An entry with nothing to add says
484
526
  nothing — silence beats an echo, and a row that reads "Compile — compiles"
485
527
  would cost the whole surface its credibility. */
@@ -489,7 +531,7 @@
489
531
  serve every generated row. The sheet lists TEMPLATES, so there is no
490
532
  instance to fill it with — and shipping the literal braces to a user is
491
533
  the kind of leak that costs a documentation surface its credibility. */
492
- if (cmd.actsOn) facts.push(cmd.actsOn.replace(/\{instance\}/g, 'the one you pick'));
534
+ if (cmd.actsOn) facts.push(cmd.actsOn.replace(/\{instance\}/g, cmd.instanceLabel || cmd.instance || 'the one you pick'));
493
535
  if (cmd.risk && cmd.risk.indexOf('destructive') !== -1) facts.push('cannot be undone');
494
536
  if (cmd.risk && cmd.risk.indexOf('costs-money') !== -1) facts.push('costs money');
495
537
  if (cmd.persistence === 'external') facts.push('reaches outside FloLess');
@@ -515,7 +557,7 @@
515
557
  themselves. Risk flags are in, so "destructive" finds what it should. */
516
558
  function matches(cmd, q) {
517
559
  if (!q) return true;
518
- var hay = [cmd.label, cmd.actsOn, cmd.group, cmd.key, cmd.why]
560
+ var hay = [cmd.label, cmd.instanceLabel, cmd.actsOn, cmd.group, cmd.key, cmd.why]
519
561
  .concat(cmd.steps || [])
520
562
  .concat(cmd.risk || [])
521
563
  .join(' ').toLowerCase();
@@ -547,6 +589,7 @@
547
589
  'In the 3D toolbar', 'In the 3D side panel', 'On the snap bar',
548
590
  'In the grid panel', 'In the Inspect panel',
549
591
  'In the Properties popup', 'In the snap override menu', 'In the dimension value popup', 'In the selection filter',
592
+ 'In the review list', // the connection-review popover — a sibling of the selection filter, and it hangs off the header stats above
550
593
  'In the ⋯ menu',
551
594
  'In the ⋯ menu — Snapping', 'In the ⋯ menu — Display', 'In the ⋯ menu — Detailing',
552
595
  'In the ⋯ menu — Model checks', 'In the ⋯ menu — Coordinate system', 'In the ⋯ menu — Session',
@@ -554,7 +597,9 @@
554
597
  'In the Connections dialog', 'In the reference-model dialogs', 'In the connection-import dialog',
555
598
  'In the confidence report', 'In the Ask AI dialog', 'In the Favourites dialog',
556
599
  // the drawing filter
557
- 'In the Drawing Filter header', 'In the Drawing Filter panel', 'On the Drawing Filter canvas',
600
+ 'In the Drawing Filter header', 'In a Drawing Filter message',
601
+ 'In the Drawing Filter panel', 'On the Drawing Filter canvas',
602
+ 'In the Drawing Filter exclusion approval',
558
603
  // the vector editor, and its 3D viewer
559
604
  'In the Trace header', 'In the Trace panel', 'On the Trace canvas',
560
605
  'In the Trace — 3D header', 'On the Trace — 3D view',
@@ -637,10 +682,10 @@
637
682
  var row = document.createElement('button');
638
683
  row.type = 'button';
639
684
  row.className = 'cmd-row';
640
- row.id = 'cmd-row-' + cmd.id; // the aria-activedescendant target
685
+ row.id = 'cmd-row-' + cmd.id + '-' + sheetRows.length; // unique aria-activedescendant target
641
686
  row.setAttribute('role', 'option');
642
687
  row.setAttribute('aria-selected', 'false');
643
- row.dataset.commandId = cmd.id;
688
+ row.dataset.commandId = cmd.commandId || cmd.id;
644
689
 
645
690
  var label = document.createElement('span');
646
691
  label.className = 'cmd-row-label';
@@ -713,27 +758,19 @@
713
758
  row is the ONLY match. The result was focusing a row inside a dialog that
714
759
  had just been hidden. Visibility is checked too: a control in a closed
715
760
  panel is found by a selector but cannot be focused. */
716
- /* Concatenated, not escaped, and that is safe for a specific reason worth
717
- stating: `cmd.id` can only be a registered id, and commands.js refuses to
718
- register anything outside lowercase dotted-kebab — so it cannot contain a
719
- quote to close the string or a backslash to start an escape.
720
-
721
- The INSTANCE key is the half that comes from data (a member mark, a level
722
- elevation like 16'-6"), and it deliberately never appears here: the second
723
- arm matches on the `id#` PREFIX and lets the attribute selector's own
724
- quoting cover whatever follows. So an instance containing a quote is a
725
- problem only where it is WRITTEN INTO markup, never where it is read back.
726
- Keep it that way — building a selector from a raw instance is the shape
727
- that would break. */
728
- var sel = '[data-command-id="' + cmd.id + '"], [data-command-id^="' + cmd.id + '#"]';
761
+ var exactCommandId = cmd.commandId || null;
762
+ function matchesCommand(el) {
763
+ var raw = el.getAttribute('data-command-id') || '';
764
+ return exactCommandId ? raw === exactCommandId : (raw === cmd.id || raw.indexOf(cmd.id + '#') === 0);
765
+ }
729
766
  var live = null;
730
767
  /* Which document the control was found in — carried so the entry can be stamped
731
768
  with where the control LIVES rather than with whatever surface happened to be
732
769
  on screen. A shell button stays alive (and focusable) under the child overlay,
733
770
  so those two are genuinely different answers. */
734
771
  var liveOrigin = 'shell';
735
- Array.prototype.forEach.call(document.querySelectorAll(sel), function (el) {
736
- if (live || (el.closest && el.closest('#command-sheet'))) return;
772
+ Array.prototype.forEach.call(document.querySelectorAll('[data-command-id]'), function (el) {
773
+ if (live || !matchesCommand(el) || (el.closest && el.closest('#command-sheet'))) return;
737
774
  if (el.offsetParent || (el.getClientRects && el.getClientRects().length)) live = el;
738
775
  });
739
776
 
@@ -751,11 +788,11 @@
751
788
  if (!live && activeReporterWindow && snapshot.child) {
752
789
  try {
753
790
  var doc = activeReporterWindow.document;
754
- Array.prototype.forEach.call(doc.querySelectorAll(sel), function (el) {
791
+ Array.prototype.forEach.call(doc.querySelectorAll('[data-command-id]'), function (el) {
755
792
  // Same exclusion as above. No child renders a sheet today, but the rows are
756
793
  // the one place a data-command-id describes a LIST ENTRY rather than a control,
757
794
  // and half a rule is how that distinction gets lost.
758
- if (live || (el.closest && el.closest('#command-sheet'))) return;
795
+ if (live || !matchesCommand(el) || (el.closest && el.closest('#command-sheet'))) return;
759
796
  if (el.offsetParent || (el.getClientRects && el.getClientRects().length)) {
760
797
  live = el;
761
798
  liveOrigin = snapshot.child.surface || 'shell';
@@ -771,10 +808,20 @@
771
808
  /* FALLS THROUGH when the control cannot be described, rather than returning.
772
809
  focusFor() resolves upward through
773
810
  `closest('button, [role="button"], [role="treeitem"], a[href], input, select, textarea')`, and
774
- three registered commands carry their id on a <label> whose <input> is a
775
- DESCENDANT — filter.match-on and vector.show-kind — so the walk finds
776
- nothing and it returns null. (That shape is deliberate: the id sits on the
777
- label because that is what a screen reader names the control from.)
811
+ a registered command can carry its id on a <label> whose <input> is a
812
+ DESCENDANT, and SEVEN carriers across four templates still do:
813
+ shell.open-at-startup and shell.routine-enabled (index.html),
814
+ steel.show-labels and steel.work-plane-show (steel-editor.html),
815
+ vector.show-kind and vector.isolate-weak (vector-editor.html). For every one
816
+ of them `live.focus()` above quietly does nothing — a <label> is not
817
+ focusable — so this fall-through is the ONLY outcome those commands can
818
+ reach, and `?` describes them instead of going to them.
819
+ #805 Phase D moved the two steel-filter ones (filter.match-on,
820
+ filter.facet-toggle) off that shape and left the rest alone: they are other
821
+ surfaces, and moving them is not that slice's to do. Putting the id on the
822
+ input costs no accessible name — `accessibleNameOf` names a form control
823
+ from its wrapping label — and it is what makes Enter here actually go to the
824
+ control. The remaining seven are a known, recorded gap, not a design.
778
825
 
779
826
  Returning here on a null entry would have left the PREVIOUS entry standing,
780
827
  since setFocusEntry declines rather than assigning — reintroducing exactly
@@ -796,14 +843,14 @@
796
843
  learns what it does and where it lives, which is what they asked for. */
797
844
  setFocusEntry({
798
845
  label: cmd.label,
799
- acts: cmd.actsOn ? cmd.actsOn.replace(/\{instance\}/g, 'the one you pick') : null,
846
+ acts: cmd.actsOn ? cmd.actsOn.replace(/\{instance\}/g, cmd.instanceLabel || cmd.instance || 'the one you pick') : null,
800
847
  group: cmd.group,
801
848
  key: cmd.key,
802
849
  tip: cmd.why || '',
803
850
  disabled: false,
804
851
  disabledReason: null,
805
852
  commandId: cmd.id,
806
- instance: null,
853
+ instance: cmd.instance || null,
807
854
  }, cmd.surface || 'shell');
808
855
  paint();
809
856
  }
@@ -838,6 +885,7 @@
838
885
  app using `inert`, so it is latent rather than live, but "the second user of
839
886
  inert silently breaks the first" is a bad thing to leave lying around. */
840
887
  var inertBefore = null;
888
+ var coveredDialogAriaBefore = null;
841
889
 
842
890
  function setBackgroundInert(on) {
843
891
  if (on) {
@@ -856,15 +904,20 @@
856
904
 
857
905
  function openSheet() {
858
906
  if (!$sheet || sheetOpen || !enabled) return false;
859
- /* Never stack on another dialog. Every .modal-backdrop here sits at the same
860
- z-index (app.css records the bugs that caused), so a second one would be
861
- ordered by DOM position rather than by what the user opened last. Declining
862
- is the honest behaviour — `?` while a dialog is open is not a request to
863
- bury it. */
864
- if (document.querySelector('.modal-backdrop.show')) return false;
907
+ /* Requests is the one dialog whose runtime-built controls need to be browsable in this sheet.
908
+ It is covered (inert + aria-hidden) while the sheet owns the screen, and app.css gives the
909
+ sheet the explicit upper tier. Every other dialog still refuses stacking: its controls are
910
+ already explained in place and opening above it would obscure an unfinished decision. */
911
+ var shownDialogs = Array.prototype.slice.call(document.querySelectorAll('.modal-backdrop.show'))
912
+ .filter(function (modal) { return modal !== $sheet; });
913
+ if (shownDialogs.some(function (modal) { return modal.id !== 'requests-modal'; })) return false;
865
914
 
866
915
  returnFocusTo = document.activeElement;
867
916
  sheetOpen = true;
917
+ coveredDialogAriaBefore = shownDialogs.map(function (modal) {
918
+ return [modal, modal.getAttribute('aria-hidden')];
919
+ });
920
+ shownDialogs.forEach(function (modal) { modal.setAttribute('aria-hidden', 'true'); });
868
921
  $sheet.hidden = false;
869
922
  $sheet.classList.add('show');
870
923
  setBackgroundInert(true);
@@ -888,7 +941,23 @@
888
941
  sheetOpen = false;
889
942
  $sheet.classList.remove('show');
890
943
  $sheet.hidden = true;
944
+ // A pointer-opened row is normally the freshest hover target when this dialog closes.
945
+ // That row is hidden now, so letting the next `?` prefer it over the control we just
946
+ // focused narrates the row's opaque instance key instead of the live control's authored
947
+ // `data-command-instance-label`. Retire only a target owned by this surface: a still-visible
948
+ // control elsewhere remains the user's valid pointer intent after a keyboard close.
949
+ if (lastHovered && lastHovered.closest && lastHovered.closest('#command-sheet')) {
950
+ lastHovered = null;
951
+ lastHoveredAt = 0;
952
+ }
891
953
  setBackgroundInert(false);
954
+ if (coveredDialogAriaBefore) {
955
+ coveredDialogAriaBefore.forEach(function (pair) {
956
+ if (pair[1] === null) pair[0].removeAttribute('aria-hidden');
957
+ else pair[0].setAttribute('aria-hidden', pair[1]);
958
+ });
959
+ coveredDialogAriaBefore = null;
960
+ }
892
961
  // Focus goes back where it came from. Dropping it on <body> is how a keyboard
893
962
  // user gets stranded at the top of the document with no idea what happened.
894
963
  if (returnFocusTo && returnFocusTo.focus && document.contains(returnFocusTo)) returnFocusTo.focus();