spequi 0.1.8 → 0.1.9

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.
@@ -2,7 +2,7 @@
2
2
  const panel = () => document.getElementById('requests-panel');
3
3
  const workspace = () => document.getElementById('workspace');
4
4
  const labels = { stalled: 'In progress · check CLI', queued: 'Queued', running: 'Working', 'awaiting-input': 'Answer needed', completed: 'Completed', failed: 'Failed', cancelled: 'Cancelled' };
5
- const actions = { 'start-plan': 'New spec', 'plan-next': 'Next artifact', 'revise-plan': 'Spec revision', preview: 'Implementation preview', verify: 'Verification', explore: 'Question', 'update-specs': 'Review feedback', impact: 'File impact', archive: 'Archive' };
5
+ const actions = { 'commit-message': 'Commit message', 'start-plan': 'New spec', 'plan-next': 'Next artifact', 'revise-plan': 'Spec revision', preview: 'Implementation preview', verify: 'Verification', explore: 'Question', 'update-specs': 'Review feedback', impact: 'File impact', archive: 'Archive' };
6
6
  let page = 1, pages = 1, opener, activityPending, activityAgain = false, agent = {}, listGeneration = 0;
7
7
  const saves = new Map(), saved = new Map(), saveFailures = new Map(), deletedDrafts = new Set();
8
8
  const notificationKey = `spequi-request-notifications:${location.host}`;
@@ -60,17 +60,11 @@
60
60
  for (const toggle of document.querySelectorAll('[data-requests-toggle]')) toggle.setAttribute('aria-expanded', 'false');
61
61
  }
62
62
  function positionPanel() {
63
- const drawer = panel(), anchor = document.querySelector('.topbar [data-requests-toggle]') || opener;
64
- if (!drawer || drawer.hidden || !anchor?.getBoundingClientRect || !window.innerWidth) return;
65
- const trigger = anchor.getBoundingClientRect(), header = anchor.closest('.topbar')?.getBoundingClientRect();
66
- const gutter = window.innerWidth <= 520 ? 8 : 16, width = drawer.getBoundingClientRect().width;
67
- const left = Math.max(gutter, Math.min(trigger.left, window.innerWidth - width - gutter));
68
- const top = Math.max(gutter, Math.max(trigger.bottom, header?.bottom || 0) + 8);
69
- drawer.style.left = `${Math.round(left)}px`; drawer.style.right = 'auto'; drawer.style.top = `${Math.round(top)}px`;
70
- drawer.style.maxHeight = `${Math.max(0, Math.min(640, window.innerHeight - top - gutter))}px`;
63
+ const drawer = panel();
64
+ if (drawer && !drawer.hidden) window.spequiPositionDropdown?.(drawer, document.querySelector('.topbar [data-requests-toggle]') || opener);
71
65
  }
