@floless/app 0.111.1 → 0.111.3

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.
@@ -3466,8 +3466,11 @@
3466
3466
  'member-added': 'k-added', 'member-removed': 'k-removed', 'member-changed': 'k-changed',
3467
3467
  'plan-added': 'k-added', 'plan-changed': 'k-changed',
3468
3468
  };
3469
- /** The 2–3 headline fields worth showing for an added member — not the whole record. */
3469
+ /** The 2–3 headline fields worth showing for a member — not the whole record. */
3470
3470
  const MEMBER_HEADLINE = ['profile', 'role', 'material'];
3471
+ /** Shared by `member-added` and `member-removed`, so the two member rows cannot drift apart. */
3472
+ const memberHeadline = (m) =>
3473
+ MEMBER_HEADLINE.map((k) => m[k]).filter((v) => v != null && v !== '').map(shortVal).join(' · ');
3471
3474
 
3472
3475
  function proposalRow(p, idx, bucket) {
3473
3476
  const row = revEl('div', 'rev-row ' + (KIND_CLASS[p.kind] || 'k-changed'));
@@ -3485,22 +3488,83 @@
3485
3488
  head.appendChild(title);
3486
3489
  main.appendChild(head);
3487
3490
 
3491
+ // WHAT THIS ROW SAYS BEYOND ITS ID — collected rather than appended straight to `main`, so the
3492
+ // checkbox can be wired to it with `aria-describedby` below. Without that wiring a sighted reader
3493
+ // decides with the profile, the role and the sheets while a screen-reader user gets an id: the
3494
+ // same "most consequential row, least to judge by" defect this change exists to fix, for fewer
3495
+ // people. (The kind BADGE is still outside every row's accessible name — pre-existing, uniform
3496
+ // across all four kinds, and deliberately left to one follow-up rather than patched asymmetrically
3497
+ // here.)
3498
+ const desc = [];
3488
3499
  if (p.kind === 'member-changed' || p.kind === 'plan-changed') {
3489
3500
  const fields = revEl('div', 'rev-fields');
3490
3501
  for (const f of p.fields || []) fields.appendChild(fieldLine(f.key, f.before, f.after));
3491
- main.appendChild(fields);
3502
+ desc.push(fields);
3492
3503
  } else if (p.kind === 'member-added' && p.member) {
3493
- const sub = MEMBER_HEADLINE.map((k) => p.member[k]).filter((v) => v != null && v !== '').map(shortVal).join(' · ');
3494
- if (sub) main.appendChild(revEl('div', 'rev-row-sub', sub));
3504
+ const sub = memberHeadline(p.member);
3505
+ if (sub) desc.push(revEl('div', 'rev-row-sub', sub));
3506
+ } else if (p.kind === 'member-removed') {
3507
+ // WHAT is being deleted, then WHERE it is on record — two lines, not one dot-run. " · " already
3508
+ // means "peer scalar attributes of one subject" in the line above; a clause with its own verb is
3509
+ // not a fourth attribute, and splicing it in would blur a grammar this modal already has.
3510
+ if (p.member) {
3511
+ const sub = memberHeadline(p.member);
3512
+ if (sub) desc.push(revEl('div', 'rev-row-sub', sub));
3513
+ } else if (p.matches > 1) {
3514
+ // Only the COUNT is emphasised, reusing the one idiom this modal already has for exactly that
3515
+ // (the counts line above wraps its two figures in a bare <b> inside muted prose). No colour,
3516
+ // icon or background: the row is already `k-removed`, which carries the strongest token in the
3517
+ // set, and alarming chrome on a decision the user must still make invites a reflexive no.
3518
+ const note = revEl('div', 'rev-row-note');
3519
+ note.appendChild(revEl('b', null, String(p.matches)));
3520
+ note.appendChild(document.createTextNode(' members in the model share this id, and accepting this removes every one of them.'));
3521
+ desc.push(note);
3522
+ } else if (p.matches === 0) {
3523
+ // NOT "accepting this removes nothing", which is what it looks like and is false:
3524
+ // `applyStagedRevision` REFUSES a removal whose target is absent, and confirm answers 400 for
3525
+ // the WHOLE selection. And not an instruction either — the first version said "close and
3526
+ // reopen the review", which review showed is a ritual that cannot help: this state needs the
3527
+ // facts and the proposals to have come from different documents, so reopening recomputes the
3528
+ // same row. A statement of what is true, and what it means for this checkbox.
3529
+ desc.push(revEl('div', 'rev-row-note', 'This id is not in the model this review was computed against, so this row cannot be applied.'));
3530
+ }
3531
+ // INDEPENDENT of `matches`, because the sheets are looked up from the ID and not from the
3532
+ // resolved record: they stay true when it is missing, and when it is ambiguous.
3533
+ if (!(p.sheets || []).length && p.matches > 0) {
3534
+ // THE ONE FIELD THAT WOULD OTHERWISE DEGRADE IN SILENCE, which review caught: an unreadable
3535
+ // `memberRefs` yields `sheets: []`, the line below simply does not render, and the row looks
3536
+ // like an ordinary confident removal that happens to be referenced nowhere. Those are opposite
3537
+ // conclusions — "referenced nowhere" argues FOR deleting, "we could not read where it is
3538
+ // referenced" argues against — and a screen whose whole job is informed consent must not let
3539
+ // them render identically.
3540
+ //
3541
+ // Safe to say outright because the empty case is IMPOSSIBLE for a sound document:
3542
+ // `checkModelReferences` raises `member-unpresented` unless a member has an active observation
3543
+ // or a `memberRefs` entry, which is exactly the union the server computes here.
3544
+ desc.push(revEl('div', 'rev-row-note', 'This model does not record where this member appears — it may be referenced on sheets this review cannot list.'));
3545
+ }
3546
+ if ((p.sheets || []).length) {
3547
+ // "Referenced", never "shown" — span containment is deliberately not in this list, so a column
3548
+ // can appear on sheets that never name it. Any verb implying "you would SEE it there" would be
3549
+ // false; one implying "it is on record here" is not. The tooltip carries the full caveat so the
3550
+ // visible line does not have to.
3551
+ const on = revEl('div', 'rev-row-sub', `Referenced on ${shortVal(p.sheets)}`);
3552
+ on.setAttribute('data-tip', 'Sheets that list this member or supply its evidence. A column can also appear on other sheets whose level its span crosses.');
3553
+ desc.push(on);
3554
+ }
3495
3555
  } else if (p.kind === 'plan-added') {
3496
3556
  const keys = Object.keys(p.plan || {}).filter((k) => k !== 'sheet');
3497
- main.appendChild(revEl('div', 'rev-row-sub', keys.length ? `${keys.length} field${keys.length > 1 ? 's' : ''}: ${keys.slice(0, 6).map(prettyKey).join(', ')}${keys.length > 6 ? '…' : ''}` : 'a new sheet'));
3557
+ desc.push(revEl('div', 'rev-row-sub', keys.length ? `${keys.length} field${keys.length > 1 ? 's' : ''}: ${keys.slice(0, 6).map(prettyKey).join(', ')}${keys.length > 6 ? '…' : ''}` : 'a new sheet'));
3498
3558
  // The omission is NAMED. A reviewer who cannot see the page image should be told it comes with
3499
3559
  // the sheet, rather than left to read the field list as complete.
3500
3560
  if ((p.omitted || []).length) {
3501
- main.appendChild(revEl('div', 'rev-row-note', `The page image and traced linework come with this sheet (${p.omitted.map(prettyKey).join(', ')}).`));
3561
+ desc.push(revEl('div', 'rev-row-note', `The page image and traced linework come with this sheet (${p.omitted.map(prettyKey).join(', ')}).`));
3502
3562
  }
3503
3563
  }
3564
+ if (desc.length) {
3565
+ desc.forEach((n, i) => { n.id = `${id}-desc-${i}`; main.appendChild(n); });
3566
+ box.setAttribute('aria-describedby', desc.map((n) => n.id).join(' '));
3567
+ }
3504
3568
  row.appendChild(label);
3505
3569
  row.appendChild(main);
3506
3570
  return row;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.111.1",
3
+ "version": "0.111.3",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app \u00e2\u20ac\u201d serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {