@floless/app 0.158.0 → 0.159.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 +92620 -75445
- package/dist/schemas/drawing-check.profile.v1.schema.json +33 -1
- package/dist/skills/floless-app-actions/SKILL.md +23 -5
- package/dist/skills/floless-app-bridge/SKILL.md +5 -3
- package/dist/skills/floless-app-onboarding/SKILL.md +67 -4
- package/dist/skills/floless-app-onboarding/references/floless-surfaces.md +7 -4
- package/dist/skills/floless-app-queue/SKILL.md +3 -1
- package/dist/skills/floless-app-steel-model/SKILL.md +11 -5
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +28 -8
- package/dist/skills/floless-app-workflows/SKILL.md +6 -3
- package/dist/web/agents.js +12 -5
- package/dist/web/app.css +87 -13
- package/dist/web/app.js +6 -0
- package/dist/web/aware.js +29 -4
- package/dist/web/chat.css +42 -22
- package/dist/web/chat.js +181 -30
- package/dist/web/commands-shell.js +305 -4
- package/dist/web/commands-steel.js +1 -0
- package/dist/web/drawing-check-editor.html +10 -0
- package/dist/web/drawing-check-editor.js +44 -0
- package/dist/web/guide.js +4 -2
- package/dist/web/index.html +41 -9
- package/dist/web/instructor.js +20 -8
- package/dist/web/pages.js +71 -13
- package/dist/web/project-access.js +67 -8
- package/dist/web/project-modules.js +474 -0
- package/dist/web/project-workflows.js +274 -0
- package/dist/web/steel-3d-core.js +46 -0
- package/dist/web/steel-3d-view.js +8 -38
- package/dist/web/steel-editor.html +192 -49
- package/dist/web/workspace-root-recovery.js +119 -0
- package/dist/web/workspaces.js +358 -114
- package/launch-starting-page.mjs +5 -2
- package/launch.mjs +136 -78
- package/package.json +5 -1
package/dist/web/chat.js
CHANGED
|
@@ -41,6 +41,17 @@
|
|
|
41
41
|
moveSecondary: el('chat-move-secondary'), moveDismiss: el('chat-move-dismiss'),
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
// The hint line under the message box only takes room when it says something about this moment. Its idle text
|
|
45
|
+
// ("Enter to send …") is kept for screen readers but not drawn. Watched rather than set at each of the many places
|
|
46
|
+
// that write the hint, so a new writer can never leave an error hidden behind the idle class.
|
|
47
|
+
function markIdleHint() {
|
|
48
|
+
ui.hint?.classList.toggle('is-idle', /^Enter to send /.test(ui.hint.textContent || ''));
|
|
49
|
+
}
|
|
50
|
+
if (ui.hint && typeof MutationObserver === 'function') {
|
|
51
|
+
new MutationObserver(markIdleHint).observe(ui.hint, { childList: true, characterData: true, subtree: true });
|
|
52
|
+
markIdleHint();
|
|
53
|
+
}
|
|
54
|
+
|
|
44
55
|
const state = {
|
|
45
56
|
// #2438: the picks waiting to go with the next message (per conversation), and the open @ list.
|
|
46
57
|
mentions: {}, mentionMenu: null, mentionDismissed: null,
|
|
@@ -621,6 +632,7 @@
|
|
|
621
632
|
const workspaceSurface = {
|
|
622
633
|
drawings: 'drawing-filter', model: 'project-model', exports: 'project-exports',
|
|
623
634
|
history: 'project-history', knowledge: 'project-knowledge', pages: 'project-pages',
|
|
635
|
+
workflows: 'project-workflows', // #2470 R6.2
|
|
624
636
|
}[selectedStep || ''] || 'project-list';
|
|
625
637
|
const workspaceProjectOpen = document.getElementById('ws-project')?.hidden === false;
|
|
626
638
|
const dashboardVisible = document.getElementById('dashboard')?.hidden === false;
|
|
@@ -666,6 +678,7 @@
|
|
|
666
678
|
case 'project-history': return shellText('ws-history');
|
|
667
679
|
case 'project-knowledge': return shellText('ws-knowledge');
|
|
668
680
|
case 'project-pages': return shellText('ws-pages');
|
|
681
|
+
case 'project-workflows': return shellText('ws-workflows');
|
|
669
682
|
case 'project-list': return shellText('ws-landing');
|
|
670
683
|
case 'workflow-list': return shellText('wf-landing');
|
|
671
684
|
case 'agent-list': case 'agent-page': return shellText('agents-surface');
|
|
@@ -681,7 +694,7 @@
|
|
|
681
694
|
function floLessContextLabel(context = currentFloLessContext()) {
|
|
682
695
|
const labels = {
|
|
683
696
|
'drawing-filter': 'Drawing Filter', 'project-model': 'project model', 'project-exports': 'project exports',
|
|
684
|
-
'project-history': 'project history', 'project-knowledge': 'project Knowledge', 'project-pages': 'project Pages', 'project-list': 'project list',
|
|
697
|
+
'project-history': 'project history', 'project-knowledge': 'project Knowledge', 'project-pages': 'project Pages', 'project-workflows': 'project Workflows', 'project-list': 'project list',
|
|
685
698
|
'workflow-canvas': 'workflow canvas', dashboard: 'dashboard', report: 'report', '3d-report': '3D report',
|
|
686
699
|
'model-editor': 'model editor', 'workflow-list': 'workflow list', 'agent-list': 'list of agents', 'agent-page': 'agent page',
|
|
687
700
|
};
|
|
@@ -859,6 +872,66 @@
|
|
|
859
872
|
return node;
|
|
860
873
|
}
|
|
861
874
|
|
|
875
|
+
/*
|
|
876
|
+
* #2582: the two source viewers (a cited source, a readiness place) open over a backdrop of their own, never as a
|
|
877
|
+
* native modal <dialog>. showModal() lifts a dialog into the browser's top layer and makes the rest of the page inert,
|
|
878
|
+
* the Instructor included: `?` explained a viewer's control in a band nobody could see, and "see all" opened a command
|
|
879
|
+
* sheet nobody could click. Like the Page viewer, the backdrop sits under the band and the sheet (app.css), Tab stays
|
|
880
|
+
* in the viewer, and a press on the backdrop itself closes it. The rest of the app is made inert as a modal would make
|
|
881
|
+
* it, all but the band and its Ask menu, so the sheet takes a person to the viewer's own control and never to the same
|
|
882
|
+
* command on a chip behind it. Returns what puts it all back; the caller's `close` must call it.
|
|
883
|
+
*/
|
|
884
|
+
function showChatViewer(dialog, close) {
|
|
885
|
+
const backdrop = document.createElement('div');
|
|
886
|
+
backdrop.className = 'modal-backdrop show ai-chat-viewer-backdrop';
|
|
887
|
+
// The Instructor's command sheet may open over this viewer, as over the Page viewer: its controls are built at run time.
|
|
888
|
+
backdrop.dataset.commandSheetOver = '';
|
|
889
|
+
dialog.setAttribute('aria-modal', 'true');
|
|
890
|
+
backdrop.append(dialog);
|
|
891
|
+
// What was inert already stays so when the viewer closes: put back, never cleared.
|
|
892
|
+
const covered = [...document.querySelectorAll('#app > *')].filter((node) => node.id !== 'instructor' && node.id !== 'ix-ask-menu')
|
|
893
|
+
.map((node) => [node, node.inert]);
|
|
894
|
+
for (const [node] of covered) node.inert = true;
|
|
895
|
+
document.body.append(backdrop);
|
|
896
|
+
dialog.show();
|
|
897
|
+
let pressedBackdrop = false;
|
|
898
|
+
backdrop.addEventListener('mousedown', (event) => { pressedBackdrop = event.target === backdrop; });
|
|
899
|
+
backdrop.addEventListener('click', (event) => {
|
|
900
|
+
const hit = pressedBackdrop && event.target === backdrop;
|
|
901
|
+
pressedBackdrop = false;
|
|
902
|
+
if (hit) close();
|
|
903
|
+
});
|
|
904
|
+
// On the document, in capture, not on the dialog: a click on the picture or the title leaves focus on <body>, and a
|
|
905
|
+
// shown (not modal) dialog has no Escape of its own, so a dialog-level listener would never hear the key. The viewer
|
|
906
|
+
// takes Escape and Tab from wherever focus is (the viewer, the band, a toast, the page itself), except while
|
|
907
|
+
// something above it owns the keys: another dialog (the command sheet, or a form the band's Ask menu opens) or the
|
|
908
|
+
// Ask menu itself, open or holding focus. Tab goes round the viewer's controls and then the band's, so "see all" and
|
|
909
|
+
// Ask stay reachable from the keyboard.
|
|
910
|
+
const forThisViewer = (event) => {
|
|
911
|
+
if ([...document.querySelectorAll('.modal-backdrop.show')].some((node) => node !== backdrop)) return false;
|
|
912
|
+
const askMenu = document.getElementById('ix-ask-menu');
|
|
913
|
+
return !(askMenu && (!askMenu.hidden || askMenu.contains(event.target)));
|
|
914
|
+
};
|
|
915
|
+
const onKey = (event) => {
|
|
916
|
+
if ((event.key !== 'Escape' && event.key !== 'Tab') || !forThisViewer(event)) return;
|
|
917
|
+
event.preventDefault();
|
|
918
|
+
if (event.key === 'Escape') { event.stopPropagation(); close(); return; }
|
|
919
|
+
const reachable = (node) => !node.disabled && !node.closest('[inert]') && node.getClientRects().length;
|
|
920
|
+
const band = document.getElementById('instructor');
|
|
921
|
+
const focusables = [...dialog.querySelectorAll('button, a[href], [tabindex="0"]'), ...(band?.querySelectorAll('button, a[href], [tabindex="0"]') ?? [])].filter(reachable);
|
|
922
|
+
if (!focusables.length) return;
|
|
923
|
+
const at = focusables.indexOf(document.activeElement);
|
|
924
|
+
const step = event.shiftKey ? -1 : 1;
|
|
925
|
+
focusables[at < 0 ? (event.shiftKey ? focusables.length - 1 : 0) : (at + step + focusables.length) % focusables.length].focus();
|
|
926
|
+
};
|
|
927
|
+
document.addEventListener('keydown', onKey, true);
|
|
928
|
+
return () => {
|
|
929
|
+
document.removeEventListener('keydown', onKey, true);
|
|
930
|
+
backdrop.remove();
|
|
931
|
+
for (const [node, wasInert] of covered) node.inert = wasInert;
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
|
|
862
935
|
// The composer's disclosure line. Derived from state in ONE place and called from every render
|
|
863
936
|
// entry point, rather than switched on where the chooser is built and off in each of the paths
|
|
864
937
|
// that leave it: a guarantee assembled from N call sites is only as good as the one someone
|
|
@@ -2413,12 +2486,11 @@
|
|
|
2413
2486
|
if (finished) return;
|
|
2414
2487
|
finished = true;
|
|
2415
2488
|
if (dialog.open) dialog.close();
|
|
2416
|
-
|
|
2489
|
+
hide();
|
|
2417
2490
|
if (picture) URL.revokeObjectURL(picture);
|
|
2418
2491
|
liveCitationOpener(turnId, row.anchor)?.focus({ preventScroll: true });
|
|
2419
2492
|
};
|
|
2420
2493
|
close.addEventListener('click', finish);
|
|
2421
|
-
dialog.addEventListener('keydown', (event) => { if (event.key === 'Escape') { event.preventDefault(); finish(); } });
|
|
2422
2494
|
dialog.addEventListener('close', finish);
|
|
2423
2495
|
head.append(title, close);
|
|
2424
2496
|
const note = Object.assign(document.createElement('span'), { className: 'ai-chat-source-viewer-note', textContent: citationProvenance(entry) });
|
|
@@ -2427,8 +2499,8 @@
|
|
|
2427
2499
|
status.setAttribute('role', 'status');
|
|
2428
2500
|
body.append(status);
|
|
2429
2501
|
dialog.append(head, note, body);
|
|
2430
|
-
|
|
2431
|
-
|
|
2502
|
+
const hide = showChatViewer(dialog, finish);
|
|
2503
|
+
close.focus({ preventScroll: true });
|
|
2432
2504
|
const refused = async (response) => {
|
|
2433
2505
|
if (response.status === 404) return 'FloLess no longer holds this source, or its project is no longer part of this conversation.';
|
|
2434
2506
|
if (response.status === 410) {
|
|
@@ -4295,12 +4367,11 @@
|
|
|
4295
4367
|
if (finished) return;
|
|
4296
4368
|
finished = true;
|
|
4297
4369
|
if (dialog.open) dialog.close();
|
|
4298
|
-
|
|
4370
|
+
hide();
|
|
4299
4371
|
if (picture) URL.revokeObjectURL(picture);
|
|
4300
4372
|
if (opener?.isConnected) opener.focus({ preventScroll: true });
|
|
4301
4373
|
};
|
|
4302
4374
|
close.addEventListener('click', finish);
|
|
4303
|
-
dialog.addEventListener('keydown', (event) => { if (event.key === 'Escape') { event.preventDefault(); finish(); } });
|
|
4304
4375
|
dialog.addEventListener('close', finish);
|
|
4305
4376
|
head.append(Object.assign(document.createElement('strong'), { textContent: title }), close);
|
|
4306
4377
|
const note = Object.assign(document.createElement('span'), { className: 'ai-chat-source-viewer-note', textContent: EVIDENCE_ORIGIN[place.origin].note(place) });
|
|
@@ -4329,8 +4400,7 @@
|
|
|
4329
4400
|
show(false);
|
|
4330
4401
|
body.append(status, frame);
|
|
4331
4402
|
dialog.append(head, note, views, body);
|
|
4332
|
-
|
|
4333
|
-
dialog.showModal();
|
|
4403
|
+
const hide = showChatViewer(dialog, finish);
|
|
4334
4404
|
close.focus({ preventScroll: true });
|
|
4335
4405
|
// A place that changed or is gone says so and offers the way on: the card asked for again, never sent for the person.
|
|
4336
4406
|
const offerAgain = (why) => {
|
|
@@ -4744,6 +4814,9 @@
|
|
|
4744
4814
|
case 'create-workflow':
|
|
4745
4815
|
return { title: guideText?.title || `Build a workflow: ${move.name || ''}`, action: 'Build it', detail: move.purpose,
|
|
4746
4816
|
note: 'Opens New workflow with its name filled in. Nothing is built until you confirm there.' };
|
|
4817
|
+
// An Open card only shows a page: there is no next step to confirm.
|
|
4818
|
+
case 'open':
|
|
4819
|
+
return guideText ? { ...guideText, note: 'This only opens the page. Nothing changes.' } : null;
|
|
4747
4820
|
default:
|
|
4748
4821
|
return guideText ? { ...guideText, note: 'Nothing happens until you confirm in the next step.' } : null;
|
|
4749
4822
|
}
|
|
@@ -5000,7 +5073,8 @@
|
|
|
5000
5073
|
use.dataset.tip = move.kind === 'follow-up' ? 'Puts this message in the message box. Nothing is sent.'
|
|
5001
5074
|
: move.kind === 'action' && move.risk === 'read' ? 'Shows the result here. Nothing changes.'
|
|
5002
5075
|
: move.kind === 'action' && move.risk !== 'human-only' ? 'Opens a request below for your OK. Nothing runs from this card.'
|
|
5003
|
-
:
|
|
5076
|
+
: move.kind === 'open' ? `${text.action}. Nothing changes.`
|
|
5077
|
+
: 'Opens the place to do this. Nothing happens until you confirm there.';
|
|
5004
5078
|
if (entry.busy === 'use') use.setAttribute('aria-busy', 'true');
|
|
5005
5079
|
use.addEventListener('click', () => { void useAssistantCard(entry, text); });
|
|
5006
5080
|
for (const control of [later, never, use]) control.disabled = Boolean(entry.busy);
|
|
@@ -7354,7 +7428,9 @@
|
|
|
7354
7428
|
};
|
|
7355
7429
|
const flushLinks = () => { if (links.length) { ui.feed.append(...receiptFold(links)); links = []; } };
|
|
7356
7430
|
for (const event of state.events) {
|
|
7357
|
-
|
|
7431
|
+
// A follow-up can share its provider turn with the preceding answer. Its question still
|
|
7432
|
+
// starts a new visible answer group, after that answer's text and held receipts (#2505).
|
|
7433
|
+
if (event.type === 'user-message' || (links.length && event.turnId !== links[0].turnId)) { flushAssistant(); flushLinks(); }
|
|
7358
7434
|
if (event.type === 'assistant-message' && event.payload?.delta) {
|
|
7359
7435
|
// Codex keeps a stable item id while Claude's SDK may assign one per stream packet.
|
|
7360
7436
|
// Same-turn deltas stay in one visible answer. Tools separate progress paragraphs;
|
|
@@ -9947,11 +10023,19 @@
|
|
|
9947
10023
|
|
|
9948
10024
|
// The units question of a workspace conversation (#1890): asked until the person answers, then a quiet line to change
|
|
9949
10025
|
// it. Never blocks Send — an unanswered question tells the AI the units are not chosen yet, and it asks.
|
|
10026
|
+
// The units menu's open state and its outside-click listener belong to the chip they were made for: a repaint that
|
|
10027
|
+
// replaces the chip drops both, so a menu never comes back open without a way to close it.
|
|
10028
|
+
function dropUnitsMenu() {
|
|
10029
|
+
if (state.workspaceUnitsMenuAway) document.removeEventListener('pointerdown', state.workspaceUnitsMenuAway, true);
|
|
10030
|
+
state.workspaceUnitsMenuAway = null;
|
|
10031
|
+
state.workspaceUnitsMenuOpen = false;
|
|
10032
|
+
}
|
|
10033
|
+
|
|
9950
10034
|
function paintWorkspaceUnits() {
|
|
9951
10035
|
const host = ui.workspaceUnits;
|
|
9952
10036
|
if (!host) return;
|
|
9953
10037
|
const chat = state.chat;
|
|
9954
|
-
if (state.scope?.owner?.kind !== 'workspace' || !chat || chat.archivedAt) { host.hidden = true; host.replaceChildren(); delete host.dataset.painted; return; }
|
|
10038
|
+
if (state.scope?.owner?.kind !== 'workspace' || !chat || chat.archivedAt) { dropUnitsMenu(); host.hidden = true; host.replaceChildren(); delete host.dataset.painted; return; }
|
|
9955
10039
|
// The receipts' units follow the conversation's own (chosen, else suggested) — set here, where the chat is known.
|
|
9956
10040
|
state.displayUnits = workspaceUnitsOf(chat);
|
|
9957
10041
|
const units = chat.workspaceUnits || {};
|
|
@@ -9962,23 +10046,77 @@
|
|
|
9962
10046
|
if (host.dataset.painted === painted) return;
|
|
9963
10047
|
host.dataset.painted = painted;
|
|
9964
10048
|
host.hidden = false;
|
|
10049
|
+
dropUnitsMenu();
|
|
9965
10050
|
host.replaceChildren();
|
|
9966
10051
|
if (chosen && !state.workspaceUnitsEditing) {
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
10052
|
+
// A toolbar chip ("ft-in ⌄"), whose two-item menu changes the units in place.
|
|
10053
|
+
const chip = document.createElement('button');
|
|
10054
|
+
chip.type = 'button';
|
|
10055
|
+
chip.className = 'ai-chat-units-chip ai-chat-units-change';
|
|
10056
|
+
chip.setAttribute('aria-label', `Units: ${label(chosen)}. Change units`);
|
|
10057
|
+
chip.setAttribute('aria-haspopup', 'menu');
|
|
10058
|
+
chip.setAttribute('aria-expanded', String(Boolean(state.workspaceUnitsMenuOpen)));
|
|
10059
|
+
chip.setAttribute('aria-controls', 'chat-units-menu');
|
|
10060
|
+
chip.dataset.commandId = 'shell.chat-units-change';
|
|
10061
|
+
chip.dataset.tip = `Units: ${label(chosen)}. Choose the units AI answers in, in this conversation`;
|
|
10062
|
+
chip.insertAdjacentHTML('afterbegin', '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"/><path d="m14.5 12.5 2-2"/><path d="m11.5 9.5 2-2"/><path d="m8.5 6.5 2-2"/><path d="m17.5 15.5 2-2"/></svg>');
|
|
10063
|
+
const value = document.createElement('span');
|
|
10064
|
+
value.textContent = chosen === 'mm' ? 'mm' : 'ft-in';
|
|
10065
|
+
const chevron = document.createElement('span');
|
|
10066
|
+
chevron.className = 'ai-chat-access-chevron';
|
|
10067
|
+
chevron.setAttribute('aria-hidden', 'true');
|
|
10068
|
+
chevron.textContent = '⌄';
|
|
10069
|
+
chip.append(value, chevron);
|
|
10070
|
+
const menu = document.createElement('div');
|
|
10071
|
+
menu.className = 'ai-chat-units-menu';
|
|
10072
|
+
menu.id = 'chat-units-menu';
|
|
10073
|
+
menu.setAttribute('role', 'menu');
|
|
10074
|
+
menu.setAttribute('aria-label', 'Units');
|
|
10075
|
+
menu.hidden = !state.workspaceUnitsMenuOpen;
|
|
10076
|
+
const closeMenu = (focusChip) => {
|
|
10077
|
+
dropUnitsMenu();
|
|
10078
|
+
menu.hidden = true;
|
|
10079
|
+
chip.setAttribute('aria-expanded', 'false');
|
|
10080
|
+
if (focusChip) chip.focus();
|
|
10081
|
+
};
|
|
10082
|
+
for (const option of ['ft-in', 'mm']) {
|
|
10083
|
+
const item = document.createElement('button');
|
|
10084
|
+
item.type = 'button';
|
|
10085
|
+
item.setAttribute('role', 'menuitemradio');
|
|
10086
|
+
item.setAttribute('aria-checked', String(option === chosen));
|
|
10087
|
+
item.dataset.commandId = `shell.chat-units-choose#${option}`;
|
|
10088
|
+
item.dataset.commandInstanceLabel = option === 'mm' ? 'metric (mm)' : 'feet and inches';
|
|
10089
|
+
item.textContent = option === 'mm' ? 'Metric (mm)' : 'Feet and inches (ft-in)';
|
|
10090
|
+
item.addEventListener('click', () => { closeMenu(false); if (option !== chosen) void chooseWorkspaceUnits(option); else chip.focus(); });
|
|
10091
|
+
menu.append(item);
|
|
10092
|
+
}
|
|
10093
|
+
// Escape closes it from the chip or the menu; focus leaving both (Tab away) closes it too.
|
|
10094
|
+
chip.addEventListener('keydown', (event) => {
|
|
10095
|
+
if (event.key === 'Escape' && state.workspaceUnitsMenuOpen) { event.preventDefault(); closeMenu(true); }
|
|
10096
|
+
});
|
|
10097
|
+
// On the chip and menu (rebuilt each paint), never the long-lived host, so listeners never pile up.
|
|
10098
|
+
const leave = (event) => { if (state.workspaceUnitsMenuOpen && !chip.contains(event.relatedTarget) && !menu.contains(event.relatedTarget)) closeMenu(false); };
|
|
10099
|
+
chip.addEventListener('focusout', leave);
|
|
10100
|
+
menu.addEventListener('focusout', leave);
|
|
10101
|
+
menu.addEventListener('keydown', (event) => {
|
|
10102
|
+
const items = [...menu.querySelectorAll('button')];
|
|
10103
|
+
const at = items.indexOf(document.activeElement);
|
|
10104
|
+
if (event.key === 'Escape') { event.preventDefault(); closeMenu(true); }
|
|
10105
|
+
else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
10106
|
+
event.preventDefault();
|
|
10107
|
+
items[(at + (event.key === 'ArrowDown' ? 1 : items.length - 1)) % items.length]?.focus();
|
|
10108
|
+
}
|
|
10109
|
+
});
|
|
10110
|
+
chip.addEventListener('click', () => {
|
|
10111
|
+
if (state.workspaceUnitsMenuOpen) { closeMenu(false); return; }
|
|
10112
|
+
state.workspaceUnitsMenuOpen = true;
|
|
10113
|
+
menu.hidden = false;
|
|
10114
|
+
chip.setAttribute('aria-expanded', 'true');
|
|
10115
|
+
state.workspaceUnitsMenuAway = (event) => { if (!host.contains(event.target)) closeMenu(false); };
|
|
10116
|
+
document.addEventListener('pointerdown', state.workspaceUnitsMenuAway, true);
|
|
10117
|
+
(menu.querySelector('[aria-checked="true"]') || menu.querySelector('button'))?.focus();
|
|
9980
10118
|
});
|
|
9981
|
-
host.append(
|
|
10119
|
+
host.append(chip, menu);
|
|
9982
10120
|
return;
|
|
9983
10121
|
}
|
|
9984
10122
|
host.hidden = true;
|
|
@@ -12893,8 +13031,17 @@
|
|
|
12893
13031
|
}
|
|
12894
13032
|
const count = Array.isArray(chat.scopeExtensions) ? chat.scopeExtensions.length : 0;
|
|
12895
13033
|
const home = state.scopeView?.scope?.home?.label || state.scope?.label || 'Home';
|
|
12896
|
-
|
|
12897
|
-
|
|
13034
|
+
// A toolbar chip: a folder icon and the home (+ how many added); the word "Scope" is in its name and tooltip.
|
|
13035
|
+
const scopeText = `${home}${count ? ` + ${count}` : ''}`;
|
|
13036
|
+
const scopeLabel = ui.scopeToggle.querySelector('span') || document.createElement('span');
|
|
13037
|
+
if (!scopeLabel.isConnected) {
|
|
13038
|
+
ui.scopeToggle.replaceChildren();
|
|
13039
|
+
ui.scopeToggle.insertAdjacentHTML('afterbegin', '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg>');
|
|
13040
|
+
ui.scopeToggle.append(scopeLabel);
|
|
13041
|
+
}
|
|
13042
|
+
scopeLabel.textContent = scopeText;
|
|
13043
|
+
ui.scopeToggle.setAttribute('aria-label', `Scope: ${scopeText}`);
|
|
13044
|
+
ui.scopeToggle.dataset.tip = `Scope: ${scopeText}. See the conversation’s home folder and add or remove other projects and workflows.`;
|
|
12898
13045
|
ui.scopeToggle.disabled = state.loading;
|
|
12899
13046
|
if (ui.scopeToggle.disabled) ui.scopeToggle.dataset.blockedReason = 'The conversation is still loading.';
|
|
12900
13047
|
else delete ui.scopeToggle.dataset.blockedReason;
|
|
@@ -13592,10 +13739,14 @@
|
|
|
13592
13739
|
ui.input.focus();
|
|
13593
13740
|
}
|
|
13594
13741
|
|
|
13742
|
+
// An intake creates the project and saves its drawings before the first turn's own capability check and locks, so it
|
|
13743
|
+
// needs longer than REQUEST_START_TIMEOUT_MS; a retry with the same submission id never makes a second project.
|
|
13744
|
+
const PROJECT_INTAKE_TIMEOUT_MS = 120000;
|
|
13595
13745
|
async function startProjectIntake(submissionId, payload) {
|
|
13596
13746
|
await ensureSession();
|
|
13747
|
+
// A shorter wait read "could not create" about a project that was made, on a busy computer (#2470 R6.4 E2E).
|
|
13597
13748
|
return request(`/api/chat/project-intakes/${encodeURIComponent(submissionId)}/start`, {
|
|
13598
|
-
method: 'POST', body: JSON.stringify(payload),
|
|
13749
|
+
method: 'POST', timeoutMs: PROJECT_INTAKE_TIMEOUT_MS, body: JSON.stringify(payload),
|
|
13599
13750
|
});
|
|
13600
13751
|
}
|
|
13601
13752
|
|
|
@@ -13624,7 +13775,7 @@
|
|
|
13624
13775
|
async function resumeProjectIntake(submissionId) {
|
|
13625
13776
|
await ensureSession();
|
|
13626
13777
|
return request(`/api/chat/project-intakes/${encodeURIComponent(submissionId)}/resume`, {
|
|
13627
|
-
method: 'POST', body: '{}',
|
|
13778
|
+
method: 'POST', timeoutMs: PROJECT_INTAKE_TIMEOUT_MS, body: '{}',
|
|
13628
13779
|
});
|
|
13629
13780
|
}
|
|
13630
13781
|
|