72
66
  function openLink(job) {
73
- const stage = ['preview', 'impact'].includes(job.action) ? 'implement' : ['verify', 'sync-specs', 'archive'].includes(job.action) ? 'finish' : 'shape';
67
+ const stage = ['preview', 'impact'].includes(job.action) ? 'implement' : ['verify', 'sync-specs', 'archive', 'commit-message'].includes(job.action) ? 'finish' : 'shape';
74
68
  const query = job.action === 'start-plan' ? { view: 'studio', new: '1', creation: job.id } : {
75
69
  change: job.change || '', view: stage === 'shape' ? 'studio' : ['preview', 'impact'].includes(job.action) ? 'preview' : 'workflow', ...(stage === 'shape' ? { stage } : {}),
76
70
  ...(job.status === 'awaiting-input' ? { pane: 'conversation' } : {}),
@@ -122,9 +116,7 @@
122
116
  if (question && !question.answeredAt) row.append(replies.get(`${job.id}:${question.id}`) || window.spequiQuestionForm(job, question, 'inbox'));
123
117
  const detail = node('details'); detail.open = expanded.has(job.groupKey || job.id);
124
118
  const summary = node('summary'); summary.append(node('span', job.message || 'View request details', 'request-summary-text'), requestIcon('chevron')); detail.append(summary);
125
- const body = node('div', undefined, 'request-detail-body'), log = node('ol');
126
- for (const item of job.logs?.slice(-30) || []) log.append(node('li', item.message));
127
- if (log.children.length) body.append(node('h3', 'Activity'), log);
119
+ const body = node('div', undefined, 'request-detail-body');
128
120
  if (job.result) body.append(node('h3', 'Result'), node('p', job.result, 'request-result'));
129
121
  if (job.stalled) body.prepend(node('p', 'This can take a few minutes. The result will appear here when ready. Your CLI may be waiting for a permission or another action.', 'request-status-note'));
130
122
  detail.append(body); row.append(detail);
@@ -221,12 +213,16 @@
221
213
  activityPending = (async () => {
222
214
  const result = await api('/api/activity?' + new URLSearchParams({ change: current.dataset.change || '', creation: query.searchParams.get('creation') || '' }));
223
215
  notifyTransitions(result.notifications);
216
+ if (agent.observedAt && result.agent.observedAt && result.agent.observedAt < agent.observedAt) { activityAgain = true; return; }
224
217
  agent = result.agent; document.dispatchEvent(new window.CustomEvent('agent-status', { detail: agent }));
225
218
  const attention = result.attention || 0, inboxCount = result.inboxCount ?? attention;
219
+ const answers = result.active.filter(job => job.status === 'awaiting-input').length;
220
+ for (const marker of document.querySelectorAll('[data-request-answer]')) { marker.hidden = !answers; marker.textContent = `${answers} ${answers === 1 ? 'answer needed' : 'answers needed'}`; }
226
221
  const markerLabel = inboxCount ? `${inboxCount} ${inboxCount === 1 ? 'item' : 'items'} in your inbox${attention ? `; ${attention} ${attention === 1 ? 'needs' : 'need'} your attention` : ''}` : 'No pending requests';
227
- for (const count of document.querySelectorAll('[data-request-count]')) { count.textContent = inboxCount; count.hidden = !inboxCount; count.title = markerLabel; }
222
+ for (const count of document.querySelectorAll('[data-request-count]')) { count.textContent = inboxCount; count.hidden = !inboxCount || Boolean(answers); count.title = markerLabel; }
228
223
  for (const toggle of document.querySelectorAll('.topbar [data-requests-toggle]')) {
229
- toggle.title = markerLabel; toggle.setAttribute('aria-label', `Requests. ${markerLabel}`);
224
+ toggle.dataset.answerNeeded = String(Boolean(answers));
225
+ toggle.title = answers ? `${answers} unanswered ${answers === 1 ? 'question' : 'questions'} — open Requests to reply` : markerLabel; toggle.setAttribute('aria-label', `Requests. ${answers ? `${answers} answers needed.` : markerLabel}`);
230
226
  }
231
227
  renderDrafts(result.drafts);
232
228
  for (const status of document.querySelectorAll('[data-job-state]')) status.textContent = labels[result.active.find(job => job.change === status.dataset.jobState)?.status] || '';
@@ -304,7 +300,7 @@
304
300
  await api(`/api/jobs/${encodeURIComponent(id)}/${action}`, payload);
305
301
  if (action === 'retry' || action === 'dismiss') { feedback(''); document.dispatchEvent(new window.CustomEvent('spequi-toast', { detail: { message: action === 'dismiss' ? 'Dismissed from inbox. History kept.' : 'Retry queued.' } })); }
306
302
  else feedback(action === 'delete' ? 'Request removed.' : 'Request cancelled.');
307
- await Promise.all([activity(), loadRequests()]);
303
+ await Promise.all([activity(), loadRequests(), window.spequiRefreshAgent?.()]);
308
304
  }
309
305
  catch (error) { feedback(error.message, true); }
310
306
  finally { control.disabled = false; }
@@ -313,7 +309,7 @@
313
309
  const toggle = event.target.closest('[data-requests-toggle]');
314
310
  if (toggle) {
315
311
  const visible = panel().hidden; close(); panel().hidden = !visible;
316
- if (visible) { opener = toggle; toggle.setAttribute('aria-expanded', 'true'); positionPanel(); panel().querySelector('[data-requests-close]').focus(); void loadRequests(); }
312
+ if (visible) { if (toggle.dataset.answerNeeded === 'true') { panel().querySelector('[data-request-filter]').value = 'inbox'; page = 1; } opener = toggle; toggle.setAttribute('aria-expanded', 'true'); positionPanel(); panel().querySelector('[data-requests-close]').focus(); void loadRequests(); }
317
313
  return;
318
314
  }
319
315
  if (event.target.closest('[data-requests-close]')) { close(); opener?.focus(); return; }
@@ -348,6 +344,7 @@
348
344
  document.addEventListener('requests-updated', () => { void activity(); void loadRequests(); });
349
345
  document.addEventListener('agent-status', event => {
350
346
  const next = event.detail;
347
+ if (agent.observedAt && next.observedAt && next.observedAt < agent.observedAt) return;
351
348
  const changed = agent.status !== next.status || agent.queue?.active?.id !== next.queue?.active?.id || agent.queue?.active?.ownerConnected !== next.queue?.active?.ownerConnected;
352
349
  agent = next;
353
350
  if (changed) { void activity(); void loadRequests(); }
package/public/review.css CHANGED
@@ -271,9 +271,6 @@
271
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
272
 
273
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
274
  .review-update-hint{margin:0 0 12px;font-size:10px;line-height:1.6;color:var(--muted)}
278
275
  .comment-group-path>small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
279
276
  .comment-group-count{background:transparent;padding:0;font-size:10px}
@@ -283,4 +280,24 @@
283
280
  .review-comment .comment-source-link{background:transparent;padding:0;border-radius:0;font-size:10px;gap:5px}
284
281
  .review-comment .comment-source-link svg{width:11px;height:11px}
285
282
  .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}}
283
+ @media(pointer:coarse){.review-feedback-actions .button,.comment-view-filter>button,.review-comment .saved-comment-thread>summary{min-height:44px}.review-comment .comment-delete{min-height:32px;width:32px}}
284
+
285
+ .comment-image-toolbar{display:flex;align-items:center;gap:8px;margin:7px 0 10px;font-size:10px;color:var(--muted)}
286
+ .comment-image-add{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--text);font-size:11px;cursor:pointer}
287
+ .comment-image-add svg{width:14px;height:14px}
288
+ .comment-image-drafts{display:flex;flex-wrap:wrap;gap:8px}
289
+ .comment-image-draft{display:flex;flex-direction:column;gap:4px;width:80px}
290
+ .comment-image-draft img{width:80px;height:64px;object-fit:contain;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius)}
291
+ .comment-image-draft button{font-size:10px;padding:2px;border:0;background:transparent;color:var(--muted);cursor:pointer}
292
+ .comment-image{display:inline-flex;flex-direction:column;gap:4px;max-width:240px;margin:8px 8px 8px 0;vertical-align:top;font-size:10px;overflow-wrap:anywhere;color:var(--accent-text)}
293
+ .comment-image img{max-width:100%;max-height:180px;object-fit:contain;border:1px solid var(--line);border-radius:var(--radius)}
294
+ @media(max-width:760px){.comment-image-add,.comment-image-draft button{min-height:36px}.comment-image-toolbar>span{display:none}}
295
+
296
+ .comment-attachment-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-right:auto}
297
+ .comment-attachment-actions>.comment-image-add{min-height:32px}
298
+ .attachment-paste-hint{font-size:11px;color:var(--muted);line-height:1.5}
299
+ .comment-composer-actions{flex-wrap:wrap}
300
+ .comment-image-drafts:empty{display:none}
301
+ .comment-image-draft{width:auto;max-width:160px;padding:6px;border:1px solid var(--line);border-radius:var(--radius)}
302
+ .comment-image-draft>span{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
303
+ .comment-image>svg{width:24px;height:24px}
package/public/review.js CHANGED
@@ -1,9 +1,9 @@
1
1
  (() => {
2
2
  const drafts = new Map();
3
+ const imageDrafts = new Map(), imageUploads = new Set();
3
4
  const saving = new Set();
4
5
  const deleting = new Set();
5
6
  const deleteMessages = new Map();
6
- const exporting = new Set(), exportMessages = new Map();
7
7
  const updating = new Set(), updateMessages = new Map();
8
8
  const commentViews = new Map(), composerStates = new Map();
9
9
  const inlineTargets = new Map();
@@ -13,6 +13,74 @@
13
13
  const form = () => document.getElementById('review-comment-form');
14
14
  const field = (node, name) => node.querySelector(`[name="${name}"]`);
15
15
  const key = node => `${node.dataset.preview}:${node.dataset.file}`;
16
+ const attachmentForms = () => [...document.querySelectorAll('form[data-attachment-scope]')];
17
+ function renderImageDraft(node) {
18
+ const host = node.querySelector('[data-comment-images]'); if (!host) return;
19
+ const images = imageDrafts.get(key(node)) || [];
20
+ host.replaceChildren();
21
+ for (const image of images) {
22
+ const tile = document.createElement('div'), remove = document.createElement('button');
23
+ tile.className = 'comment-image-draft';
24
+ if (/^image\/(png|jpeg|webp)$/.test(image.type)) {
25
+ const picture = document.createElement('img'); picture.src = image.url; picture.alt = image.name; tile.append(picture);
26
+ }
27
+ const name = document.createElement('span'); name.textContent = image.name; name.title = image.name; tile.append(name);
28
+ remove.type = 'button'; remove.dataset.commentImageRemove = image.id; remove.textContent = 'Remove'; remove.setAttribute('aria-label', `Remove ${image.name}`);
29
+ tile.append(remove); host.append(tile);
30
+ }
31
+ const textarea = node.querySelector('textarea[name=body],textarea[name=message]');
32
+ if (textarea) textarea.required = !images.length;
33
+ node.querySelector('[type=submit]').disabled = saving.has(key(node)) || imageUploads.has(key(node)) || node.getAttribute('aria-busy') === 'true' || node.dataset.attachmentBlocked === 'true';
34
+ }
35
+ window.spequiAttachments = {
36
+ ids: node => (imageDrafts.get(key(node)) || []).map(image => image.id),
37
+ busy: node => imageUploads.has(key(node)),
38
+ clear: node => { imageDrafts.delete(key(node)); renderImageDraft(node); }
39
+ };
40
+ async function uploadImages(node, files) {
41
+ const id = key(node), selected = [...files];
42
+ if (imageUploads.has(id) || saving.has(id) || node.getAttribute('aria-busy') === 'true') return;
43
+ const report = node.querySelector('[data-composer-feedback]');
44
+ if ((imageDrafts.get(id)?.length || 0) + selected.length > 4) { report.textContent = 'Attach up to four files.'; return; }
45
+ imageUploads.add(id); renderImageDraft(node); report.textContent = 'Adding attachments…';
46
+ try {
47
+ for (const file of selected) {
48
+ if (file.size > 5 * 1024 * 1024) throw new Error('Choose files up to 5 MiB each.');
49
+ if (['image/png', 'image/jpeg', 'image/webp'].includes(file.type)) {
50
+ const image = await createImageBitmap(file), pixels = image.width * image.height; image.close();
51
+ if (pixels > 40000000) throw new Error('Choose an image smaller than 40 megapixels.');
52
+ }
53
+ const data = await new Promise((resolve, reject) => { const reader = new FileReader(); reader.onload = () => resolve(reader.result.split(',')[1]); reader.onerror = () => reject(new Error('Could not read this file.')); reader.readAsDataURL(file); });
54
+ const response = await fetch(`/api/reviews/${encodeURIComponent(node.dataset.attachmentScope)}/attachments`, { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json', 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]').content }, body: JSON.stringify({ name: file.name, data }) });
55
+ const result = await response.json();
56
+ if (!response.ok || !result.image) throw new Error(result.error || 'Could not upload this file.');
57
+ imageDrafts.set(id, [...imageDrafts.get(id) || [], result.image]);
58
+ }
59
+ report.textContent = '';
60
+ } catch (error) { report.textContent = error.message; }
61
+ finally { imageUploads.delete(id); for (const active of attachmentForms().filter(form => key(form) === id)) { renderImageDraft(active); if (active.id === 'review-comment-form') showSelection(active); } }
62
+ }
63
+ document.addEventListener('paste', event => {
64
+ const node = event.target.closest('form[data-attachment-scope]'); if (!node) return;
65
+ const files = [...event.clipboardData?.files || []];
66
+ if (!files.length) return;
67
+ event.preventDefault();
68
+ const text = event.clipboardData.getData('text/plain'), textarea = event.target.closest('textarea');
69
+ if (text && textarea) { textarea.setRangeText(text.slice(0, Math.max(0, textarea.maxLength - textarea.value.length + textarea.selectionEnd - textarea.selectionStart)), textarea.selectionStart, textarea.selectionEnd, 'end'); textarea.dispatchEvent(new Event('input', { bubbles: true })); }
70
+ void uploadImages(node, files);
71
+ });
72
+ document.addEventListener('change', event => {
73
+ if (!event.target.matches('[data-comment-image-input]')) return;
74
+ const files = [...event.target.files]; event.target.value = '';
75
+ void uploadImages(event.target.closest('form'), files);
76
+ });
77
+ document.addEventListener('click', event => {
78
+ const choose = event.target.closest('[data-comment-image-choose]');
79
+ if (choose) choose.closest('form').querySelector('[data-comment-image-input]').click();
80
+ const remove = event.target.closest('[data-comment-image-remove]');
81
+ if (remove) { const node = remove.closest('form'), id = key(node); imageDrafts.set(id, (imageDrafts.get(id) || []).filter(image => image.id !== remove.dataset.commentImageRemove)); renderImageDraft(node); if (node.id === 'review-comment-form') showSelection(node); }
82
+ });
83
+ document.addEventListener('htmx:afterSwap', () => attachmentForms().forEach(renderImageDraft));
16
84
  function remember() {
17
85
  const node = form(); if (!node) return;
18
86
  drafts.set(key(node), { ...Object.fromEntries(['body', 'side', 'start', 'end'].map(name => [name, field(node, name).value])), ...(node.dataset.sourceHash ? { sourceHash: node.dataset.sourceHash } : {}) });
@@ -34,7 +102,7 @@
34
102
  if (contextRow) contextRow.hidden = Boolean(node.dataset.sourceHash && side === 'file' && !stale && node.closest('[data-document-composer-home]'));
35
103
  const general = document.querySelector('[data-general-document-comment]');
36
104
  if (general) general.hidden = !node.closest('.document-inline-thread') && side === 'file' && !stale;
37
- const draft = field(node, 'body').value.trim().length > 0;
105
+ const draft = field(node, 'body').value.trim().length > 0 || Boolean(imageDrafts.get(key(node))?.length);
38
106
  const label = document.querySelector('[data-composer-label]'), marker = document.querySelector('[data-comment-draft]');
39
107
  if (label) label.textContent = draft ? 'Continue comment' : 'Add a comment';
40
108
  if (marker) marker.hidden = !draft;
@@ -69,7 +137,6 @@
69
137
  function initialize() {
70
138
  restoreDeleteMessages();
71
139
  updateCommentView();
72
- restoreExportState();
73
140
  restoreUpdateState();
74
141
  for (const node of document.querySelectorAll('[data-delete-comment]')) if (deleting.has(`${node.dataset.reviewScope}:${node.dataset.commentId}`)) setDeleteBusy(node.dataset.reviewScope, node.dataset.commentId, true);
75
142
  const node = form(); if (!node) return;
@@ -79,11 +146,12 @@
79
146
  for (const name of ['body', 'side', 'start', 'end']) field(node, name).value = saved[name];
80
147
  if (saved.sourceHash) node.dataset.sourceHash = saved.sourceHash;
81
148
  }
149
+ renderImageDraft(node);
82
150
  placeDocumentComposer(inlineTargets.get(key(node)));
83
151
  placeDiffComposer(diffTargets.get(key(node)));
84
152
  showSelection(node);
85
153
  setComposer(node, composerStates.get(key(node)) ?? (Boolean(saved?.body) || document.getElementById('review-comment-composer').hasAttribute('data-default-open')));
86
- node.querySelector('[type="submit"]').disabled = saving.has(key(node));
154
+ node.querySelector('[type="submit"]').disabled = saving.has(key(node)) || imageUploads.has(key(node));
87
155
  const query = new URLSearchParams(location.search);
88
156
  const line = Number(query.get('line')), side = query.get('side'), commentID = query.get('comment');
89
157
  const locationKey = `${key(node)}:${side}:${line}:${commentID || ''}`;
@@ -149,28 +217,14 @@
149
217
  document.addEventListener('htmx:beforeRequest', remember);
150
218
  document.addEventListener('htmx:afterSwap', initialize);
151
219
  document.addEventListener('toggle', event => { if (event.target.id === 'review-comment-composer' && form()) composerStates.set(key(form()), event.target.hasAttribute('open')); }, true);
152
- function feedback(message, error = false, downloadUrl = '') {
220
+ function feedback(message, error = false) {
153
221
  const target = document.getElementById('review-feedback'); if (!target) return;
154
222
  const paragraph = document.createElement('p');
155
223
  paragraph.className = error ? 'error-message' : 'success-message'; paragraph.textContent = message;
156
- if (downloadUrl) {
157
- const link = document.createElement('a'); link.href = downloadUrl; link.download = 'openspec-review-feedback.md'; link.textContent = 'Download Markdown';
158
- paragraph.append(' ', link);
159
- }
160
224
  target.replaceChildren(paragraph);
161
225
  const local = form()?.querySelector('[data-composer-feedback]');
162
226
  if (local) local.replaceChildren(paragraph.cloneNode(true));
163
227
  }
164
- function restoreExportState() {
165
- const section = document.getElementById('review-comments'); if (!section) return;
166
- const node = section.querySelector('[data-feedback-export]'); if (!node) return;
167
- const busy = exporting.has(section.dataset.preview);
168
- if (busy) node.setAttribute('aria-busy', 'true'); else node.removeAttribute('aria-busy');
169
- node.querySelector('[type="submit"]').disabled = busy || !section.querySelector('.review-comment');
170
- node.querySelector('[data-export-label]').textContent = busy ? 'Exporting…' : 'Export .md';
171
- const state = exportMessages.get(section.dataset.preview);
172
- if (state) feedback(state.message, state.error, state.downloadUrl);
173
- }
174
228
  function restoreUpdateState() {
175
229
  const node = document.querySelector('[data-spec-update]'); if (!node) return;
176
230
  const busy = updating.has(node.dataset.change);
@@ -178,7 +232,7 @@
178
232
  node.querySelector('button').disabled = busy || node.dataset.blocked === 'true';
179
233
  node.querySelector('[data-update-label]').textContent = busy ? 'Queuing…' : node.dataset.pendingStatus === 'awaiting-input' ? 'Reply in Build' : node.dataset.pendingStatus === 'running' ? 'Updating…' : node.dataset.pendingStatus === 'queued' ? 'Queued' : 'Update spec';
180
234
  const state = updateMessages.get(node.dataset.change);
181
- if (state) feedback(state.message, state.error, state.downloadUrl);
235
+ if (state) feedback(state.message, state.error);
182
236
  }
183
237
  document.addEventListener('submit', async event => {
184
238
  const node = event.target.closest('[data-spec-update]'); if (!node) return;
@@ -194,12 +248,12 @@
194
248
  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: '' });
195
249
  const result = response.headers.get('content-type')?.includes('application/json') ? await response.json() : {};
196
250
  if (!response.ok) throw new Error(result.error || (response.status === 403 ? 'Local session expired. Reload the viewer and retry the update.' : 'Could not queue the planning update. Retry Update spec.'));
197
- const { update, exported } = result;
198
- if (!update || update.change !== change || update.reviewPreview !== preview || update.feedbackId !== exported?.id || exported.preview !== preview || update.status !== 'queued' || exported.downloadUrl !== `/api/reviews/${preview}/feedback/${exported.id}`) throw new Error('Could not confirm the planning update. Reload to check its status before retrying.');
251
+ const { update, feedback: snapshot } = result;
252
+ if (!update || update.change !== change || update.reviewPreview !== preview || update.feedbackId !== snapshot?.id || snapshot.preview !== preview || update.status !== 'queued') throw new Error('Could not confirm the planning update. Reload to check its status before retrying.');
199
253
  // Preserve the accepted request if a subsequent workspace refresh fails.
200
254
  node.dataset.blocked = 'true';
201
255
  node.dataset.pendingStatus = 'queued';
202
- updateMessages.delete(change); exportMessages.delete(preview);
256
+ updateMessages.delete(change);
203
257
  await refreshComments(preview, '', { change, outcome: 'Planning update queued' });
204
258
  document.dispatchEvent(new window.CustomEvent('spequi-toast', { detail: { message: 'Spec update queued for your agent.' } }));
205
259
  } catch (error) {
@@ -212,27 +266,6 @@
212
266
  }
213
267
  }
214
268
  }, true);
