spequi 0.1.0 → 0.1.1
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/CHANGELOG.md +8 -0
- package/README.md +25 -23
- package/bin/spequi.mjs +51 -18
- package/docs/agent-workflow.md +24 -35
- package/package.json +14 -5
- package/public/app.css +114 -5
- package/public/app.js +119 -19
- package/public/diff.css +1 -1
- package/public/requests.js +328 -0
- package/public/review.css +27 -13
- package/public/review.js +5 -2
- package/public/session.js +134 -23
- package/public/studio.css +120 -22
- package/public/studio.js +2 -11
- package/public/{lifecycle.js → workflow.js} +30 -9
- package/skills/spequi/SKILL.md +11 -6
- package/src/agent-client.mjs +17 -0
- package/src/agent-session.mjs +3 -2
- package/src/analytics.mjs +63 -0
- package/src/commands.mjs +35 -11
- package/src/comment-view.mjs +3 -2
- package/src/creation-view.mjs +7 -7
- package/src/diff-view.mjs +11 -2
- package/src/direct-preview.mjs +4 -3
- package/src/drafts.mjs +83 -0
- package/src/files.mjs +79 -6
- package/src/job-dialogue.mjs +2 -2
- package/src/jobs.mjs +138 -43
- package/src/lifecycle.mjs +18 -23
- package/src/openspec-cli.mjs +5 -5
- package/src/preview-view.mjs +20 -7
- package/src/previews.mjs +6 -2
- package/src/project.mjs +2 -0
- package/src/requests.mjs +80 -0
- package/src/server.mjs +151 -21
- package/src/studio-view.mjs +31 -16
- package/src/views.mjs +39 -23
- package/src/workspace-state.mjs +48 -0
- package/public/lifecycle.css +0 -93
- package/src/lifecycle-view.mjs +0 -58
package/public/review.css
CHANGED
|
@@ -68,14 +68,14 @@
|
|
|
68
68
|
@media(max-width:760px){.impact-summary-title{font-size:13px}.impact-summary-text{font-size:12px}}
|
|
69
69
|
.review-comment-overview{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 12px;font-size:10px;line-height:1.5;color:var(--muted)}
|
|
70
70
|
.review-comment-overview>span{font-size:9px;white-space:nowrap}
|
|
71
|
-
.review-feedback-actions{display:
|
|
72
|
-
.review-feedback-actions form{min-width:0;margin:0}
|
|
71
|
+
.review-feedback-actions{display:flex;align-items:center;gap:8px;margin-bottom:6px}
|
|
72
|
+
.review-feedback-actions form{min-width:0;margin:0}.review-feedback-actions [data-spec-update]{flex:1}
|
|
73
73
|
.review-feedback-actions .button{width:100%;height:100%;min-height:32px;padding:6px;font-size:10px;gap:5px;box-shadow:none}
|
|
74
74
|
.review-feedback-actions .button svg{width:13px;height:13px}
|
|
75
|
-
.comment-view-filter{display:flex;gap:
|
|
76
|
-
.comment-view-filter>button{flex:1;min-width:0;min-height:
|
|
77
|
-
.comment-view-filter>button>span{margin-inline-start:
|
|
78
|
-
.comment-view-filter>button[aria-pressed=true]{background:var(--
|
|
75
|
+
.comment-view-filter{display:flex;gap:18px;padding:0;background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;margin:12px 0 4px}
|
|
76
|
+
.comment-view-filter>button{flex:0 1 auto;min-width:0;min-height:32px;padding:6px 0;background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;gap:8px;justify-content:flex-start;font-size:11px;color:var(--muted);font-weight:500}
|
|
77
|
+
.comment-view-filter>button>span{margin-inline-start:0;font-size:9px;font-variant-numeric:tabular-nums;font-weight:450}
|
|
78
|
+
.comment-view-filter>button[aria-pressed=true]{background:transparent;color:var(--accent-text);border-bottom-color:var(--accent)}
|
|
79
79
|
.review-compose{background:var(--surface);border:1px solid var(--line);border-radius:7px;margin-bottom:12px}
|
|
80
80
|
.review-compose>summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;min-height:34px;padding:8px 10px;color:var(--accent-text);font-size:11px;font-weight:550}
|
|
81
81
|
.review-compose>summary::-webkit-details-marker{display:none}
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
.comment-compose-close{background:transparent;border-color:transparent;color:var(--muted);font-size:10px;min-height:32px;padding:6px 4px}
|
|
99
99
|
.review-comment-list{margin-top:4px}
|
|
100
100
|
.comment-file-group{border-top:1px solid var(--line)}
|
|
101
|
-
.comment-file-group[hidden]{display:none}
|
|
101
|
+
.comment-file-group[hidden]{display:none}.comment-file-group:first-child{border-top:0}
|
|
102
102
|
.comment-file-group>summary{display:flex;align-items:center;gap:6px;list-style:none;min-height:44px;padding:10px 0;cursor:pointer}
|
|
103
103
|
.comment-file-group>summary::-webkit-details-marker{display:none}
|
|
104
104
|
.comment-file-group>summary>svg:first-child{width:11px;height:11px;transition:transform .15s;color:var(--muted)}
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
.comment-group-path>small{display:block;font-size:9px;line-height:1.4;color:var(--muted);overflow-wrap:anywhere}
|
|
110
110
|
.comment-group-count{font-size:9px;color:var(--muted);background:var(--rail);padding:1px 5px;border-radius:4px;font-variant-numeric:tabular-nums}
|
|
111
111
|
.comment-current-label{font-size:9px;color:var(--accent-text)}
|
|
112
|
-
.comment-file-notes{display:flex;flex-direction:column;gap:
|
|
113
|
-
.review-comment{background:
|
|
112
|
+
.comment-file-notes{display:flex;flex-direction:column;gap:0;padding-bottom:8px}
|
|
113
|
+
.review-comment{background:transparent;border:0;border-radius:0;padding:0;min-width:0}
|
|
114
114
|
.review-comment-location{display:flex;align-items:center;gap:6px;min-width:0}
|
|
115
115
|
.comment-source-link{display:inline-flex;align-items:center;max-width:100%;font-size:9px;font-weight:500;line-height:1.6;color:var(--accent-text);background:var(--accent-soft);padding:2px 5px;border-radius:4px;overflow-wrap:anywhere}
|
|
116
116
|
.comment-source-link.current{background:var(--rail);color:var(--muted)}
|
|
@@ -134,7 +134,6 @@
|
|
|
134
134
|
.review-comments-empty>svg{width:20px;height:20px;margin-bottom:2px}
|
|
135
135
|
.review-comments-empty>strong{font-size:11px;color:var(--text);font-weight:550}
|
|
136
136
|
.review-comments-empty>p{font-size:10px;line-height:1.7;margin:0}
|
|
137
|
-
.comment-export-scope{font-size:9px;line-height:1.7;color:var(--muted);margin:8px 0}
|
|
138
137
|
.comment-update-status{font-size:10px;margin:12px 0;color:var(--muted)}
|
|
139
138
|
.comment-update-status>summary{display:flex;gap:8px;align-items:center;cursor:pointer;list-style:none;min-height:28px}
|
|
140
139
|
.comment-update-status>summary::-webkit-details-marker{display:none}
|
|
@@ -261,12 +260,27 @@
|
|
|
261
260
|
.comment-context-row[hidden]{display:none}
|
|
262
261
|
@media(max-width:760px){.saved-comment-thread>summary{flex-wrap:wrap;gap:6px}.saved-comment-thread time{font-size:10px}}
|
|
263
262
|
|
|
264
|
-
.review-comment.saved-comment{padding:0;border-radius:
|
|
265
|
-
.review-comment .saved-comment-thread>summary{font-size:10px;padding:
|
|
266
|
-
.review-comment .saved-comment-thread>p{font-size:
|
|
263
|
+
.review-comment.saved-comment{padding:0;border:0;border-radius:0;overflow:visible}.review-comment.saved-comment+.review-comment.saved-comment{border-top:1px solid var(--line)}
|
|
264
|
+
.review-comment .saved-comment-thread>summary{min-height:32px;font-size:10px;padding:6px 28px 6px 0;gap:6px;border-radius:3px}
|
|
265
|
+
.review-comment .saved-comment-thread>p{border:0;font-size:12px;padding:2px 0 8px 18px;line-height:1.65}
|
|
267
266
|
.review-comment .saved-comment-label>svg{display:none}
|
|
268
267
|
.saved-comment-source{padding:0 12px 10px}
|
|
269
268
|
|
|
270
269
|
.comment-update-status.failed>summary>span,.comment-update-status.failed>p{color:var(--red)}
|
|
271
270
|
.comment-update-status.completed>summary>span{color:var(--green)}
|
|
272
271
|
@media(max-width:760px){.review-comment-form textarea,.document-discussion textarea,.document-inline-thread textarea,.diff-inline-thread textarea{font-size:16px}.comment-composer-actions button{min-height:36px}}
|
|
272
|
+
|
|
273
|
+
/* Review feedback stays inline; the attached agent is the primary path. */
|
|
274
|
+
.review-feedback-actions .review-export{width:32px;min-height:32px;padding:6px;border-color:transparent;background:transparent;color:var(--muted)}
|
|
275
|
+
.review-feedback-actions .review-export:hover{background:var(--rail);color:var(--text)}
|
|
276
|
+
.review-export-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
|
|
277
|
+
.review-update-hint{margin:0 0 12px;font-size:10px;line-height:1.6;color:var(--muted)}
|
|
278
|
+
.comment-group-path>small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
|
|
279
|
+
.comment-group-count{background:transparent;padding:0;font-size:10px}
|
|
280
|
+
.review-comment .saved-comment-tools{inset-inline-end:-3px;top:4px}
|
|
281
|
+
.review-comment .saved-comment-thread>summary:hover{background:transparent;color:var(--text)}
|
|
282
|
+
.review-comment .saved-comment-source{padding:0 0 8px 18px}
|
|
283
|
+
.review-comment .comment-source-link{background:transparent;padding:0;border-radius:0;font-size:10px;gap:5px}
|
|
284
|
+
.review-comment .comment-source-link svg{width:11px;height:11px}
|
|
285
|
+
.review-comment .saved-comment-thread>.comment-source-context{padding:0 0 8px 18px}
|
|
286
|
+
@media(pointer:coarse){.review-feedback-actions .button,.comment-view-filter>button,.review-comment .saved-comment-thread>summary{min-height:44px}.review-feedback-actions .review-export{width:44px}.review-comment .comment-delete{min-height:32px;width:32px}}
|
package/public/review.js
CHANGED
|
@@ -186,7 +186,10 @@
|
|
|
186
186
|
const { preview, change } = node.dataset;
|
|
187
187
|
if (updating.has(change) || node.dataset.blocked === 'true') return;
|
|
188
188
|
remember(); updating.add(change);
|
|
189
|
-
updateMessages.
|
|
189
|
+
updateMessages.delete(change);
|
|
190
|
+
document.getElementById('review-feedback')?.replaceChildren();
|
|
191
|
+
form()?.querySelector('[data-composer-feedback]')?.replaceChildren();
|
|
192
|
+
restoreUpdateState();
|
|
190
193
|
try {
|
|
191
194
|
const response = await fetch(node.getAttribute('action'), { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', Accept: 'application/json', 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').content }, body: '' });
|
|
192
195
|
const result = response.headers.get('content-type')?.includes('application/json') ? await response.json() : {};
|
|
@@ -198,7 +201,7 @@
|
|
|
198
201
|
node.dataset.pendingStatus = 'queued';
|
|
199
202
|
updateMessages.delete(change); exportMessages.delete(preview);
|
|
200
203
|
await refreshComments(preview, '', { change, outcome: 'Planning update queued' });
|
|
201
|
-
|
|
204
|
+
document.dispatchEvent(new window.CustomEvent('spequi-toast', { detail: { message: 'Spec update queued for your agent.' } }));
|
|
202
205
|
} catch (error) {
|
|
203
206
|
updateMessages.set(change, { message: error instanceof TypeError ? 'Could not reach the viewer. Check that the server is running and retry Update spec.' : error.message, error: true });
|
|
204
207
|
} finally {
|
package/public/session.js
CHANGED
|
@@ -1,50 +1,161 @@
|
|
|
1
1
|
(() => {
|
|
2
|
-
let current = null, opener = null;
|
|
3
|
-
const
|
|
4
|
-
function close() {
|
|
2
|
+
let current = null, opener = null, checking = false;
|
|
3
|
+
const panels = () => document.querySelectorAll('#agent-connections, #mcp-connections');
|
|
4
|
+
function close() { for(const panel of panels()) panel.hidden = true; for(const button of document.querySelectorAll('[data-session-toggle]')) button.setAttribute('aria-expanded','false'); }
|
|
5
|
+
function positionMCP() {
|
|
6
|
+
const panel = document.getElementById('mcp-connections'), button = document.querySelector('.session-mcp-button');
|
|
7
|
+
if (!panel || panel.hidden || !button?.getBoundingClientRect || !window.innerWidth) return;
|
|
8
|
+
const anchor = button.getBoundingClientRect(), header = button.closest('.topbar')?.getBoundingClientRect();
|
|
9
|
+
const gutter = window.innerWidth <= 520 ? 8 : 16, width = panel.getBoundingClientRect().width;
|
|
10
|
+
const top = Math.max(gutter, Math.max(anchor.bottom, header?.bottom || 0) + 8);
|
|
11
|
+
panel.style.left = `${Math.round(Math.max(gutter, Math.min(anchor.right - width, window.innerWidth - width - gutter)))}px`;
|
|
12
|
+
panel.style.right = 'auto'; panel.style.top = `${Math.round(top)}px`;
|
|
13
|
+
panel.style.maxHeight = `${Math.max(0, window.innerHeight - top - gutter)}px`;
|
|
14
|
+
}
|
|
15
|
+
function text(id, value) { const node = document.getElementById(id); if (node) node.textContent = value; return node; }
|
|
16
|
+
function lastSeen(at) {
|
|
17
|
+
const age = Math.max(0, Date.now() - at);
|
|
18
|
+
if (age < 15000) return 'Just now';
|
|
19
|
+
if (age < 60000) return `${Math.floor(age / 1000)} seconds ago`;
|
|
20
|
+
if (age < 3600000) { const minutes = Math.floor(age / 60000); return `${minutes} minute${minutes === 1 ? '' : 's'} ago`; }
|
|
21
|
+
if (age < 86400000) { const hours = Math.floor(age / 3600000); return `${hours} hour${hours === 1 ? '' : 's'} ago`; }
|
|
22
|
+
return new Date(at).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
|
|
23
|
+
}
|
|
5
24
|
function render(agent) {
|
|
25
|
+
if (current && (current.status !== agent.status || current.connected !== agent.connected || current.agent !== agent.agent)) {
|
|
26
|
+
const result = document.querySelector('[data-session-check-result]'); if (result) result.textContent = '';
|
|
27
|
+
}
|
|
6
28
|
current = agent;
|
|
7
|
-
const labels = { live:'Agent
|
|
29
|
+
const labels = { live:'Agent ready', connected:'Agent connected', blocked:'Queue blocked', working:'Agent working', waiting:'Awaiting your answer', unresponsive:'Agent offline', unattached:'No agent connected', unavailable:'Status unavailable' };
|
|
8
30
|
const label = labels[agent.status] || 'Status unavailable';
|
|
9
|
-
for(const node of document.querySelectorAll('[data-session-label]')) node.textContent = label;
|
|
10
31
|
const indicator = document.getElementById('agent-indicator');
|
|
32
|
+
const nameLabel = typeof agent.agent === 'string' ? agent.agent.trim() : '';
|
|
33
|
+
const stateLabel = { live:'Ready', connected:'Connected', blocked:'Queue blocked', working:'Working', waiting:'Answer needed' }[agent.status];
|
|
34
|
+
for(const node of document.querySelectorAll('[data-session-label]')) node.textContent = indicator?.contains(node) && agent.connected && nameLabel && stateLabel ? `${nameLabel} · ${stateLabel}` : label;
|
|
11
35
|
indicator?.classList.toggle('session-online',Boolean(agent.connected));
|
|
12
36
|
if (indicator) indicator.dataset.sessionState = agent.status;
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
37
|
+
const heartbeatStopped = agent.status === 'unresponsive';
|
|
38
|
+
const hint = heartbeatStopped ? 'Heartbeat stopped. Resume Spequi in the same coding session.' : agent.at ? `${agent.agent || 'Agent'} · Last heartbeat ${new Date(agent.at).toLocaleTimeString()}` : 'Attach the spequi skill in your coding agent';
|
|
39
|
+
indicator?.setAttribute('title', hint);
|
|
40
|
+
indicator?.setAttribute('aria-description', heartbeatStopped ? hint : 'Open agent status and recovery details.');
|
|
41
|
+
const status = agent.status || 'unavailable';
|
|
42
|
+
const badge = text('session-state', { live:'Ready', connected:'Connected', blocked:'Blocked', working:'Working', waiting:'Answer needed', unresponsive:'Offline', unattached:'Not attached', unavailable:'Unknown' }[status] || 'Unknown');
|
|
43
|
+
if (badge) badge.dataset.state = status;
|
|
44
|
+
text('session-agent-name', nameLabel || 'Spequi Agent');
|
|
45
|
+
text('session-agent-caption', { live:'Listening for your next request', connected:'Not listening for new requests', blocked:'A request needs attention', working:'Processing your request', waiting:'Waiting for your answer', unresponsive:'Session stopped responding', unattached:'No coding session connected', unavailable:'Connection status unavailable' }[status] || 'Connection status unavailable');
|
|
46
|
+
const timestamp = Number(agent.at), validTime = Number.isFinite(timestamp) && timestamp > 0 && !Number.isNaN(new Date(timestamp).getTime());
|
|
47
|
+
const seen = text('session-last-seen', validTime ? lastSeen(timestamp) : 'Not yet');
|
|
48
|
+
if (seen) { seen.title = validTime ? new Date(timestamp).toLocaleString() : 'No activity reported'; if (validTime) seen.setAttribute('datetime', new Date(timestamp).toISOString()); else seen.removeAttribute('datetime'); }
|
|
16
49
|
const info = agent.mcps || {supported:null,stale:true,connections:[],connectedCount:null};
|
|
17
50
|
const count = document.getElementById('mcp-count'); if(count) count.textContent = info.connectedCount === null ? 'MCPs' : `${info.connectedCount} MCP${info.connectedCount === 1 ? '' : 's'}`;
|
|
18
51
|
const mcpButton = document.querySelector('.session-mcp-button');
|
|
19
52
|
mcpButton?.setAttribute('aria-label',info.connectedCount === null ? 'MCP connections: status not reported' : `${info.connectedCount} connected MCP${info.connectedCount === 1 ? '' : 's'}`);
|
|
20
53
|
const summary = document.getElementById('mcp-report-summary');
|
|
21
|
-
|
|
54
|
+
const connections = info.connections || [], hasConnections = connections.length > 0;
|
|
55
|
+
const mcpState = text('mcp-panel-state', hasConnections ? info.stale ? 'Last report' : `${info.connectedCount ?? 0} connected` : info.supported === true && !info.stale ? 'None reported' : 'Unavailable');
|
|
56
|
+
if (mcpState) mcpState.dataset.state = !info.stale && info.connectedCount > 0 ? 'connected' : 'unknown';
|
|
57
|
+
if(summary) { summary.hidden = !hasConnections; summary.textContent = info.stale ? 'Last reported connections. Live status is unknown.' : `Shared by ${nameLabel || 'Spequi Agent'}.`; }
|
|
58
|
+
const mcpEmpty = document.querySelector('[data-mcp-empty]'); if (mcpEmpty) mcpEmpty.hidden = hasConnections;
|
|
59
|
+
text('mcp-empty-title', agent.status === 'unavailable' ? 'Couldn’t refresh connections' : info.supported === false ? 'Connection details unavailable' : info.supported === true && !info.stale ? 'No MCP connections reported' : 'Waiting for connection details');
|
|
60
|
+
text('mcp-empty-description', agent.status === 'unavailable' ? 'Check the local server and try again.' : info.supported === false ? 'This session can’t report its MCP connection status.' : info.supported === true && !info.stale ? 'Your agent reported no MCP connections.' : 'Your agent hasn’t shared current connection details yet.');
|
|
22
61
|
const list = document.getElementById('session-mcps');
|
|
23
62
|
if(list) {
|
|
24
63
|
list.replaceChildren();
|
|
25
|
-
for(const connection of
|
|
26
|
-
const item = document.createElement('li'), title = document.createElement('span'), status = document.createElement('small');
|
|
64
|
+
for(const connection of connections) {
|
|
65
|
+
const item = document.createElement('li'), icon = document.createElement('span'), title = document.createElement('span'), status = document.createElement('small');
|
|
66
|
+
icon.className = 'mcp-service-icon'; icon.setAttribute('aria-hidden', 'true');
|
|
67
|
+
icon.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.65" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="6" height="6" rx="1.5"/><rect x="15" y="15" width="6" height="6" rx="1.5"/><path d="M6 9v6a3 3 0 0 0 3 3h6M9 6h6a3 3 0 0 1 3 3v6"/></svg>';
|
|
68
|
+
title.className = 'mcp-service-name';
|
|
27
69
|
title.textContent = connection.name;
|
|
28
|
-
|
|
29
|
-
status.
|
|
30
|
-
|
|
70
|
+
const statusLabel = { connected: 'Connected', disconnected: 'Disconnected', unavailable: 'Unavailable', unknown: 'Unknown' }[connection.status] || 'Unknown';
|
|
71
|
+
status.textContent = `${info.stale ? 'Last: ' : ''}${statusLabel}`;
|
|
72
|
+
status.className = 'mcp-service-state'; status.dataset.state = info.stale ? 'unknown' : connection.status;
|
|
73
|
+
item.append(icon,title,status); list.append(item);
|
|
31
74
|
}
|
|
32
75
|
}
|
|
33
|
-
const
|
|
34
|
-
const
|
|
76
|
+
const queue = agent.queue, active = status !== 'unavailable' ? queue?.active : null;
|
|
77
|
+
const stalled = active?.status === 'running' && !active.ownerConnected && !active.origin;
|
|
78
|
+
text('session-queue-state', status === 'unavailable' || !queue ? 'Unknown' : queue.queued ? `${queue.queued} waiting` : 'Empty');
|
|
79
|
+
const request = document.querySelector('[data-session-current]'); if (request) request.hidden = !active;
|
|
80
|
+
text('session-current-change', active?.change || 'Project question');
|
|
81
|
+
text('session-current-state', active?.status === 'awaiting-input' ? 'Answer needed' : stalled ? 'Waiting for agent' : active?.preparing ? 'Preparing' : 'Working');
|
|
82
|
+
text('session-current-hint', active?.status === 'awaiting-input' ? 'Open Requests to answer the question.' : stalled ? 'The request is saved and waiting for its session.' : active?.origin ? 'A local preview is running. Follow progress in Requests.' : 'Follow progress in Requests.');
|
|
83
|
+
const needsHelp = !agent.connected || status === 'blocked' || status === 'connected' && !active && !agent.ready;
|
|
84
|
+
const recovery = document.getElementById('session-recovery'); if (recovery) recovery.hidden = !needsHelp;
|
|
85
|
+
text('session-recovery-message', status === 'unavailable' ? 'Could not read the connection status. Check the local server, then refresh.'
|
|
86
|
+
: stalled ? 'Resume Spequi in the original coding session to continue.'
|
|
87
|
+
: status === 'blocked' ? 'Open Requests to review the queue, then resume Spequi.'
|
|
88
|
+
: status === 'unattached' ? 'Start the spequi skill in your coding session to attach an agent.'
|
|
89
|
+
: status === 'connected' ? 'Resume the spequi skill in your coding session to receive requests.'
|
|
90
|
+
: 'Resume the spequi skill in your coding session to reconnect.');
|
|
91
|
+
const detail = text('session-recovery-detail', 'If the old session cannot resume, stop it before ending the stalled request in Requests.'); if (detail) detail.hidden = !stalled;
|
|
92
|
+
const date = document.getElementById('mcp-report-date'), reported = Number(info.reportedAt);
|
|
93
|
+
if(date) {
|
|
94
|
+
const valid = Number.isFinite(reported) && reported > 0 && !Number.isNaN(new Date(reported).getTime());
|
|
95
|
+
date.textContent = valid ? `Updated ${lastSeen(reported).toLowerCase()}` : 'Not reported yet';
|
|
96
|
+
date.title = valid ? new Date(reported).toLocaleString() : 'No connection report received';
|
|
97
|
+
if (valid) date.setAttribute('datetime', new Date(reported).toISOString()); else date.removeAttribute('datetime');
|
|
98
|
+
}
|
|
35
99
|
}
|
|
36
100
|
async function refresh() {
|
|
37
|
-
try {
|
|
38
|
-
|
|
101
|
+
try {
|
|
102
|
+
let agent;
|
|
103
|
+
if (window.spequiRefreshAgent) agent = await window.spequiRefreshAgent();
|
|
104
|
+
else {
|
|
105
|
+
const response = await fetch('/api/agent-status', { signal: globalThis.AbortSignal?.timeout?.(10000) });
|
|
106
|
+
if(!response.ok) throw new Error('Unavailable');
|
|
107
|
+
agent = await response.json();
|
|
108
|
+
}
|
|
109
|
+
if (!agent) throw new Error('Unavailable');
|
|
110
|
+
render(agent); return agent;
|
|
111
|
+
} catch { render({...current,connected:false,status:'unavailable',mcps:{...current?.mcps,stale:true,connectedCount:null}}); return null; }
|
|
112
|
+
}
|
|
113
|
+
async function checkConnection(button) {
|
|
114
|
+
if (checking) return;
|
|
115
|
+
const restoreFocus = document.activeElement === button;
|
|
116
|
+
checking = true; button.disabled = true; button.textContent = 'Checking…'; button.setAttribute('aria-busy', 'true');
|
|
117
|
+
const result = document.querySelector('[data-session-check-result]');
|
|
118
|
+
if (result) { result.textContent = 'Checking agent status…'; result.dataset.state = 'checking'; }
|
|
119
|
+
try {
|
|
120
|
+
const agent = await refresh();
|
|
121
|
+
const name = agent?.agent || 'Spequi Agent';
|
|
122
|
+
const message = !agent ? 'Could not refresh status. Check that the local server is running and try again.'
|
|
123
|
+
: !agent.connected ? agent.status === 'unattached' ? 'No agent attached. Start the Spequi skill in your coding session.' : 'Still disconnected. Checked just now.'
|
|
124
|
+
: agent.ready ? `${name} is connected and ready.`
|
|
125
|
+
: agent.status === 'working' ? `${name} is connected and working.`
|
|
126
|
+
: agent.status === 'waiting' ? `${name} is connected and waiting for your answer.`
|
|
127
|
+
: agent.status === 'blocked' ? `${name} is connected. The queue needs attention.`
|
|
128
|
+
: `${name} is connected. Resume Spequi to receive requests.`;
|
|
129
|
+
if (result) { result.textContent = message; result.dataset.state = !agent ? 'error' : agent.connected ? 'connected' : 'disconnected'; }
|
|
130
|
+
} finally {
|
|
131
|
+
checking = false; button.disabled = false; button.textContent = 'Refresh status'; button.removeAttribute('aria-busy');
|
|
132
|
+
if (restoreFocus && button.isConnected && !button.closest('.session-panel')?.hidden && (document.activeElement === document.body || document.activeElement === button)) button.focus({preventScroll:true});
|
|
133
|
+
}
|
|
39
134
|
}
|
|
40
135
|
document.addEventListener('agent-status',event => render(event.detail));
|
|
41
136
|
document.addEventListener('click',event => {
|
|
42
137
|
const toggle = event.target.closest('[data-session-toggle]');
|
|
43
|
-
|
|
44
|
-
if(
|
|
138
|
+
const target = toggle && document.getElementById(toggle.getAttribute('aria-controls'));
|
|
139
|
+
if(target) {
|
|
140
|
+
const opening = target.hidden; close();
|
|
141
|
+
if(opening) { opener=toggle; target.hidden=false; toggle.setAttribute('aria-expanded','true'); positionMCP(); target.querySelector('[data-session-close]')?.focus({preventScroll:true}); refresh(); }
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const check = event.target.closest('[data-session-refresh]');
|
|
145
|
+
if(check) { void checkConnection(check); return; }
|
|
146
|
+
const mcpRefresh = event.target.closest('[data-mcp-refresh]');
|
|
147
|
+
if(mcpRefresh) {
|
|
148
|
+
if (mcpRefresh.disabled) return;
|
|
149
|
+
mcpRefresh.disabled = true; mcpRefresh.textContent = 'Refreshing…'; mcpRefresh.setAttribute('aria-busy', 'true');
|
|
150
|
+
void refresh().finally(() => { mcpRefresh.disabled = false; mcpRefresh.textContent = 'Refresh status'; mcpRefresh.removeAttribute('aria-busy'); });
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if(event.target.closest('[data-session-open-requests]')) { close(); document.querySelector('.topbar [data-requests-toggle]')?.click(); return; }
|
|
45
154
|
if(event.target.closest('[data-session-close]')) { close(); opener?.focus(); return; }
|
|
46
|
-
if(!event.target.closest('#agent-connections')) close();
|
|
155
|
+
if(!event.target.closest('#agent-connections, #mcp-connections')) close();
|
|
47
156
|
});
|
|
48
|
-
document.addEventListener('keydown',event => { if(event.key === 'Escape' &&
|
|
49
|
-
|
|
157
|
+
document.addEventListener('keydown',event => { if(event.key === 'Escape' && [...panels()].some(panel => !panel.hidden)) { close(); opener?.focus(); } });
|
|
158
|
+
window.addEventListener('resize', positionMCP);
|
|
159
|
+
window.addEventListener('scroll', positionMCP, { passive: true });
|
|
160
|
+
refresh(); setInterval(refresh,30000);
|
|
50
161
|
})();
|
package/public/studio.css
CHANGED
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
.workspace.studio-workspace{grid-template-columns:var(--rail-width) minmax(0,1fr)}
|
|
10
10
|
.studio-workspace .main{min-width:0;min-height:0;container:studio-main / inline-size}
|
|
11
11
|
.studio-workspace .reader{overflow:hidden;display:flex;flex-direction:column;min-height:0;padding:0}
|
|
12
|
-
.studio-workspace .compact-change-header{
|
|
12
|
+
.studio-workspace .compact-change-header{display:flex;align-items:center;gap:16px;padding:6px 20px;min-height:54px;flex-shrink:0}
|
|
13
|
+
.studio-workspace .compact-change-header>.breadcrumbs{flex:1;min-width:0;min-height:40px;padding:0;border:0;white-space:nowrap;overflow:hidden}
|
|
14
|
+
.studio-workspace .compact-change-header>.breadcrumbs>span{flex-shrink:0}
|
|
15
|
+
.studio-workspace .compact-change-header>.breadcrumbs>svg{flex-shrink:0}
|
|
16
|
+
.studio-flow-controls{display:flex;align-items:center;gap:8px;flex-shrink:0}
|
|
17
|
+
.studio-flow-controls .studio-commands{margin-left:0}
|
|
18
|
+
.studio-flow-controls>[data-draft-delete]{font-size:11px;white-space:nowrap}
|
|
13
19
|
.studio-workspace .workspace-footer{display:none}
|
|
14
20
|
.studio{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;background:var(--surface)}
|
|
15
21
|
.studio-header{display:flex;align-items:center;gap:16px;padding:10px 20px;border-bottom:1px solid var(--line);min-height:60px;flex-shrink:0}
|
|
@@ -28,6 +34,27 @@
|
|
|
28
34
|
.studio-picker{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;font-size:12px;margin:0;min-width:0}
|
|
29
35
|
.studio-picker select{min-height:34px;max-width:min(320px,100%);font-size:12px;min-width:0}
|
|
30
36
|
.studio-picker label{color:var(--muted)}
|
|
37
|
+
.studio-artifact-navigation{display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px}
|
|
38
|
+
.studio-artifact-navigation>.studio-artifact-tabs{flex:1 1 280px;flex-wrap:nowrap;min-width:0;overflow-x:auto}
|
|
39
|
+
.studio-artifact-file-picker{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;margin:0}
|
|
40
|
+
.studio-artifact-file-picker>button{display:flex;align-items:center;gap:8px;max-width:280px;min-width:0;min-height:34px;padding:7px 10px;font-size:12px;background:var(--surface);border:1px solid var(--line);border-radius:6px}
|
|
41
|
+
.studio-artifact-file-picker>button>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
42
|
+
.studio-artifact-file-picker>button>svg{flex-shrink:0;width:15px;height:15px;color:var(--muted)}
|
|
43
|
+
.studio-artifact-file-picker>button[aria-expanded=true]{border-color:var(--accent);color:var(--accent-text)}
|
|
44
|
+
.studio-artifact-file-menu{position:fixed;inset:auto;margin:0;width:min(380px,calc(100vw - 24px));max-height:420px;overflow:auto;box-sizing:border-box;padding:5px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);box-shadow:0 12px 35px #15203b20}
|
|
45
|
+
.studio-artifact-file-menu>a{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:5px;color:inherit;text-decoration:none}
|
|
46
|
+
.studio-artifact-file-menu>a:hover{background:var(--panel)}
|
|
47
|
+
.studio-artifact-file-menu>a.selected{background:var(--accent-soft);color:var(--accent-text)}
|
|
48
|
+
.studio-artifact-option-copy{flex:1;min-width:0}
|
|
49
|
+
.studio-artifact-file-menu .studio-artifact-option-heading{display:flex;align-items:baseline;min-width:0;white-space:nowrap;font-size:11px;font-weight:550;line-height:1.6}
|
|
50
|
+
.studio-artifact-folder{min-width:0;overflow:hidden;text-overflow:ellipsis}
|
|
51
|
+
.studio-artifact-filename{flex-shrink:0;color:var(--muted);font-weight:400}
|
|
52
|
+
.studio-artifact-file-menu .selected .studio-artifact-filename{color:inherit;opacity:.85}
|
|
53
|
+
.studio-artifact-file-menu small{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-top:3px;font-size:10.5px;line-height:1.5;color:var(--muted)}
|
|
54
|
+
.studio-artifact-file-menu .selected small{color:inherit;opacity:.85}
|
|
55
|
+
.studio-artifact-choice-state{display:flex;align-items:center;justify-content:center;width:16px;flex-shrink:0;color:var(--accent-text)}
|
|
56
|
+
.studio-artifact-choice-state>svg{width:15px;height:15px}
|
|
57
|
+
@media(pointer:coarse){.studio-artifact-file-picker>button{min-height:44px}.studio-artifact-file-menu>a{min-height:44px}}
|
|
31
58
|
.studio-canvas-body{padding:24px 28px 36px;overflow:auto;min-height:0;flex:1;overflow-wrap:anywhere}
|
|
32
59
|
.studio-document.prose{padding:0;max-width:74ch;margin:0 auto;font-size:14px;line-height:1.8}
|
|
33
60
|
.studio-document.prose h1{font-size:25px}
|
|
@@ -57,13 +84,12 @@
|
|
|
57
84
|
.studio-conversation{display:flex;flex-direction:column;min-height:0;min-width:0;border-left:1px solid var(--line);background:var(--surface)}
|
|
58
85
|
.studio-conversation>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px;border-bottom:1px solid var(--line);flex-shrink:0}
|
|
59
86
|
.studio-conversation h2{font-size:14px;margin:0;font-weight:600}.studio-conversation>header>div>span{font-size:11px;color:var(--muted)}
|
|
60
|
-
.studio-expand{font-size:11px;min-height:
|
|
87
|
+
.studio-expand{font-size:11px;line-height:18px;min-height:34px;padding:7px 10px;gap:7px;flex-shrink:0;white-space:nowrap;color:var(--muted);background:var(--surface);border:1px solid var(--line)}.studio-expand:hover{color:var(--accent-text);background:var(--panel)}
|
|
61
88
|
.studio[data-conversation-expanded=true] .studio-body{grid-template-columns:minmax(0,1fr)}
|
|
62
89
|
.studio[data-conversation-expanded=true] .studio-canvas{display:none}
|
|
63
90
|
.studio[data-conversation-expanded=true] .studio-conversation{border-left:0}
|
|
64
91
|
.studio[data-conversation-expanded=true] .studio-thread{padding-inline:max(18px,calc((100% - 74ch)/2))}
|
|
65
92
|
.studio[data-awaiting-input=true] .studio-footer{min-height:0;padding-block:8px}
|
|
66
|
-
.studio-agent-note{font-size:11px;line-height:1.6;color:var(--muted);margin:0;padding:10px 18px;background:var(--panel)}
|
|
67
93
|
.studio-thread{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px;overflow-wrap:anywhere;scroll-padding-block:18px}
|
|
68
94
|
.studio-conversation-empty{font-size:13px;line-height:1.8;color:var(--muted)}
|
|
69
95
|
.studio-exchange+.studio-exchange{margin-top:24px}.studio-message{font-size:13px;line-height:1.7}.studio-message p{margin:6px 0 10px}
|
|
@@ -73,17 +99,18 @@
|
|
|
73
99
|
.studio-message details{font-size:11px;color:var(--muted);margin-top:10px}.studio-message details summary{cursor:pointer}.studio-message details ol{padding-left:17px}
|
|
74
100
|
.studio-result h1,.studio-result h2,.studio-result h3{font-size:14px}.studio-result pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px}
|
|
75
101
|
.studio-result table{display:block;max-width:100%;overflow:auto}
|
|
76
|
-
.studio-question{padding:12px;margin:12px 0;background:var(--accent-soft);border-radius:6px;font-size:13px;scroll-margin-block:18px}
|
|
77
|
-
.studio-question .
|
|
102
|
+
.studio-question{border-block:1px solid var(--line);padding:12px;margin:12px 0;background:var(--accent-soft);border-radius:6px;font-size:13px;scroll-margin-block:18px}
|
|
103
|
+
.studio-question .studio-question-text{font-weight:500;line-height:1.65;white-space:pre-wrap;max-width:72ch;margin:0 0 16px}
|
|
104
|
+
.studio-choice{display:flex;align-items:flex-start;gap:9px;padding:9px 0;cursor:pointer}.studio-choice input{margin-top:5px;accent-color:var(--accent);flex-shrink:0}
|
|
78
105
|
.studio-question textarea{width:100%;min-height:88px;font:inherit;margin:8px 0;background:var(--surface);color:var(--text)}
|
|
79
|
-
.studio-question form>label:not(.
|
|
106
|
+
.studio-question form>label:not(.studio-choice){display:block;margin-top:10px;font-size:12px}
|
|
80
107
|
.studio-answer{border-top:1px solid var(--line);padding-top:8px}.studio-answer p{white-space:pre-wrap}
|
|
81
|
-
.studio-composer{padding:
|
|
82
|
-
.studio-composer fieldset{display:flex;gap:
|
|
108
|
+
.studio-composer{padding:14px 16px;border-top:1px solid var(--line);background:var(--panel);flex-shrink:0;max-height:40%;overflow:auto}
|
|
109
|
+
.studio-composer fieldset{display:inline-flex;gap:2px;border:1px solid var(--line);border-radius:7px;background:var(--rail);padding:3px;margin:0;font-size:11px;color:var(--muted)}
|
|
83
110
|
.studio-composer legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
|
|
84
|
-
.studio-composer fieldset label{display:flex;align-items:center;gap:5px}.studio-composer input{accent-
|
|
85
|
-
.studio-composer>label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%)}.studio-composer textarea{display:block;width:100%;height:
|
|
86
|
-
.studio-composer-end{display:flex;align-items:center;justify-content:space-between;gap:
|
|
111
|
+
.studio-composer fieldset label{position:relative;cursor:pointer}.studio-composer fieldset input{position:absolute;inline-size:1px;block-size:1px;opacity:0}.studio-composer fieldset label>span{display:flex;align-items:center;gap:6px;min-height:30px;padding:5px 8px;border-radius:4px}.studio-composer fieldset svg{width:13px;height:13px}.studio-composer fieldset input:checked+span{background:var(--surface);color:var(--accent-text);font-weight:600}.studio-composer fieldset input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}.studio-composer fieldset input:disabled+span{opacity:.5;cursor:not-allowed}
|
|
112
|
+
.studio-composer>label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%)}.studio-message-box{border:1px solid var(--line);border-radius:10px;background:var(--surface);overflow:hidden}.studio-message-box:has(textarea:focus-visible){outline:2px solid var(--accent);outline-offset:2px;border-color:var(--accent)}.studio-composer textarea{display:block;width:100%;height:80px;min-height:80px;max-height:160px;padding:12px 14px;border:0;border-radius:0;background:transparent;color:var(--text);resize:vertical;font-family:inherit;font-size:13px;line-height:1.65}.studio-composer textarea:focus-visible{outline:none}.studio-composer textarea::placeholder{color:var(--muted);opacity:1}.studio-composer textarea:disabled{opacity:.6;cursor:not-allowed}
|
|
113
|
+
.studio-composer-end{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 10px}.studio-composer-end>.button{flex-shrink:0}
|
|
87
114
|
.studio-footer{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 16px;padding:10px 20px;border-top:1px solid var(--line);flex-shrink:0;min-height:60px;max-height:30%;overflow:auto}
|
|
88
115
|
.studio-footer>div:first-child{min-width:0}.studio-footer strong{display:block;font-size:13px;font-weight:600}.studio-footer>div:first-child>span{font-size:12px;line-height:1.6;color:var(--muted);display:block;margin-top:3px}
|
|
89
116
|
#studio-action-feedback:empty,.studio [data-lifecycle-feedback]:empty{display:none}#studio-action-feedback{grid-column:1/-1;max-height:72px;overflow:auto;margin:0}.studio-footer>.studio-action{max-width:340px}.studio-footer .studio-action form{display:flex;justify-content:flex-end}.studio-footer .studio-blocker{margin-top:4px;line-height:1.4}.studio-footer [data-lifecycle-feedback]{display:none}
|
|
@@ -128,17 +155,44 @@
|
|
|
128
155
|
[data-preview-placement=change]>.nav-heading{margin-top:0;padding-top:0}
|
|
129
156
|
|
|
130
157
|
/* Idea → clarification → actual plan, within the existing project shell. */
|
|
131
|
-
.studio-creation{min-height:0}.studio-creation-scroll{flex:1;min-height:0;overflow:auto;padding:28px 36px}.studio-idea-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:48px;max-width:1060px;margin:0 auto}.studio-idea-layout h1{font-size:30px;line-height:1.25;letter-spacing:-.02em;margin:0 0 12px}.studio-idea-intro{font-size:14px;line-height:1.7;color:var(--muted);max-width:65ch;margin:0 0 24px}.studio-idea-form label,.studio-generation legend{display:block;font-size:13px;font-weight:550;margin:0 0 8px}.studio-idea-form textarea,.studio-idea-form input:not([type=radio],[type=hidden]){display:block;width:100%;border:1px solid var(--line);border-radius:6px;padding:12px 14px;font:inherit;font-size:14px;line-height:1.65;background:var(--surface);color:var(--text)}.studio-idea-form textarea{min-height:130px;resize:vertical}.studio-idea-name{margin-top:20px}.studio-field-help{font-size:12px;line-height:1.65;color:var(--muted);margin:8px 0 20px}.studio-generation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0;margin:24px 0 16px;border:0;min-width:0}.studio-generation legend{margin-bottom:12px}.studio-generation label{display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--line);border-radius:6px;font-weight:400;cursor:pointer;line-height:1.6;margin:0}.studio-generation label:has(input:checked){background:var(--accent-soft);border-color:var(--accent);color:var(--accent-text)}.studio-generation input{accent-color:var(--accent);margin-top:5px;flex-shrink:0}.studio-generation strong{display:block;font-size:13px;font-weight:550}.studio-generation small{display:block;font-size:12px;margin-top:4px;color:inherit}.studio-creation-guide{border-left:1px solid var(--line);padding-left:28px;margin-top:8px;font-size:12px;line-height:1.7}.studio-creation-guide h2{font-size:15px;margin:0 0 16px}.studio-creation-guide>p{color:var(--muted);margin:0 0 20px}.studio-creation-guide>section{padding-bottom:18px;margin-bottom:18px;border-bottom:1px solid var(--line)}.studio-creation-guide strong{display:block;font-size:13px;font-weight:550}.studio-creation-guide section p{margin:4px 0 0;color:var(--muted)}.studio-pending-creations{border-top:1px solid var(--line);padding-top:20px;margin-top:20px}.studio-pending-creations h2{font-size:15px}.studio-pending-creations .button{margin:0 8px 8px 0}.studio-creation-caption{padding:12px max(20px,calc((100% - 760px)/2));border-bottom:1px solid var(--line);flex-shrink:0}.studio-creation-caption h1{font-size:18px;line-height:1.3;margin:0 0 4px}.studio-creation-caption p{color:var(--muted);font-size:13px;line-height:1.6;margin:0}.studio-creation-thread{padding:18px max(20px,calc((100% - 760px)/2))}.studio-creation-thread .studio-message{font-size:14px}.studio-creation-thread .studio-question{background:none;border-radius:0;padding:20px 0}.studio-creation-thread .
|
|
158
|
+
.studio-creation{min-height:0}.studio-creation-scroll{flex:1;min-height:0;overflow:auto;padding:28px 36px}.studio-idea-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:48px;max-width:1060px;margin:0 auto}.studio-idea-layout h1{font-size:30px;line-height:1.25;letter-spacing:-.02em;margin:0 0 12px}.studio-idea-intro{font-size:14px;line-height:1.7;color:var(--muted);max-width:65ch;margin:0 0 24px}.studio-idea-form label,.studio-generation legend{display:block;font-size:13px;font-weight:550;margin:0 0 8px}.studio-idea-form textarea,.studio-idea-form input:not([type=radio],[type=hidden]){display:block;width:100%;border:1px solid var(--line);border-radius:6px;padding:12px 14px;font:inherit;font-size:14px;line-height:1.65;background:var(--surface);color:var(--text)}.studio-idea-form textarea{min-height:130px;resize:vertical}.studio-idea-name{margin-top:20px}.studio-field-help{font-size:12px;line-height:1.65;color:var(--muted);margin:8px 0 20px}.studio-generation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0;margin:24px 0 16px;border:0;min-width:0}.studio-generation legend{margin-bottom:12px}.studio-generation label{display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--line);border-radius:6px;font-weight:400;cursor:pointer;line-height:1.6;margin:0}.studio-generation label:has(input:checked){background:var(--accent-soft);border-color:var(--accent);color:var(--accent-text)}.studio-generation input{accent-color:var(--accent);margin-top:5px;flex-shrink:0}.studio-generation strong{display:block;font-size:13px;font-weight:550}.studio-generation small{display:block;font-size:12px;margin-top:4px;color:inherit}.studio-creation-guide{border-left:1px solid var(--line);padding-left:28px;margin-top:8px;font-size:12px;line-height:1.7}.studio-creation-guide h2{font-size:15px;margin:0 0 16px}.studio-creation-guide>p{color:var(--muted);margin:0 0 20px}.studio-creation-guide>section{padding-bottom:18px;margin-bottom:18px;border-bottom:1px solid var(--line)}.studio-creation-guide strong{display:block;font-size:13px;font-weight:550}.studio-creation-guide section p{margin:4px 0 0;color:var(--muted)}.studio-pending-creations{border-top:1px solid var(--line);padding-top:20px;margin-top:20px}.studio-pending-creations h2{font-size:15px}.studio-pending-creations .button{margin:0 8px 8px 0}.studio-creation-caption{padding:12px max(20px,calc((100% - 760px)/2));border-bottom:1px solid var(--line);flex-shrink:0}.studio-creation-caption h1{font-size:18px;line-height:1.3;margin:0 0 4px}.studio-creation-caption p{color:var(--muted);font-size:13px;line-height:1.6;margin:0}.studio-creation-thread{padding:18px max(20px,calc((100% - 760px)/2))}.studio-creation-thread .studio-message{font-size:14px}.studio-creation-thread .studio-question{background:none;border-radius:0;padding:20px 0}.studio-creation-thread .studio-question-text{font-size:17px;font-weight:550}.studio-creation-thread .studio-choice{padding:12px;border:1px solid var(--line);border-radius:6px;margin:0 0 10px;font-size:14px}.studio-creation-thread .studio-choice:has(input:checked){background:var(--accent-soft);border-color:var(--accent);color:var(--accent-text)}.studio-creation-thread .studio-question textarea{padding:12px;border:1px solid var(--line);border-radius:6px;resize:vertical;min-height:80px}.studio-artifact-tabs{display:flex;gap:4px;flex-wrap:wrap;margin:0 0 6px;font-size:12px}.studio-artifact-tab{display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border-radius:5px;text-transform:capitalize;min-height:34px;color:var(--muted)}.studio-artifact-tab.selected{background:var(--accent-soft);color:var(--accent-text);font-weight:600}.studio-artifact-tab[aria-disabled=true]{opacity:.7}.studio-artifact-tab small{font-size:11px}
|
|
132
159
|
@container studio-main (max-width:1000px){.studio-idea-layout{grid-template-columns:minmax(0,1fr);gap:24px}.studio-creation-guide{border-left:0;border-top:1px solid var(--line);padding:24px 0 0}.studio-creation-guide>section{display:inline-block;width:48%;vertical-align:top;padding-right:20px}.studio-creation-guide>p{max-width:70ch}}
|
|
133
160
|
@media(max-width:760px){.studio-creation-scroll{padding:24px 20px}.studio-idea-layout h1{font-size:27px}.studio-generation{grid-template-columns:minmax(0,1fr)}.studio-idea-form textarea,.studio-idea-form input:not([type=radio],[type=hidden]),.studio-creation-thread .studio-question textarea{font-size:16px}.studio-creation .studio-header{display:none}.studio-creation .studio-footer>div{display:none}.studio-creation .studio-footer>.button{width:100%;min-height:44px}.studio-creation-guide>section{width:100%}.studio-artifact-tab{min-height:44px}.studio-creation-caption{padding:18px 20px}.studio-creation-caption h1{font-size:22px}.studio-creation-thread{padding:20px}}
|
|
134
|
-
.studio-commands{
|
|
135
|
-
|
|
136
|
-
|
|
161
|
+
.studio-commands{font-size:12px;flex-shrink:0;margin-left:auto}
|
|
162
|
+
.studio-commands>button{display:flex;align-items:center;gap:9px;padding:7px 10px;min-height:36px;border:1px solid var(--line);border-radius:6px;background:var(--surface);font-size:12px}
|
|
163
|
+
.studio-commands>button[aria-expanded=true]{background:var(--accent-soft);border-color:transparent;color:var(--accent-text)}
|
|
164
|
+
.studio-commands>button>svg{width:13px;height:13px;color:var(--muted)}
|
|
165
|
+
.studio-commands kbd{padding:1px 5px;border:1px solid var(--line);border-radius:4px;color:var(--muted);font:inherit;font-size:11px;line-height:16px}
|
|
166
|
+
.studio-command-menu{position:fixed;inset:auto;margin:0;width:min(320px,calc(100vw - 24px));max-height:min(520px,65dvh);box-sizing:border-box;overflow:auto;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;box-shadow:0 12px 35px #15203b20;padding:6px}
|
|
167
|
+
.studio-command-menu header{display:flex;align-items:center;justify-content:space-between;padding:9px 10px;color:var(--muted);font-size:11px}
|
|
168
|
+
.studio-command-menu header strong{font-size:11px;font-weight:500}
|
|
169
|
+
.studio-command-menu form{margin:0}
|
|
170
|
+
.studio-command-menu button,.studio-command-menu>a{display:flex;width:100%;align-items:center;gap:10px;text-align:left;border:0;background:transparent;color:inherit;padding:10px;border-radius:5px;min-height:44px;font-size:12px;text-decoration:none}
|
|
171
|
+
.studio-command-menu button:hover,.studio-command-menu>a:hover{background:var(--panel)}
|
|
172
|
+
.studio-command-menu button>svg{flex-shrink:0;width:16px;height:16px;color:var(--accent-text)}
|
|
173
|
+
.studio-command-copy{flex:1;min-width:0}
|
|
174
|
+
.studio-command-menu strong{display:block;font-weight:550;font-size:12px}
|
|
175
|
+
.studio-command-menu small{display:block;color:var(--muted);font-size:11px;line-height:1.6;margin-top:3px}
|
|
176
|
+
.studio-command-shortcut{margin-left:auto;color:var(--muted);white-space:nowrap;font-size:11px;font-weight:400}
|
|
177
|
+
.studio-command-status{display:flex;align-items:flex-start;gap:10px;padding:12px 10px}
|
|
178
|
+
.studio-command-status>svg{width:18px;height:18px;color:var(--muted);flex-shrink:0;margin-top:1px}
|
|
179
|
+
.studio-command-status>div{min-width:0;flex:1}
|
|
180
|
+
.studio-command-status p{margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.65}
|
|
181
|
+
.studio-command-status .studio-command-context{display:inline-flex;align-items:center;gap:7px;width:auto;min-height:32px;padding:0;margin-top:8px;color:var(--accent-text);font-size:11px;text-decoration:none}
|
|
182
|
+
.studio-command-context svg{width:13px;height:13px}
|
|
183
|
+
.studio-command-completed{border-top:1px solid var(--line);margin-top:5px;padding-top:3px}
|
|
184
|
+
.studio-command-history{display:flex;align-items:center;gap:9px;padding:8px 10px;color:var(--muted)}
|
|
185
|
+
.studio-command-history>svg{width:14px;height:14px;flex-shrink:0}
|
|
186
|
+
.studio-command-history>strong{font-size:11px;font-weight:400}
|
|
187
|
+
.studio-command-menu [data-lifecycle-feedback]:not(:empty){white-space:pre-wrap;padding:10px;margin:4px;font-size:12px;line-height:1.7}
|
|
188
|
+
.studio-command-menu [data-lifecycle-feedback]:empty{display:none}
|
|
189
|
+
@container studio-main (max-width:800px){.studio-header{position:relative;align-items:flex-start;flex-direction:column;gap:8px;padding:8px 16px}.studio-context{display:flex;align-items:baseline;gap:10px;width:100%}.studio-stages{width:100%;justify-content:space-between}.studio-header>.studio-commands{position:absolute;right:20px;top:12px}.studio-context{padding-right:120px}}
|
|
190
|
+
@media(max-width:760px){.studio-commands>button{min-height:44px}.studio-header>.studio-commands{right:14px;top:8px}}
|
|
137
191
|
/* Agent liveness is separate from the browser's connection to the local server. */
|
|
138
|
-
.session-
|
|
139
|
-
@media(max-width:900px){.topbar-end{gap:4px}.
|
|
192
|
+
.session-mcp-button{border-color:transparent;background:transparent;color:var(--muted);font-size:12px;padding:8px 10px;min-height:36px;white-space:nowrap}.topbar .topbar-end{gap:8px}.topbar .requests-toggle,.session-indicator{height:32px;min-height:32px;gap:7px;padding:6px 10px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--muted);font-size:12px;font-weight:500;line-height:18px;white-space:nowrap}.topbar .requests-toggle>svg{width:16px;height:16px}.topbar .requests-toggle:hover,.session-indicator:hover,.topbar .requests-toggle[aria-expanded=true],.session-indicator[aria-expanded=true]{background:var(--rail);color:var(--text);border-color:transparent}.session-indicator [data-session-label]{max-width:240px;overflow:hidden;text-overflow:ellipsis}.session-agent-icon{position:relative;display:inline-flex;align-items:center;flex-shrink:0;width:18px;height:18px}.session-agent-icon>svg{width:18px;height:18px}.session-indicator i{position:absolute;right:-2px;bottom:-1px;display:block;width:7px;height:7px;border:2px solid var(--surface);border-radius:50%;background:var(--muted)}.session-indicator.session-online i{background:var(--green)}.session-chevron{display:flex;margin-left:2px}.session-chevron svg{width:12px;height:12px;transform:rotate(90deg)}.session-indicator[aria-expanded=true] .session-chevron svg{transform:rotate(-90deg)}.session-mcp-button svg{width:17px;height:17px}.session-panel[hidden]{display:none}.session-panel{position:fixed;z-index:30;right:24px;top:64px;width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 84px);overflow:auto;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;box-shadow:0 16px 50px #15203b24;padding:20px}.session-panel>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.session-panel h2{font-size:17px;margin:0}.session-panel h3{font-size:14px;margin:24px 0 10px}.session-panel p{font-size:12px;line-height:1.7;color:var(--muted);margin:8px 0 16px}.session-panel ul{list-style:none;margin:0;padding:0}.session-panel li{padding:12px 0;display:flex;justify-content:space-between;align-items:flex-start;gap:12px;border-top:1px solid var(--line);font-size:12px;line-height:1.6;overflow-wrap:anywhere}.session-panel li small{font-size:11px;color:var(--muted);text-transform:capitalize;flex-shrink:0}.session-panel li .mcp-connected{color:var(--green)}
|
|
193
|
+
@media(max-width:900px){.topbar-end{gap:4px}.session-indicator,.session-mcp-button{font-size:11px}}
|
|
140
194
|
@media(max-width:760px){.session-indicator,.session-mcp-button{min-height:44px}.session-mcp-button{gap:4px}.topbar .brand-suffix{display:none}.topbar-end .theme-toggle{width:30px;padding:5px}.session-panel{right:12px}.topbar{padding-inline:10px;gap:6px}.topbar .brand{font-size:14px;gap:6px}.workspace-mode{padding:5px 7px}}
|
|
141
|
-
@media(max-width:520px){.session-mcp-button #mcp-count{display:none}.topbar .brand>svg{display:none}.topbar .local-pill{display:none}.session-indicator{font-size:11px;max-width:120px}.session-indicator>
|
|
195
|
+
@media(max-width:520px){.session-mcp-button #mcp-count{display:none}.topbar .brand>svg{display:none}.topbar .local-pill{display:none}.session-indicator{font-size:11px;max-width:120px}.session-indicator>[data-session-label]{overflow:hidden;text-overflow:ellipsis}.topbar-end .theme-toggle{width:28px}.workspace-modes{font-size:11px}.workspace-mode{padding-inline:5px}}
|
|
142
196
|
.studio-composer [data-lifecycle-feedback]{white-space:pre-wrap}
|
|
143
197
|
|
|
144
198
|
/* Progress is readable without opening Activity; history yields space to the current request. */
|
|
@@ -151,11 +205,55 @@
|
|
|
151
205
|
.studio-history>summary{display:flex;align-items:baseline;justify-content:space-between;gap:12px;cursor:pointer;padding:10px 0;border-bottom:1px solid var(--line);font-size:12px}
|
|
152
206
|
.studio-history>summary>span{font-size:10px;color:var(--muted)}.studio-history[open]>summary{margin-bottom:14px}
|
|
153
207
|
.session-indicator[data-session-state=working]{color:var(--accent-text)}
|
|
154
|
-
.session-indicator[data-session-state=working] i{width:
|
|
155
|
-
.session-indicator[data-session-state=unresponsive]{color:var(--
|
|
156
|
-
#session-recovery{padding-bottom:16px;border-bottom:1px solid var(--line)}
|
|
157
|
-
#session-recovery code{font-size:11px;color:var(--text)}
|
|
208
|
+
.session-indicator[data-session-state=working] i{width:6px;height:6px;background:none;border:1px solid var(--line);border-top-color:var(--accent);animation:studio-working 1s linear infinite}
|
|
209
|
+
.session-indicator[data-session-state=unresponsive]{color:var(--muted)}.session-indicator[data-session-state=unresponsive]:hover{background:var(--rail);color:var(--text)}
|
|
158
210
|
@keyframes studio-working{to{transform:rotate(360deg)}}
|
|
159
211
|
@media(prefers-reduced-motion:reduce){.studio-progress-indicator[data-working],.session-indicator[data-session-state=working] i{animation:none;border-color:var(--accent)}}
|
|
160
212
|
@media(max-height:700px){.studio-footer>div:first-child>span{display:none}.studio-composer{padding-block:8px}.studio-composer textarea{height:48px;min-height:48px}.studio-footer{min-height:48px;padding-block:7px}.studio-canvas-body{padding-block:16px}.studio-creation-caption{padding-block:10px}}
|
|
161
213
|
@media(max-width:760px){.studio-footer{grid-template-columns:minmax(0,1fr) auto;padding:8px 14px}.studio-footer>div:first-child>span{display:none}.studio-footer>div:first-child strong{font-size:11px}.studio-composer{max-height:40%;padding:8px 14px}.studio-creation .studio-footer{grid-template-columns:minmax(0,1fr)}.studio-creation-caption{padding:10px 20px}.studio-creation-caption h1{font-size:18px}}
|
|
214
|
+
|
|
215
|
+
.session-panel [data-session-check-result]{margin:10px 0 0;font-size:12px;line-height:1.6}.session-panel [data-session-check-result]:empty{display:none}.session-panel [data-session-check-result][data-state=error]{color:var(--red)}.session-panel [data-session-check-result][data-state=connected]{color:var(--green)}
|
|
216
|
+
/* Agent details prioritize connection state and the next useful action. */
|
|
217
|
+
.agent-panel{width:380px;max-width:calc(100vw - 32px);box-shadow:none;border-radius:10px}
|
|
218
|
+
.agent-panel>header{margin-bottom:18px}.agent-panel>header h2{font-size:15px;font-weight:600}.agent-panel>header .icon-button{width:28px;min-height:28px;padding:5px;border-color:transparent;background:transparent;color:var(--muted)}.agent-panel>header .icon-button:hover{background:var(--rail);color:var(--text)}
|
|
219
|
+
.agent-summary{display:flex;align-items:center;gap:10px}.agent-avatar{display:grid;place-items:center;flex-shrink:0;width:34px;height:34px;background:var(--panel);border-radius:7px;color:var(--muted)}.agent-avatar svg{width:20px;height:20px}.agent-identity{min-width:0;flex:1}.agent-identity strong{display:block;font-size:15px;font-weight:600;overflow-wrap:anywhere}.agent-panel .agent-identity p{margin:3px 0 0;font-size:11px;line-height:1.5}
|
|
220
|
+
.agent-state-badge{font-size:10px;font-weight:550;line-height:1.4;padding:4px 7px;border-radius:4px;background:var(--panel);color:var(--muted);white-space:nowrap}.agent-state-badge[data-state=live]{background:var(--green-bg);color:var(--green)}.agent-state-badge[data-state=working],.agent-state-badge[data-state=waiting]{background:var(--accent-soft);color:var(--accent-text)}.agent-state-badge[data-state=blocked]{background:var(--red-bg);color:var(--red)}
|
|
221
|
+
.agent-facts{margin:16px 0 0;padding:14px 0;border-block:1px solid var(--line);display:grid;gap:10px;font-size:12px;line-height:1.5}.agent-facts>div{margin:0;font-size:inherit;display:flex;justify-content:space-between;align-items:baseline;gap:16px}.agent-facts dt{color:var(--muted)}.agent-facts dd{margin:0;color:var(--text);text-align:right;font-variant-numeric:tabular-nums}
|
|
222
|
+
.agent-panel [hidden]{display:none}.agent-current{margin-top:14px}.agent-current>div{display:flex;align-items:baseline;justify-content:space-between;gap:16px}.agent-current strong{font-size:12px;font-weight:550;overflow-wrap:anywhere}.agent-current>div>span{font-size:10px;color:var(--accent-text);white-space:nowrap}.agent-panel .agent-current p{margin:5px 0 0;font-size:11px}.agent-panel .agent-guidance p{margin:14px 0 0;font-size:12px;line-height:1.65}.agent-panel .agent-guidance #session-recovery-detail{font-size:11px;margin-top:8px}
|
|
223
|
+
.agent-panel-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}.agent-panel-actions [data-session-refresh]{min-width:108px}.agent-panel-actions [data-session-open-requests]{padding:7px 8px;min-height:34px;font-size:11px;gap:6px}.agent-panel-actions svg{width:13px;height:13px}
|
|
224
|
+
|
|
225
|
+
/* MCP details share the compact connection controls. */
|
|
226
|
+
.topbar .session-mcp-button{display:inline-flex;align-items:center;gap:6px;height:32px;min-height:32px;padding:6px 10px;border-radius:6px;font-size:12px;line-height:18px}
|
|
227
|
+
.topbar .session-mcp-button:hover,.topbar .session-mcp-button[aria-expanded=true]{background:var(--rail);color:var(--text)}
|
|
228
|
+
.mcp-panel{display:flex;flex-direction:column;width:360px;max-width:calc(100vw - 32px);padding:0;border-radius:10px;box-shadow:none;overflow:hidden}
|
|
229
|
+
.mcp-panel[hidden],.mcp-panel [hidden]{display:none}
|
|
230
|
+
.mcp-panel>header{min-height:48px;margin:0;padding:10px 14px;border-bottom:1px solid var(--line);flex-shrink:0;gap:12px}
|
|
231
|
+
.mcp-panel>header>div{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}
|
|
232
|
+
.mcp-panel>header h2{font-size:14px;font-weight:600;line-height:20px}
|
|
233
|
+
.mcp-panel .icon-button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;min-height:28px;padding:5px;border:0;border-radius:5px;background:transparent;color:var(--muted)}
|
|
234
|
+
.mcp-panel .icon-button:hover{background:var(--rail);color:var(--text)}
|
|
235
|
+
.mcp-panel .icon-button svg{width:16px;height:16px}
|
|
236
|
+
.mcp-panel-state{font-size:10px;font-weight:500;line-height:16px;padding:2px 6px;border-radius:4px;background:var(--panel);color:var(--muted);white-space:nowrap}
|
|
237
|
+
.mcp-panel-state[data-state=connected]{background:var(--green-bg);color:var(--green)}
|
|
238
|
+
.mcp-panel-body{min-height:0;overflow:auto;overscroll-behavior:contain}
|
|
239
|
+
.mcp-panel #mcp-report-summary{margin:0;padding:12px 14px 4px;font-size:11px;line-height:1.6;color:var(--muted)}
|
|
240
|
+
.mcp-empty{display:flex;align-items:flex-start;gap:12px;padding:20px 14px}
|
|
241
|
+
.mcp-empty-icon{display:grid;place-items:center;flex-shrink:0;width:32px;height:32px;border-radius:7px;background:var(--panel);color:var(--muted)}
|
|
242
|
+
.mcp-empty-icon svg{width:18px;height:18px}
|
|
243
|
+
.mcp-empty>div{min-width:0}
|
|
244
|
+
.mcp-panel .mcp-empty h3{font-size:13px;font-weight:550;line-height:20px;margin:0 0 4px;color:var(--text)}
|
|
245
|
+
.mcp-panel .mcp-empty p{font-size:12px;line-height:1.6;margin:0;color:var(--muted)}
|
|
246
|
+
.mcp-panel li{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 14px;border-top:1px solid var(--line);font-size:12px;line-height:1.5}
|
|
247
|
+
.mcp-panel li:first-child{border-top:0}
|
|
248
|
+
.mcp-service-icon{display:flex;align-items:center;color:var(--muted)}
|
|
249
|
+
.mcp-service-name{min-width:0;overflow-wrap:anywhere;font-weight:500}
|
|
250
|
+
.mcp-panel .mcp-service-state{display:inline-flex;align-items:center;gap:5px;padding:2px 6px;border-radius:4px;background:var(--panel);color:var(--muted);font-size:10px;line-height:16px;text-transform:none;white-space:nowrap}
|
|
251
|
+
.mcp-service-state::before{content:"";width:4px;height:4px;border-radius:50%;background:currentColor}
|
|
252
|
+
.mcp-panel .mcp-service-state[data-state=connected]{color:var(--green);background:var(--green-bg)}
|
|
253
|
+
.mcp-panel .mcp-service-state[data-state=unavailable]{color:var(--red);background:var(--red-bg)}
|
|
254
|
+
.mcp-panel-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 10px 6px 14px;border-top:1px solid var(--line);font-size:11px;color:var(--muted);flex-shrink:0}
|
|
255
|
+
.mcp-panel-footer .text-button{font-size:11px;line-height:18px;min-height:28px;padding:5px 6px;border-radius:5px;color:var(--accent-text)}
|
|
256
|
+
.mcp-panel-footer .text-button:hover{background:var(--rail)}
|
|
257
|
+
.mcp-panel-footer time{font-variant-numeric:tabular-nums;text-align:right}
|
|
258
|
+
@media(max-width:520px){.mcp-panel{max-width:calc(100vw - 16px)}.topbar .session-mcp-button{min-height:36px}.mcp-panel .icon-button{min-height:36px;width:36px}}
|
|
259
|
+
@media(pointer:coarse){.topbar .session-mcp-button,.mcp-panel .icon-button,.mcp-panel-footer .text-button{min-height:44px}.mcp-panel .icon-button{width:44px}}
|
package/public/studio.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
function synchronizeSearch() {
|
|
16
16
|
const form = document.querySelector('#navigation .search'); if (!form || !workspace()) return;
|
|
17
17
|
const url = new URL(canonical(), location.href);
|
|
18
|
-
for (const name of ['change', 'view', 'doc', 'stage', 'plan', 'compare', 'pane', 'job', 'file', 'mode', 'wrap', 'new', 'creation', 'created']) {
|
|
18
|
+
for (const name of ['change', 'view', 'doc', 'stage', 'plan', 'compare', 'pane', 'job', 'file', 'mode', 'wrap', 'new', 'creation', 'created', 'draft']) {
|
|
19
19
|
const value = name === 'change' ? workspace().dataset.change : name === 'view' ? workspace().dataset.view : url.searchParams.get(name);
|
|
20
20
|
let input = form.querySelector(`input[type=hidden][name="${name}"]`);
|
|
21
21
|
if (!value) { input?.remove(); continue; }
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
studio.dataset.conversationExpanded = String(expanded);
|
|
49
49
|
const button = studio.querySelector('[data-studio-expand]');
|
|
50
50
|
button?.setAttribute('aria-expanded', String(expanded));
|
|
51
|
-
if (button) button.textContent = expanded ? 'Show document' : 'Expand conversation';
|
|
51
|
+
if (button) (button.querySelector('[data-studio-expand-label]') || button).textContent = expanded ? 'Show document' : 'Expand conversation';
|
|
52
52
|
}
|
|
53
53
|
function initialize() {
|
|
54
54
|
if (!workspace()) return;
|
|
@@ -67,11 +67,6 @@
|
|
|
67
67
|
const previous = saved.stages[node.dataset.studioStage];
|
|
68
68
|
if (previous) setURL(node, withSearch(previous));
|
|
69
69
|
}
|
|
70
|
-
for (const node of document.querySelectorAll('#navigation .change-link')) {
|
|
71
|
-
const url = new URL(node.getAttribute('href'), location.href);
|
|
72
|
-
url.searchParams.set('view', currentMode === 'build' ? 'studio' : 'rendered');
|
|
73
|
-
setURL(node, withSearch(url.pathname + url.search));
|
|
74
|
-
}
|
|
75
70
|
const place = positions.get(canonical());
|
|
76
71
|
const sidebar = document.getElementById('navigation'), canvas = document.getElementById('studio-canvas-body'), thread = document.getElementById('studio-thread');
|
|
77
72
|
if (sidebar) sidebar.scrollTop = place?.sidebar ?? saved.sidebar ?? 0;
|
|
@@ -140,9 +135,6 @@
|
|
|
140
135
|
const narrow = window.matchMedia?.('(max-width:760px)').matches || document.querySelector('.studio-mobile-panes')?.offsetHeight > 0;
|
|
141
136
|
if (narrow && (active.closest('.studio-canvas') && studio.dataset.pane === 'conversation' || active.closest('.studio-conversation') && studio.dataset.pane === 'document')) studio.querySelector(`[data-studio-pane="${studio.dataset.pane}"]`)?.focus();
|
|
142
137
|
});
|
|
143
|
-
document.addEventListener('keydown', event => {
|
|
144
|
-
if (event.key === 'Escape') { const picker = document.getElementById('studio-command-picker'); if (picker?.open) { picker.open = false; picker.querySelector('summary')?.focus(); } }
|
|
145
|
-
});
|
|
146
138
|
document.addEventListener('click', event => {
|
|
147
139
|
const button = event.target.closest('[data-studio-pane]'), studio = document.getElementById('studio');
|
|
148
140
|
if (button && studio) {
|
|
@@ -160,7 +152,6 @@
|
|
|
160
152
|
message.value = command.dataset.studioInsertCommand;
|
|
161
153
|
message.dispatchEvent(new window.Event('input', {bubbles:true}));
|
|
162
154
|
message.focus();
|
|
163
|
-
const picker = studio.querySelector('#studio-command-picker'); if(picker) picker.open = false;
|
|
164
155
|
}
|
|
165
156
|
return;
|
|
166
157
|
}
|