Making the editor toolbar sparkle icon appear on focus of the editor and when the inline chat is not visible yet (#198458)

changed the condition for the sparkle to appear
This commit is contained in:
Aiday Marlen Kyzy
2023-11-17 11:39:09 +01:00
committed by GitHub
parent 7b9833be69
commit edc4698236

View File

@@ -43,7 +43,7 @@ export class StartSessionAction extends EditorAction2 {
title: { value: LOCALIZED_START_INLINE_CHAT_STRING, original: 'Start Inline Chat' },
category: AbstractInlineChatAction.category,
f1: true,
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_HAS_PROVIDER, EditorContextKeys.writable),
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_HAS_PROVIDER, CTX_INLINE_CHAT_VISIBLE.toNegated(), EditorContextKeys.focus),
keybinding: {
weight: KeybindingWeight.WorkbenchContrib,
primary: KeyMod.CtrlCmd | KeyCode.KeyI,
@@ -52,7 +52,7 @@ export class StartSessionAction extends EditorAction2 {
icon: START_INLINE_CHAT,
menu: [{
id: MenuId.EditorTitle,
when: ContextKeyExpr.and(CTX_INLINE_CHAT_HAS_PROVIDER, EditorContextKeys.writable),
when: ContextKeyExpr.and(CTX_INLINE_CHAT_HAS_PROVIDER, CTX_INLINE_CHAT_VISIBLE.toNegated(), EditorContextKeys.focus),
group: 'navigation',
order: -1000000, // at the very front
}],