215
- // Export owns its POST and download. An HTMX swap/live refresh must not
216
- // consume the response or discard the only link before it can be used.
217
- document.addEventListener('submit', async event => {
218
- const node = event.target.closest('[data-feedback-export]'); if (!node) return;
219
- event.preventDefault(); event.stopImmediatePropagation();
220
- const preview = node.dataset.preview; if (exporting.has(preview)) return;
221
- exporting.add(preview);
222
- exportMessages.set(preview, { message: 'Preparing feedback document…' }); restoreExportState();
223
- try {
224
- 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: '' });
225
- const result = response.headers.get('content-type')?.includes('application/json') ? await response.json() : {};
226
- if (!response.ok) throw new Error(result.error || (response.status === 403 ? 'Local session expired. Reload the viewer and retry the export.' : 'Could not export feedback. Check the server connection and retry.'));
227
- const exported = result.exported;
228
- if (!exported || exported.preview !== preview || typeof exported.id !== 'string' || !/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,100}$/.test(exported.id) || exported.downloadUrl !== `/api/reviews/${preview}/feedback/${exported.id}`) throw new Error('Could not confirm the exported document. Retry the export.');
229
- exportMessages.set(preview, { message: 'Feedback exported. If the download did not start, use this link.', downloadUrl: exported.downloadUrl });
230
- const download = document.createElement('a'); download.href = exported.downloadUrl; download.download = 'openspec-review-feedback.md'; download.hidden = true;
231
- document.body.append(download); download.click(); download.remove();
232
- } catch (error) {
233
- exportMessages.set(preview, { message: error instanceof TypeError ? 'Could not reach the viewer. Check that the server is running and retry the export.' : error.message, error: true });
234
- } finally { exporting.delete(preview); restoreExportState(); }
235
- }, true);
236
269
  async function refreshComments(preview, savedFile, { change = '', outcome = 'Comment saved', revealComment = '' } = {}) {
237
270
  const current = form(), workspace = document.getElementById('workspace');
238
271
  if (!workspace?.dataset.refreshUrl || (change ? workspace.dataset.change !== change : !current || current.dataset.preview !== preview)) return;
@@ -244,8 +277,8 @@
244
277
  if (generation !== refreshGeneration || document.getElementById('workspace') !== workspace || workspace.dataset.refreshUrl !== url) return;
245
278
  const updated = html.getElementById('review-comments');
246
279
  if (!updated) throw new Error(`${outcome}. Reload this view to refresh the comment list.`);
247
- const inspector = document.getElementById('review-details'), top = inspector.scrollTop;
248
- const reader = document.querySelector('.reader'), readerTop = reader.scrollTop, readerLeft = reader.scrollLeft;
280
+ const inspector = document.getElementById('review-details') || document.querySelector('.studio-review'), top = inspector?.scrollTop || 0;
281
+ const reader = document.getElementById('studio-canvas-body') || document.querySelector('.reader'), readerTop = reader.scrollTop, readerLeft = reader.scrollLeft;
249
282
  const code = document.querySelector('.diff-code-scroll'), codeTop = code?.scrollTop, codeLeft = code?.scrollLeft;
250
283
  const active = current?.contains(document.activeElement) ? { name: document.activeElement.name, start: document.activeElement.selectionStart, end: document.activeElement.selectionEnd } : null;
251
284
  const disclosures = [...document.querySelectorAll('#workspace details[id]')].filter(node => node.id !== 'review-comment-composer').map(node => ({ id: node.id, open: node.hasAttribute('open') }));
@@ -266,7 +299,7 @@
266
299
  if (window.htmx && document.querySelector('.file-diff')) window.htmx.process(document.querySelector('.file-diff'));
267
300
  document.dispatchEvent(new CustomEvent('htmx:afterSwap', { detail: { target: imported } }));
268
301
  if (active) { const input = form()?.querySelector(`[name="${active.name}"]`); input?.focus({ preventScroll: true }); if (typeof input?.setSelectionRange === 'function' && Number.isInteger(active.start)) input.setSelectionRange(active.start, active.end); }
269
- inspector.scrollTop = top;
302
+ if (inspector) inspector.scrollTop = top;
270
303
  reader.scrollTop = readerTop; reader.scrollLeft = readerLeft;
271
304
  const updatedCode = document.querySelector('.diff-code-scroll');
272
305
  if (updatedCode && code) { updatedCode.scrollTop = codeTop; updatedCode.scrollLeft = codeLeft; }
@@ -305,7 +338,6 @@
305
338
  const refreshURL = document.getElementById('workspace')?.dataset.refreshUrl;
306
339
  const viewport = ['.reader', '.diff-code-scroll'].map(selector => { const target = document.querySelector(selector); return target ? { selector, top: target.scrollTop, left: target.scrollLeft } : null; }).filter(Boolean);
307
340
  remember();
308
- exportMessages.delete(scope); exportMessages.delete(document.getElementById('review-comments')?.dataset.preview);
309
341
  for (const prefix of ['comment-', 'inline-diff-comment-', 'inline-document-comment-', 'document-comment-']) document.getElementById(prefix + id)?.remove();
310
342
  await refreshComments(scope, removed.file, { change: viewChange, outcome: 'Comment removed' });
311
343
  if (document.getElementById('workspace')?.dataset.refreshUrl === refreshURL) {
@@ -324,8 +356,9 @@
324
356
  document.addEventListener('submit', async event => {
325
357
  const node = event.target.closest('#review-comment-form'); if (!node) return;
326
358
  event.preventDefault(); event.stopImmediatePropagation();
327
- const submittedKey = key(node); if (saving.has(submittedKey)) return;
359
+ const submittedKey = key(node); if (saving.has(submittedKey) || imageUploads.has(submittedKey)) return;
328
360
  const payload = new URLSearchParams({ file: node.dataset.file, body: field(node, 'body').value, side: field(node, 'side').value });
361
+ payload.set('attachments', JSON.stringify((imageDrafts.get(submittedKey) || []).map(image => image.id)));
329
362
  if (node.dataset.sourceHash) payload.set('sourceHash', node.dataset.sourceHash);
330
363
  if (payload.get('side') !== 'file') for (const name of ['start', 'end']) payload.set(name, field(node, name).value);
331
364
  remember(); setComposer(node, true); saving.add(submittedKey); node.setAttribute('aria-busy', 'true'); node.querySelector('[type="submit"]').disabled = true;
@@ -348,14 +381,16 @@
348
381
  document.addEventListener('review-saved', event => {
349
382
  const savedKey = `${event.detail.preview}:${event.detail.file}`;
350
383
  if (event.detail.body !== undefined && drafts.get(savedKey)?.body !== event.detail.body) return;
351
- drafts.delete(savedKey);
384
+ drafts.delete(savedKey); imageDrafts.delete(savedKey);
352
385
  const node = form(); if (!node || key(node) !== savedKey) return;
353
386
  anchor = null;
354
387
  inlineTargets.delete(savedKey); diffTargets.delete(savedKey); placeDocumentComposer(); placeDiffComposer();
388
+ renderImageDraft(node);
355
389
  field(node, 'body').value = ''; field(node, 'side').value = 'file'; field(node, 'start').value = ''; field(node, 'end').value = '';
356
390
  showSelection(node);
357
391
  setComposer(node, Boolean(document.getElementById('document-discussion')));
358
392
  if (document.activeElement === field(node, 'body')) field(node, 'body').blur();
359
393
  });
360
394
  initialize();
395
+ attachmentForms().forEach(renderImageDraft);
361
396
  })();
package/public/session.js CHANGED
@@ -3,16 +3,7 @@
3
3
  const panels = () => document.querySelectorAll('#agent-connections, #mcp-connections');
4
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
5
  function positionMCP() {
6
- for (const panel of panels()) {
7
- const button = document.querySelector(`[data-session-toggle][aria-controls="${panel.id}"]`);
8
- if (panel.hidden || !button?.getBoundingClientRect || !window.innerWidth) continue;
9
- const anchor = button.getBoundingClientRect(), header = button.closest('.topbar')?.getBoundingClientRect();
10
- const gutter = window.innerWidth <= 520 ? 8 : 16, width = panel.getBoundingClientRect().width;
11
- const top = Math.max(gutter, Math.max(anchor.bottom, header?.bottom || 0) + 8);
12
- panel.style.left = `${Math.round(Math.max(gutter, Math.min(anchor.right - width, window.innerWidth - width - gutter)))}px`;
13
- panel.style.right = 'auto'; panel.style.top = `${Math.round(top)}px`;
14
- panel.style.maxHeight = `${Math.max(0, window.innerHeight - top - gutter)}px`;
15
- }
6
+ for (const panel of panels()) if (!panel.hidden) window.spequiPositionDropdown?.(panel, document.querySelector(`[data-session-toggle][aria-controls="${panel.id}"]`));
16
7
  }
17
8
  function text(id, value) { const node = document.getElementById(id); if (node) node.textContent = value; return node; }
18
9
  function lastSeen(at) {
@@ -24,6 +15,7 @@
24
15
  return new Date(at).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
25
16
  }
26
17
  function render(agent) {
18
+ if (current?.observedAt && agent.observedAt && agent.observedAt < current.observedAt) return;
27
19
  if (current && (current.status !== agent.status || current.connected !== agent.connected || current.agent !== agent.agent)) {
28
20
  const result = document.querySelector('[data-session-check-result]'); if (result) result.textContent = '';
29
21
  }
@@ -154,6 +146,7 @@
154
146
  }
155
147
  }
156
148
  document.addEventListener('agent-status',event => render(event.detail));
149
+ document.addEventListener('requests-updated', () => { void refresh(); });
157
150
  document.addEventListener('click',event => {
158
151
  const toggle = event.target.closest('[data-session-toggle]');
159
152
  const target = toggle && document.getElementById(toggle.getAttribute('aria-controls'));
package/public/studio.css CHANGED
@@ -89,6 +89,10 @@
89
89
  .studio[data-awaiting-input=true] .studio-footer{min-height:0;padding-block:8px}
90
90
  .studio-thread{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px;overflow-wrap:anywhere;scroll-padding-block:18px}
91
91
  .studio-conversation-empty{font-size:13px;line-height:1.8;color:var(--muted)}
92
+ .studio-thread-placeholder{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;text-align:center;color:var(--muted)}
93
+ .studio-thread-placeholder>svg{width:28px;height:28px;margin-bottom:12px}
94
+ .studio-thread-placeholder>strong{font-size:13px;font-weight:500}
95
+ .studio-thread-placeholder>p{max-width:30ch;margin:6px 0 0;font-size:12px;line-height:1.7}
92
96
  .studio-exchange+.studio-exchange{margin-top:24px}.studio-message{font-size:13px;line-height:1.7}.studio-message p{margin:6px 0 10px}
93
97
  .studio-user{background:var(--panel);padding:10px 12px;border-radius:7px;margin-bottom:14px}
94
98
  .studio-message>strong,.studio-message-heading>strong{font-size:12px;font-weight:600}
@@ -161,34 +165,6 @@
161
165
  .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}
162
166
  @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}}
