Skip to content

Commit a8c6c30

Browse files
authored
fixes checkpoints hover opacity, better language (microsoft#256147)
* various checkpoint feedback fixes :) * some cleanup
1 parent 816021c commit a8c6c30

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatClearActions.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export function registerNewChatActions() {
163163
constructor() {
164164
super({
165165
id: 'workbench.action.chat.redoEdit',
166-
title: localize2('chat.redoEdit.label', "Redo Checkpoint Restore"),
166+
title: localize2('chat.redoEdit.label', "Redo Last Request"),
167167
category: CHAT_CATEGORY,
168168
icon: Codicon.redo,
169169
precondition: ContextKeyExpr.and(ChatContextKeys.chatEditingCanRedo, ChatContextKeys.enabled),
@@ -185,11 +185,12 @@ export function registerNewChatActions() {
185185
}
186186
});
187187

188-
registerAction2(class RedoChatEditInteractionAction2 extends EditingSessionAction {
188+
registerAction2(class RedoChatCheckpoints extends EditingSessionAction {
189189
constructor() {
190190
super({
191191
id: 'workbench.action.chat.redoEdit2',
192-
title: localize2('chat.redoEdit.label2', "Redo Checkpoint Restore"),
192+
title: localize2('chat.redoEdit.label2', "Redo"),
193+
tooltip: localize2('chat.redoEdit.tooltip', "Reapply discarded workspace changes and chat"),
193194
category: CHAT_CATEGORY,
194195
precondition: ContextKeyExpr.and(ChatContextKeys.chatEditingCanRedo, ChatContextKeys.enabled),
195196
f1: true,

src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ registerAction2(class RestoreCheckpointAction extends Action2 {
429429
constructor() {
430430
super({
431431
id: 'workbench.action.chat.restoreCheckpoint',
432-
title: localize2('chat.restoreCheckpoint.label', "Restore Checkpoint"),
433-
tooltip: localize2('chat.restoreCheckpoint.tooltip', "Restore Checkpoint"),
432+
title: localize2('chat.restoreCheckpoint.label', "Restore checkpoint"),
433+
tooltip: localize2('chat.restoreCheckpoint.tooltip', "Restores workspace and chat to this point"),
434434
f1: false,
435435
category: CHAT_CATEGORY,
436436
keybinding: {
@@ -464,6 +464,11 @@ registerAction2(class RestoreCheckpointAction extends Action2 {
464464
return;
465465
}
466466

467+
if (isRequestVM(item)) {
468+
widget?.focusInput();
469+
widget?.input.setValue(item.messageText, false);
470+
}
471+
467472
widget?.viewModel?.model.setCheckpoint(item.id);
468473
await restoreSnapshotWithConfirmation(accessor, item);
469474
}

src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
419419
const checkpointRestoreContainer = dom.append(rowContainer, $('.checkpoint-restore-container'));
420420
const codiconRestoreContainer = dom.append(checkpointRestoreContainer, $('.codicon-container'));
421421
dom.append(codiconRestoreContainer, $('span.codicon.codicon-bookmark'));
422+
const label = dom.append(checkpointRestoreContainer, $('span.checkpoint-label-text'));
423+
label.textContent = localize('checkpointRestore', 'Checkpoint restored');
422424
const checkpointRestoreToolbar = templateDisposables.add(scopedInstantiationService.createInstance(MenuWorkbenchToolBar, checkpointRestoreContainer, MenuId.ChatMessageRestoreCheckpoint, {
423425
actionViewItemProvider: (action, options) => {
424426
if (action instanceof MenuItemAction) {

src/vs/workbench/contrib/chat/browser/media/chat.css

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,6 @@ have to be updated for changes to the rules above, or to support more deeply nes
18701870

18711871
.interactive-item-container.interactive-request {
18721872
align-items: flex-end;
1873-
padding-bottom: 0px;
18741873
}
18751874

18761875
.interactive-item-container.interactive-request:not(.editing):hover .request-hover {
@@ -1983,6 +1982,7 @@ have to be updated for changes to the rules above, or to support more deeply nes
19831982
.checkpoint-restore-container {
19841983
display: flex;
19851984
width: 100%;
1985+
position: relative;
19861986

19871987
.checkpoint-divider {
19881988
border-top: 1px dashed var(--vscode-editorWidget-border);
@@ -2005,22 +2005,38 @@ have to be updated for changes to the rules above, or to support more deeply nes
20052005
}
20062006

20072007
.monaco-toolbar {
2008-
user-select: none;
20092008
opacity: 0;
2010-
width: 0;
2009+
height: fit-content;
2010+
width: fit-content;
2011+
user-select: none;
2012+
position: absolute;
2013+
top: 5px;
2014+
left: 25px;
2015+
background: var(--vscode-sideBar-background);
20112016
}
20122017

20132018
.monaco-toolbar .action-label {
20142019
border: 1px solid var(--vscode-chat-requestBorder, var(--vscode-input-background));
20152020
padding: 1px 5px;
20162021
background-color: var(--vscode-sideBar-background);
2017-
margin-top: 5px;
2018-
margin-left: 10px;
20192022
}
20202023
}
20212024

20222025
.checkpoint-restore-container {
20232026
margin-top: 10px;
2027+
2028+
.checkpoint-label-text {
2029+
font-size: 12px;
2030+
color: var(--vscode-descriptionForeground);
2031+
padding-right: 4px;
2032+
display: flex;
2033+
align-items: center;
2034+
gap: 4px;
2035+
}
2036+
2037+
.monaco-toolbar {
2038+
left: 145px;
2039+
}
20242040
}
20252041

20262042
.checkpoint-container .monaco-toolbar:focus-within,

0 commit comments

Comments
 (0)