visualproof 0.11.0 → 0.11.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.
@@ -24,7 +24,8 @@
24
24
  // The notes layer stacks, bottom to top (NOTE_Z): the leaders, the icons and dots with the folded
25
25
  // clusters' markers, the cards — the one pressed or opened last in front —, what would hold a dragged
26
26
  // note, and the icon being dragged. An expanded note's card covers the icons under it; its own it
27
- // never covers, since a card hangs clear of its icon.
27
+ // never covers, since a card hangs clear of its icon. Another card it covers only where no place
28
+ // near enough is free (the owner's decision of 2026-11-10, spreadCards).
28
29
  import { AUTO_COLLAPSE_PX, CARD_REACH, DECL_AT, DECL_REACH, keptDecl, noteLook, ZONE_MAX_PX, ZONE_MIN_PX } from "./sticky.js";
29
30
  /** the icon's diameter on the screen, in pixels: something to point at and click, small enough to
30
31
  * sit in a cluster without covering what is around its place */
@@ -257,6 +258,64 @@ export function hangCard(icon, off, w, h, room, avoid = null) {
257
258
  }
258
259
  return { box: best.box, flip: best.flip };
259
260
  }
261
+ /** the room kept between two cards set apart (spreadCards), in pixels of the screen */
262
+ export const CARD_APART = 6;
263
+ /** The cards' boxes set apart so that, as far as they can be, no card covers another (the owner's
264
+ * decision of 2026-11-10): one placed by hand, or dragged, stays where it is; every other, from the
265
+ * top of the screen down, keeps where it hangs by itself where nothing taken is there, and else
266
+ * moves the least it can to where nothing is — another way round its icon (FLIPS), or from one of
267
+ * them along an edge of a card in the way to just past it, CARD_APART clear —, clear of its own
268
+ * icon, within CARD_REACH of it, no further out of the room nor over the name it keeps off than it
269
+ * was. Where no such place is, it stays where it hangs, over the others. */
270
+ export function spreadCards(cards) {
271
+ const out = cards.map((c) => c.box);
272
+ const taken = cards.filter((c) => c.fixed).map((c) => c.box);
273
+ const free = cards
274
+ .map((c, i) => ({ c, i }))
275
+ .filter(({ c }) => !c.fixed)
276
+ .sort((a, b) => a.c.box.y0 - b.c.box.y0 || a.c.box.x0 - b.c.box.x0 || a.i - b.i);
277
+ for (const { c, i } of free) {
278
+ const b = c.box;
279
+ const meets = (x) => taken.some((t) => area(x, t) > 0);
280
+ if (!meets(b)) {
281
+ taken.push(b);
282
+ continue;
283
+ }
284
+ const w = b.x1 - b.x0, h = b.y1 - b.y0;
285
+ const outside = (x) => Math.max(0, w * h - area(x, c.room));
286
+ const was = { out: outside(b), covers: !!c.avoid && area(b, c.avoid) > 0 };
287
+ const [ix, iy] = c.icon;
288
+ const off = [(b.x0 + b.x1) / 2 - ix, (b.y0 + b.y1) / 2 - iy];
289
+ const fits = (x) => {
290
+ const dx = (x.x0 + x.x1) / 2 - ix, dy = (x.y0 + x.y1) / 2 - iy;
291
+ if (Math.abs(dx) > CARD_REACH || Math.abs(dy) > CARD_REACH)
292
+ return false;
293
+ if (Math.abs(dx) < w / 2 + ICON_CLEAR && Math.abs(dy) < h / 2 + ICON_CLEAR)
294
+ return false;
295
+ if (outside(x) > was.out + 0.5)
296
+ return false;
297
+ if (!was.covers && c.avoid && area(x, c.avoid) > 0)
298
+ return false;
299
+ return !meets(x);
300
+ };
301
+ const by = (x, dx, dy) => ({ x0: x.x0 + dx, y0: x.y0 + dy, x1: x.x1 + dx, y1: x.y1 + dy });
302
+ const ways = [];
303
+ for (const [fx, fy] of FLIPS) {
304
+ const f = cardBox(ix, iy, [off[0] * fx, off[1] * fy], w, h);
305
+ ways.push(f);
306
+ for (const t of taken)
307
+ ways.push(by(f, 0, t.y0 - CARD_APART - f.y1), by(f, 0, t.y1 + CARD_APART - f.y0), by(f, t.x0 - CARD_APART - f.x1, 0), by(f, t.x1 + CARD_APART - f.x0, 0));
308
+ }
309
+ // the nearest to where it hangs by itself, the first of those as near: tried nearest first
310
+ const cx = (b.x0 + b.x1) / 2, cy = (b.y0 + b.y1) / 2;
311
+ const far = ways.map((x, k) => ({ x, k, d: Math.hypot((x.x0 + x.x1) / 2 - cx, (x.y0 + x.y1) / 2 - cy) }));
312
+ far.sort((p, q) => p.d - q.d || p.k - q.k);
313
+ const best = far.find((p) => fits(p.x))?.x ?? b;
314
+ out[i] = best;
315
+ taken.push(best);
316
+ }
317
+ return out;
318
+ }
260
319
  /** The leader between an icon at (x, y) and its card's box: from the icon's edge to the point of the
261
320
  * card nearest the icon's centre; null where they touch. */