163
167
  @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}}
164
- .studio-commands{font-size:12px;flex-shrink:0;margin-left:auto}
165
- .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}
166
- .studio-commands>button[aria-expanded=true]{background:var(--accent-soft);border-color:transparent;color:var(--accent-text)}
167
- .studio-commands>button>svg{width:13px;height:13px;color:var(--muted)}
168
- .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}
169
- .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}
170
- .studio-command-menu header{display:flex;align-items:center;justify-content:space-between;padding:9px 10px;color:var(--muted);font-size:11px}
171
- .studio-command-menu header strong{font-size:11px;font-weight:500}
172
- .studio-command-menu form{margin:0}
173
- .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}
174
- .studio-command-menu button:hover,.studio-command-menu>a:hover{background:var(--panel)}
175
- .studio-command-menu button>svg{flex-shrink:0;width:16px;height:16px;color:var(--accent-text)}
176
- .studio-command-copy{flex:1;min-width:0}
177
- .studio-command-menu strong{display:block;font-weight:550;font-size:12px}
178
- .studio-command-menu small{display:block;color:var(--muted);font-size:11px;line-height:1.6;margin-top:3px}
179
- .studio-command-shortcut{margin-left:auto;color:var(--muted);white-space:nowrap;font-size:11px;font-weight:400}
180
- .studio-command-status{display:flex;align-items:flex-start;gap:10px;padding:12px 10px}
181
- .studio-command-status>svg{width:18px;height:18px;color:var(--muted);flex-shrink:0;margin-top:1px}
182
- .studio-command-status>div{min-width:0;flex:1}
183
- .studio-command-status p{margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.65}
184
- .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}
185
- .studio-command-context svg{width:13px;height:13px}
186
- .studio-command-completed{border-top:1px solid var(--line);margin-top:5px;padding-top:3px}
187
- .studio-command-history{display:flex;align-items:center;gap:9px;padding:8px 10px;color:var(--muted)}
188
- .studio-command-history>svg{width:14px;height:14px;flex-shrink:0}
189
- .studio-command-history>strong{font-size:11px;font-weight:400}
190
- .studio-command-menu [data-lifecycle-feedback]:not(:empty){white-space:pre-wrap;padding:10px;margin:4px;font-size:12px;line-height:1.7}
191
- .studio-command-menu [data-lifecycle-feedback]:empty{display:none}
192
168
  @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}}
