Skip to content

Commit 3d69200

Browse files
committed
Merge branch 'feat/vscode-undo'
2 parents ad3a937 + c0ec3ae commit 3d69200

11 files changed

Lines changed: 919 additions & 40 deletions

File tree

‎packages/vscode-ide-companion/resources/prompt-attachments.js‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
throw new Error("Prompt attachment manager requires promptInput, inputWrap, and toolsLine.");
4949
}
5050

51+
const resolveImageUrl = options.resolveImageUrl || ((url) => url);
5152
let attachments = [];
5253
let nextAttachmentId = 0;
5354
let previewPopup = null;
@@ -111,7 +112,7 @@
111112

112113
ensurePreviewPopup();
113114
previewAnchor = anchor;
114-
previewImage.src = attachment.dataUrl;
115+
previewImage.src = resolveImageUrl(attachment.dataUrl);
115116
previewPopup.classList.add("show");
116117
updatePreviewPosition(anchor);
117118
}
@@ -169,7 +170,7 @@
169170

170171
const pill = createElement("div", "chat-attached-context-pill");
171172
const image = createElement("img", "chat-attached-context-pill-image");
172-
image.src = attachment.dataUrl;
173+
image.src = resolveImageUrl(attachment.dataUrl);
173174
image.alt = ATTACHMENT_LABEL;
174175
pill.appendChild(image);
175176

@@ -280,6 +281,10 @@
280281

281282
return {
282283
clear,
284+
setImageUrls(urls) {
285+
clear();
286+
for (const url of urls || []) addAttachmentData({ dataUrl: url });
287+
},
283288
hasAttachments() {
284289
return attachments.length > 0;
285290
},

‎packages/vscode-ide-companion/resources/webview.css‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,3 +1765,36 @@ textarea::placeholder {
17651765
.diff-line.removed .diff-line-content {
17661766
color: var(--vscode-gitDecoration-deletedResourceForeground, #f85149);
17671767
}
1768+
1769+
#undoDialog {
1770+
color: var(--vscode-foreground);
1771+
background: var(--vscode-editor-background);
1772+
border: 1px solid var(--vscode-widget-border, #666);
1773+
border-radius: 6px;
1774+
width: min(500px, calc(100% - 40px));
1775+
max-height: 75vh;
1776+
padding: 14px;
1777+
}
1778+
#undoDialog::backdrop { background: #0006; }
1779+
.undo-heading, .queue-message, .queue-edit-bar { display: flex; align-items: center; gap: 8px; }
1780+
.undo-heading { justify-content: space-between; margin-bottom: 12px; }
1781+
#undoBody { overflow-y: auto; max-height: 60vh; }
1782+
#undoBody button { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 8px; }
1783+
#undoBody small { display: block; opacity: .7; margin-top: 4px; }
1784+
#undoDialog button, .queue-list button, .queue-edit-bar button {
1785+
color: var(--vscode-foreground);
1786+
background: var(--vscode-button-secondaryBackground);
1787+
border: 1px solid transparent;
1788+
border-radius: 3px;
1789+
cursor: pointer;
1790+
}
1791+
#undoDialog button:focus-visible, .queue-list button:focus-visible, .queue-edit-bar button:focus-visible {
1792+
outline: 1px solid var(--vscode-focusBorder);
1793+
}
1794+
#undoDialog button:disabled, .queue-list button:disabled { opacity: .5; cursor: default; }
1795+
.queue-list { max-height: 140px; overflow-y: auto; padding: 8px 0; }
1796+
.queue-message { margin-top: 6px; }
1797+
.queue-message span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1798+
.queue-edit-bar { padding: 6px 0; }
1799+
.queue-edit-bar[hidden] { display: none; }
1800+
.message-image { display: block; max-width: 100%; max-height: 160px; margin-top: 6px; }

0 commit comments

Comments
 (0)