@floless/app 0.153.0 → 0.154.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 +4925 -2888
- package/dist/schemas/revit.model.v1.schema.json +5 -0
- package/dist/skills/floless-app-new-workflow/SKILL.md +8 -2
- package/dist/skills/floless-app-onboarding/SKILL.md +8 -5
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +8 -3
- package/dist/skills/floless-app-queue/SKILL.md +23 -4
- package/dist/web/app.css +56 -1
- package/dist/web/app.js +12 -1
- package/dist/web/aware.js +422 -55
- package/dist/web/chat.css +60 -13
- package/dist/web/chat.js +585 -138
- package/dist/web/commands-shell.js +154 -14
- package/dist/web/guide.js +213 -13
- package/dist/web/index.html +8 -3
- package/dist/web/left-pane.js +3 -3
- package/dist/web/revit-editor.js +1 -0
- package/dist/web/tekla-structural-grid-adapter.js +7 -1
- package/dist/web/tool-updates.js +141 -33
- package/dist/web/workspaces.js +30 -4
- package/package.json +1 -1
package/dist/web/left-pane.js
CHANGED
|
@@ -163,12 +163,12 @@
|
|
|
163
163
|
function sideBySide() { return columnsWanted() && presented('narrative') && presented('model'); }
|
|
164
164
|
function minimumNarrativeRatio() { return (290 + 5.5) / stack.clientHeight * 100; }
|
|
165
165
|
// The AI Chat section is never shorter than the rows of its chat that do not shrink (#1515): its
|
|
166
|
-
// heading and controls, the chat toolbar, the recovery
|
|
166
|
+
// heading and controls, the chat toolbar, the recovery row and the composer (attachments included). The
|
|
167
167
|
// conversation feed, the ⚙ strip and the approval tray are the rows that give height back — chat.css
|
|
168
168
|
// declares exactly those minmax(0, …), and chat-ui.test.ts holds this list to that template. Below
|
|
169
169
|
// this floor the composer would be pushed out through the host's overflow: hidden edge, leaving the
|
|
170
170
|
// panel with no message box at all. It is measured, not a constant: the composer grows with a long
|
|
171
|
-
// message
|
|
171
|
+
// message or attachments above it, and the disclosure wraps with the panel's width. Model
|
|
172
172
|
// yields height to it, down to Model's own minimum and never further: a window too short for both
|
|
173
173
|
// is a cue to hide one.
|
|
174
174
|
const CHAT_YIELDING_ROWS = [1, 2, 5];
|
|
@@ -1191,7 +1191,7 @@
|
|
|
1191
1191
|
if (chatFeed) new MutationObserver(refitFloor).observe(chatFeed, { childList: true });
|
|
1192
1192
|
// The AI Chat floor moves with the chat's rows that do not shrink and with the stack's own height (the
|
|
1193
1193
|
// Instructor strip opening, not only a window resize), so the split is re-sized whenever the composer,
|
|
1194
|
-
// the recovery
|
|
1194
|
+
// the recovery row, the attachments inside the composer, or the stack changes size: a message growing to six lines at the
|
|
1195
1195
|
// minimum takes height from Model instead of pushing the composer out. None of these, nor the three
|
|
1196
1196
|
// below, is sized by the split, so re-sizing it cannot feed back into this. (Row 4 also holds the offscreen-activity
|
|
1197
1197
|
// badge, which follows the feed's height; chat.js only shows it with 88px of feed to spare, so it is
|
package/dist/web/revit-editor.js
CHANGED
|
@@ -270,6 +270,7 @@ const TEKLA_AUDIT_COPY = Object.freeze({
|
|
|
270
270
|
'part-operations-unevaluated': Object.freeze({ group: 'shape-not-evaluated', title: 'Shape detail not evaluated', detail: 'Some part operations were preserved as database facts but were not evaluated into the displayed shape.' }),
|
|
271
271
|
'weld-recipes-unevaluated': Object.freeze({ group: 'shape-not-evaluated', title: 'Shape detail not evaluated', detail: 'Some weld-shape instructions were preserved as database facts but were not evaluated into display geometry.' }),
|
|
272
272
|
'grid-mapping-unevaluated': Object.freeze({ group: 'shape-not-evaluated', title: 'Grid not shown in 3D', detail: 'This grid is present in the Tekla database, but its display extents could not be mapped safely.' }),
|
|
273
|
+
'grid-record-undecoded': Object.freeze({ group: 'not-shown', title: 'Grid not shown in 3D', detail: 'This grid is in the Tekla model, but it could not be drawn: the model has more than one grid, or its grid record could not be read. The rest of the model is unaffected. To see the grid, keep one grid in the Tekla model and read the model again; if it is still not shown, use Report an issue.' }),
|
|
273
274
|
'unsupported-native-type': Object.freeze({ group: 'shape-not-evaluated', title: 'Shape detail not evaluated', detail: 'This native Tekla object type is recorded but is not yet interpreted by the parser.' }),
|
|
274
275
|
// #1836: the model was read without a Tekla catalogue file the person chose to continue without.
|
|
275
276
|
'profile-catalogue-missing': Object.freeze({ group: 'shape-not-evaluated', title: 'Shown as a stand-in bar', detail: 'This part’s profile shape isn’t known because profdb.bin was missing, so it is drawn as a thin stand-in bar where it can be placed. Read the model again with that file for the real shape.' }),
|
|
@@ -15,7 +15,13 @@ const finiteNonnegative = (value, name) => {
|
|
|
15
15
|
export function teklaStructuralGridContract(entity) {
|
|
16
16
|
const payload = entity?.structuralGrid;
|
|
17
17
|
if (!payload) return null;
|
|
18
|
-
if (payload.schemaVersion !== SCHEMA || payload.entityId !== entity.id
|
|
18
|
+
if (payload.schemaVersion !== SCHEMA || payload.entityId !== entity.id) {
|
|
19
|
+
throw new TypeError('The authenticated Tekla structural grid facade is inconsistent.');
|
|
20
|
+
}
|
|
21
|
+
// A Grid whose extents or origin could not be mapped is signed, but not drawn: its Audit row is the
|
|
22
|
+
// open `grid-mapping-unevaluated` finding ("Grid not shown in 3D"). It must not stop the model opening.
|
|
23
|
+
if (payload.mapping?.kind === 'unevaluated') return null;
|
|
24
|
+
if (payload.mapping?.kind !== 'symmetric') {
|
|
19
25
|
throw new TypeError('The authenticated Tekla structural grid facade is inconsistent.');
|
|
20
26
|
}
|
|
21
27
|
const extents = payload.mapping.extentsMm;
|
package/dist/web/tool-updates.js
CHANGED
|
@@ -292,11 +292,14 @@
|
|
|
292
292
|
// ── The footer pill ────────────────────────────────────────────────────────
|
|
293
293
|
function paintPill() {
|
|
294
294
|
var offers = view && view.supported ? view.offers || [] : [];
|
|
295
|
+
// Only the rows the person can act on count: FloLess's own, archived and in-progress workflows (the quiet groups) never
|
|
296
|
+
// do. The server says how many; a server without groups counts every row, as before.
|
|
295
297
|
var needs = view && view.supported ? view.needsYou || [] : [];
|
|
298
|
+
var needCount = view && view.supported && typeof view.needsCount === 'number' ? view.needsCount : needs.length;
|
|
296
299
|
var cleanup = cleanupNeeds();
|
|
297
300
|
var urgent = offers.filter(function (o) { return !!o.advisory; }).length;
|
|
298
301
|
// Only a check this page started: a background pass is not something the person is waiting for.
|
|
299
|
-
if (!offers.length && !
|
|
302
|
+
if (!offers.length && !needCount && !cleanup.length && !checking) {
|
|
300
303
|
// A pill that disappears under the keyboard's focus must not drop focus to the page behind.
|
|
301
304
|
if (document.activeElement === $pill) { var menu = document.getElementById('menu-btn'); if (menu) menu.focus(); }
|
|
302
305
|
$pill.hidden = true;
|
|
@@ -317,11 +320,11 @@
|
|
|
317
320
|
var days = Math.max.apply(null, offers.map(function (o) { return o.waitingDays || 0; }));
|
|
318
321
|
text += ' · waiting ' + plural(days, 'day', 'days');
|
|
319
322
|
}
|
|
320
|
-
} else if (
|
|
323
|
+
} else if (needCount || cleanup.length) {
|
|
321
324
|
state = 'needs';
|
|
322
325
|
var folders = cleanup.filter(function (c) { return c.kind !== 'unreadable'; }).length;
|
|
323
|
-
if (
|
|
324
|
-
else if (
|
|
326
|
+
if (needCount && cleanup.length) text = (needCount + cleanup.length) + ' things need you';
|
|
327
|
+
else if (needCount) text = plural(needCount, 'workflow needs you', 'workflows need you');
|
|
325
328
|
else if (folders === cleanup.length) text = plural(folders, 'folder needs you', 'folders need you');
|
|
326
329
|
else text = plural(cleanup.length, 'item needs you', 'items need you');
|
|
327
330
|
} else {
|
|
@@ -371,36 +374,47 @@
|
|
|
371
374
|
return card;
|
|
372
375
|
}
|
|
373
376
|
|
|
374
|
-
|
|
377
|
+
/** A row under a group's explanation says only which workflow (and what is specific to it); a row with no group (an older server) carries its own sentence. */
|
|
378
|
+
function needsRow(item, grouped) {
|
|
375
379
|
var row = el('div', 'tool-updates-needs');
|
|
376
380
|
row.setAttribute('data-app', item.app);
|
|
377
381
|
row.setAttribute('data-kind', item.kind);
|
|
378
382
|
var text = el('div', 'tool-updates-needs-text');
|
|
379
383
|
text.appendChild(el('span', 'tool-updates-needs-name', item.workflowName));
|
|
380
|
-
text.appendChild(el('span', 'tool-updates-needs-sentence', item.sentence));
|
|
384
|
+
if (!grouped) text.appendChild(el('span', 'tool-updates-needs-sentence', item.sentence));
|
|
385
|
+
else if (item.detail) text.appendChild(el('span', 'tool-updates-needs-sentence', item.detail));
|
|
381
386
|
row.appendChild(text);
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
var openButton = el('button', 'tool-updates-open', 'Open workflow');
|
|
387
|
-
openButton.type = 'button';
|
|
388
|
-
openButton.setAttribute('data-command-id', 'shell.tool-updates-open-workflow');
|
|
389
|
-
openButton.setAttribute('data-tip', 'Open ' + item.workflowName + ' to do this');
|
|
390
|
-
openButton.addEventListener('click', function () {
|
|
391
|
-
close();
|
|
392
|
-
Promise.resolve(bridge.openApp(item.app)).catch(function (error) {
|
|
393
|
-
console.warn('could not open the workflow', error);
|
|
394
|
-
// Back to the dialog, with the reason in its live line (open() clears that line, so it is set after).
|
|
395
|
-
open($pill.hidden ? null : $pill);
|
|
396
|
-
$live.textContent = error.message;
|
|
397
|
-
});
|
|
398
|
-
});
|
|
399
|
-
row.appendChild(openButton);
|
|
387
|
+
if (item.action === 'open-workflow') {
|
|
388
|
+
// Offered only for a workflow the Workflows page lists — one installed from a terminal cannot be opened here. That list
|
|
389
|
+
// loads on its own schedule, so a row it does not list yet is marked and given its button the moment it does.
|
|
390
|
+
if (!attachOpenButton(row, item)) row.setAttribute('data-awaiting-open', '');
|
|
400
391
|
}
|
|
401
392
|
return row;
|
|
402
393
|
}
|
|
403
394
|
|
|
395
|
+
/** The Open workflow button, once the Workflows page lists this workflow. False while it does not. */
|
|
396
|
+
function attachOpenButton(row, item) {
|
|
397
|
+
var bridge = window.flolessBridge;
|
|
398
|
+
if (!(bridge && typeof bridge.openApp === 'function' && typeof bridge.canOpenApp === 'function' && bridge.canOpenApp(item.app))) return false;
|
|
399
|
+
var openButton = el('button', 'tool-updates-open', 'Open workflow');
|
|
400
|
+
openButton.type = 'button';
|
|
401
|
+
openButton.setAttribute('data-command-id', 'shell.tool-updates-open-workflow');
|
|
402
|
+
openButton.setAttribute('data-tip', 'Open ' + item.workflowName + ' to do this');
|
|
403
|
+
openButton.setAttribute('aria-label', 'Open workflow ' + item.workflowName);
|
|
404
|
+
openButton.addEventListener('click', function () {
|
|
405
|
+
close();
|
|
406
|
+
Promise.resolve(bridge.openApp(item.app)).catch(function (error) {
|
|
407
|
+
console.warn('could not open the workflow', error);
|
|
408
|
+
// Back to the dialog, with the reason in its live line (open() clears that line, so it is set after).
|
|
409
|
+
open($pill.hidden ? null : $pill);
|
|
410
|
+
$live.textContent = error.message;
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
row.appendChild(openButton);
|
|
414
|
+
row.removeAttribute('data-awaiting-open');
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
|
|
404
418
|
var forgetting = null; // the path being removed from the list, while its request is in flight
|
|
405
419
|
|
|
406
420
|
function cleanupRow(item) {
|
|
@@ -479,6 +493,86 @@
|
|
|
479
493
|
return lines;
|
|
480
494
|
}
|
|
481
495
|
|
|
496
|
+
// ── The Needs-you rows, under the server's explanations (#2180) ──────────────────────────────────────────────
|
|
497
|
+
// The server says what each group of rows is (title, one explanation, whether the person can act on it); this only lays
|
|
498
|
+
// them out. A group the person can act on shows its explanation and its rows; the quiet ones (FloLess's own workflows,
|
|
499
|
+
// archived ones, runs in progress) sit collapsed under "Nothing to do" and never count toward the pill.
|
|
500
|
+
var QUIET_OPEN = {}; // group id → the person opened (true) or closed (false) its list; kept across repaints
|
|
501
|
+
var OPEN_WITHOUT_ASKING = 3; // a group this short shows its rows straight away
|
|
502
|
+
|
|
503
|
+
function groupHead(group, count) {
|
|
504
|
+
var head = el('div', 'tool-updates-group-head');
|
|
505
|
+
head.appendChild(el('span', 'tool-updates-group-title', group.title));
|
|
506
|
+
head.appendChild(el('span', 'tool-updates-group-count', String(count)));
|
|
507
|
+
return head;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/** Only the person's own click or key press on the summary is remembered: a list's default state is set again at every repaint. */
|
|
511
|
+
function rememberOpen(details, id) {
|
|
512
|
+
var summary = details.querySelector('summary');
|
|
513
|
+
if (summary) summary.addEventListener('click', function () { setTimeout(function () { QUIET_OPEN[id] = details.open; }, 0); });
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
function actionGroup(group, rows) {
|
|
517
|
+
var box = el('div', 'tool-updates-group');
|
|
518
|
+
box.setAttribute('data-group', group.id);
|
|
519
|
+
box.appendChild(groupHead(group, rows.length));
|
|
520
|
+
box.appendChild(el('p', 'tool-updates-group-explain', group.explanation));
|
|
521
|
+
var list = el('details', 'tool-updates-group-rows');
|
|
522
|
+
var open = QUIET_OPEN[group.id];
|
|
523
|
+
list.open = open === undefined ? rows.length <= OPEN_WITHOUT_ASKING : open;
|
|
524
|
+
var what = rows.length === 1 ? 'the workflow' : 'the ' + rows.length + ' workflows';
|
|
525
|
+
var toggle = el('summary', null, (list.open ? 'Hide ' : 'Show ') + what);
|
|
526
|
+
toggle.setAttribute('data-command-id', 'shell.tool-updates-show-workflows');
|
|
527
|
+
list.appendChild(toggle);
|
|
528
|
+
rememberOpen(list, group.id);
|
|
529
|
+
// The click runs before the browser flips `open`, so the label says what the click is about to do; `toggle` (which comes later, and also for a change made by other means) settles it.
|
|
530
|
+
toggle.addEventListener('click', function () { toggle.textContent = (list.open ? 'Show ' : 'Hide ') + what; });
|
|
531
|
+
list.addEventListener('toggle', function () { toggle.textContent = (list.open ? 'Hide ' : 'Show ') + what; });
|
|
532
|
+
rows.forEach(function (n) { list.appendChild(needsRow(n, true)); });
|
|
533
|
+
box.appendChild(list);
|
|
534
|
+
return box;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
function quietGroup(group, rows) {
|
|
538
|
+
var box = el('details', 'tool-updates-group tool-updates-group-quiet');
|
|
539
|
+
box.setAttribute('data-group', group.id);
|
|
540
|
+
box.open = QUIET_OPEN[group.id] === true;
|
|
541
|
+
var summary = el('summary', null);
|
|
542
|
+
summary.setAttribute('data-command-id', 'shell.tool-updates-show-workflows');
|
|
543
|
+
summary.appendChild(el('span', 'tool-updates-group-title', group.title));
|
|
544
|
+
summary.appendChild(el('span', 'tool-updates-group-count', String(rows.length)));
|
|
545
|
+
box.appendChild(summary);
|
|
546
|
+
rememberOpen(box, group.id);
|
|
547
|
+
box.appendChild(el('p', 'tool-updates-group-explain', group.explanation));
|
|
548
|
+
rows.forEach(function (n) { box.appendChild(needsRow(n, true)); });
|
|
549
|
+
return box;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/** The workflows' rows, laid out by group. An older server's view has no groups: its flat rows are listed as they come. */
|
|
553
|
+
function paintNeeds(needs, cleanup) {
|
|
554
|
+
var groups = view && Array.isArray(view.needsGroups) ? view.needsGroups : null;
|
|
555
|
+
var rowsOf = function (id) { return needs.filter(function (n) { return n.group === id; }); };
|
|
556
|
+
var loose = groups ? needs.filter(function (n) { return !groups.some(function (g) { return g.id === n.group; }); }) : needs;
|
|
557
|
+
var acting = groups ? groups.filter(function (g) { return g.tone === 'action' && rowsOf(g.id).length; }) : [];
|
|
558
|
+
var quiet = groups ? groups.filter(function (g) { return g.tone !== 'action' && rowsOf(g.id).length; }) : [];
|
|
559
|
+
var count = (groups ? acting.reduce(function (n, g) { return n + rowsOf(g.id).length; }, 0) + loose.length : needs.length) + cleanup.length;
|
|
560
|
+
if (count) {
|
|
561
|
+
var needsSection = section('Needs you', count);
|
|
562
|
+
acting.forEach(function (g) { needsSection.appendChild(actionGroup(g, rowsOf(g.id))); });
|
|
563
|
+
loose.forEach(function (n) { needsSection.appendChild(needsRow(n, false)); });
|
|
564
|
+
cleanup.forEach(function (n) { needsSection.appendChild(cleanupRow(n)); });
|
|
565
|
+
$body.appendChild(needsSection);
|
|
566
|
+
}
|
|
567
|
+
if (quiet.length) {
|
|
568
|
+
var total = quiet.reduce(function (n, g) { return n + rowsOf(g.id).length; }, 0);
|
|
569
|
+
var quietSection = section('Nothing to do', total);
|
|
570
|
+
quiet.forEach(function (g) { quietSection.appendChild(quietGroup(g, rowsOf(g.id))); });
|
|
571
|
+
$body.appendChild(quietSection);
|
|
572
|
+
}
|
|
573
|
+
return count + (quiet.length ? 1 : 0);
|
|
574
|
+
}
|
|
575
|
+
|
|
482
576
|
function section(title, count) {
|
|
483
577
|
var wrap = el('div', 'tool-updates-section');
|
|
484
578
|
wrap.appendChild(el('div', 'tool-updates-section-head', title + ' (' + count + ')'));
|
|
@@ -530,6 +624,7 @@
|
|
|
530
624
|
command: active.getAttribute('data-command-id'),
|
|
531
625
|
path: row && row.getAttribute('data-path'),
|
|
532
626
|
app: row && row.getAttribute('data-app'),
|
|
627
|
+
group: !row && active.closest ? (active.closest('[data-group]') || { getAttribute: function () { return null; } }).getAttribute('data-group') : null,
|
|
533
628
|
head: active.classList.contains('tool-updates-section-head'),
|
|
534
629
|
};
|
|
535
630
|
}
|
|
@@ -541,7 +636,8 @@
|
|
|
541
636
|
else if (key.command) {
|
|
542
637
|
target = Array.prototype.find.call($body.querySelectorAll('[data-command-id="' + key.command + '"]'), function (b) {
|
|
543
638
|
var row = b.closest('.tool-updates-needs');
|
|
544
|
-
|
|
639
|
+
if (!row) return (b.closest('[data-group]') ? b.closest('[data-group]').getAttribute('data-group') : null) === key.group;
|
|
640
|
+
return row.getAttribute('data-path') === key.path && row.getAttribute('data-app') === key.app;
|
|
545
641
|
}) || null;
|
|
546
642
|
}
|
|
547
643
|
if (target && target.offsetParent !== null) {
|
|
@@ -552,6 +648,20 @@
|
|
|
552
648
|
}
|
|
553
649
|
}
|
|
554
650
|
|
|
651
|
+
// A dialog painted before the Workflows page has listed its workflows had no Open workflow buttons and never got them. The page
|
|
652
|
+
// says when its list arrives (floless:workflows-listed); rows marked data-awaiting-open are then given their button in place.
|
|
653
|
+
// Nothing is rebuilt, so a click, a tooltip or the screen reader's place is never lost.
|
|
654
|
+
function giveAwaitingOpenButtons() {
|
|
655
|
+
var rows = $body.querySelectorAll('.tool-updates-needs[data-awaiting-open]');
|
|
656
|
+
if (!rows.length) return;
|
|
657
|
+
var byApp = {};
|
|
658
|
+
((view && view.needsYou) || []).forEach(function (n) { byApp[n.app] = n; });
|
|
659
|
+
Array.prototype.forEach.call(rows, function (row) {
|
|
660
|
+
var item = byApp[row.getAttribute('data-app')];
|
|
661
|
+
if (item) attachOpenButton(row, item);
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
|
|
555
665
|
function paint() {
|
|
556
666
|
var keepFocus = focusKey();
|
|
557
667
|
try { paintNow(); } finally { restoreFocus(keepFocus); }
|
|
@@ -591,19 +701,16 @@
|
|
|
591
701
|
}
|
|
592
702
|
}
|
|
593
703
|
var cleanup = cleanupNeeds();
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
needs.forEach(function (n) { needsSection.appendChild(needsRow(n)); });
|
|
597
|
-
cleanup.forEach(function (n) { needsSection.appendChild(cleanupRow(n)); });
|
|
598
|
-
$body.appendChild(needsSection);
|
|
599
|
-
}
|
|
600
|
-
if (!results && !offers.length && !needs.length && !cleanup.length && view && view.supported && !view.sentence) {
|
|
704
|
+
var shownRows = paintNeeds(needs, cleanup);
|
|
705
|
+
if (!results && !offers.length && !shownRows && view && view.supported && !view.sentence) {
|
|
601
706
|
$body.appendChild(el('div', 'tool-updates-summary', view.checking
|
|
602
707
|
? 'Checking which workflows a tool update affects…'
|
|
603
708
|
: 'All your workflows are on the tool versions you approved.'));
|
|
604
709
|
}
|
|
605
710
|
var dl = downloadsLine();
|
|
606
|
-
if (dl) $foot.appendChild(el('div', 'tool-updates-downloads', dl));
|
|
711
|
+
if (dl) $foot.appendChild(el('div', 'tool-updates-downloads' + (view.downloads && view.downloads.error ? ' tool-updates-downloads-problem' : ''), dl));
|
|
712
|
+
// Tools AWARE left as they are because they are the person's own copy: said apart from a failure.
|
|
713
|
+
if (view && view.downloads && view.downloads.note) $foot.appendChild(el('div', 'tool-updates-downloads', view.downloads.note));
|
|
607
714
|
cleanupLines().forEach(function (line) { $foot.appendChild(el('div', 'tool-updates-downloads', line)); });
|
|
608
715
|
var checked = lastChecked();
|
|
609
716
|
if (checked) $foot.appendChild(el('div', 'tool-updates-downloads', checked));
|
|
@@ -822,6 +929,7 @@
|
|
|
822
929
|
|
|
823
930
|
window.addEventListener('floless:tool-updates-changed', function () { void refresh(); });
|
|
824
931
|
window.addEventListener('floless:apps-changed', function () { void refresh(); });
|
|
932
|
+
window.addEventListener('floless:workflows-listed', giveAwaitingOpenButtons);
|
|
825
933
|
window.flolessToolUpdates = { refresh: refresh, open: open };
|
|
826
934
|
void refresh();
|
|
827
935
|
})();
|
package/dist/web/workspaces.js
CHANGED
|
@@ -372,6 +372,10 @@
|
|
|
372
372
|
const $revitReassure = document.getElementById('ws-source-reassure');
|
|
373
373
|
let revitSourceState = null;
|
|
374
374
|
let revitActiveOperation = null;
|
|
375
|
+
// The Source card an import leaves ("…It is not approved yet.") stays true only until that model is approved.
|
|
376
|
+
let revitSourceAwaitsApproval = false;
|
|
377
|
+
// Every paint of the Source pane counts, so a late answer can tell that something newer was painted.
|
|
378
|
+
let revitSourcePaints = 0;
|
|
375
379
|
const activeImportPolls = new Set();
|
|
376
380
|
let teklaUploadAbort = null;
|
|
377
381
|
let teklaUploadProjectId = null;
|
|
@@ -1299,6 +1303,7 @@
|
|
|
1299
1303
|
const headVersion = approvalHeadVersion(review);
|
|
1300
1304
|
approvalState = { status: 'ready', review, pendingCount: groups.length, headVersion, error: '' };
|
|
1301
1305
|
renderApprovalHeader();
|
|
1306
|
+
settleImportedSourceCard(projectId);
|
|
1302
1307
|
syncWorkspaceGuide();
|
|
1303
1308
|
if (!$wsExports.hidden) paintExports(current.approvedAt);
|
|
1304
1309
|
return review;
|
|
@@ -4142,6 +4147,8 @@
|
|
|
4142
4147
|
$teklaContinueWithout?.addEventListener('click', () => teklaAsk?.onContinue());
|
|
4143
4148
|
|
|
4144
4149
|
function paintRevitSourceState(title, detail) {
|
|
4150
|
+
revitSourcePaints++;
|
|
4151
|
+
revitSourceAwaitsApproval = false;
|
|
4145
4152
|
if (!$sourcePlaceholder) return;
|
|
4146
4153
|
const titleNode = $sourcePlaceholder.querySelector('.ws-source-title');
|
|
4147
4154
|
const detailNode = $sourcePlaceholder.querySelector('.ws-source-sub');
|
|
@@ -4265,6 +4272,18 @@
|
|
|
4265
4272
|
$sourcePlaceholder?.setAttribute('aria-atomic', 'true');
|
|
4266
4273
|
}
|
|
4267
4274
|
|
|
4275
|
+
/**
|
|
4276
|
+
* Once the model an import left on the Source card is approved with nothing pending, the card rests as it
|
|
4277
|
+
* does when the project is reopened ("Source RVT · <file> · <size>"). The header is the one place approval
|
|
4278
|
+
* is shown, so the card never repeats it, and a later import re-arms it.
|
|
4279
|
+
*/
|
|
4280
|
+
function settleImportedSourceCard(projectId) {
|
|
4281
|
+
if (!revitSourceAwaitsApproval || approvalState.status !== 'ready'
|
|
4282
|
+
|| !approvalState.headVersion || approvalState.pendingCount > 0) return;
|
|
4283
|
+
revitSourceAwaitsApproval = false;
|
|
4284
|
+
void refreshRevitSourceState(projectId, revitSourcePaints);
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4268
4287
|
// Replacement admission needs a fresh generation, but it must not share the painter's
|
|
4269
4288
|
// stale-response guard. A simultaneous project-open refresh can legitimately change the
|
|
4270
4289
|
// displayed operation while this request is in flight; that must not silently discard the
|
|
@@ -4295,13 +4314,16 @@
|
|
|
4295
4314
|
return current?.id === project.id ? response.state : null;
|
|
4296
4315
|
}
|
|
4297
4316
|
|
|
4298
|
-
async function refreshRevitSourceState(projectId = current?.id) {
|
|
4317
|
+
async function refreshRevitSourceState(projectId = current?.id, paintsAtRequest = null) {
|
|
4299
4318
|
if (!projectId || !current || current.id !== projectId || !isModelSourceProject(current)) return null;
|
|
4300
4319
|
const operationAtRequest = revitActiveOperation;
|
|
4320
|
+
// A caller that only tidies the pane passes the paint count it saw: anything painted since (an upload that
|
|
4321
|
+
// has no operation yet, a round trip to another project) is newer than this answer.
|
|
4322
|
+
const paintedSince = () => paintsAtRequest !== null && revitSourcePaints !== paintsAtRequest;
|
|
4301
4323
|
try {
|
|
4302
4324
|
const tekla = isTeklaParserProject(current);
|
|
4303
4325
|
const response = await api(`/api/${tekla ? 'tekla' : 'revit'}-projects/${encodeURIComponent(projectId)}/source-state`);
|
|
4304
|
-
if (!current || current.id !== projectId) return null;
|
|
4326
|
+
if (!current || current.id !== projectId || paintedSince()) return null;
|
|
4305
4327
|
// A project-open status request may finish after a new upload has been admitted.
|
|
4306
4328
|
// Never replace the newer operation with the older source-state response.
|
|
4307
4329
|
if (revitActiveOperation !== operationAtRequest) return null;
|
|
@@ -4335,7 +4357,7 @@
|
|
|
4335
4357
|
}
|
|
4336
4358
|
return response.state;
|
|
4337
4359
|
} catch (error) {
|
|
4338
|
-
if (!current || current.id !== projectId || revitActiveOperation !== operationAtRequest) return null;
|
|
4360
|
+
if (!current || current.id !== projectId || revitActiveOperation !== operationAtRequest || paintedSince()) return null;
|
|
4339
4361
|
paintRevitSourceState(isTeklaParserProject() ? 'Tekla source unavailable' : 'Revit source unavailable', error && error.message || 'Could not read source status.');
|
|
4340
4362
|
paintRevitSourceActions('ready', false);
|
|
4341
4363
|
return null;
|
|
@@ -4616,6 +4638,7 @@
|
|
|
4616
4638
|
if (operation.state === 'ready') {
|
|
4617
4639
|
revitActiveOperation = null;
|
|
4618
4640
|
paintRevitSourceState(tekla ? 'Read-only snapshot ready to review' : 'Model ready to review', 'The model is available on the Model tab. It is not approved yet.');
|
|
4641
|
+
revitSourceAwaitsApproval = true;
|
|
4619
4642
|
paintRevitSourceActions('imported', true);
|
|
4620
4643
|
// A Model tab opened during conversion has already loaded its temporary "unavailable" state.
|
|
4621
4644
|
// Invalidate that frame now: reload immediately when visible, or on the next tab activation.
|
|
@@ -5997,7 +6020,9 @@
|
|
|
5997
6020
|
const conflicts = review.moveForward && Array.isArray(review.moveForward.conflicts) ? review.moveForward.conflicts : [];
|
|
5998
6021
|
const conflictDecisions = approvalDialogState.conflicts || {};
|
|
5999
6022
|
$approvalSub.textContent = review.moveForward
|
|
6000
|
-
?
|
|
6023
|
+
? review.moveForward.replacesLatest
|
|
6024
|
+
? `This model will replace v${review.moveForward.toVersion} as the approved version`
|
|
6025
|
+
: `Your changes from v${review.moveForward.fromVersion} will be applied on top of approved v${review.moveForward.toVersion}`
|
|
6001
6026
|
: review.base ? `Compared with approved v${review.base.version}` : 'First approval · full-model baseline';
|
|
6002
6027
|
$approvalImpact.textContent = [review.summary, ...(Array.isArray(review.cautions) ? review.cautions : [])].filter(Boolean).join(' ');
|
|
6003
6028
|
const groupHtml = groups.map((group) => {
|
|
@@ -6312,6 +6337,7 @@
|
|
|
6312
6337
|
approvalState = { status: 'ready', review, pendingCount: Array.isArray(review.groups) ? review.groups.length : 0,
|
|
6313
6338
|
headVersion: approvalHeadVersion(review), error: '' };
|
|
6314
6339
|
renderApprovalHeader();
|
|
6340
|
+
settleImportedSourceCard(project.id);
|
|
6315
6341
|
renderApprovalReview();
|
|
6316
6342
|
if (canRestore) {
|
|
6317
6343
|
approvalDialogState.retryAction = 'approve';
|