193
169
  @media(max-width:760px){.studio-commands>button{min-height:44px}.studio-header>.studio-commands{right:14px;top:8px}}
194
170
  /* Agent liveness is separate from the browser's connection to the local server. */
@@ -337,3 +313,113 @@
337
313
  .studio-creation-thread [id^=studio-cancel-]>.button{min-height:36px;padding:6px 0;border-color:transparent;background:transparent;color:var(--muted);font-size:12px}
338
314
  .studio-creation-thread [id^=studio-cancel-]>.button:hover{color:var(--text);text-decoration:underline;text-underline-offset:3px}
339
315
  @media(max-width:760px){.studio-creation .studio-creation-caption{padding:24px 20px 0}.studio-creation .studio-creation-caption h1{font-size:22px}.studio-creation .studio-creation-thread{padding:24px 20px}.studio-creation-thread [id^=studio-cancel-]>.button{min-height:44px}}
316
+
317
+ .studio-review{flex:none;max-height:40%;overflow:auto;border-bottom:1px solid var(--line);background:var(--surface)}
318
+ .studio-review>summary{padding:10px 18px;font-size:12px;cursor:pointer;color:var(--accent-text);font-weight:600}
319
+ .studio-review>summary svg{width:14px;height:14px;vertical-align:middle;margin-right:8px}
320
+ .studio-review .inspector-section{padding:14px 18px}
321
+ .studio-review .section-title{font-size:12px}
322
+ .studio-canvas .document-discussion{padding-inline:0}
323
+ .workflow-step-actions{display:flex;flex-direction:column;align-items:flex-start;gap:10px;min-width:0}
324
+ .workflow-step-actions>.studio-action{width:100%;margin-top:0}
325
+ .workflow-step-actions .studio-action form{display:flex;align-items:flex-start;flex-direction:column;gap:8px}
326
+ .workflow-step-actions [data-lifecycle-feedback]:empty{display:none}
327
+ .workflow-step-actions [data-lifecycle-feedback]{max-width:100%;margin:0;padding:8px 10px;border-radius:var(--radius);font-size:12px;overflow-wrap:anywhere}
328
+ .workflow-step-actions>time{font-size:11px;color:var(--muted)}
329
+ .workflow-report{width:100%;border-block:1px solid var(--line);padding:10px 0}
330
+ .workflow-report-missing{font-size:12px;color:var(--text);background:var(--panel);padding:12px;border-radius:var(--radius)}
331
+ .workflow-step-actions>p{margin:0}
332
+ .topbar .requests-toggle[data-answer-needed=true]{background:var(--accent-soft);color:var(--accent-text);border-color:var(--accent-text)}
333
+
334
+ .workflow-step-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
335
+ .workflow-command-label{font:10px/1.6 'IBM Plex Mono',monospace;padding:2px 6px;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--muted);white-space:nowrap}
336
+ .studio-thread:empty{padding:0}
337
+ .studio-review .section-title,.studio-review .review-comment-overview,.studio-review .review-update-hint{display:none}
338
+ .studio-review .review-feedback-actions{margin:0 0 10px}
339
+ .studio-review .review-feedback-actions .button{min-height:30px;font-size:11px;padding:5px 10px;width:auto}
340
+ .studio-review .inspector-section{padding:8px 16px 12px}
341
+
342
+ .plan-publish{margin-top:14px;width:100%;font-size:12px;border-top:1px solid var(--line)}
343
+ .plan-publish>summary{display:flex;align-items:center;gap:8px;padding:12px 0;cursor:pointer;color:var(--text);list-style:none}
344
+ .plan-publish>summary>svg{width:15px;height:15px;color:var(--muted)}
345
+ .plan-publish>summary>svg:last-child{margin-left:4px;width:12px;height:12px}
346
+ .plan-publish[open]>summary>svg:last-child{transform:rotate(90deg)}
347
+ .plan-publish>summary>strong{font-weight:600}
348
+ .plan-publish>summary>span{margin-left:auto;color:var(--muted);font-size:10px}
349
+ .plan-publish-body{display:grid;gap:20px;padding:8px 0 16px}
350
+ .plan-files-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
351
+ .plan-files-heading h2{font-size:13px!important;margin:0!important;font-weight:600}
352
+ .plan-files-heading>span{color:var(--muted);font-size:11px}
353
+ .plan-file-list{list-style:none;padding:0;margin:0;max-height:240px;overflow:auto;border-block:1px solid var(--line)}
354
+ .plan-file-list>li{position:relative;margin:0}
355
+ .plan-file-list>li+li{border-top:1px solid var(--line)}
356
+ .plan-file-list>li>a,.plan-file-list>li>div{display:flex;align-items:center;gap:10px;min-height:41px;padding:8px 4px}
357
+ .plan-file-list>li>a:hover{background:var(--panel)}
358
+ .plan-file-list svg{width:15px;height:15px;color:var(--muted)}
359
+ .plan-file-list>li>a>svg:last-child{width:12px;height:12px;margin-left:auto}
360
+ .plan-file-copy{display:flex;align-items:baseline;gap:12px;min-width:0;flex:1}
361
+ .plan-file-copy strong{font-size:12px;font-weight:500;white-space:nowrap}
362
+ .plan-file-copy small{font-size:10px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
363
+ .plan-file-ignored{display:block;margin:-4px 0 7px 29px;font-size:10px;color:var(--muted)}
364
+ .plan-files-empty{margin:8px 0 0;color:var(--muted);font-size:12px;line-height:1.7}
365
+ .plan-message-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
366
+ .plan-message-heading label{font-size:13px;font-weight:600}
367
+ .plan-message-heading form{display:flex;flex-direction:column;align-items:flex-end}
368
+ .plan-generate-message{gap:6px;min-height:30px;padding:5px 9px;font-size:11px;background:var(--surface)}
369
+ .plan-generate-message svg{width:13px;height:13px}
370
+ .plan-publish #plan-publish-form{display:grid;gap:8px;margin-top:-10px}
371
+ .plan-publish textarea{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--text);font-family:inherit;font-size:13px;line-height:1.6;resize:vertical;min-height:80px;max-height:180px}
372
+ .plan-publish textarea:read-only{color:var(--muted);background:var(--panel)}
373
+ .plan-message-help,.plan-generation-note{margin:0;color:var(--muted);font-size:11px;line-height:1.65}
374
+ .plan-publish-actions{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:12px}
375
+ .plan-publish-actions>p{font-size:11px;line-height:1.65;color:var(--muted);margin:0;max-width:32ch}
376
+ .plan-publish-actions>.button{flex-shrink:0;gap:7px}
377
+ .plan-publish-actions>.button svg{width:14px;height:14px}
378
+ .plan-git-details{border-top:1px solid var(--line);padding-top:12px;font-size:11px;color:var(--muted)}
379
+ .plan-git-details>summary{cursor:pointer}
380
+ .plan-git-details p{font-size:11px!important;line-height:1.7;margin:8px 0 0;overflow-wrap:anywhere}
381
+ .plan-git-warning,.plan-git-unavailable{padding:12px 14px;border-radius:var(--radius);background:#fff4df;color:#805000;font-size:12px;line-height:1.6}
382
+ .plan-git-warning p,.plan-git-unavailable p{margin:4px 0 0;font-size:11px}
383
+ .plan-git-unavailable h2{font-size:14px;margin:0}
384
+ [data-theme=dark] .plan-git-warning,[data-theme=dark] .plan-git-unavailable{background:#413522;color:#f1cc85}
385
+ .plan-message-heading [data-lifecycle-feedback]:empty{display:none}
386
+ .plan-message-heading [data-lifecycle-feedback]:not(:empty){font-size:11px;max-width:280px;line-height:1.6;margin-top:5px}
387
+ @media(max-width:760px){.plan-file-copy{display:grid;gap:1px}.plan-file-copy strong{white-space:normal}.plan-file-copy small{white-space:normal;overflow-wrap:anywhere}.plan-publish-actions{align-items:flex-start;flex-direction:column}.plan-publish-actions>.button{width:100%;justify-content:center}.plan-file-list>li>a{min-height:44px}}
388
+
389
+ .studio-send-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
390
+ .studio-send-actions .comment-image-add{border:0;background:transparent;min-height:32px;padding:6px;color:var(--muted)}
391
+ .studio-send-actions .comment-image-add>span{display:none}
392
+ .studio-send-actions .comment-image-add svg{width:17px;height:17px}
393
+ .studio-message-box>[data-comment-images]:not(:empty){padding:0 12px 8px}
394
+ .studio-message-box>[data-composer-feedback]:not(:empty){padding:0 12px 8px;font-size:11px;color:var(--muted)}
395
+ .studio[data-conversation-expanded=true]{--conversation-column:760px}
396
+ .studio[data-conversation-expanded=true] .studio-thread,.studio[data-conversation-expanded=true] .studio-composer{padding-inline:max(18px,calc((100% - var(--conversation-column))/2))}
397
+ .studio[data-conversation-expanded=true] .studio-composer{background:transparent;border-top:0}
398
+ .studio[data-conversation-expanded=true] .studio-send-actions .comment-image-add>span{display:inline}
399
+
400
+ .studio-message-box>.attachment-paste-hint{margin:0;padding:0 14px 6px;font-size:11px;color:var(--muted);line-height:1.5}
401
+
402
+ .badge.workflow-status-waiting{background:#fff2da;color:#805000}
403
+ [data-theme=dark] .badge.workflow-status-waiting{background:#413522;color:#f1cc85}
404
+ .badge.workflow-status-error{background:var(--red-bg);color:var(--red)}
405
+
406
+
407
+ .studio-plan-ready{width:100%;max-width:640px;margin:18px auto 36px;padding:0}
408
+ .studio-plan-ready>h1{margin:0 0 12px;font-size:28px;line-height:1.25;letter-spacing:-.02em}
409
+ .studio-plan-ready>p{margin:0 0 24px;font-size:14px;line-height:1.75;color:var(--muted)}
410
+ .studio-plan-ready .plan-publish{margin:0;border:0}
411
+ #plan-push-dialog{width:460px}
412
+ #plan-push-dialog [hidden]{display:none}
413
+ .plan-push-facts{display:grid;gap:14px;margin:20px 0}
414
+ .plan-push-facts>div{display:grid;gap:5px}
415
+ .plan-push-facts dt{color:var(--muted);font-size:11px}
416
+ .plan-push-facts dd{margin:0;font-size:13px;line-height:1.6;overflow-wrap:anywhere;white-space:pre-wrap}
417
+ #plan-push-dialog details{font-size:12px}
418
+ #plan-push-dialog details summary{cursor:pointer}
419
+ #plan-push-dialog ul{max-height:150px;overflow:auto;padding-left:18px;overflow-wrap:anywhere;font-size:11px;line-height:1.7}
420
+ #plan-push-dialog .dialog-actions{flex-wrap:wrap}
421
+
422
+ .plan-published{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:var(--radius);background:var(--green-bg);color:var(--green)}
423
+ .plan-published>svg{width:18px;height:18px;margin-top:1px}
424
+ .plan-published strong{font-size:13px}
425
+ .plan-published p{font-size:12px;line-height:1.6;margin:3px 0 0}