@floless/app 0.117.1 → 0.119.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.
- package/dist/floless-server.cjs +214 -13
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +63 -8
- package/dist/skills/floless-app-vectorize/SKILL.md +91 -29
- package/dist/skills/floless-app-vectorize/scripts/classify_and_trace.py +1039 -0
- package/dist/skills/floless-app-vectorize/scripts/rectify_and_trace.py +447 -0
- package/dist/skills/floless-app-vectorize/scripts/vision_to_contract.py +176 -9
- package/dist/skills/reading-structural-drawings/SKILL.md +35 -3
- package/dist/skills/steel-drawing-abbreviations/SKILL.md +1 -1
- package/dist/skills/steel-drawing-abbreviations/references/standard-us-abbreviations.md +5 -1
- package/dist/web/app.css +56 -6
- package/dist/web/app.js +244 -0
- package/dist/web/index.html +14 -0
- package/dist/web/steel-3d-core.js +3 -3
- package/dist/web/steel-editor.html +20 -10
- package/dist/web/steel-filter-core.js +1 -1
- package/dist/web/vector-3d.html +33 -7
- package/dist/web/vector-editor.html +26 -2
- package/dist/web/workspaces.js +327 -13
- package/package.json +4 -2
package/dist/web/app.js
CHANGED
|
@@ -1597,6 +1597,249 @@ document.addEventListener('keydown', (e) => {
|
|
|
1597
1597
|
}
|
|
1598
1598
|
});
|
|
1599
1599
|
|
|
1600
|
+
/* ============= THEMED SELECT ============= */
|
|
1601
|
+
// CLAUDE.md, "Style EVERY control, including the secondary/native ones": `<select>`
|
|
1602
|
+
// dropdowns must be the themed combobox, never the native control. The `select { appearance:
|
|
1603
|
+
// none }` rule in app.css de-nativizes the CLOSED state only — the OPEN option list is drawn
|
|
1604
|
+
// by the OS and comes back white against the dark baseline, which is exactly why
|
|
1605
|
+
// steel-editor.html (plan switcher) and steel-filter.html (sheet switcher) each dropped their
|
|
1606
|
+
// <select> for a hand-rolled combobox. The Routines editor was the straggler: six native
|
|
1607
|
+
// selects (workflow, schedule kind, every-N-minutes, every-N-hours, hour, minute), every one
|
|
1608
|
+
// of them opening a light OS popup on a dark modal.
|
|
1609
|
+
//
|
|
1610
|
+
// This is the same move, done as an in-place UPGRADE rather than a rewrite. The <select> stays
|
|
1611
|
+
// in the DOM and stays the single source of truth: `.value` reads/writes, `.innerHTML` option
|
|
1612
|
+
// rebuilds, `.disabled` toggles, `data-tip` and `change` listeners all keep working untouched
|
|
1613
|
+
// (aware.js does all six of those to these controls). It is only made invisible, with a
|
|
1614
|
+
// .wf-combo trigger + popover — the SAME markup and classes the workflow picker and the
|
|
1615
|
+
// form-modal pickers already render — drawn in its place and kept in sync.
|
|
1616
|
+
//
|
|
1617
|
+
// Sync is not left to a call site remembering to ask for it: the option list and the
|
|
1618
|
+
// disabled/data-tip attributes are observed, and the instance's `value` setter is wrapped, so
|
|
1619
|
+
// there is no way to change the select and leave the combo showing something stale.
|
|
1620
|
+
const SELECT_COMBO_SEARCH_MIN = 12; // a search box earns its place only once the list outgrows a scan
|
|
1621
|
+
function themeSelect(sel) {
|
|
1622
|
+
if (!sel || sel.dataset.combo) return;
|
|
1623
|
+
sel.dataset.combo = '1';
|
|
1624
|
+
|
|
1625
|
+
const box = document.createElement('div');
|
|
1626
|
+
// fm-select: the modal-field variant, whose popover flows IN-LINE (position:static). The
|
|
1627
|
+
// routines modal is itself a scroll container (.modal.routine-edit is overflow-y:auto), and
|
|
1628
|
+
// an absolutely-positioned popover inside one gets clipped — the reason fm-select exists.
|
|
1629
|
+
box.className = 'wf-combo fm-select sel-combo';
|
|
1630
|
+
const trigger = document.createElement('button');
|
|
1631
|
+
trigger.type = 'button';
|
|
1632
|
+
trigger.className = 'wf-trigger fm-select-trigger';
|
|
1633
|
+
trigger.id = (sel.id || 'sel') + '-combo-trigger';
|
|
1634
|
+
trigger.setAttribute('aria-haspopup', 'listbox');
|
|
1635
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
1636
|
+
const label = document.createElement('span');
|
|
1637
|
+
label.className = 'wf-trigger-label fm-select-label';
|
|
1638
|
+
trigger.appendChild(label);
|
|
1639
|
+
trigger.insertAdjacentHTML('beforeend',
|
|
1640
|
+
'<svg class="wf-caret" width="10" height="6" viewBox="0 0 10 6" aria-hidden="true"><path fill="currentColor" d="M0 0l5 6 5-6z"/></svg>');
|
|
1641
|
+
const popover = document.createElement('div');
|
|
1642
|
+
popover.className = 'wf-popover fm-select-popover';
|
|
1643
|
+
popover.setAttribute('role', 'listbox');
|
|
1644
|
+
popover.hidden = true;
|
|
1645
|
+
const searchWrap = document.createElement('div');
|
|
1646
|
+
searchWrap.className = 'wf-search-wrap';
|
|
1647
|
+
searchWrap.hidden = true;
|
|
1648
|
+
const search = document.createElement('input');
|
|
1649
|
+
search.type = 'text';
|
|
1650
|
+
search.className = 'wf-search fm-select-search';
|
|
1651
|
+
search.placeholder = 'Search…';
|
|
1652
|
+
search.autocomplete = 'off';
|
|
1653
|
+
search.setAttribute('aria-label', 'Search');
|
|
1654
|
+
searchWrap.appendChild(search);
|
|
1655
|
+
const list = document.createElement('div');
|
|
1656
|
+
list.className = 'wf-list fm-select-list';
|
|
1657
|
+
const empty = document.createElement('div');
|
|
1658
|
+
empty.className = 'wf-empty-search';
|
|
1659
|
+
empty.textContent = 'No matches';
|
|
1660
|
+
empty.hidden = true;
|
|
1661
|
+
popover.append(searchWrap, list, empty);
|
|
1662
|
+
box.append(trigger, popover);
|
|
1663
|
+
sel.classList.add('sel-native'); // display:none — the value model, not a rendered control
|
|
1664
|
+
sel.setAttribute('aria-hidden', 'true');
|
|
1665
|
+
sel.tabIndex = -1;
|
|
1666
|
+
sel.after(box);
|
|
1667
|
+
|
|
1668
|
+
// Accessible name. The field's own <label for=…> now points at a hidden element, so it is
|
|
1669
|
+
// re-pointed at the trigger and read together WITH the trigger's text (which is the current
|
|
1670
|
+
// value) — the pairing a native select gives for free. A select carrying its own aria-label
|
|
1671
|
+
// (the hour/minute pair) hands that over instead.
|
|
1672
|
+
const field = document.querySelector(`label[for="${CSS.escape(sel.id || '')}"]`);
|
|
1673
|
+
const ownLabel = sel.getAttribute('aria-label');
|
|
1674
|
+
if (ownLabel) {
|
|
1675
|
+
trigger.setAttribute('aria-label', ownLabel);
|
|
1676
|
+
popover.setAttribute('aria-label', ownLabel);
|
|
1677
|
+
} else if (field) {
|
|
1678
|
+
if (!field.id) field.id = (sel.id || 'sel') + '-combo-label';
|
|
1679
|
+
trigger.setAttribute('aria-labelledby', `${field.id} ${trigger.id}`);
|
|
1680
|
+
popover.setAttribute('aria-label', field.textContent.trim());
|
|
1681
|
+
// A label whose `for` target is display:none is inert on click; keep the click target.
|
|
1682
|
+
field.addEventListener('click', (e) => { e.preventDefault(); trigger.focus(); });
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
let hi = -1;
|
|
1686
|
+
const rows = () => [...list.children];
|
|
1687
|
+
const visible = () => rows().filter((r) => !r.hidden);
|
|
1688
|
+
const clearHi = () => { rows().forEach((r) => r.classList.remove('highlighted')); hi = -1; };
|
|
1689
|
+
|
|
1690
|
+
function render() {
|
|
1691
|
+
const opts = [...sel.options];
|
|
1692
|
+
const at = sel.selectedIndex;
|
|
1693
|
+
label.textContent = at >= 0 ? opts[at].textContent : (sel.dataset.placeholder || 'Select…');
|
|
1694
|
+
label.toggleAttribute('data-empty', at < 0);
|
|
1695
|
+
list.replaceChildren(...opts.map((o, i) => {
|
|
1696
|
+
const row = document.createElement('div');
|
|
1697
|
+
row.className = 'wf-option' + (i === at ? ' selected' : '');
|
|
1698
|
+
row.setAttribute('role', 'option');
|
|
1699
|
+
row.setAttribute('aria-selected', i === at ? 'true' : 'false');
|
|
1700
|
+
row.dataset.index = String(i);
|
|
1701
|
+
row.dataset.search = o.textContent.toLowerCase();
|
|
1702
|
+
row.tabIndex = -1;
|
|
1703
|
+
if (o.disabled) row.setAttribute('aria-disabled', 'true');
|
|
1704
|
+
const name = document.createElement('span');
|
|
1705
|
+
name.className = 'wf-option-name';
|
|
1706
|
+
name.textContent = o.textContent; // textContent, not innerHTML — option text is server data
|
|
1707
|
+
row.appendChild(name);
|
|
1708
|
+
return row;
|
|
1709
|
+
}));
|
|
1710
|
+
searchWrap.hidden = opts.length <= SELECT_COMBO_SEARCH_MIN;
|
|
1711
|
+
empty.hidden = true;
|
|
1712
|
+
trigger.disabled = sel.disabled;
|
|
1713
|
+
// data-tip lives on the select in the markup/callers; the hidden element can never be
|
|
1714
|
+
// hovered, so the tip has to ride the control the user actually points at.
|
|
1715
|
+
const tip = sel.getAttribute('data-tip');
|
|
1716
|
+
if (tip) trigger.setAttribute('data-tip', tip); else trigger.removeAttribute('data-tip');
|
|
1717
|
+
clearHi();
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
const filter = (q) => {
|
|
1721
|
+
q = (q || '').toLowerCase().trim();
|
|
1722
|
+
let any = false;
|
|
1723
|
+
rows().forEach((r) => { const m = !q || r.dataset.search.includes(q); r.hidden = !m; if (m) any = true; });
|
|
1724
|
+
empty.hidden = any;
|
|
1725
|
+
clearHi();
|
|
1726
|
+
};
|
|
1727
|
+
const open = () => {
|
|
1728
|
+
if (trigger.disabled) return;
|
|
1729
|
+
closeOtherCombos(box);
|
|
1730
|
+
popover.hidden = false;
|
|
1731
|
+
trigger.classList.add('open');
|
|
1732
|
+
trigger.setAttribute('aria-expanded', 'true');
|
|
1733
|
+
// The highlight belongs to ONE open session and must not survive into the next. close() clears
|
|
1734
|
+
// it, but closeOtherCombos() only hides the DOM — so a combo dismissed by an outside click kept
|
|
1735
|
+
// `hi` pointing at whatever the arrows had reached. Reopening then armed it: the trigger's
|
|
1736
|
+
// keydown opened the popover and the SAME Enter bubbled on to select that stale row, so one
|
|
1737
|
+
// keypress on a closed control silently changed the schedule from Every day to Specific days.
|
|
1738
|
+
// Reproduced in Chromium before this line existed. Clearing on open() fixes it wherever the
|
|
1739
|
+
// close came from, which is why it is here and not in closeOtherCombos().
|
|
1740
|
+
clearHi();
|
|
1741
|
+
if (!searchWrap.hidden) { search.value = ''; filter(''); setTimeout(() => search.focus(), 0); }
|
|
1742
|
+
const sel0 = list.querySelector('.wf-option.selected');
|
|
1743
|
+
if (sel0) sel0.scrollIntoView({ block: 'nearest' });
|
|
1744
|
+
};
|
|
1745
|
+
const close = (focusTrigger) => {
|
|
1746
|
+
popover.hidden = true;
|
|
1747
|
+
trigger.classList.remove('open');
|
|
1748
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
1749
|
+
clearHi();
|
|
1750
|
+
if (focusTrigger) trigger.focus();
|
|
1751
|
+
};
|
|
1752
|
+
const move = (d) => {
|
|
1753
|
+
const vis = visible();
|
|
1754
|
+
if (!vis.length) return;
|
|
1755
|
+
hi = hi < 0 ? (d > 0 ? 0 : vis.length - 1) : Math.max(0, Math.min(vis.length - 1, hi + d));
|
|
1756
|
+
vis.forEach((r, i) => r.classList.toggle('highlighted', i === hi));
|
|
1757
|
+
vis[hi].scrollIntoView({ block: 'nearest' });
|
|
1758
|
+
};
|
|
1759
|
+
const choose = (row) => {
|
|
1760
|
+
const i = Number(row.dataset.index);
|
|
1761
|
+
const changed = i !== sel.selectedIndex;
|
|
1762
|
+
if (changed) {
|
|
1763
|
+
sel.selectedIndex = i;
|
|
1764
|
+
render();
|
|
1765
|
+
// bubbles: the routines wiring uses .onchange, and a caller may yet delegate.
|
|
1766
|
+
sel.dispatchEvent(new Event('change', { bubbles: true }));
|
|
1767
|
+
}
|
|
1768
|
+
close(true);
|
|
1769
|
+
};
|
|
1770
|
+
|
|
1771
|
+
trigger.addEventListener('click', (e) => { e.stopPropagation(); popover.hidden ? open() : close(false); });
|
|
1772
|
+
trigger.addEventListener('keydown', (e) => {
|
|
1773
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter' || e.key === ' ') { e.preventDefault(); open(); }
|
|
1774
|
+
});
|
|
1775
|
+
list.addEventListener('click', (e) => {
|
|
1776
|
+
const row = e.target.closest('.wf-option');
|
|
1777
|
+
if (row && !row.hasAttribute('aria-disabled')) { e.stopPropagation(); choose(row); }
|
|
1778
|
+
});
|
|
1779
|
+
search.addEventListener('input', () => filter(search.value));
|
|
1780
|
+
// Keep combo keys inside the combo. Escape especially: the document-level Escape handler
|
|
1781
|
+
// closes the whole routines modal, which would throw away the form to dismiss a dropdown.
|
|
1782
|
+
box.addEventListener('keydown', (e) => {
|
|
1783
|
+
if (popover.hidden) return;
|
|
1784
|
+
if (e.key === 'ArrowDown') { e.preventDefault(); e.stopPropagation(); move(1); }
|
|
1785
|
+
else if (e.key === 'ArrowUp') { e.preventDefault(); e.stopPropagation(); move(-1); }
|
|
1786
|
+
else if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); const vis = visible(); if (hi >= 0 && vis[hi]) choose(vis[hi]); }
|
|
1787
|
+
else if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); close(true); }
|
|
1788
|
+
});
|
|
1789
|
+
|
|
1790
|
+
// Option-list rebuilds (`$wf.innerHTML = …`, fillTimeSelects) and disabled/data-tip flips
|
|
1791
|
+
// reach the DOM, so they are observed rather than announced.
|
|
1792
|
+
new MutationObserver(render).observe(sel, {
|
|
1793
|
+
childList: true, subtree: true, attributes: true, attributeFilter: ['disabled', 'data-tip'],
|
|
1794
|
+
});
|
|
1795
|
+
// `select.value = x` sets an IDL property and produces no mutation record, so the setter is
|
|
1796
|
+
// wrapped on this instance. Without it, openRoutineEdit()'s five value writes would leave
|
|
1797
|
+
// every trigger reading whatever the previous routine said.
|
|
1798
|
+
const native = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, 'value');
|
|
1799
|
+
Object.defineProperty(sel, 'value', {
|
|
1800
|
+
configurable: true,
|
|
1801
|
+
get() { return native.get.call(this); },
|
|
1802
|
+
set(v) { native.set.call(this, v); render(); },
|
|
1803
|
+
});
|
|
1804
|
+
// Backstop for the selection writes neither of the two above can see: `selectedIndex = i`,
|
|
1805
|
+
// `option.selected = true` and `form.reset()` set IDL state that emits no mutation record and does
|
|
1806
|
+
// not pass through the `value` setter. No call site in web/ does any of those today — the only
|
|
1807
|
+
// `selectedIndex =` in the tree is choose()'s own, which renders explicitly — so this closes a
|
|
1808
|
+
// latent gap rather than a live bug, and it is one line instead of routing every mutation through
|
|
1809
|
+
// a new API. It catches anything that follows the conventional mutate-then-dispatch pattern;
|
|
1810
|
+
// a mutation with NO change event still would not repaint, which is stated rather than implied.
|
|
1811
|
+
// render() is idempotent, so the extra pass after choose()'s explicit one costs nothing.
|
|
1812
|
+
sel.addEventListener('change', render);
|
|
1813
|
+
|
|
1814
|
+
render();
|
|
1815
|
+
}
|
|
1816
|
+
// Only one popover open at a time, and a click OUTSIDE every combo dismisses them all.
|
|
1817
|
+
// `keep` is the one combo left alone — the one being opened, or the one a click landed inside.
|
|
1818
|
+
function closeOtherCombos(keep) {
|
|
1819
|
+
document.querySelectorAll('.sel-combo').forEach((other) => {
|
|
1820
|
+
if (other === keep) return;
|
|
1821
|
+
const pop = other.querySelector('.fm-select-popover');
|
|
1822
|
+
if (!pop || pop.hidden) return;
|
|
1823
|
+
pop.hidden = true;
|
|
1824
|
+
const t = other.querySelector('.fm-select-trigger');
|
|
1825
|
+
if (t) { t.classList.remove('open'); t.setAttribute('aria-expanded', 'false'); }
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
function initThemedSelects() {
|
|
1829
|
+
document.querySelectorAll('select:not([hidden])').forEach(themeSelect);
|
|
1830
|
+
// Resolve the combo the click landed IN and keep that one open. The earlier
|
|
1831
|
+
// `closeOtherCombos(null)` relied on every in-combo click calling stopPropagation — which the
|
|
1832
|
+
// trigger and the option rows do, but the SEARCH BOX does not. So clicking into the search
|
|
1833
|
+
// field of the hour/minute pickers (the only lists past SELECT_COMBO_SEARCH_MIN, hence the only
|
|
1834
|
+
// ones that have a search box) closed the very popover being clicked into and dropped focus to
|
|
1835
|
+
// <body>: the field was unreachable by mouse. Asking the event where it landed fixes that
|
|
1836
|
+
// without weakening "click outside dismisses", and no longer depends on every inner control
|
|
1837
|
+
// remembering to stop the event.
|
|
1838
|
+
document.addEventListener('click', (e) => {
|
|
1839
|
+
closeOtherCombos(e.target instanceof Element ? e.target.closest('.sel-combo') : null);
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1600
1843
|
/* ============= TOOLTIPS ============= */
|
|
1601
1844
|
// App-styled tooltips for any [data-tip] element — one reused box, event-delegated
|
|
1602
1845
|
// (so JS-generated cards/chips/buttons get them for free), shown on hover AND
|
|
@@ -1670,6 +1913,7 @@ document.addEventListener('keydown', (e) => {
|
|
|
1670
1913
|
/* ============= INIT ============= */
|
|
1671
1914
|
loadState();
|
|
1672
1915
|
initTheme();
|
|
1916
|
+
initThemedSelects();
|
|
1673
1917
|
loadWidths();
|
|
1674
1918
|
applyCollapse();
|
|
1675
1919
|
setupResize();
|
package/dist/web/index.html
CHANGED
|
@@ -564,6 +564,20 @@
|
|
|
564
564
|
</div>
|
|
565
565
|
</div>
|
|
566
566
|
|
|
567
|
+
<!-- Project thumbnail viewer — the picture on a Workspaces card, shown large.
|
|
568
|
+
VIEW-ONLY, deliberately: Add/Replace/Remove live on the card's ⋯ menu, which is the one
|
|
569
|
+
place this app offers project management (the header picker's own comment spells that rule
|
|
570
|
+
out). A second set of the same actions here would split that authority in two. -->
|
|
571
|
+
<div class="modal-backdrop" id="ws-thumb-modal" role="dialog" aria-modal="true" aria-labelledby="ws-thumb-title">
|
|
572
|
+
<div class="modal ws-thumb-viewer" tabindex="-1">
|
|
573
|
+
<div class="ws-thumb-head">
|
|
574
|
+
<div class="modal-title" id="ws-thumb-title">Thumbnail</div>
|
|
575
|
+
<button type="button" id="ws-thumb-close" data-tip="Close">×</button>
|
|
576
|
+
</div>
|
|
577
|
+
<div class="ws-thumb-stage"><img id="ws-thumb-full" alt=""></div>
|
|
578
|
+
</div>
|
|
579
|
+
</div>
|
|
580
|
+
|
|
567
581
|
<div class="toast-container" id="toast-container"></div>
|
|
568
582
|
|
|
569
583
|
<!-- Reusable styled prompt/form modal — used for node inputs (double-click an
|
|
@@ -335,9 +335,9 @@ export function snapPoint(dragged, candidates, toScreen, tolPx) {
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
/** An intersection is worth this many px of aim against a line when choosing BETWEEN grid levels. */
|
|
338
|
-
|
|
338
|
+
const GRID_INT_HEADSTART_PX = 3;
|
|
339
339
|
/** Scores this close are "the same pixel" — the levels are stacked, so distance can't choose. */
|
|
340
|
-
|
|
340
|
+
const GRID_LEVEL_TIE_PX = 0.5;
|
|
341
341
|
|
|
342
342
|
/**
|
|
343
343
|
* Choose which grid LEVEL a snap lands on. A structural grid is drawn at every visible Z datum, so the
|
|
@@ -555,7 +555,7 @@ export function offsetsFor(v, st, vA) {
|
|
|
555
555
|
|
|
556
556
|
// UCS Stage 5 — one shared unit-direction rule for a frame-aware dim's world axisDir.
|
|
557
557
|
// Below EPS a vector is degenerate (no direction); above UNIT_TOL from 1 it's non-unit and gets re-normalized.
|
|
558
|
-
|
|
558
|
+
const AXDIR_EPS = 1e-9, AXDIR_UNIT_TOL = 1e-6;
|
|
559
559
|
/**
|
|
560
560
|
* Normalize a candidate world direction, or return null when it carries no usable direction.
|
|
561
561
|
* null unless v is [finite, finite, finite] with a FINITE magnitude > AXDIR_EPS. Math.hypot can
|
|
@@ -1176,9 +1176,10 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
1176
1176
|
<aside id=panel></aside>
|
|
1177
1177
|
<button type=button id=panelToggle aria-label="Collapse properties panel" aria-controls=panel aria-expanded=true data-tip="Collapse properties panel">›</button>
|
|
1178
1178
|
</main>
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1179
|
+
<!-- (The conntypes / profiles / details <datalist>s that used to sit here are gone: every input that
|
|
1180
|
+
bound to them moved to the themed dark combobox below (COMBO_SRC / showCombo), which is what a
|
|
1181
|
+
native datalist popup cannot be — it is drawn white by the OS. They had already lost their last
|
|
1182
|
+
`list=` binding and were rendering nothing.) -->
|
|
1182
1183
|
<div id=viewGenModal role=dialog aria-modal=true aria-labelledby=vgTitle>
|
|
1183
1184
|
<div class=mbackdrop id=vgBackdrop></div>
|
|
1184
1185
|
<div class=mpanel>
|
|
@@ -1277,8 +1278,10 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
1277
1278
|
<div class=elab>Kind</div>
|
|
1278
1279
|
<div class=favkindfield role=group aria-label=Kind><span id=favKind class=chip></span></div>
|
|
1279
1280
|
<label class=elab for=favCat>Category</label>
|
|
1280
|
-
|
|
1281
|
-
|
|
1281
|
+
<!-- Category suggestions come from the themed combobox (data-src=favcats), not a native
|
|
1282
|
+
<datalist>: the datalist popup is OS-drawn and white, which is the whole reason every other
|
|
1283
|
+
suggesting input on this page already uses .combo. -->
|
|
1284
|
+
<input id=favCat class=combo data-src=favcats placeholder="Uncategorized" autocomplete=off>
|
|
1282
1285
|
<div id=favHint class=hint style="margin-top:6px"></div>
|
|
1283
1286
|
<div style="display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:6px">
|
|
1284
1287
|
<button id=favCancel class=ghost>Cancel</button>
|
|
@@ -4349,9 +4352,12 @@ function render(){
|
|
|
4349
4352
|
s+=renderPropLabels(); // right-click property-label chips (2D); 3D labels ride the div-overlay pool
|
|
4350
4353
|
s+=renderSelLenLabels(); // on-select member-length chips (2D), gated by the ⋯ Display "Show member length" toggle
|
|
4351
4354
|
if(P.frame)s+=axisGlyphSvg(P.frame.o,P.frame.u,false); // local-axes glyph at the origin (only when a frame is set; removed on reset)
|
|
4352
|
-
//
|
|
4353
|
-
//
|
|
4354
|
-
|
|
4355
|
+
// No datalist population here any more. The #profiles and #details <datalist>s went with the rest of
|
|
4356
|
+
// them (an OS-drawn white popup has no themed mode), and COMBO_SRC.profiles/.details already read
|
|
4357
|
+
// `profs` and `detTexts()` live — so the combobox offers the same list with no mirror to keep filled.
|
|
4358
|
+
// Deleting the elements while these two writes stayed made render() throw on null here, which also
|
|
4359
|
+
// killed every call after it on this line (stats/panel/upd*/syncDisplayRows). Measured in Chromium.
|
|
4360
|
+
svg.innerHTML=s; stats(); panel(); updUR(); updDup(); updConf(); updCS(); updConnBtn(); updBpBtn(); updSpBtn(); syncDisplayRows();
|
|
4355
4361
|
if(selFilterReady)reflectSelFilter(); // keep the Select-bar Members/Connections buttons in sync with the model — a new/removed connection kind (e.g. the first auto-detailed base plate) flips their on/off without a manual toggle. Gated on selFilterReady so it doesn't run until the deferred first reflect has armed it (that reflect needs BASE_MEMBER_TYPES, initialised later in main()).
|
|
4356
4362
|
if(view3d&&window.Steel3DView){window.Steel3DView.setSelection(selIds);if(window.Steel3DView.setGridSelection)window.Steel3DView.setGridSelection(selGridIds);updateIsolateBtn();if((selIds.size||selGridIds.size)&&window.Steel3DView.selectedClips&&window.Steel3DView.selectedClips().length)window.Steel3DView.setSelectedClips([]);refreshLegendSel();} // keep the 3D member + grid highlight in sync; selecting geometry clears any clip selection (exclusive)
|
|
4357
4363
|
try{updateConnCrumb();}catch(_){} // Connection Component breadcrumb follows the selection (3D-only; hidden at root)
|
|
@@ -8356,6 +8362,9 @@ let armedFavId=null; // the favourite whose placement crosshair is arm
|
|
|
8356
8362
|
const FAV_KIND_LABEL={'base-plate':'Base plate','shear-plate':'Shear plate','brace-gusset':'Gusset plate','custom':'Custom (imported)'};
|
|
8357
8363
|
const FAV_KIND_COLOR={'base-plate':'#6b7a8d','shear-plate':'#7d8ba0','brace-gusset':'#94a2b7','custom':'#8a97a8'}; // mirror steel-joints.ts GROUPS
|
|
8358
8364
|
const FAV_CAT_SUGGEST={'base-plate':['Base plates','Columns'],'shear-plate':['Shear plates','Beams'],'brace-gusset':['Gusset plates','Braces'],'custom':['Imported','Details']};
|
|
8365
|
+
// The connection kind the ★ modal is currently showing — decides which categories its Category combo
|
|
8366
|
+
// suggests. Held here rather than read off the DOM because the chip shows a LABEL, not the kind key.
|
|
8367
|
+
let favCatKind='';
|
|
8359
8368
|
function favHostNoun(k){return k==='base-plate'?'column':k==='brace-gusset'?'brace':'beam';}
|
|
8360
8369
|
function favIsPortable(f){return !!f&&(f.kind==='base-plate'||f.kind==='shear-plate'||f.kind==='brace-gusset');}
|
|
8361
8370
|
// The saved-recipe payload captured from a selected whole connection: recipe scalars, or an opaque custom mesh.
|
|
@@ -8386,7 +8395,7 @@ function favFillModal({title,kind,name,category,portable,hint}){
|
|
|
8386
8395
|
kf.style.borderColor=portable?'var(--brand)':'var(--line)';kf.style.color=portable?'#bfdbfe':'var(--mut)';
|
|
8387
8396
|
document.getElementById('favName').value=name||'';
|
|
8388
8397
|
document.getElementById('favCat').value=category||'';
|
|
8389
|
-
|
|
8398
|
+
favCatKind=kind; // what COMBO_SRC.favcats offers — set before the field can be focused
|
|
8390
8399
|
document.getElementById('favHint').textContent=hint;
|
|
8391
8400
|
document.getElementById('favSave').textContent=favModalEditId?'Save changes':'Save to Favourites';
|
|
8392
8401
|
document.getElementById('favConnModal').style.display='flex';
|
|
@@ -9697,7 +9706,8 @@ const COMBO_SRC={
|
|
|
9697
9706
|
profiles:()=>profs,
|
|
9698
9707
|
membertypes:()=>memberTypeRecords().map(t=>t.label),
|
|
9699
9708
|
conntypes:()=>['moment','drag','shear','braced','pinned','fixed'],
|
|
9700
|
-
details:()=>detTexts(), // the SAME list the Details modal
|
|
9709
|
+
details:()=>detTexts(), // the SAME list the Details modal shows — see detTexts (#397)
|
|
9710
|
+
favcats:()=>FAV_CAT_SUGGEST[favCatKind]||[],
|
|
9701
9711
|
connrows:()=>['— none —',...(C.connections||[]).map(r=>connLabel(r))]
|
|
9702
9712
|
};
|
|
9703
9713
|
// A connection-library row's one-line label for the per-end picker. The id is the prefix (parsed
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/** Canonical dimension order for a mode string — keeps legacy 'thickness+layer'/'thickness+color'. */
|
|
20
|
-
|
|
20
|
+
const MODE_ORDER = ['thickness', 'layer', 'color'];
|
|
21
21
|
|
|
22
22
|
/** The dimensions a mode activates, order-agnostic: 'thickness+layer' -> ['thickness','layer']. */
|
|
23
23
|
export function modeDims(mode) {
|
package/dist/web/vector-3d.html
CHANGED
|
@@ -59,6 +59,11 @@
|
|
|
59
59
|
.srow:hover{background:var(--line)}
|
|
60
60
|
.srow .sid{color:#f59e0b;flex:none;font-variant-numeric:tabular-nums}
|
|
61
61
|
.srow .rsn{color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
62
|
+
/* Themed tooltip — replaces native title= so no OS-default tooltip leaks the dark theme.
|
|
63
|
+
Same element, tokens and geometry as the sibling editors' #tooltip (vector-editor.html,
|
|
64
|
+
steel-filter.html, steel-editor.html) so the four surfaces read as one family. */
|
|
65
|
+
#tooltip{position:fixed;z-index:80;background:var(--panel);border:1px solid var(--line);border-radius:6px;padding:5px 8px;font-size:11.5px;line-height:1.35;color:var(--text);pointer-events:none;max-width:260px;box-shadow:0 8px 22px rgba(0,0,0,.5);opacity:0;transition:opacity .12s}
|
|
66
|
+
#tooltip.show{opacity:1}
|
|
62
67
|
</style>
|
|
63
68
|
</head>
|
|
64
69
|
<body>
|
|
@@ -73,15 +78,15 @@
|
|
|
73
78
|
<canvas id="stage3d"></canvas>
|
|
74
79
|
<div id="bar" hidden>
|
|
75
80
|
<div class="seg-group" id="projSeg">
|
|
76
|
-
<button data-proj="persp" class="on"
|
|
77
|
-
<button data-proj="ortho"
|
|
81
|
+
<button data-proj="persp" class="on" data-tip="Perspective view — natural depth">Persp</button>
|
|
82
|
+
<button data-proj="ortho" data-tip="Orthographic — true scale, no perspective">Ortho</button>
|
|
78
83
|
</div>
|
|
79
|
-
<button id="fitBtn"
|
|
84
|
+
<button id="fitBtn" data-tip="Fit all to view">Fit</button>
|
|
80
85
|
<span class="tb-sep"></span>
|
|
81
86
|
<div class="seg-group" id="modeSeg">
|
|
82
|
-
<button data-mode="solid" class="on"
|
|
83
|
-
<button data-mode="wire"
|
|
84
|
-
<button data-mode="xray"
|
|
87
|
+
<button data-mode="solid" class="on" data-tip="Solid shaded model">Solid</button>
|
|
88
|
+
<button data-mode="wire" data-tip="Wireframe — edges only">Wire</button>
|
|
89
|
+
<button data-mode="xray" data-tip="See-through — reveal hidden parts">X-ray</button>
|
|
85
90
|
</div>
|
|
86
91
|
<span class="tb-sep"></span>
|
|
87
92
|
<span id="groupToggles"></span>
|
|
@@ -171,7 +176,10 @@ function boot(v3d) {
|
|
|
171
176
|
for (const s of skipped) {
|
|
172
177
|
const row = document.createElement('div'); row.className = 'srow';
|
|
173
178
|
const sid = document.createElement('span'); sid.className = 'sid'; sid.textContent = s.id;
|
|
174
|
-
|
|
179
|
+
// The row clips its reason with an ellipsis, so the full text lives in a tooltip. `dataset.tip`
|
|
180
|
+
// (not `.title`) — the shared handler below reads data-tip, and a native title here would be the
|
|
181
|
+
// one light OS tooltip left on this surface.
|
|
182
|
+
const rsn = document.createElement('span'); rsn.className = 'rsn'; rsn.textContent = s.reason; rsn.dataset.tip = s.reason;
|
|
175
183
|
row.append(sid, rsn); list.appendChild(row);
|
|
176
184
|
}
|
|
177
185
|
}
|
|
@@ -237,6 +245,24 @@ function boot(v3d) {
|
|
|
237
245
|
hideState();
|
|
238
246
|
})();
|
|
239
247
|
}
|
|
248
|
+
|
|
249
|
+
// Themed tooltips (replaces native title=) — one shared element, shown on data-tip hover after a
|
|
250
|
+
// short delay, positioned below the control and clamped to the viewport (same handler as the vector
|
|
251
|
+
// editor and the steel editor's 3D toolbar). Reads data-tip via getAttribute, so JS-set
|
|
252
|
+
// el.dataset.tip works too. Installed at module top level, NOT inside boot(): the toolbar is hidden
|
|
253
|
+
// until the scene loads, but the skip panel's rows carry tips and render on the failure paths where
|
|
254
|
+
// boot() returns early — a handler that only existed after a successful 3D build would leave those
|
|
255
|
+
// dead.
|
|
256
|
+
(function(){ const tip=document.createElement('div'); tip.id='tooltip'; document.body.appendChild(tip); let t=null;
|
|
257
|
+
function show(el){ const txt=el.getAttribute('data-tip'); if(!txt) return; tip.textContent=txt; tip.classList.add('show');
|
|
258
|
+
const r=el.getBoundingClientRect(), tw=tip.offsetWidth, th=tip.offsetHeight;
|
|
259
|
+
let x=Math.max(6,Math.min(r.left+r.width/2-tw/2, innerWidth-tw-6)), y=r.bottom+6; if(y+th>innerHeight-6) y=r.top-th-6;
|
|
260
|
+
tip.style.left=x+'px'; tip.style.top=y+'px'; }
|
|
261
|
+
function hide(){ clearTimeout(t); tip.classList.remove('show'); }
|
|
262
|
+
document.addEventListener('pointerover', e=>{ const el=e.target.closest('[data-tip]'); if(!el) return; clearTimeout(t); t=setTimeout(()=>show(el),400); });
|
|
263
|
+
document.addEventListener('pointerout', e=>{ if(e.target.closest('[data-tip]')) hide(); });
|
|
264
|
+
document.addEventListener('pointerdown', hide, true); // a click hides the tip immediately
|
|
265
|
+
})();
|
|
240
266
|
</script>
|
|
241
267
|
</body>
|
|
242
268
|
</html>
|
|
@@ -540,10 +540,34 @@
|
|
|
540
540
|
// The zero-weak wording must match HOW the drawing was read: after a vision read the honest
|
|
541
541
|
// message is "scored above the bar, still spot-check", never the exact-extraction claim
|
|
542
542
|
// (the extractor field is the provenance; absent/non-vision = the no-AI deterministic path).
|
|
543
|
-
|
|
543
|
+
// Three ways a drawing gets read, and the note must name the one that happened. Testing
|
|
544
|
+
// only for /^vision/ made every OTHER extractor claim the vector-PDF wording — so a scan
|
|
545
|
+
// measured by the CV tracer told the user "traced exactly from the vector PDF (no AI
|
|
546
|
+
// involved)", which is false twice over. Reproduced before this was changed.
|
|
547
|
+
// The vector-PDF claim is the STRONGEST of the four, so it must be earned by a positive
|
|
548
|
+
// match, never reached by falling through. Narrowing /^vision/ to a three-way test still
|
|
549
|
+
// left every unknown or absent extractor asserting "traced exactly from the vector PDF" —
|
|
550
|
+
// the same defect, just rarer. Unknown provenance now gets a neutral note instead.
|
|
551
|
+
const ex = (C && C.source && C.source.extractor) || '';
|
|
552
|
+
const pdfRead = /^pymupdf/.test(ex) || ex === ''; // '' = the bundled hard-coded example
|
|
553
|
+
const visionRead = /^vision/.test(ex);
|
|
554
|
+
const inkRead = /^opencv/.test(ex); // geometry measured from a scan's ink
|
|
555
|
+
const hybrid = inkRead && /vision/.test(ex); // ...with the text read by the model
|
|
556
|
+
// "text", not "labels" — the Show panel two rows above already calls this category Text, and
|
|
557
|
+
// a second word for one concept inside a 244px aside reads as a different feature. Every
|
|
558
|
+
// note also ends on the same "against the original" so none looks like an abbreviation.
|
|
559
|
+
const cleanNote = hybrid
|
|
560
|
+
? 'No weak traces — geometry measured from the scan’s ink; text read by AI. Spot-check the text against the original.'
|
|
561
|
+
: inkRead
|
|
562
|
+
? 'No weak traces — geometry measured from the scan’s ink (no AI involved). Spot-check against the original.'
|
|
563
|
+
: visionRead
|
|
564
|
+
? 'No weak traces — every element scored above ' + WEAK + '. Spot-check against the original.'
|
|
565
|
+
: pdfRead
|
|
566
|
+
? 'No weak traces — traced exactly from the vector PDF (no AI involved).'
|
|
567
|
+
: 'No weak traces. Spot-check against the original.';
|
|
544
568
|
$('weakNote').textContent = c.weak
|
|
545
569
|
? (c.weak + ' trace' + (c.weak === 1 ? '' : 's') + ' scored below ' + WEAK + ' confidence.')
|
|
546
|
-
:
|
|
570
|
+
: cleanNote;
|
|
547
571
|
$('weakRow').hidden = c.weak === 0; // hide the filter when there's nothing to filter (not disabled)
|
|
548
572
|
if (c.weak === 0) $('weakOnly').checked = false; // nothing left to isolate — release the filter
|
|
549
573
|
// Reviewed N/M — M is the weak count at load; Accept and Delete both count as reviewed.
|