@floless/app 0.162.0 → 0.163.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 +11754 -8096
- package/dist/schemas/steel.model.v2.schema.json +16 -2
- package/dist/skills/floless-app-actions/SKILL.md +54 -3
- package/dist/skills/floless-app-onboarding/SKILL.md +2 -2
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +8 -6
- package/dist/skills/floless-app-report-issue/SKILL.md +12 -1
- package/dist/skills/floless-app-rfi/SKILL.md +36 -9
- package/dist/skills/floless-app-steel-model/SKILL.md +5 -3
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +39 -34
- package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +10 -6
- package/dist/web/agents.js +24 -4
- package/dist/web/app.css +45 -7
- package/dist/web/app.js +22 -3
- package/dist/web/aware.js +157 -43
- package/dist/web/chat.css +26 -1
- package/dist/web/chat.js +32 -8
- package/dist/web/commands-shell.js +190 -4
- package/dist/web/commands-steel.js +14 -0
- package/dist/web/failure-copy.js +168 -0
- package/dist/web/index.html +35 -1
- package/dist/web/instructor.js +3 -1
- package/dist/web/landing-sort.js +277 -0
- package/dist/web/model-editor-steel-adapter.js +3 -0
- package/dist/web/model-panel-bridge.js +13 -2
- package/dist/web/model-view-query.js +23 -15
- package/dist/web/project-access.js +3 -3
- package/dist/web/project-rfis.js +250 -7
- package/dist/web/project-workflows.js +1 -1
- package/dist/web/steel-3d-view.js +8 -1
- package/dist/web/steel-editor.html +441 -12
- package/dist/web/steel-filter-core.js +2 -0
- package/dist/web/steel-filter.html +38 -5
- package/dist/web/steel-model-v2-commands.js +3 -1
- package/dist/web/steel-profile-colours.js +124 -24
- package/dist/web/workspaces.js +243 -38
- package/package.json +1 -1
package/dist/web/workspaces.js
CHANGED
|
@@ -283,6 +283,8 @@
|
|
|
283
283
|
// mode — and the markup stays the one place that sentence is written.
|
|
284
284
|
const WORKSPACE_TAB_TIP = $workspaceTab?.getAttribute('data-tip') || '';
|
|
285
285
|
const $landing = document.getElementById('ws-landing');
|
|
286
|
+
// #2866: a changed Sort by choice repaints the landing (renderLanding keeps the search, focus, scroll and sections).
|
|
287
|
+
window.flolessLandingSort?.onChange('workspaces', () => { if (!$landing.hidden) renderLanding(); });
|
|
286
288
|
// The landing search's query. Kept here, not only in the input, because renderLanding() rebuilds the
|
|
287
289
|
// whole landing with innerHTML on background refreshes; applyMode() empties it on each fresh visit.
|
|
288
290
|
let landingQuery = '';
|
|
@@ -792,6 +794,7 @@
|
|
|
792
794
|
{ key: 'rfis', label: 'RFIs' }, // #2470 R6.6c: owner ruling 2026-10-25, right after Model
|
|
793
795
|
{ key: 'pages', label: 'Pages' }, // #2262: stored, versioned HTML Pages; #2568: just before Exports (both are output)
|
|
794
796
|
{ key: 'exports', label: 'Exports' },
|
|
797
|
+
{ key: 'workflows', label: 'Workflows' }, // #2470 R6.2b: the workflows this project owns; owner ruling 2026-10-29, right after Exports
|
|
795
798
|
{ key: 'history', label: 'History' },
|
|
796
799
|
],
|
|
797
800
|
diff: true, // steel semantic diff expander
|
|
@@ -842,6 +845,7 @@
|
|
|
842
845
|
{ key: 'model', label: 'Traced' }, // reuse the 'model' frame slot; label "Traced"
|
|
843
846
|
{ key: 'pages', label: 'Pages' }, // #2262: stored, versioned HTML Pages; #2568: just before Exports (both are output)
|
|
844
847
|
{ key: 'exports', label: 'Exports' },
|
|
848
|
+
{ key: 'workflows', label: 'Workflows' }, // #2470 R6.2b: the workflows this project owns; owner ruling 2026-10-29, right after Exports
|
|
845
849
|
{ key: 'history', label: 'History' },
|
|
846
850
|
],
|
|
847
851
|
diff: false,
|
|
@@ -872,8 +876,10 @@
|
|
|
872
876
|
{ key: 'knowledge', label: 'Knowledge' },
|
|
873
877
|
{ key: 'drawings', label: 'Source' },
|
|
874
878
|
{ key: 'model', label: 'Model' },
|
|
875
|
-
{ key: 'history', label: 'History' },
|
|
876
879
|
{ key: 'pages', label: 'Pages' }, // #2262: stored, versioned HTML Pages (every app)
|
|
880
|
+
// #2470 R6.2b: the workflows this project owns. Owner ruling 2026-10-29, "After Pages, before History": History closes the row.
|
|
881
|
+
{ key: 'workflows', label: 'Workflows' },
|
|
882
|
+
{ key: 'history', label: 'History' },
|
|
877
883
|
],
|
|
878
884
|
diff: false,
|
|
879
885
|
exports: [],
|
|
@@ -900,8 +906,10 @@
|
|
|
900
906
|
{ key: 'knowledge', label: 'Knowledge' },
|
|
901
907
|
{ key: 'drawings', label: 'Source' },
|
|
902
908
|
{ key: 'model', label: 'Model' },
|
|
903
|
-
{ key: 'history', label: 'History' },
|
|
904
909
|
{ key: 'pages', label: 'Pages' }, // #2262: stored, versioned HTML Pages (every app)
|
|
910
|
+
// #2470 R6.2b: the workflows this project owns. Owner ruling 2026-10-29, "After Pages, before History": History closes the row.
|
|
911
|
+
{ key: 'workflows', label: 'Workflows' },
|
|
912
|
+
{ key: 'history', label: 'History' },
|
|
905
913
|
],
|
|
906
914
|
diff: false,
|
|
907
915
|
exports: [],
|
|
@@ -964,8 +972,10 @@
|
|
|
964
972
|
steps: [
|
|
965
973
|
{ key: 'knowledge', label: 'Knowledge' }, // the client's standards are knowledge, as for every app
|
|
966
974
|
{ key: 'model', label: 'Checker' },
|
|
967
|
-
{ key: 'history', label: 'History' },
|
|
968
975
|
{ key: 'pages', label: 'Pages' }, // #2262: stored, versioned HTML Pages (every app)
|
|
976
|
+
// #2470 R6.2b: the workflows this project owns. Owner ruling 2026-10-29, "After Pages, before History": History closes the row.
|
|
977
|
+
{ key: 'workflows', label: 'Workflows' },
|
|
978
|
+
{ key: 'history', label: 'History' },
|
|
969
979
|
],
|
|
970
980
|
diff: false,
|
|
971
981
|
exports: [],
|
|
@@ -2080,6 +2090,7 @@
|
|
|
2080
2090
|
}
|
|
2081
2091
|
const wasUnits = cached.displayUnits === 'mm' ? 'mm' : 'ft-in';
|
|
2082
2092
|
const wasApproved = cached.approvedAt;
|
|
2093
|
+
const wasSortKeys = { name: cached.name, createdAt: cached.createdAt, updatedAt: cached.updatedAt };
|
|
2083
2094
|
Object.assign(cached, fresh, {
|
|
2084
2095
|
displayUnits: fresh.displayUnits === 'mm' ? 'mm' : 'ft-in',
|
|
2085
2096
|
registrationState: registration.status,
|
|
@@ -2090,6 +2101,12 @@
|
|
|
2090
2101
|
});
|
|
2091
2102
|
if (!Object.hasOwn(fresh, 'approvedAt')) delete cached.approvedAt;
|
|
2092
2103
|
patchRegisteredCard(cached);
|
|
2104
|
+
// #2866: the patch updates the card in place; when it changed what the page is sorted by, repaint so the card
|
|
2105
|
+
// moves to its place (renderLanding keeps focus, scroll, search and sections). The name always counts: a date
|
|
2106
|
+
// sort orders undated cards and equal dates by name.
|
|
2107
|
+
{ const sort = window.flolessLandingSort?.get('workspaces');
|
|
2108
|
+
const key = sort?.field === 'created' ? 'createdAt' : sort?.field === 'modified' ? 'updatedAt' : 'name';
|
|
2109
|
+
if (sort && !$landing.hidden && !current && (wasSortKeys.name !== cached.name || wasSortKeys[key] !== cached[key])) renderLanding(); }
|
|
2093
2110
|
if (navigation !== openNavSeq || current?.registrationId !== registrationId) continue;
|
|
2094
2111
|
const units = cached.displayUnits === 'mm' ? 'mm' : 'ft-in';
|
|
2095
2112
|
Object.assign(current, cached);
|
|
@@ -2734,6 +2751,23 @@
|
|
|
2734
2751
|
const rootPath = rootState && rootState.root && rootState.root.path;
|
|
2735
2752
|
const rootUnavailable = !!rootState && rootState.available === false;
|
|
2736
2753
|
const folderName = window.flolessWorkspaceRoot ? window.flolessWorkspaceRoot.name() : 'Workspace directory';
|
|
2754
|
+
// #2866: the page's Sort by choice orders the cards inside each module section (and the Archived list); the
|
|
2755
|
+
// sections themselves keep their order. Dates are the project's own createdAt/updatedAt; an offline project with
|
|
2756
|
+
// no last-known record has neither and is listed last, by name, rather than given an invented date.
|
|
2757
|
+
const sorter = window.flolessLandingSort || null;
|
|
2758
|
+
const sortState = sorter ? sorter.get('workspaces') : null;
|
|
2759
|
+
const sortKeys = (p) => ({ name: p.name, id: p.registrationId || p.id, created: p.createdAt, modified: p.updatedAt });
|
|
2760
|
+
const sorted = (list) => (sorter ? sorter.sort(list, sortState, sortKeys) : list);
|
|
2761
|
+
/** The card's time segment: "2 h ago" (its last change) as always, or, while the page is sorted by date created,
|
|
2762
|
+
* the date it was created. A project with no recorded creation date shows no time rather than another date. The
|
|
2763
|
+
* created date is not a `.t`: patchRegisteredCard rewrites `.t` with the change time. */
|
|
2764
|
+
function projectCardTime(p) {
|
|
2765
|
+
if (sorter && sortState?.field === 'created') {
|
|
2766
|
+
const text = sorter.cardDate(sortState, p.createdAt, p.updatedAt);
|
|
2767
|
+
return text ? `<span class="ws-sep"> · </span><span class="t-created">${escapeHtml(text)}</span>` : '';
|
|
2768
|
+
}
|
|
2769
|
+
return `<span class="ws-sep"> · </span><span class="t">${escapeHtml(relAgo(p.updatedAt))}</span>`;
|
|
2770
|
+
}
|
|
2737
2771
|
let html = `<div class="ws-head"><div class="ws-head-text"><h2>Workspaces</h2>` +
|
|
2738
2772
|
`<div class="ws-sub">${rootUnavailable ? 'Workspace directory unavailable. Choose another folder to continue.' : 'Open a project to view its drawings, model, Knowledge and history.'}</div></div>` +
|
|
2739
2773
|
`<div class="ws-head-actions">` +
|
|
@@ -2741,6 +2775,7 @@
|
|
|
2741
2775
|
(!rootUnavailable && projects.length
|
|
2742
2776
|
? `<input type="search" id="ws-landing-search" class="ws-landing-search" data-command-id="shell.project-list-search" placeholder="Search projects" aria-label="Search projects by name, description, kind or workflow" autocomplete="off" spellcheck="false" value="${escapeAttr(landingQuery)}">`
|
|
2743
2777
|
: '') +
|
|
2778
|
+
(!rootUnavailable && (projects.length || archived.length) && sorter ? sorter.controlHtml('workspaces') : '') +
|
|
2744
2779
|
`<button type="button" class="ws-import-btn ws-folder-btn${rootUnavailable ? ' is-unavailable' : ''}" id="ws-workspace-folder" data-command-id="menu.workspace-folder" data-tip="${escapeAttr(rootPath || 'Choose the Workspace directory FloLess reads for projects and workflows')}">Workspace directory · ${escapeHtml(rootUnavailable ? 'unavailable' : folderName)}</button>` +
|
|
2745
2780
|
`${rootUnavailable ? '' : '<button type="button" class="ws-import-btn" id="ws-import-project" data-command-id="shell.project-import" data-tip="Restore a project from an exported .zip file or a zipped project folder">↓ Import project…</button>'}</div></div>`;
|
|
2746
2781
|
html += '<div class="ws-folder-review-note" id="ws-folder-review-note" hidden></div>';
|
|
@@ -2767,9 +2802,11 @@
|
|
|
2767
2802
|
const expanded = landingQuery.trim() ? (projectGroupSearchOverrides.get(group.key) ?? true) : projectGroupExpanded(group.key);
|
|
2768
2803
|
html += `<section class="ws-project-section" data-module="${escapeAttr(group.key)}">` +
|
|
2769
2804
|
`<h3 class="ws-project-heading"><button type="button" class="ws-project-group-toggle" data-project-group-toggle="${escapeAttr(group.key)}" data-command-id="shell.project-group-toggle#${escapeAttr(group.key)}" data-command-instance-label="${escapeAttr(group.label)}" aria-controls="${groupGridId}" aria-expanded="${expanded}" data-tip="${escapeAttr((expanded ? 'Collapse ' : 'Expand ') + group.label)}"><span class="ws-project-chevron" aria-hidden="true">›</span><span class="ws-project-group-label">${escapeHtml(group.label)}</span> ` +
|
|
2770
|
-
`<span class="ws-project-count">${group.projects.length} ${group.projects.length === 1 ? 'project' : 'projects'}</span
|
|
2805
|
+
`<span class="ws-project-count">${group.projects.length} ${group.projects.length === 1 ? 'project' : 'projects'}</span>` +
|
|
2806
|
+
(sorter ? `<span class="ls-undated">${escapeHtml(sorter.undatedNote(sorter.undatedCount(group.projects, sortState, sortKeys), group.projects.length, sortState))}</span>` : '') +
|
|
2807
|
+
`</button></h3>` +
|
|
2771
2808
|
`<div class="ws-grid" id="${groupGridId}"${expanded ? '' : ' hidden'}>`;
|
|
2772
|
-
for (const p of group.projects) {
|
|
2809
|
+
for (const p of sorted(group.projects)) {
|
|
2773
2810
|
const d = wsDescOf(p);
|
|
2774
2811
|
const displayApp = projectAppName(p);
|
|
2775
2812
|
const projectCapability = d && d.projectCapability ? d.projectCapability : '';
|
|
@@ -2796,7 +2833,7 @@
|
|
|
2796
2833
|
(p.importedMidSave ? `<span class="ws-meta ws-unverified" data-tip="${escapeAttr(UNVERIFIED_IMPORT_TIP)}">Imported mid-save · not verified. Export again on the source computer.</span>` : '') +
|
|
2797
2834
|
`<span class="ws-meta ws-registration-status"${p.registrationState === 'unavailable' ? '' : ' hidden'}>${escapeHtml(p.registrationReason || 'Project folder unavailable. Locate or restore it.')}</span>` +
|
|
2798
2835
|
`<span class="ws-meta ws-registration-location-note"${p.registrationState !== 'unavailable' && p.registrationLocationWarning ? '' : ' hidden'}>${escapeHtml(p.registrationLocationWarning || '')}</span>` +
|
|
2799
|
-
`<span class="ws-meta ws-meta-app"><span class="ws-meta-kind">${escapeHtml(displayApp)}</span>${wfName}
|
|
2836
|
+
`<span class="ws-meta ws-meta-app"><span class="ws-meta-kind">${escapeHtml(displayApp)}</span>${wfName}${projectCardTime(p)}</span></span>` +
|
|
2800
2837
|
`<button type="button" class="ws-kebab" data-kebab="${escapeAttr(p.id)}"${p.registrationState === 'unavailable' ? ` data-command-id="shell.project-registration-review#${escapeAttr(p.registrationId)}" data-command-instance-label="${escapeAttr(p.name)}"` : ''} aria-label="${p.registrationState === 'unavailable' ? 'Review project folder' : 'Project actions'}" data-tip="${p.registrationState === 'unavailable' ? 'Review project folder' : p.importedMidSave ? 'Rename · Thumbnail · Mark as checked · Duplicate · Export · Archive' : 'Rename · Thumbnail · Duplicate · Export · Archive'}">⋯</button>` +
|
|
2801
2838
|
`</span></div>`;
|
|
2802
2839
|
}
|
|
@@ -2840,7 +2877,7 @@
|
|
|
2840
2877
|
// Demoted rows (muted, no thumb) read as "put away"; each offers Restore + a guarded Delete.
|
|
2841
2878
|
if (archived.length) {
|
|
2842
2879
|
let rows = '';
|
|
2843
|
-
for (const p of archived) {
|
|
2880
|
+
for (const p of sorted(archived)) {
|
|
2844
2881
|
const displayApp = projectAppName(p);
|
|
2845
2882
|
// Tooltip only, deliberately: the Trash is a scan-and-act list where the user's own project
|
|
2846
2883
|
// NAME is the identifier (it doesn't even carry projectCapability), and a third clause on an
|
|
@@ -2862,7 +2899,9 @@
|
|
|
2862
2899
|
`</div>`;
|
|
2863
2900
|
}
|
|
2864
2901
|
html += `<details class="ws-archived">` +
|
|
2865
|
-
`<summary class="ws-archived-summary"><span class="ws-archived-caret hd-caret" aria-hidden="true">▸</span>Archived <span class="ws-archived-count">${archived.length}</span
|
|
2902
|
+
`<summary class="ws-archived-summary"><span class="ws-archived-caret hd-caret" aria-hidden="true">▸</span>Archived <span class="ws-archived-count">${archived.length}</span>` +
|
|
2903
|
+
(sorter && sorter.undatedCount(archived, sortState, sortKeys) ? ` <span class="ls-undated">${escapeHtml(sorter.undatedNote(sorter.undatedCount(archived, sortState, sortKeys), archived.length, sortState))}</span>` : '') +
|
|
2904
|
+
`</summary>` +
|
|
2866
2905
|
`<div class="ws-archived-list">${rows}</div>` +
|
|
2867
2906
|
`</details>`;
|
|
2868
2907
|
}
|
|
@@ -3811,6 +3850,9 @@
|
|
|
3811
3850
|
const $projectSetupKickoffNote = document.getElementById('project-setup-kickoff-note');
|
|
3812
3851
|
const $projectSetupBuild = document.getElementById('project-setup-build');
|
|
3813
3852
|
const $projectSetupQuickTerms = document.getElementById('project-setup-quick-terms');
|
|
3853
|
+
const $projectSetupQuickTermsTail = document.getElementById('project-setup-quick-terms-tail');
|
|
3854
|
+
const $projectSetupFilter = document.getElementById('project-setup-filter');
|
|
3855
|
+
const $projectSetupExclusions = document.getElementById('project-setup-exclusions');
|
|
3814
3856
|
const $projectSetupBuildLocked = document.getElementById('project-setup-build-locked');
|
|
3815
3857
|
const $projectSetupCancel = document.getElementById('project-setup-cancel');
|
|
3816
3858
|
const $projectSetupCreateOnly = document.getElementById('project-setup-create-only');
|
|
@@ -4070,14 +4112,75 @@
|
|
|
4070
4112
|
else button.removeAttribute('aria-disabled');
|
|
4071
4113
|
}
|
|
4072
4114
|
$projectSetupQuickTerms.hidden = mode !== 'quick';
|
|
4115
|
+
// #2521 row 2c: who decides the Drawing Filter, asked only with Quick (Precise always waits for the person's Save).
|
|
4116
|
+
const filter = projectSetupFilterChoice(state);
|
|
4117
|
+
if ($projectSetupFilter) {
|
|
4118
|
+
$projectSetupFilter.hidden = mode !== 'quick';
|
|
4119
|
+
for (const button of $projectSetupFilter.querySelectorAll('[data-filter-choice]')) {
|
|
4120
|
+
button.setAttribute('aria-pressed', String(button.dataset.filterChoice === filter));
|
|
4121
|
+
if (locked) button.setAttribute('aria-disabled', 'true');
|
|
4122
|
+
else button.removeAttribute('aria-disabled');
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
4125
|
+
// Revision 3 (owner ruling 2026-10-26): who approves what the read leaves out, asked only while the AI chooses the Filter.
|
|
4126
|
+
const exclusions = projectSetupExclusionsChoice(state);
|
|
4127
|
+
if ($projectSetupExclusions) {
|
|
4128
|
+
$projectSetupExclusions.hidden = mode !== 'quick' || filter !== 'ai';
|
|
4129
|
+
for (const button of $projectSetupExclusions.querySelectorAll('[data-exclusions-choice]')) {
|
|
4130
|
+
button.setAttribute('aria-pressed', String(button.dataset.exclusionsChoice === exclusions));
|
|
4131
|
+
if (locked) button.setAttribute('aria-disabled', 'true');
|
|
4132
|
+
else button.removeAttribute('aria-disabled');
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
if ($projectSetupQuickTermsTail) {
|
|
4136
|
+
$projectSetupQuickTermsTail.textContent = PROJECT_SETUP_TERMS_TAIL[filter === 'ai' && exclusions === 'person' ? 'aiKeep' : filter];
|
|
4137
|
+
}
|
|
4073
4138
|
$projectSetupBuildLocked.hidden = !locked;
|
|
4074
4139
|
if (shown && mode === 'quick') $projectSetupCreateOnly.setAttribute('aria-describedby', 'project-setup-quick-create-only');
|
|
4075
4140
|
else $projectSetupCreateOnly.removeAttribute('aria-describedby');
|
|
4076
4141
|
}
|
|
4077
4142
|
|
|
4143
|
+
/**
|
|
4144
|
+
* #2521 row 2c: the Drawing Filter choice that goes with Quick: 'ai' only when the person pressed "Let the AI choose",
|
|
4145
|
+
* else 'person'. Once sent it is the sent one, as for the Model choice; with Precise there is none to send.
|
|
4146
|
+
*/
|
|
4147
|
+
function projectSetupFilterChoice(state) {
|
|
4148
|
+
const value = state.submissionId ? state.sentFilterChoice : state.filterChoice;
|
|
4149
|
+
return value === 'ai' ? 'ai' : 'person';
|
|
4150
|
+
}
|
|
4151
|
+
/**
|
|
4152
|
+
* Revision 3: who approves what the read leaves out when the AI chooses the Filter: 'ai' (the default, "it must be
|
|
4153
|
+
* quick") unless the person pressed "I'll approve them myself". Once sent it is the sent one.
|
|
4154
|
+
*/
|
|
4155
|
+
function projectSetupExclusionsChoice(state) {
|
|
4156
|
+
const value = state.submissionId ? state.sentExclusionsChoice : state.exclusionsChoice;
|
|
4157
|
+
return value === 'person' ? 'person' : 'ai';
|
|
4158
|
+
}
|
|
4159
|
+
/** The Quick terms' last sentence, which follows the Filter choice so it never says the person decides what the AI does. */
|
|
4160
|
+
const PROJECT_SETUP_TERMS_TAIL = {
|
|
4161
|
+
person: 'The AI never approves anything: you still decide on the Drawing Filter and on the review.',
|
|
4162
|
+
// It does approve what that Filter leaves out of the read, so "never approves anything" would be untrue here (code review).
|
|
4163
|
+
ai: 'The AI chooses the Drawing Filter, including what the read leaves out, recorded and labelled as its own; you still decide on the review.',
|
|
4164
|
+
aiKeep: 'The AI chooses the Drawing Filter, recorded and labelled as its own; you approve what the read leaves out, and you still decide on the review.',
|
|
4165
|
+
};
|
|
4166
|
+
function chooseProjectSetupFilter(button) {
|
|
4167
|
+
if (!button || !projectSetupState || projectSetupState.busy || projectSetupState.submissionId) return;
|
|
4168
|
+
projectSetupState.filterChoice = button.dataset.filterChoice === 'ai' ? 'ai' : 'person';
|
|
4169
|
+
// The exclusion choice belongs to the AI's Filter choice: the person's own Save drops it, back to the quick default.
|
|
4170
|
+
if (projectSetupState.filterChoice === 'person') projectSetupState.exclusionsChoice = 'ai';
|
|
4171
|
+
renderProjectSetup();
|
|
4172
|
+
}
|
|
4173
|
+
function chooseProjectSetupExclusions(button) {
|
|
4174
|
+
if (!button || !projectSetupState || projectSetupState.busy || projectSetupState.submissionId) return;
|
|
4175
|
+
projectSetupState.exclusionsChoice = button.dataset.exclusionsChoice === 'person' ? 'person' : 'ai';
|
|
4176
|
+
renderProjectSetup();
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4078
4179
|
function chooseProjectSetupBuildMode(button) {
|
|
4079
4180
|
if (!button || !projectSetupState || projectSetupState.busy || projectSetupState.submissionId) return;
|
|
4080
4181
|
projectSetupState.buildMode = button.dataset.buildMode === 'quick' ? 'quick' : 'precise';
|
|
4182
|
+
// #2521 row 2c: the Filter choice belongs to Quick: Precise drops it, and Quick again starts from the person's Save.
|
|
4183
|
+
if (projectSetupState.buildMode === 'precise') { projectSetupState.filterChoice = 'person'; projectSetupState.exclusionsChoice = 'ai'; }
|
|
4081
4184
|
renderProjectSetup();
|
|
4082
4185
|
if (projectSetupState.buildMode === 'quick') $projectSetupQuickTerms.scrollIntoView?.({ block: 'nearest' });
|
|
4083
4186
|
}
|
|
@@ -4272,6 +4375,9 @@
|
|
|
4272
4375
|
state.snapshots = snapshots;
|
|
4273
4376
|
// #2521 row 7a: the choice is settled with the first send and every retry repeats it.
|
|
4274
4377
|
if (!state.submissionId) state.sentBuildMode = projectSetupBuildShown(state, provider) && state.buildMode === 'quick' ? 'quick' : null;
|
|
4378
|
+
// #2521 row 2c: the Filter choice is sent only with Quick, and fixed with the first send like the Model choice.
|
|
4379
|
+
if (!state.submissionId) state.sentFilterChoice = state.sentBuildMode === 'quick' && state.filterChoice === 'ai' ? 'ai' : null;
|
|
4380
|
+
if (!state.submissionId) state.sentExclusionsChoice = state.sentFilterChoice === 'ai' ? (state.exclusionsChoice === 'person' ? 'person' : 'ai') : null;
|
|
4275
4381
|
const submissionId = state.submissionId || crypto.randomUUID();
|
|
4276
4382
|
state.submissionId = submissionId;
|
|
4277
4383
|
rememberProjectChatIntake(submissionId);
|
|
@@ -4283,6 +4389,8 @@
|
|
|
4283
4389
|
snapshots,
|
|
4284
4390
|
provider,
|
|
4285
4391
|
...(state.sentBuildMode === 'quick' ? { buildMode: 'quick' } : {}),
|
|
4392
|
+
...(state.sentBuildMode === 'quick' && state.sentFilterChoice === 'ai' ? { quickFilterByAi: true } : {}),
|
|
4393
|
+
...(state.sentBuildMode === 'quick' && state.sentFilterChoice === 'ai' && state.sentExclusionsChoice === 'ai' ? { quickFilterExclusionsByAi: true } : {}),
|
|
4286
4394
|
});
|
|
4287
4395
|
const project = result.project;
|
|
4288
4396
|
state.project = project;
|
|
@@ -4385,6 +4493,10 @@
|
|
|
4385
4493
|
environment: null,
|
|
4386
4494
|
// #2521 row 7a: Precise unless the person presses Quick; what was sent is kept in `sentBuildMode`.
|
|
4387
4495
|
buildMode: 'precise',
|
|
4496
|
+
// #2521 row 2c: the person's own Filter Save unless they press "Let the AI choose" (with Quick only).
|
|
4497
|
+
filterChoice: 'person',
|
|
4498
|
+
// Revision 3: with "Let the AI choose", the AI also approves what the read leaves out unless the person keeps it.
|
|
4499
|
+
exclusionsChoice: 'ai',
|
|
4388
4500
|
directory: null,
|
|
4389
4501
|
name: '',
|
|
4390
4502
|
nameDirty: false,
|
|
@@ -4442,7 +4554,11 @@
|
|
|
4442
4554
|
renderProjectSetup();
|
|
4443
4555
|
});
|
|
4444
4556
|
$projectSetupBuild?.addEventListener('click', (event) => {
|
|
4445
|
-
|
|
4557
|
+
const exclusionsButton = event.target.closest('[data-exclusions-choice]');
|
|
4558
|
+
if (exclusionsButton) { chooseProjectSetupExclusions(exclusionsButton); return; }
|
|
4559
|
+
const filterButton = event.target.closest('[data-filter-choice]');
|
|
4560
|
+
if (filterButton) chooseProjectSetupFilter(filterButton);
|
|
4561
|
+
else chooseProjectSetupBuildMode(event.target.closest('[data-build-mode]'));
|
|
4446
4562
|
});
|
|
4447
4563
|
$projectSetupProvider?.addEventListener('click', (event) => {
|
|
4448
4564
|
chooseProjectSetupProvider(event.target.closest('[data-chat-provider]'));
|
|
@@ -5850,6 +5966,20 @@
|
|
|
5850
5966
|
markScrollable($stageGuidance);
|
|
5851
5967
|
}
|
|
5852
5968
|
|
|
5969
|
+
/** #2521 row 2c: the "AI's choice" mark beside a Drawing Filter the AI chose, in the band an initial read shows. */
|
|
5970
|
+
function appendStageGuidanceAiFilterPill() {
|
|
5971
|
+
if (!$stageGuidance || $stageGuidance.querySelector('.wsg-ai-pill')) return;
|
|
5972
|
+
const pill = document.createElement('span');
|
|
5973
|
+
pill.className = 'ai-pill wsg-ai-pill';
|
|
5974
|
+
pill.textContent = 'AI’s choice';
|
|
5975
|
+
pill.tabIndex = 0;
|
|
5976
|
+
pill.dataset.tip = FILTER_AI_PILL_TIP;
|
|
5977
|
+
// After the band's words and before its actions, so it reads as part of the sentence it marks.
|
|
5978
|
+
const words = $stageGuidance.querySelector(':scope > span[aria-hidden="true"]');
|
|
5979
|
+
if (words) words.after(pill);
|
|
5980
|
+
else $stageGuidance.append(pill);
|
|
5981
|
+
}
|
|
5982
|
+
|
|
5853
5983
|
/**
|
|
5854
5984
|
* The control inside the Drawing Filter that answers its unfinished save (#1781), or null when Save
|
|
5855
5985
|
* itself is the next action. The sign-off dialog shows Cancel + Approve while it waits, but only
|
|
@@ -5980,9 +6110,11 @@
|
|
|
5980
6110
|
const title = document.createElement('strong');
|
|
5981
6111
|
title.textContent = progress.heading;
|
|
5982
6112
|
summary.append(title);
|
|
6113
|
+
// #2867: the same Done → Now (or Needs you / Blocked) → Heads up → Next order as the expanded
|
|
6114
|
+
// rows below, so collapsing never reshuffles what the person is reading.
|
|
5983
6115
|
for (const [label, text] of [
|
|
5984
|
-
[
|
|
5985
|
-
['
|
|
6116
|
+
['Done', progress.done], [progress.nowLabel || 'Now', progress.now],
|
|
6117
|
+
['Heads up', progress.caution], ['Next', progress.next],
|
|
5986
6118
|
]) {
|
|
5987
6119
|
if (!text) continue;
|
|
5988
6120
|
const highlight = document.createElement('b');
|
|
@@ -5996,13 +6128,23 @@
|
|
|
5996
6128
|
toggle.className = 'wsg-toggle';
|
|
5997
6129
|
toggle.dataset.commandId = 'shell.workspace-progress-toggle';
|
|
5998
6130
|
toggle.setAttribute('aria-controls', body.id);
|
|
6131
|
+
// #2867: a chevron, not a word — the shared panel artwork, pointing down while open and right
|
|
6132
|
+
// while folded to one line (the chat cards' convention). The button keeps its spoken name.
|
|
6133
|
+
const svgNs = 'http://www.w3.org/2000/svg';
|
|
6134
|
+
const chevron = document.createElementNS(svgNs, 'svg');
|
|
6135
|
+
chevron.setAttribute('viewBox', '0 0 16 16');
|
|
6136
|
+
chevron.setAttribute('aria-hidden', 'true');
|
|
6137
|
+
chevron.setAttribute('focusable', 'false');
|
|
6138
|
+
const chevronPath = document.createElementNS(svgNs, 'path');
|
|
6139
|
+
chevronPath.setAttribute('d', 'm6 3 5 5-5 5');
|
|
6140
|
+
chevron.appendChild(chevronPath);
|
|
6141
|
+
toggle.appendChild(chevron);
|
|
5999
6142
|
const apply = () => {
|
|
6000
6143
|
const collapsed = choices.get(scope) === true;
|
|
6001
6144
|
$stageGuidance.classList.toggle('is-collapsed', collapsed);
|
|
6002
|
-
toggle.textContent = collapsed ? 'Expand' : 'Collapse';
|
|
6003
6145
|
toggle.setAttribute('aria-label', `${collapsed ? 'Expand' : 'Collapse'} drawing read progress`);
|
|
6004
6146
|
toggle.setAttribute('aria-expanded', String(!collapsed));
|
|
6005
|
-
toggle.setAttribute('data-tip', collapsed ? '
|
|
6147
|
+
toggle.setAttribute('data-tip', collapsed ? 'Expand: show full drawing read progress' : 'Collapse: keep drawing read progress on one line');
|
|
6006
6148
|
if (live && live.textContent !== compactAnnouncement) live.textContent = compactAnnouncement;
|
|
6007
6149
|
markScrollable($stageGuidance);
|
|
6008
6150
|
};
|
|
@@ -6086,7 +6228,30 @@
|
|
|
6086
6228
|
// Keep steel projects stage-by-stage while the first drawing read is in progress. The later tabs
|
|
6087
6229
|
// stay visible so the user can see what comes next, but explain their prerequisite instead of
|
|
6088
6230
|
// opening empty destinations during a potentially long terminal-AI read.
|
|
6231
|
+
/**
|
|
6232
|
+
* #2521 row 2c: the server's verdict on whose Filter Save a read holds (`filterChosenBy`, `quickFilterByAi`,
|
|
6233
|
+
* `filterReceiptProblem` on the request view). The words only follow it; the browser never decides it.
|
|
6234
|
+
*/
|
|
6235
|
+
const FILTER_AI_CHOSEN_LEAD = 'The AI chose the Drawing Filter (Quick model)';
|
|
6236
|
+
const FILTER_AI_CHOSEN_NEXT = 'The drawing read carries on with it. You can review it and press Save filter to make it yours.';
|
|
6237
|
+
const FILTER_AI_CHOOSING = 'The AI is choosing the Drawing Filter for this Quick model, as you allowed, and the read carries on once it has. You can still review it and press Save filter yourself.';
|
|
6238
|
+
const FILTER_AI_PILL_TIP = 'The AI chose this Drawing Filter in the Quick model build, and it is recorded as the AI’s, not as your Save. It becomes yours only when you press Save filter.';
|
|
6239
|
+
/**
|
|
6240
|
+
* The AI is still to choose: it may (the server's `quickFilterByAi`), and no Save has been recorded for this read yet.
|
|
6241
|
+
* After any Save a reset sends the read back to the person's Save wording: the AI has moved on and will not choose again.
|
|
6242
|
+
*/
|
|
6243
|
+
function filterAiIsChoosing(req) {
|
|
6244
|
+
return req?.quickFilterByAi === true && !req?.filterSaveReceiptId && req?.filterExclusionsAwait !== true;
|
|
6245
|
+
}
|
|
6246
|
+
/** Revision 3a: the AI chose a Filter that leaves lines out, and the person kept that approval (server-derived). */
|
|
6247
|
+
const FILTER_AI_EXCLUSIONS_AWAIT = 'The AI chose the Drawing Filter, and it leaves some lines out of the read. You kept that approval: review what it leaves out and press Save filter in the top-right corner. The read goes on with your Save.';
|
|
6248
|
+
function filterSavedLead(req) {
|
|
6249
|
+
return req?.filterChosenBy === 'ai' ? FILTER_AI_CHOSEN_LEAD : 'The Drawing Filter is saved';
|
|
6250
|
+
}
|
|
6251
|
+
|
|
6089
6252
|
function savedFilterNextStep(req) {
|
|
6253
|
+
// #2521 row 2c: the AI's choice starts no continuation: the read that made it goes on.
|
|
6254
|
+
if (req?.filterChosenBy === 'ai') return FILTER_AI_CHOSEN_NEXT;
|
|
6090
6255
|
const continuation = req?.filterSaveContinuation;
|
|
6091
6256
|
if (continuation?.state === 'queued') return 'FloLess will continue the drawing read in the linked AI Chat when that conversation is ready.';
|
|
6092
6257
|
if (continuation?.state === 'continuing') return 'FloLess sent the saved filter to the linked AI Chat. Follow that conversation for the drawing read.';
|
|
@@ -6100,6 +6265,10 @@
|
|
|
6100
6265
|
}
|
|
6101
6266
|
|
|
6102
6267
|
function readyFilterNextStep(req) {
|
|
6268
|
+
// #2521 row 2c: an AI choice that cannot stand says why; one still to come says the AI is choosing.
|
|
6269
|
+
if (req?.filterReceiptProblem?.reason) return req.filterReceiptProblem.reason;
|
|
6270
|
+
if (req?.filterExclusionsAwait === true) return FILTER_AI_EXCLUSIONS_AWAIT;
|
|
6271
|
+
if (filterAiIsChoosing(req)) return FILTER_AI_CHOOSING;
|
|
6103
6272
|
return readRunsInChat(req)
|
|
6104
6273
|
? 'Then press Save filter in the top-right corner. FloLess will continue the drawing read in the linked AI Chat.'
|
|
6105
6274
|
: 'Then press Save filter in the top-right corner. After Save, return to the terminal AI that prepared it and tell it to continue.';
|
|
@@ -6131,7 +6300,7 @@
|
|
|
6131
6300
|
// The EARLIER save is on record, but the Filter now holds a newer one nobody has finished (#1781).
|
|
6132
6301
|
const pendingSave = drawingFilterPendingSave();
|
|
6133
6302
|
if (pendingSave) return drawingFilterPendingText(pendingSave).replace(' · ', '. ');
|
|
6134
|
-
return
|
|
6303
|
+
return `${filterSavedLead(revCardReq)}. ${savedFilterNextStep(revCardReq)}`;
|
|
6135
6304
|
}
|
|
6136
6305
|
if (waitingForInitial && revCardReq?.prepassReady) return `Check steel, member marks, grids, dimensions, and relevant callouts. Ask in AI Chat on the left if you need help. ${readyFilterNextStep(revCardReq)}`;
|
|
6137
6306
|
if (waitingForInitial && revCardReq?.preparationRetryable) return `Steel Filter preparation was interrupted. Your drawings are still attached. Return to the same ${readSessionName(revCardReq)} and retry preparation for this same request.`;
|
|
@@ -6265,9 +6434,9 @@
|
|
|
6265
6434
|
: waitingForInitial && revCardReq?.filterSaveContinuation?.state === 'recovery-needed'
|
|
6266
6435
|
? `Drawing Filter needs attention · ${savedFilterNextStep(revCardReq)}`
|
|
6267
6436
|
: waitingForInitial && revCardReq?.filterCheckpointCurrent
|
|
6268
|
-
?
|
|
6437
|
+
? `${filterSavedLead(revCardReq)} · ${savedFilterNextStep(revCardReq)} Live progress appears here once the read starts.`
|
|
6269
6438
|
: waitingForInitial && revCardReq?.prepassReady
|
|
6270
|
-
? 'Drawing Filter ready for review · ' + (window.FilterGuidance?.scope || 'Check what this steel read may use — not only the steel. Keep the steel plus member labels and sizes, grid references, scale or location dimensions, and relevant detail or section callouts.') + ' Ask in AI Chat on the left if you are unsure. ' + readyFilterNextStep(revCardReq)
|
|
6439
|
+
? (revCardReq?.filterReceiptProblem || revCardReq?.filterExclusionsAwait === true ? 'Drawing Filter needs your Save · ' : filterAiIsChoosing(revCardReq) ? 'The AI is choosing the Drawing Filter · ' : 'Drawing Filter ready for review · ') + (window.FilterGuidance?.scope || 'Check what this steel read may use — not only the steel. Keep the steel plus member labels and sizes, grid references, scale or location dimensions, and relevant detail or section callouts.') + ' Ask in AI Chat on the left if you are unsure. ' + readyFilterNextStep(revCardReq)
|
|
6271
6440
|
: waitingForInitial && revCardReq?.preparationRetryable
|
|
6272
6441
|
? `Steel Filter preparation was interrupted · Your drawings are still attached. Return to the same ${readSessionName(revCardReq)} and retry preparation for this same request.`
|
|
6273
6442
|
: waitingForInitial && readWorkingInChat(revCardReq)
|
|
@@ -6299,6 +6468,11 @@
|
|
|
6299
6468
|
if (waitingForInitial && revCardReq?.prepassReady && !revCardReq?.filterCheckpointCurrent) {
|
|
6300
6469
|
appendStageGuidanceFilterAction();
|
|
6301
6470
|
}
|
|
6471
|
+
// #2521 row 2c: the AI's choice is the person's to review, so its band marks it and opens the Filter too.
|
|
6472
|
+
if (waitingForInitial && revCardReq?.filterCheckpointCurrent && revCardReq?.filterChosenBy === 'ai') {
|
|
6473
|
+
appendStageGuidanceAiFilterPill();
|
|
6474
|
+
appendStageGuidanceFilterAction();
|
|
6475
|
+
}
|
|
6302
6476
|
}
|
|
6303
6477
|
|
|
6304
6478
|
function deferStageUntilLifecycle(s) {
|
|
@@ -7829,7 +8003,7 @@
|
|
|
7829
8003
|
renderApprovalReview();
|
|
7830
8004
|
await refreshApprovalState(st.projectId);
|
|
7831
8005
|
showToast('Discarded the selected working-copy change. Nothing was approved.', 'ok');
|
|
7832
|
-
} catch (error) {
|
|
8006
|
+
} catch (error) { showFailureToast(error, { action: 'discard these changes' }); }
|
|
7833
8007
|
}
|
|
7834
8008
|
|
|
7835
8009
|
async function retryApprovalReview() {
|
|
@@ -8709,8 +8883,11 @@
|
|
|
8709
8883
|
if (knowledgeState) paintKnowledge(knowledgeState);
|
|
8710
8884
|
return res;
|
|
8711
8885
|
} catch (err) {
|
|
8712
|
-
|
|
8713
|
-
|
|
8886
|
+
// A category refusal is written for the person (CategoryError); anything else — a busy project, a lost
|
|
8887
|
+
// connection — goes through the shared failure copy (#2868) instead of "try again".
|
|
8888
|
+
const said = err && err.body && /^knowledge-categories-/.test(String(err.body.code || '')) && typeof err.body.error === 'string' ? err.body.error : '';
|
|
8889
|
+
if (said) showToast(said, 'warn');
|
|
8890
|
+
else showFailureToast(err, { action: 'change your categories' });
|
|
8714
8891
|
// Changed elsewhere since the name box opened: close it, so the person sees the newer names before naming again.
|
|
8715
8892
|
if (body.expected && err && err.body && err.body.code === 'knowledge-categories-changed') kbCatEdit = null;
|
|
8716
8893
|
return null;
|
|
@@ -10060,9 +10237,11 @@
|
|
|
10060
10237
|
kbFocusSourceId = added.sourceId;
|
|
10061
10238
|
showToast(`Added “${added.filename}”, but couldn’t remove “${old.filename}”. Remove it from the list.`, 'warn');
|
|
10062
10239
|
} else {
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10240
|
+
// #2868: the original is only removed after the new file is in, so here it is always still there. Whether the new
|
|
10241
|
+
// file went in is known for a refusal (nothing is stored) and not for a lost connection or an unknown failure.
|
|
10242
|
+
if (err && err.body && err.body.code === 'project-changed') showToast('This project was replaced while the file was being read, so nothing changed.', 'warn');
|
|
10243
|
+
else showFailureToast(err, { action: `replace “${old.filename}”`, nothingDone: `Nothing changed; “${old.filename}” is still there.`,
|
|
10244
|
+
retry: 'Try replacing it again', unsure: `“${old.filename}” is still there. FloLess can’t tell whether the new file was added, so check the references list first.` });
|
|
10066
10245
|
}
|
|
10067
10246
|
}
|
|
10068
10247
|
if (current === proj) renderKnowledge();
|
|
@@ -10969,11 +11148,19 @@
|
|
|
10969
11148
|
}
|
|
10970
11149
|
track('kb_sources_added', { app: proj.app, n });
|
|
10971
11150
|
} catch (err) {
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
:
|
|
10976
|
-
|
|
11151
|
+
if (err && err.body && err.body.code === 'project-changed') {
|
|
11152
|
+
showToast('This project was replaced while the files were being read, so nothing was added. Choose the files again.', 'warn');
|
|
11153
|
+
} else {
|
|
11154
|
+
// #2868: the server's facts decide the sentence. A busy project (drawing preparation holds the same project lock)
|
|
11155
|
+
// says what it is busy with and to add the files when it finishes, never that the files are wrong; a file FloLess
|
|
11156
|
+
// cannot take (#2491) gives its reason. "Nothing was added" is proven for the refusals: the route checks the
|
|
11157
|
+
// batch and takes the project lock before it stores anything, and a busy lock never runs the store. A lost
|
|
11158
|
+
// connection or an unknown failure does not claim it.
|
|
11159
|
+
const plural = files.length === 1 ? 'the file' : 'the files';
|
|
11160
|
+
showFailureToast(err, { action: `add ${files.length === 1 ? 'this reference' : 'these references'}`,
|
|
11161
|
+
nothingDone: 'Nothing was added.', retry: `Try adding ${plural} again`,
|
|
11162
|
+
unsure: `FloLess can’t tell whether ${plural === 'the file' ? 'it was' : 'they were'} added. Check the references list before adding ${plural === 'the file' ? 'it' : 'them'} again.` });
|
|
11163
|
+
}
|
|
10977
11164
|
}
|
|
10978
11165
|
if (current === proj) renderKnowledge();
|
|
10979
11166
|
}
|
|
@@ -11039,7 +11226,7 @@
|
|
|
11039
11226
|
const proj = current;
|
|
11040
11227
|
if (!proj) return;
|
|
11041
11228
|
try { await api(kbUrl(proj.id, `/sources/${encodeURIComponent(sourceId)}`), { method: 'PATCH', body: JSON.stringify({ useAsKb: next }) }); }
|
|
11042
|
-
catch {
|
|
11229
|
+
catch (err) { showFailureToast(err, { action: 'update this reference' }); }
|
|
11043
11230
|
if (current === proj) renderKnowledge(); // re-render reconciles the optimistic flip either way
|
|
11044
11231
|
}
|
|
11045
11232
|
|
|
@@ -11050,7 +11237,7 @@
|
|
|
11050
11237
|
try {
|
|
11051
11238
|
await api(kbUrl(proj.id, `/sources/${encodeURIComponent(sourceId)}`), { method: 'DELETE' });
|
|
11052
11239
|
showToast(okMsg || 'Reference removed', 'ok');
|
|
11053
|
-
} catch {
|
|
11240
|
+
} catch (err) { showFailureToast(err, { action: 'remove this reference', nothingDone: 'Nothing was removed.', retry: 'Try removing it again' }); }
|
|
11054
11241
|
if (current === proj) renderKnowledge();
|
|
11055
11242
|
}
|
|
11056
11243
|
|
|
@@ -14678,7 +14865,7 @@
|
|
|
14678
14865
|
(res.readiness && res.readiness.message) || 'the agent did not become usable.'}`,
|
|
14679
14866
|
res.readiness && res.readiness.ok ? 'ok' : 'warn');
|
|
14680
14867
|
} catch (err) {
|
|
14681
|
-
|
|
14868
|
+
showFailureToast(err, { action: 'install the Blender agent' });
|
|
14682
14869
|
// Leaving `checking` in place would strand the card disabled as "Checking…" with no
|
|
14683
14870
|
// recovery button until the tab is reopened — a failed install that hides its own retry.
|
|
14684
14871
|
renderReadinessState = {
|
|
@@ -15308,8 +15495,15 @@
|
|
|
15308
15495
|
if (req.prepassReady && req.filterCheckpointCurrent) {
|
|
15309
15496
|
const dot = revEl('span', 'wrc-dot'); dot.setAttribute('aria-hidden', 'true');
|
|
15310
15497
|
const txt = revEl('span', 'wrc-text');
|
|
15311
|
-
txt.appendChild(revEl('b', null, 'Drawing Filter saved.'));
|
|
15498
|
+
txt.appendChild(revEl('b', null, req.filterChosenBy === 'ai' ? 'Drawing Filter chosen by the AI.' : 'Drawing Filter saved.'));
|
|
15312
15499
|
txt.appendChild(document.createTextNode(` ${savedFilterNextStep(req)}`));
|
|
15500
|
+
// #2521 row 2c: who chose it, at a glance; the words above say what to do about it.
|
|
15501
|
+
if (req.filterChosenBy === 'ai') {
|
|
15502
|
+
const pill = revEl('span', 'ai-pill wrc-ai-pill', 'AI’s choice');
|
|
15503
|
+
pill.dataset.tip = FILTER_AI_PILL_TIP;
|
|
15504
|
+
pill.tabIndex = 0;
|
|
15505
|
+
return [dot, txt, pill];
|
|
15506
|
+
}
|
|
15313
15507
|
return [dot, txt];
|
|
15314
15508
|
}
|
|
15315
15509
|
// Defensive fallback for a strip that could not paint; ordinary initial reads put this action in
|
|
@@ -15519,7 +15713,7 @@
|
|
|
15519
15713
|
try { await api(`/api/requests/${encodeURIComponent(req.id)}`, { method: 'DELETE' }); }
|
|
15520
15714
|
catch (error) {
|
|
15521
15715
|
if (!ownsDismiss()) return;
|
|
15522
|
-
|
|
15716
|
+
showFailureToast(error, { action: 'dismiss this drawing' });
|
|
15523
15717
|
if (bridge.loadRequests) await bridge.loadRequests().catch(() => {});
|
|
15524
15718
|
await renderRevisionCard();
|
|
15525
15719
|
return;
|
|
@@ -15694,6 +15888,7 @@
|
|
|
15694
15888
|
syncDrawingRevisionRequest(
|
|
15695
15889
|
pending?.prepassReady ? pending.id : '',
|
|
15696
15890
|
pending?.prepassReady && pending.filterCheckpointCurrent ? pending.filterSavedEtag : '',
|
|
15891
|
+
pending?.prepassReady && pending.filterCheckpointCurrent && pending.filterChosenBy === 'ai' ? 'ai' : '',
|
|
15697
15892
|
);
|
|
15698
15893
|
if (currentStep !== 'drawings') { $revisionCard.hidden = true; applyStageGating(); return; } // card is Drawing Filter-scoped
|
|
15699
15894
|
// A REVIEW IS OPEN — leave the card alone. Repainting it would replace the button focus returns to,
|
|
@@ -15714,6 +15909,8 @@
|
|
|
15714
15909
|
// (`applyStageGating()` still runs on the short-circuit path, which is why only one of the two
|
|
15715
15910
|
// surfaces went stale — and why the contradiction was visible at all.)
|
|
15716
15911
|
+ `:${revCardReq?.chatConversation?.executionOwner || ''}:${revCardReq?.chatConversation?.chatState || ''}`
|
|
15912
|
+
// #2521 row 2c: whose Filter Save it is changes the words too, and none of the fields above implies it.
|
|
15913
|
+
+ `:${pending?.filterChosenBy || ''}:${filterAiIsChoosing(pending)}:${pending?.filterExclusionsAwait === true}:${pending?.filterReceiptProblem?.reason || ''}`
|
|
15717
15914
|
+ (staged ? `:${staged.baseVersion}:${staged.headVersion}:${staged.stageId || ''}:${staged.canDiscardRevision === true}:${staged.discardState || ''}:${staged.discardWhy || ''}:${staged.canClear === true}:${staged.clearWhy || ''}:${unavailableRevisionReviewStages.has(staged.stageId)}` : '');
|
|
15718
15915
|
// The key below exists to preserve focus in the card across the three-second poll. It says
|
|
15719
15916
|
// nothing about the strip, whose progress record advances on its own revision, so the strip is
|
|
@@ -15738,11 +15935,13 @@
|
|
|
15738
15935
|
}
|
|
15739
15936
|
|
|
15740
15937
|
/** Keep the request checkpoint in the already-open Drawing Filter without navigating away edits. */
|
|
15741
|
-
function syncDrawingRevisionRequest(targetRequest, targetSavedEtag = '') {
|
|
15938
|
+
function syncDrawingRevisionRequest(targetRequest, targetSavedEtag = '', targetChosenBy = '') {
|
|
15742
15939
|
const frame = frames.drawings;
|
|
15743
15940
|
if (!frame?.dataset.want) return;
|
|
15744
15941
|
const requestId = String(targetRequest || '');
|
|
15745
15942
|
const savedEtag = requestId ? String(targetSavedEtag || '') : '';
|
|
15943
|
+
// #2521 row 2c: whose save the checkpoint is, so the Filter can offer to save the AI's choice as the person's.
|
|
15944
|
+
const chosenBy = savedEtag && targetChosenBy === 'ai' ? 'ai' : '';
|
|
15746
15945
|
let bridged = false;
|
|
15747
15946
|
if (frame.dataset.loaded) {
|
|
15748
15947
|
try {
|
|
@@ -15750,7 +15949,7 @@
|
|
|
15750
15949
|
if (checkpoint && typeof checkpoint.setRequest === 'function') {
|
|
15751
15950
|
// `false` means this exact child Save owns a transient E1→empty invalidation. Do not let the
|
|
15752
15951
|
// same stale poll rewrite dataset.want either, or the next iframe load would replay the gap.
|
|
15753
|
-
if (checkpoint.setRequest(requestId, savedEtag) === false) return false;
|
|
15952
|
+
if (checkpoint.setRequest(requestId, savedEtag, chosenBy) === false) return false;
|
|
15754
15953
|
bridged = true;
|
|
15755
15954
|
}
|
|
15756
15955
|
} catch { /* not ready or not same-origin yet — reconcile through the target URL below */ }
|
|
@@ -15760,12 +15959,15 @@
|
|
|
15760
15959
|
else wanted.searchParams.delete('revisionRequest');
|
|
15761
15960
|
if (savedEtag) wanted.searchParams.set('revisionFilterSavedEtag', savedEtag);
|
|
15762
15961
|
else wanted.searchParams.delete('revisionFilterSavedEtag');
|
|
15962
|
+
if (chosenBy) wanted.searchParams.set('revisionFilterChosenBy', chosenBy);
|
|
15963
|
+
else wanted.searchParams.delete('revisionFilterChosenBy');
|
|
15763
15964
|
frame.dataset.want = wanted.pathname + wanted.search;
|
|
15764
15965
|
if (!frame.dataset.loaded || bridged) return true;
|
|
15765
15966
|
try {
|
|
15766
15967
|
const shown = new URL(frame.contentWindow.location.href);
|
|
15767
15968
|
if ((shown.searchParams.get('revisionRequest') || '') === requestId
|
|
15768
|
-
&& (shown.searchParams.get('revisionFilterSavedEtag') || '') === savedEtag
|
|
15969
|
+
&& (shown.searchParams.get('revisionFilterSavedEtag') || '') === savedEtag
|
|
15970
|
+
&& (shown.searchParams.get('revisionFilterChosenBy') || '') === chosenBy) return true;
|
|
15769
15971
|
} catch { /* not ready or not same-origin yet — navigate to the authoritative target below */ }
|
|
15770
15972
|
frame.src = frame.dataset.want;
|
|
15771
15973
|
return true;
|
|
@@ -17298,7 +17500,7 @@
|
|
|
17298
17500
|
}
|
|
17299
17501
|
return;
|
|
17300
17502
|
}
|
|
17301
|
-
|
|
17503
|
+
showFailureToast(err, { action: 'apply that change' });
|
|
17302
17504
|
closeRevReview(); // repaints the card itself
|
|
17303
17505
|
return;
|
|
17304
17506
|
}
|
|
@@ -18869,7 +19071,7 @@
|
|
|
18869
19071
|
showToast(replacing ? 'Thumbnail replaced ✓' : 'Thumbnail added ✓', 'ok');
|
|
18870
19072
|
track('workspace_project_thumbnail_set', { app: project.app, replaced: replacing });
|
|
18871
19073
|
} catch (err) {
|
|
18872
|
-
|
|
19074
|
+
showFailureToast(err, { action: 'save that thumbnail' });
|
|
18873
19075
|
} finally { projActionBusy = false; }
|
|
18874
19076
|
loadProjects(); // background reconcile, mirroring rename/duplicate/archive
|
|
18875
19077
|
}
|
|
@@ -19927,8 +20129,11 @@
|
|
|
19927
20129
|
syncWorkspaceReporter, openChatOwner, openPagesHome, folderDecisionCompleted,
|
|
19928
20130
|
// Project access (project-access.js loads after this file): the project open now, or null.
|
|
19929
20131
|
currentProject: () => ($app.classList.contains('mode-workspaces') && current ? current : null),
|
|
19930
|
-
// #2470 R6.2: whether the open project's kind has this step
|
|
20132
|
+
// #2470 R6.2: whether the open project's kind has this step. Every kind has Workflows since R6.2b; Project access still asks,
|
|
20133
|
+
// so a kind without the step would get its owned workflows listed in full there.
|
|
19931
20134
|
projectHasStep: (key) => Boolean(current && wsDescOf(current)?.steps?.some((st) => st.key === key)),
|
|
20135
|
+
// #2470 R6.2b: a project kind's name as the person sees it ("Trace", "Drawing Checker"), for labels outside this file.
|
|
20136
|
+
kindLabelOf: (project) => (project && wsDescOf(project)?.displayName) || null,
|
|
19932
20137
|
};
|
|
19933
20138
|
applyMode(); // restore persisted mode immediately (matches panels.js applyView timing)
|
|
19934
20139
|
})();
|