262
321
  export function leaderLine(x, y, b) {
@@ -6346,7 +6346,7 @@ var FocusMenu = class {
6346
6346
  };
6347
6347
 
6348
6348
  // src/web/src/reload.ts
6349
- var PAGE_VERSION = true ? "0.11.0" : null;
6349
+ var PAGE_VERSION = true ? "0.11.2" : null;
6350
6350
  var KEY = "visualproof:reload";
6351
6351
  var FOR_KEY = "visualproof:reloaded-for";
6352
6352
  var FRESH_MS = 10 * 6e4;
@@ -15546,16 +15546,43 @@ function sectionHead(id, shut, title, aside = "") {
15546
15546
  var TargetList = class {
15547
15547
  el;
15548
15548
  hooks;
15549
+ /** the gone target whose Unmark was pressed once, waiting for the second press */
15550
+ arming = null;
15551
+ /** an Unmark under way, and why the last one was refused */
15552
+ busy = null;
15553
+ refused = null;
15549
15554
  constructor(el, hooks) {
15550
15555
  this.el = el;
15551
15556
  this.hooks = hooks;
15552
15557
  el.addEventListener("click", (e2) => {
15553
15558
  const t2 = e2.target;
15559
+ const unmark = t2.closest("[data-unmark]");
15560
+ if (unmark) return void this.unmark(unmark.dataset.unmark);
15561
+ if (this.arming !== null) {
15562
+ this.arming = null;
15563
+ this.render();
15564
+ }
15554
15565
  if (t2.closest("[data-sec]")) return this.hooks.toggle("targets");
15555
15566
  const row = t2.closest("[data-target]");
15556
15567
  if (row) this.hooks.open(row.dataset.open ?? null, row.dataset.target);
15557
15568
  });
15558
15569
  }
15570
+ /** Unmark pressed on a gone target's row: the first press arms it, the second takes it off. */
15571
+ async unmark(target) {
15572
+ if (!this.hooks.unmark || this.busy !== null) return;
15573
+ if (this.arming !== target) {
15574
+ this.arming = target;
15575
+ this.refused = null;
15576
+ return this.render();
15577
+ }
15578
+ this.arming = null;
15579
+ this.busy = target;
15580
+ this.render();
15581
+ const why = await this.hooks.unmark(target);
15582
+ this.busy = null;
15583
+ this.refused = why ? { target, why } : null;
15584
+ this.render();
15585
+ }
15559
15586
  render() {
15560
15587
  const rows = targetRows(this.hooks.targets(), this.hooks.list());
15561
15588
  const shut = this.hooks.shut("targets");
@@ -15565,12 +15592,17 @@ var TargetList = class {
15565
15592
  html += rows.length ? `<div class="tg-rows">` + rows.map(({ target, view: v2 }) => {
15566
15593
  const p2 = this.hooks.progress(target);
15567
15594
  const k2 = this.hooks.keyProgress(target);
15595
+ const gone = p2 === null && !!this.hooks.unmark && !this.hooks.readOnly?.();
15596
+ const armed = this.arming === target;
15597
+ const unmark = gone ? `<button class="tg-unmark${armed ? " armed" : ""}" data-unmark="${escapeHtml(target)}"${this.busy === target ? " disabled" : ""} title="${escapeHtml(armed ? `Press again to unmark ${target}: it is no target any more; the history keeps that it was` : `Unmark ${target}: it is not in the graph now, and is no target any more; the history keeps that it was`)}">${armed ? "Unmark it?" : "Unmark"}</button>` : "";
15598
+ const why = this.refused?.target === target ? `<div class="act-warn tg-why">${escapeHtml(this.refused.why)}</div>` : "";
15568
15599
  const pct2 = (x2) => p2 && p2.total ? (100 * x2 / p2.total).toFixed(1) : "0";
15569
15600
  const tip = v2 ? `${target} \u2014 open its view, on it: ${this.hooks.title?.(v2.id) ?? v2.id}` : `${target} \u2014 it has no view: open a temporary view of its TCB, linked to it until it goes (pin, fold or name it to keep it)`;
15570
- return `<button class="tg-row${v2 && v2.id === active ? " on" : ""}${v2 ? "" : " tg-viewless"}"${v2 ? ` data-open="${escapeHtml(v2.id)}"` : ""} data-target="${escapeHtml(target)}" title="${escapeHtml(tip)}"><span class="tg-name"><span class="star">\u2605</span>${escapeHtml(target.split(".").pop())}</span>` + (p2 ? (
15601
+ const row = `<button class="tg-row${v2 && v2.id === active ? " on" : ""}${v2 ? "" : " tg-viewless"}"${v2 ? ` data-open="${escapeHtml(v2.id)}"` : ""} data-target="${escapeHtml(target)}" title="${escapeHtml(tip)}"><span class="tg-name"><span class="star">\u2605</span>${escapeHtml(target.split(".").pop())}</span>` + (p2 ? (
15571
15602
  // with no view, that is said where the bar is, so that the name keeps its room
15572
15603
  (v2 ? `<span class="rv-bar"><i class="ok" style="width:${pct2(p2.approved)}%"></i><i class="commented" style="width:${pct2(p2.commented)}%"></i><i class="stale" style="width:${pct2(p2.stale)}%"></i></span>` : `<span class="tg-noview">no view</span>`) + (k2 ? `<span class="tg-key" title="${escapeHtml(`Key declarations that need review: ${k2.approved} of ${k2.total} approved, the target among them${k2.trusted ? `; ${k2.trusted} more trusted, in need of no review` : ""}`)}"><span class="key-mark">\u25C6</span>${k2.approved}/${k2.total}</span>` : "") + `<span class="tg-n" title="${escapeHtml(`All it rests on: ${p2.approved} of ${p2.total} approved`)}">${p2.approved}/${p2.total}</span>`
15573
15604
  ) : `<span class="muted tg-gone">not in the graph now${v2 ? "" : ", no view"}</span>`) + `</button>`;
15605
+ return unmark ? `<div class="tg-line">${row}${unmark}</div>${why}` : row;
15574
15606
  }).join("") + `</div>` : `<div class="tg-none muted">${this.hooks.readOnly?.() ? "No targets yet." : "No targets yet: \u2606 Mark as target in a theorem's panel."}</div>`;
15575
15607
  }
15576
15608
  keepFocus(this.el, () => this.el.innerHTML = html);
@@ -16687,6 +16719,13 @@ var AGAIN_MS = 900;
16687
16719
  var SIDE_MIN = 700;
16688
16720
  var FITTED_MIN = 540;
16689
16721
  var SCREEN_MIN = 1e3;
16722
+ var PANE_W = 360;
16723
+ var PANE_MIN = 240;
16724
+ var CODE_MIN = 300;
16725
+ function paneWidth(want, room2) {
16726
+ const w2 = want !== null && Number.isFinite(want) ? want : PANE_W;
16727
+ return Math.round(Math.max(PANE_MIN, Math.min(w2, room2 - CODE_MIN)));
16728
+ }
16690
16729
  function paneSide(winWidth, fitted, screenWidth) {
16691
16730
  if (screenWidth < SCREEN_MIN && winWidth < SIDE_MIN) return false;
16692
16731
  return winWidth >= (fitted && screenWidth >= SCREEN_MIN ? FITTED_MIN : SIDE_MIN);
@@ -16749,6 +16788,7 @@ function headHtml(caret, sides, interactive) {
16749
16788
  return `<div class="iv-head"><span class="iv-title">InfoView</span><span class="iv-where" title="${interactive ? "Hover a subterm for its type" : ""}">line ${caret.line + 1}, column ${caret.ch + 1}</span>${seg}<button type="button" class="icon iv-hide" data-iv-hide aria-label="Hide the InfoView" title="Hide the InfoView in every source window (kept in this browser)">${HIDE}</button></div>`;
16750
16789
  }
16751
16790
  var HIDE = `<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M6 4l4 4-4 4"/></svg>`;
16791
+ var GRIP = `<div class="iv-grip" aria-hidden="true" title="Drag to widen or narrow the InfoView; double-click for its own width"></div>`;
16752
16792
  var InfoView = class {
16753
16793
  hooks;
16754
16794
  code = null;
@@ -16767,6 +16807,8 @@ var InfoView = class {
16767
16807
  hoverWait = null;
16768
16808
  hoverTurn = 0;
16769
16809
  sizer = null;
16810
+ /** the last press in the pane was on its grip, beside the code */
16811
+ onGrip = false;
16770
16812
  constructor(hooks) {
16771
16813
  this.hooks = hooks;
16772
16814
  }
@@ -16944,7 +16986,7 @@ var InfoView = class {
16944
16986
  if (had) this.hooks.win().focus({ preventScroll: true });
16945
16987
  return this.below();
16946
16988
  }
16947
- pane.innerHTML = headHtml(k2, v2.sides, !!this.answer?.interactive) + `<div class="iv-body">${v2.html}</div>`;
16989
+ pane.innerHTML = GRIP + headHtml(k2, v2.sides, !!this.answer?.interactive) + `<div class="iv-body">${v2.html}</div>`;
16948
16990
  pane.setAttribute("aria-label", "What Lean says at the caret");
16949
16991
  if (had && !had.isConnected) (pane.querySelector(`[data-iv-when="${when}"]`) ?? this.hooks.win()).focus({ preventScroll: true });
16950
16992
  this.below();
@@ -16989,6 +17031,13 @@ var InfoView = class {
16989
17031
  this.hooks.moved();
16990
17032
  }
16991
17033
  });
17034
+ pane.addEventListener("pointerdown", (e2) => {
17035
+ this.onGrip = !!split?.classList.contains("iv-side") && !!e2.target.closest(".iv-grip");
17036
+ if (this.onGrip) this.drag(e2);
17037
+ });
17038
+ pane.addEventListener("dblclick", () => {
17039
+ if (this.onGrip) this.hooks.setWidth(null);
17040
+ });
16992
17041
  pane.addEventListener("mousemove", (e2) => {
16993
17042
  if (e2.buttons) return;
16994
17043
  const t2 = e2.target;
@@ -17039,8 +17088,51 @@ var InfoView = class {
17039
17088
  if (!r2 || r2.error || r2.pending || r2.stale || !r2.type && !r2.expr) return;
17040
17089
  this.hooks.cards.show(subtermHtml(r2, (w2) => this.hooks.resolve(w2)), box);
17041
17090
  }
17042
- /** Keep the pane beside the code where the window is wide enough, else below it; and tell the
17043
- * pane how tall the window's scrolled view is, which it stays within. */
17091
+ /** A press on the pane's edge beside the code: dragged, the pane as wide as the pointer makes it,
17092
+ * in this window as it moves and, let go, kept for every window (hooks.setWidth). Dragged left it
17093
+ * widens, the code giving way, or the window growing where it is fitted to its code. */
17094
+ drag(e2) {
17095
+ const pane = this.pane;
17096
+ const split = pane?.parentElement;
17097
+ if (!pane || !split || !e2.isPrimary || e2.pointerType === "mouse" && e2.button !== 0) return;
17098
+ e2.preventDefault();
17099
+ const x0 = e2.clientX, w0 = pane.offsetWidth;
17100
+ let w2 = w0;
17101
+ pane.setPointerCapture(e2.pointerId);
17102
+ split.classList.add("iv-sizing");
17103
+ const move = (ev) => {
17104
+ if (ev.pointerId !== e2.pointerId) return;
17105
+ w2 = paneWidth(w0 + x0 - ev.clientX, this.room());
17106
+ pane.style.width = `${w2}px`;
17107
+ };
17108
+ const end = (ev) => {
17109
+ if (ev.pointerId !== e2.pointerId) return;
17110
+ pane.removeEventListener("pointermove", move);
17111
+ pane.removeEventListener("pointerup", end);
17112
+ pane.removeEventListener("pointercancel", end);
17113
+ split.classList.remove("iv-sizing");
17114
+ if (w2 !== w0) this.hooks.setWidth(w2);
17115
+ };
17116
+ pane.addEventListener("pointermove", move);
17117
+ pane.addEventListener("pointerup", end);
17118
+ pane.addEventListener("pointercancel", end);
17119
+ }
17120
+ /** The width the code and the pane beside it may share (paneWidth's `room`): the window's, or the
17121
+ * most it may grow to where it is fitted to its code. */
17122
+ room() {
17123
+ const split = this.pane?.parentElement;
17124
+ if (!split) return 0;
17125
+ const win2 = this.hooks.win();
17126
+ const max = this.hooks.fitted() ? parseFloat(getComputedStyle(win2).maxWidth) : NaN;
17127
+ return split.clientWidth + (Number.isFinite(max) ? Math.max(0, max - win2.offsetWidth) : 0);
17128
+ }
17129
+ /** The reader's width for the pane changed, in another window or this one: it takes it. */
17130
+ resized() {
17131
+ this.size();
17132
+ }
17133
+ /** Keep the pane beside the code where the window is wide enough, else below it, as wide there as
17134
+ * the reader made it (paneWidth); and tell the pane how tall the window's scrolled view is, which
17135
+ * it stays within. */
17044
17136
  watchSize() {
17045
17137
  if (this.sizer || typeof ResizeObserver === "undefined") return this.size();
17046
17138
  this.sizer = new ResizeObserver(() => this.size());
@@ -17053,6 +17145,12 @@ var InfoView = class {
17053
17145
  if (!split || !scroll) return;
17054
17146
  const side2 = paneSide(this.hooks.win().offsetWidth, this.hooks.fitted(), document.documentElement.clientWidth || innerWidth);
17055
17147
  split.classList.toggle("iv-side", side2);
17148
+ const pane = this.pane;
17149
+ if (!side2) pane.style.width = "";
17150
+ else if (!split.classList.contains("iv-sizing")) {
17151
+ const w2 = `${paneWidth(this.hooks.width(), this.room())}px`;
17152
+ if (pane.style.width !== w2) pane.style.width = w2;
17153
+ }
17056
17154
  scroll.style.setProperty("--sw-view", `${scroll.clientHeight}px`);
17057
17155
  this.below();
17058
17156
  }
@@ -17641,6 +17739,8 @@ var SourceWindow = class {
17641
17739
  card: (name) => ({ html: this.fromGraph(name), more: this.describe(name) }),
17642
17740
  hidden: () => this.hooks.infoHidden?.() ?? false,
17643
17741
  hide: (on) => this.hooks.hideInfo?.(on),
17742
+ width: () => this.hooks.infoWidth?.() ?? null,
17743
+ setWidth: (w2) => this.hooks.setInfoWidth?.(w2),
17644
17744
  moved: () => this.hooks.caretMoved?.(this),
17645
17745
  win: () => this.el,
17646
17746
  fitted: () => this.win.fitted,
@@ -17986,6 +18086,10 @@ var SourceWindow = class {
17986
18086
  infoChanged() {
17987
18087
  this.info.draw();
17988
18088
  }
18089
+ /** The InfoView's width beside the code set by the reader, in every window. */
18090
+ infoResized() {
18091
+ this.info.resized();
18092
+ }
17989
18093
  /** Nothing picked: the quote button goes. */
17990
18094
  unpick() {
17991
18095
  this.picked = null;
@@ -42306,6 +42410,16 @@ function panelsPart(page) {
42306
42410
  store2.save();
42307
42411
  for (const w2 of sources.all) w2.infoChanged();
42308
42412
  },
42413
+ // its width beside the code, the reader's too (the owner's decision of 2026-11-10)
42414
+ infoWidth: () => {
42415
+ const w2 = store2.data.infoWidth;
42416
+ return typeof w2 === "number" && Number.isFinite(w2) ? w2 : null;
42417
+ },
42418
+ setInfoWidth: (w2) => {
42419
+ store2.data.infoWidth = w2 ?? void 0;
42420
+ store2.save();
42421
+ for (const s2 of sources.all) s2.infoResized();
42422
+ },
42309
42423
  caretMoved: (w2) => {
42310
42424
  for (const o2 of sources.all) if (o2 !== w2) o2.followCaret(null);
42311
42425
  page.people.report();
@@ -48623,6 +48737,48 @@ function hangCard(icon, off, w2, h2, room2, avoid = null) {
48623
48737
  }
48624
48738
  return { box: best.box, flip: best.flip };
48625
48739
  }
48740
+ var CARD_APART = 6;
48741
+ function spreadCards(cards) {
48742
+ const out = cards.map((c3) => c3.box);
48743
+ const taken = cards.filter((c3) => c3.fixed).map((c3) => c3.box);
48744
+ const free = cards.map((c3, i2) => ({ c: c3, i: i2 })).filter(({ c: c3 }) => !c3.fixed).sort((a3, b2) => a3.c.box.y0 - b2.c.box.y0 || a3.c.box.x0 - b2.c.box.x0 || a3.i - b2.i);
48745
+ for (const { c: c3, i: i2 } of free) {
48746
+ const b2 = c3.box;
48747
+ const meets2 = (x2) => taken.some((t2) => area(x2, t2) > 0);
48748
+ if (!meets2(b2)) {
48749
+ taken.push(b2);
48750
+ continue;
48751
+ }
48752
+ const w2 = b2.x1 - b2.x0, h2 = b2.y1 - b2.y0;
48753
+ const outside2 = (x2) => Math.max(0, w2 * h2 - area(x2, c3.room));
48754
+ const was = { out: outside2(b2), covers: !!c3.avoid && area(b2, c3.avoid) > 0 };
48755
+ const [ix, iy] = c3.icon;
48756
+ const off = [(b2.x0 + b2.x1) / 2 - ix, (b2.y0 + b2.y1) / 2 - iy];
48757
+ const fits = (x2) => {
48758
+ const dx = (x2.x0 + x2.x1) / 2 - ix, dy = (x2.y0 + x2.y1) / 2 - iy;
48759
+ if (Math.abs(dx) > CARD_REACH || Math.abs(dy) > CARD_REACH) return false;
48760
+ if (Math.abs(dx) < w2 / 2 + ICON_CLEAR && Math.abs(dy) < h2 / 2 + ICON_CLEAR) return false;
48761
+ if (outside2(x2) > was.out + 0.5) return false;
48762
+ if (!was.covers && c3.avoid && area(x2, c3.avoid) > 0) return false;
48763
+ return !meets2(x2);
48764
+ };
48765
+ const by = (x2, dx, dy) => ({ x0: x2.x0 + dx, y0: x2.y0 + dy, x1: x2.x1 + dx, y1: x2.y1 + dy });
48766
+ const ways = [];
48767
+ for (const [fx, fy] of FLIPS) {
48768
+ const f2 = cardBox(ix, iy, [off[0] * fx, off[1] * fy], w2, h2);
48769
+ ways.push(f2);
48770
+ for (const t2 of taken)
48771
+ ways.push(by(f2, 0, t2.y0 - CARD_APART - f2.y1), by(f2, 0, t2.y1 + CARD_APART - f2.y0), by(f2, t2.x0 - CARD_APART - f2.x1, 0), by(f2, t2.x1 + CARD_APART - f2.x0, 0));
48772
+ }
48773
+ const cx = (b2.x0 + b2.x1) / 2, cy = (b2.y0 + b2.y1) / 2;
48774
+ const far = ways.map((x2, k2) => ({ x: x2, k: k2, d: Math.hypot((x2.x0 + x2.x1) / 2 - cx, (x2.y0 + x2.y1) / 2 - cy) }));
48775
+ far.sort((p2, q2) => p2.d - q2.d || p2.k - q2.k);
48776
+ const best = far.find((p2) => fits(p2.x))?.x ?? b2;
48777
+ out[i2] = best;
48778
+ taken.push(best);
48779
+ }
48780
+ return out;
48781
+ }
48626
48782
  function leaderLine(x2, y2, b2) {
48627
48783
  const px2 = Math.max(b2.x0, Math.min(b2.x1, x2)), py = Math.max(b2.y0, Math.min(b2.y1, y2));
48628
48784
  const d2 = Math.hypot(px2 - x2, py - y2);
@@ -48994,6 +49150,8 @@ var Stickies = class {
48994
49150
  nbOf = { L: null, nodes: null, mode: null };
48995
49151
  /** the ring around the board, as drawn in the last frame */
48996
49152
  ring = null;
49153
+ /** the cards open this frame, as each hangs by itself: set apart once all are placed (hangCards) */
49154
+ opened = [];
48997
49155
  /** what would hold the note whose icon is dragged, were it let go now */
48998
49156
  target = null;
48999
49157
  /** the circle round its declaration, while the icon of a note attached to one is dragged */
@@ -49273,6 +49431,7 @@ var Stickies = class {
49273
49431
  const S7 = C7.scene;
49274
49432
  const W2 = innerWidth, H2 = innerHeight;
49275
49433
  this.topRing = void 0;
49434
+ this.opened = [];
49276
49435
  const onRing = [];
49277
49436
  const inCluster = [];
49278
49437
  for (const d3 of this.drawn.values()) {
@@ -49288,6 +49447,7 @@ var Stickies = class {
49288
49447
  else this.place(d3, s2.x, s2.y, look, t2, s2.point);
49289
49448
  }
49290
49449
  this.frameRing(onRing);
49450
+ this.hangCards();
49291
49451
  const p2 = this.dragging();
49292
49452
  const d2 = p2?.part === "icon" && p2.now ? this.drawn.get(p2.id) : void 0;
49293
49453
  const aim2 = d2 && p2?.now ? this.aimFor(d2, p2.now) : null;
@@ -49391,9 +49551,10 @@ var Stickies = class {
49391
49551
  /** Note `d` drawn at (wx, wy) of the board's world — its place, or, attached to a declaration whose
49392
49552
  * point is at `point`, its spot at its offset from it —, in `look`, `t` of its icon showing (1 its
49393
49553
  * icon, 0 its dot, between a blend: shared/notecard.ts, iconShare): its mark, and where it is open
49394
- * its card, hanging as its offset says and flipped to stay on the screen, joined to the icon by its
49395
- * leader; attached, the dashed leader to the declaration's point. Hidden where its mark is off the
49396
- * screen. What is dragged follows the pointer instead: the icon with its card, or the card alone. */
49554
+ * its card, hanging as its offset says and flipped to stay on the screen, then set apart from the
49555
+ * other open cards and joined to the icon by its leader (hangCards); attached, the dashed leader to
49556
+ * the declaration's point. Hidden where its mark is off the screen. What is dragged follows the
49557
+ * pointer instead: the icon with its card, or the card alone. */
49397
49558
  place(d2, wx, wy, look, t2 = 1, point = null) {
49398
49559
  const C7 = this.canvas;
49399
49560
  const k2 = C7.cam.k;
@@ -49426,13 +49587,30 @@ var Stickies = class {
49426
49587
  return;
49427
49588
  }
49428
49589
  const [w2, h2] = this.cardSizeOf(d2);
49429
- let box;
49590
+ const room2 = this.room();
49591
+ let box, avoid = null;
49430
49592
  if (p2?.part === "card" && p2.now) box = { x0: p2.now[0], y0: p2.now[1], x1: p2.now[0] + w2, y1: p2.now[1] + h2 };
49431
49593
  else {
49432
- const { off, avoid } = this.hangOf(d2, w2, h2);
49433
- box = hangCard([sx, sy], off, w2, h2, this.room(), avoid).box;
49594
+ const hang = this.hangOf(d2, w2, h2);
49595
+ avoid = hang.avoid;
49596
+ box = hangCard([sx, sy], hang.off, w2, h2, room2, avoid).box;
49434
49597
  }
49435
49598
  d2.box = box;
49599
+ this.opened.push({ d: d2, card: { icon: [sx, sy], box, room: room2, avoid, fixed: !!p2 || !!d2.note.card } });
49600
+ }
49601
+ /** The open cards set apart from one another, as far as they can be (the owner's decision of
49602
+ * 2026-11-10; shared/notecard.ts, spreadCards), and each hung there, joined to its icon by its
49603
+ * leader. */
49604
+ hangCards() {
49605
+ const opened = this.opened;
49606
+ this.opened = [];
49607
+ const boxes = spreadCards(opened.map((o2) => o2.card));
49608
+ opened.forEach(({ d: d2, card }, k2) => this.hang(d2, card.icon, boxes[k2]));
49609
+ }
49610
+ /** Note `d`'s card hung at `box`, its leader from its icon at `icon`. */
49611
+ hang(d2, icon, box) {
49612
+ const [sx, sy] = icon;
49613
+ d2.box = box;
49436
49614
  d2.card.style.transform = `translate(${Math.round(box.x0)}px, ${Math.round(box.y0)}px)`;
49437
49615
  const line = leaderLine(sx, sy, box);
49438
49616
  d2.lead.hidden = !line;
@@ -55921,6 +56099,9 @@ function tabsPart(page) {
55921
56099
  return i2 === void 0 ? null : page.flowNow.keyProgress(i2);
55922
56100
  },
55923
56101
  open: (id, target) => openTarget(id, target),
56102
+ // a target gone from the graph taken off from its row (HistorySpec decision 13), under the
56103
+ // reader's name
56104
+ unmark: async (target) => await page.people.ensure() ? page.submit({ op: "target", name: target, on: false }) : "A target is unmarked under your name: give one first.",
55924
56105
  title: (id) => page.views.title(id),
55925
56106
  shut: page.shut,
55926
56107
  toggle: page.toggleSection
@@ -56905,6 +57086,8 @@ var LostAndFound = class {
56905
57086
  flash = null;
56906
57087
  /** the Archived section opened by the reader */
56907
57088
  archivedOpen = false;
57089
+ /** the target entry whose Unmark was pressed once, by its key, waiting for the second press */
57090
+ unmarking = null;
56908
57091
  constructor(el, api2, hooks) {
56909
57092
  this.el = el;
56910
57093
  this.api = api2;
@@ -57034,6 +57217,22 @@ var LostAndFound = class {
57034
57217
  return;
57035
57218
  }
57036
57219
  const ek = at("data-lf-e");
57220
+ if (ek !== null && t2.closest("[data-lf-unmark]")) {
57221
+ const entry = group()?.entries[Number(ek)];
57222
+ if (!entry || entry.kind !== "target" || !this.hooks.unmark) return;
57223
+ if (this.unmarking !== entry.key) {
57224
+ this.unmarking = entry.key;
57225
+ return this.render();
57226
+ }
57227
+ this.unmarking = null;
57228
+ const unmark = this.hooks.unmark;
57229
+ void this.act(entry.key, async () => {
57230
+ const why = await unmark(entry.name);
57231
+ return why ? { error: why } : { ok: true };
57232
+ });
57233
+ return;
57234
+ }
57235
+ if (this.unmarking !== null) this.unmarking = null;
57037
57236
  if (ek !== null && t2.closest("[data-lf-archive]")) {
57038
57237
  const g2 = group();
57039
57238
  const entry = g2?.entries[Number(ek)];
@@ -57165,7 +57364,7 @@ var LostAndFound = class {
57165
57364
  g2.entries.forEach((e2, ei) => {
57166
57365
  const ewait = this.busy.has(e2.key) || this.busy.has(name) ? " disabled" : "";
57167
57366
  const eerr = this.errors.get(e2.key);
57168
- html += `<div class="lf-entry" data-lf-e="${ei}" data-lf-key="${escapeHtml(e2.key)}"><span class="lf-kind lf-${e2.kind}">${e2.kind}</span><div class="lf-entry-t">${this.entryHtml(e2)}</div><button class="lf-arch" data-lf-archive${ewait} title="Archive: hide it from the list; it is kept, under Archived">Archive</button>` + (eerr ? `<div class="act-warn">${escapeHtml(eerr)}</div>` : "") + `</div>`;
57367
+ html += `<div class="lf-entry" data-lf-e="${ei}" data-lf-key="${escapeHtml(e2.key)}"><span class="lf-kind lf-${e2.kind}">${e2.kind}</span><div class="lf-entry-t">${this.entryHtml(e2)}</div>` + (e2.kind === "target" && this.hooks.unmark ? this.unmarking === e2.key ? `<button class="lf-arch lf-unmark armed" data-lf-unmark${ewait} title="Press again to unmark it: it is no target any more; the history keeps that it was">Unmark it?</button>` : `<button class="lf-arch lf-unmark" data-lf-unmark${ewait} title="Unmark target: it is no target any more, and leaves this list; the history keeps that it was">Unmark</button>` : "") + `<button class="lf-arch" data-lf-archive${ewait} title="Archive: hide it from the list; it is kept, under Archived">Archive</button>` + (eerr ? `<div class="act-warn">${escapeHtml(eerr)}</div>` : "") + `</div>`;
57169
57368
  });
57170
57369
  return html + `</div>`;
57171
57370
  }
@@ -57290,6 +57489,9 @@ function timelinePart(page) {
57290
57489
  timeMachine: (at) => page.timeMachine(at),
57291
57490
  ensureName: () => page.people.ensure(),
57292
57491
  nameLost: () => page.people.lost(),
57492
+ // a lost target taken off from its entry (HistorySpec decision 13); the drawer asked for a name.
57493
+ // Not where the review cannot be changed: a snapshot, a read-only page
57494
+ ...data.snapshot || reader ? {} : { unmark: (name) => page.submit({ op: "target", name, on: false }) },
57293
57495
  toggled: (open) => {
57294
57496
  if (open && activity.open) activity.toggle(false);
57295
57497
  page.syncInsets();
@@ -812,7 +812,21 @@ button.o-trust:hover { color: var(--accent); background: var(--code-bg); }
812
812
  contain: inline-size; position: sticky; bottom: 0; max-height: max(140px, calc(var(--sw-view, 60vh) * 0.45));
813
813
  border-top: 1px solid var(--line); box-shadow: 0 -10px 18px -16px rgba(0, 0, 0, 0.35);
814
814
  }
815
- .sw-split.iv-side > .sw-info { flex: none; width: 360px; position: sticky; top: 0; max-height: var(--sw-view, 70vh); border-left: 1px solid var(--line); }
815
+ /* beside the code, as wide as the reader made it (web/src/infoview.ts, paneWidth: its own 360 px); its
816
+ head stays and its body scrolls, so that the grip on its left edge stays in sight */
817
+ .sw-split.iv-side > .sw-info {
818
+ flex: none; width: 360px; position: sticky; top: 0; max-height: var(--sw-view, 70vh); border-left: 1px solid var(--line);
819
+ display: flex; flex-direction: column; overflow: visible;
820
+ }
821
+ .sw-split.iv-side > .sw-info > .iv-head { flex: none; }
822
+ .sw-split.iv-side > .sw-info > .iv-body { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
823
+ /* the grip: the pane's left edge, dragged to widen or narrow it, double-clicked for its own width; the
824
+ line lights under the pointer and while dragged */
825
+ .iv-grip { display: none; }
826
+ .sw-split.iv-side > .sw-info > .iv-grip { display: block; position: absolute; z-index: 2; top: 0; bottom: 0; left: -5px; width: 9px; cursor: ew-resize; touch-action: none; }
827
+ .iv-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background 0.15s, box-shadow 0.15s; }
828
+ .iv-grip:hover::after, .iv-sizing .iv-grip::after { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
829
+ .sw-split.iv-sizing, .sw-split.iv-sizing * { cursor: ew-resize !important; user-select: none; -webkit-user-select: none; }
816
830
  .iv-head {
817
831
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px;
818
832
  background: var(--surface-solid); border-bottom: 1px solid var(--line); font: 12px var(--font);
@@ -1742,6 +1756,8 @@ details.lf-archived > summary { cursor: pointer; }
1742
1756
  }
1743
1757
  .lf-arch:hover { border-color: var(--accent); color: var(--accent); }
1744
1758
  .lf-arch:disabled, .act-undo:disabled { opacity: 0.5; cursor: default; }
1759
+ .lf-unmark { margin-right: 4px; }
1760
+ .lf-unmark.armed { border-color: color-mix(in srgb, var(--bad) 55%, transparent); color: var(--bad); }
1745
1761
  .lf-mv { font-size: 12.5px; }
1746
1762
  .lf-how { color: var(--text-2); font-size: 12px; }
1747
1763
  .lf-carried { color: var(--text-2); font-size: 11.5px; }
@@ -2088,7 +2104,19 @@ details.lf-archived > summary { cursor: pointer; }
2088
2104
  .tg-n { color: var(--text-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
2089
2105
  .tg-key { color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
2090
2106
  .tg-key .key-mark { margin-right: 1px; }
2091
- .tg-gone { grid-column: 2 / 5; font-size: 11px; }
2107
+ /* gone from the graph: said on a line of its own under the name, which keeps its room beside Unmark */
2108
+ .tg-gone { grid-column: 1 / -1; font-size: 11px; }
2109
+ /* a target gone from the graph: its row, and Unmark beside it (HistorySpec decision 13) */
2110
+ .tg-line { display: flex; align-items: center; gap: 4px; }
2111
+ .tg-line > .tg-row { flex: 1 1 auto; min-width: 0; }
2112
+ .tg-unmark {
2113
+ flex: none; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-solid);
2114
+ color: var(--text-2); font: 500 11px var(--font); line-height: 18px; cursor: pointer;
2115
+ }
2116
+ .tg-unmark:hover, .tg-unmark:focus-visible { border-color: var(--accent); color: var(--accent); }
2117
+ .tg-unmark.armed { border-color: color-mix(in srgb, var(--bad) 55%, transparent); color: var(--bad); }
2118
+ .tg-unmark:disabled { opacity: 0.5; cursor: default; }
2119
+ .tg-why { margin: 2px 6px 4px; font-size: 11px; }
2092
2120
  .tg-none { margin-top: 4px; font-size: 11.5px; line-height: 1.4; }
2093
2121
  /* the board (web/src/boardpanel.ts): which view, kept or not, and its scope as chips */
2094
2122
  .board-h { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visualproof",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "type": "module",
5
5
  "description": "See a Lean codebase's declaration graph and the TCB of its theorems.",
6
6
  "license": "Apache-2.0",