Skip to content

Commit b09c5e0

Browse files
committed
Refactor the Checkpoints QuickPick implementation to conditionally show the "Edit Description" button only for user-created checkpoints
1 parent bd6a911 commit b09c5e0

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎packages/ui/src/components/editor/panel/Dropdown/Dropdown.module.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
font-size: var(--font-size-11px);
3636
color: var(--vscode-descriptionForeground);
3737
white-space: nowrap;
38+
padding-left: var(--padding-3px);
3839
}
3940

4041
&__icon {

‎packages/vscode/src/commands/checkpoints-command/checkpoints-command.ts‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const checkpoints_command = (
6767
const quick_pick = vscode.window.createQuickPick<
6868
vscode.QuickPickItem & { id?: string; checkpoint?: Checkpoint }
6969
>()
70+
quick_pick.title = 'Checkpoints'
7071
quick_pick.placeholder =
7172
'Select a checkpoint to restore or add a new one'
7273

@@ -154,10 +155,14 @@ export const checkpoints_command = (
154155
),
155156
tooltip: c.starred ? 'Unstar' : 'Star'
156157
},
157-
{
158-
iconPath: new vscode.ThemeIcon('edit'),
159-
tooltip: 'Edit Description'
160-
},
158+
...(c.title == 'Created by user'
159+
? [
160+
{
161+
iconPath: new vscode.ThemeIcon('edit'),
162+
tooltip: 'Edit Description'
163+
}
164+
]
165+
: []),
161166
{
162167
iconPath: new vscode.ThemeIcon('trash'),
163168
tooltip: 'Delete'

0 commit comments

Comments
 (0)