| ... | @@ -3072,6 +3072,10 @@ function OpenCommandPaletteDialog(props: { | ... | @@ -3072,6 +3072,10 @@ function OpenCommandPaletteDialog(props: { |
| 3072 | ? "Create & Add" | 3072 | ? "Create & Add" |
| 3073 | : "Add"; | 3073 | : "Add"; |
| 3074 | const addShortcutLabel = hasHighlightedBrowseItem ? `${submitModifierLabel} Enter` : "Enter"; | 3074 | const addShortcutLabel = hasHighlightedBrowseItem ? `${submitModifierLabel} Enter` : "Enter"; |
| | 3075 | const hasHighlightedNewProjectItem = newProjectFlow !== null && highlightedItemValue !== null; |
| | 3076 | const createShortcutLabel = hasHighlightedNewProjectItem |
| | 3077 | ? `${submitModifierLabel} Enter` |
| | 3078 | : "Enter"; |
| 3075 | const remoteProjectButtonLabel = addProjectCloneFlow | 3079 | const remoteProjectButtonLabel = addProjectCloneFlow |
| 3076 | ? addProjectCloneFlow.source === "url" | 3080 | ? addProjectCloneFlow.source === "url" |
| 3077 | ? "Continue" | 3081 | ? "Continue" |
| ... | @@ -3165,15 +3169,17 @@ function OpenCommandPaletteDialog(props: { | ... | @@ -3165,15 +3169,17 @@ function OpenCommandPaletteDialog(props: { |
| 3165 | } | 3169 | } |
| 3166 | | 3170 | |
| 3167 | // Enter creates the project unless an item below the name is | 3171 | // Enter creates the project unless an item below the name is |
| 3168 | // highlighted, in which case it runs that item. | 3172 | // highlighted, in which case it runs that item. Mod+Enter always creates. |
| 3169 | if ( | 3173 | if ( |
| 3170 | newProjectFlow !== null && | 3174 | newProjectFlow !== null && |
| 3171 | event.key === "Enter" && | 3175 | event.key === "Enter" && |
| 3172 | highlightedItemValue === null && | 3176 | (!hasHighlightedNewProjectItem || isPrimaryModifierPressed(event)) && |
| 3173 | // Enter that confirms an IME composition is part of typing the name. | 3177 | // Enter that confirms an IME composition is part of typing the name. |
| 3174 | !event.nativeEvent.isComposing && | 3178 | !event.nativeEvent.isComposing && |
| 3175 | event.keyCode !== 229 | 3179 | event.keyCode !== 229 |
| 3176 | ) { | 3180 | ) { |
| | 3181 | // Base UI would otherwise also click the highlighted row. |
| | 3182 | (event as typeof event & { preventBaseUIHandler?: () => void }).preventBaseUIHandler?.(); |
| 3177 | event.preventDefault(); | 3183 | event.preventDefault(); |
| 3178 | void submitNewProject(); | 3184 | void submitNewProject(); |
| 3179 | return; | 3185 | return; |
| ... | @@ -3383,7 +3389,7 @@ function OpenCommandPaletteDialog(props: { | ... | @@ -3383,7 +3389,7 @@ function OpenCommandPaletteDialog(props: { |
| 3383 | size="xs" | 3389 | size="xs" |
| 3384 | tabIndex={-1} | 3390 | tabIndex={-1} |
| 3385 | className="absolute inset-e-2.5 top-1/2 -translate-y-1/2" | 3391 | className="absolute inset-e-2.5 top-1/2 -translate-y-1/2" |
| 3386 | aria-label="Create (Enter)" | 3392 | aria-label={`Create (${createShortcutLabel})`} |
| 3387 | disabled={!canSubmitNewProject} | 3393 | disabled={!canSubmitNewProject} |
| 3388 | onMouseDown={(event) => { | 3394 | onMouseDown={(event) => { |
| 3389 | event.preventDefault(); | 3395 | event.preventDefault(); |
| ... | @@ -3396,10 +3402,10 @@ function OpenCommandPaletteDialog(props: { | ... | @@ -3396,10 +3402,10 @@ function OpenCommandPaletteDialog(props: { |
| 3396 | > | 3402 | > |
| 3397 | <span>{isCreatingNewProject ? "Creating" : "Create"}</span> | 3403 | <span>{isCreatingNewProject ? "Creating" : "Create"}</span> |
| 3398 | <KbdGroup className="pointer-events-none -me-0.5"> | 3404 | <KbdGroup className="pointer-events-none -me-0.5"> |
| 3399 | <Kbd>Enter</Kbd> | 3405 | <Kbd>{createShortcutLabel}</Kbd> |
| 3400 | </KbdGroup> | 3406 | </KbdGroup> |
| 3401 | </TooltipTrigger> | 3407 | </TooltipTrigger> |
| 3402 | <TooltipPopup side="top">Create (Enter)</TooltipPopup> | 3408 | <TooltipPopup side="top">{`Create (${createShortcutLabel})`}</TooltipPopup> |
| 3403 | </Tooltip> | 3409 | </Tooltip> |
| 3404 | ) : addProjectCloneFlow?.step === "repository" ? ( | 3410 | ) : addProjectCloneFlow?.step === "repository" ? ( |
| 3405 | <Tooltip> | 3411 | <Tooltip> |
| ... | @@ -3512,8 +3518,9 @@ function OpenCommandPaletteDialog(props: { | ... | @@ -3512,8 +3518,9 @@ function OpenCommandPaletteDialog(props: { |
| 3512 | inputProps={{ | 3518 | inputProps={{ |
| 3513 | // The submit button is absolutely positioned over the field, so the | 3519 | // The submit button is absolutely positioned over the field, so the |
| 3514 | // inner input must reserve enough room for the full action label. | 3520 | // inner input must reserve enough room for the full action label. |
| 3515 | className: | 3521 | className: hasHighlightedNewProjectItem |
| 3516 | addProjectCloneFlow?.step === "repository" || newProjectFlow !== null | 3522 | ? "*:data-[slot=autocomplete-input]:pe-38!" |
| | 3523 | : addProjectCloneFlow?.step === "repository" || newProjectFlow !== null |
| 3517 | ? "*:data-[slot=autocomplete-input]:pe-32!" | 3524 | ? "*:data-[slot=autocomplete-input]:pe-32!" |
| 3518 | : isBrowsing | 3525 | : isBrowsing |
| 3519 | ? browseInputEndPaddingClass({ | 3526 | ? browseInputEndPaddingClass({ |