Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
import { CustomIcon } from '../CustomIcon'
|
2024-03-06 02:42:27 +11:00
|
|
|
import React, { useState } from 'react'
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
import { ActionButton } from '../ActionButton'
|
|
|
|
import { Selections, getSelectionTypeDisplayText } from 'lib/selections'
|
|
|
|
import { useHotkeys } from 'react-hotkeys-hook'
|
2024-02-23 11:24:22 -05:00
|
|
|
import { KclCommandValue, KclExpressionWithVariable } from 'lib/commandTypes'
|
|
|
|
import Tooltip from 'components/Tooltip'
|
|
|
|
import { roundOff } from 'lib/utils'
|
2025-01-23 10:25:21 -05:00
|
|
|
import { commandBarActor, useCommandBarState } from 'machines/commandBarMachine'
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
|
|
|
|
function CommandBarHeader({ children }: React.PropsWithChildren<{}>) {
|
2025-01-23 10:25:21 -05:00
|
|
|
const commandBarState = useCommandBarState()
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
const {
|
|
|
|
context: { selectedCommand, currentArgument, argumentsToSubmit },
|
|
|
|
} = commandBarState
|
|
|
|
const isReviewing = commandBarState.matches('Review')
|
|
|
|
const [showShortcuts, setShowShortcuts] = useState(false)
|
|
|
|
|
|
|
|
useHotkeys(
|
|
|
|
'alt',
|
|
|
|
() => setShowShortcuts(true),
|
|
|
|
{ enableOnFormTags: true, enableOnContentEditable: true },
|
|
|
|
[showShortcuts]
|
|
|
|
)
|
|
|
|
useHotkeys(
|
|
|
|
'alt',
|
|
|
|
() => setShowShortcuts(false),
|
|
|
|
{ keyup: true, enableOnFormTags: true, enableOnContentEditable: true },
|
|
|
|
[showShortcuts]
|
|
|
|
)
|
|
|
|
useHotkeys(
|
|
|
|
[
|
|
|
|
'alt+1',
|
|
|
|
'alt+2',
|
|
|
|
'alt+3',
|
|
|
|
'alt+4',
|
|
|
|
'alt+5',
|
|
|
|
'alt+6',
|
|
|
|
'alt+7',
|
|
|
|
'alt+8',
|
|
|
|
'alt+9',
|
|
|
|
'alt+0',
|
|
|
|
],
|
|
|
|
(_, b) => {
|
|
|
|
if (b.keys && !Number.isNaN(parseInt(b.keys[0], 10))) {
|
|
|
|
if (!selectedCommand?.args) return
|
|
|
|
const argName = Object.keys(selectedCommand.args)[
|
|
|
|
parseInt(b.keys[0], 10) - 1
|
|
|
|
]
|
|
|
|
const arg = selectedCommand?.args[argName]
|
2024-02-23 11:24:22 -05:00
|
|
|
if (!argName || !arg) return
|
2025-01-23 10:25:21 -05:00
|
|
|
commandBarActor.send({
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
type: 'Change current argument',
|
|
|
|
data: { arg: { ...arg, name: argName } },
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ keyup: true, enableOnFormTags: true, enableOnContentEditable: true },
|
|
|
|
[argumentsToSubmit, selectedCommand]
|
|
|
|
)
|
|
|
|
|
|
|
|
return (
|
|
|
|
selectedCommand &&
|
|
|
|
argumentsToSubmit && (
|
|
|
|
<>
|
2024-02-23 11:24:22 -05:00
|
|
|
<div className="group px-4 text-sm flex gap-4 items-start">
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
<div className="flex flex-1 flex-wrap gap-2">
|
|
|
|
<p
|
|
|
|
data-command-name={selectedCommand?.name}
|
|
|
|
className="pr-4 flex gap-2 items-center"
|
|
|
|
>
|
|
|
|
{selectedCommand &&
|
|
|
|
'icon' in selectedCommand &&
|
|
|
|
selectedCommand.icon && (
|
|
|
|
<CustomIcon name={selectedCommand.icon} className="w-5 h-5" />
|
|
|
|
)}
|
2024-09-23 22:42:51 +10:00
|
|
|
<span data-testid="command-name">
|
|
|
|
{selectedCommand.displayName || selectedCommand.name}
|
|
|
|
</span>
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
</p>
|
2024-03-04 16:06:43 -05:00
|
|
|
{Object.entries(selectedCommand?.args || {})
|
|
|
|
.filter(([_, argConfig]) =>
|
|
|
|
typeof argConfig.required === 'function'
|
|
|
|
? argConfig.required(commandBarState.context)
|
|
|
|
: argConfig.required
|
|
|
|
)
|
|
|
|
.map(([argName, arg], i) => {
|
|
|
|
const argValue =
|
|
|
|
(typeof argumentsToSubmit[argName] === 'function'
|
|
|
|
? (argumentsToSubmit[argName] as Function)(
|
|
|
|
commandBarState.context
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
)
|
2024-03-04 16:06:43 -05:00
|
|
|
: argumentsToSubmit[argName]) || ''
|
|
|
|
|
|
|
|
return (
|
|
|
|
<button
|
2024-09-23 22:42:51 +10:00
|
|
|
data-testid="cmd-bar-input-tab"
|
|
|
|
data-is-current-arg={
|
|
|
|
argName === currentArgument?.name ? 'true' : 'false'
|
|
|
|
}
|
2024-03-04 16:06:43 -05:00
|
|
|
disabled={!isReviewing && currentArgument?.name === argName}
|
|
|
|
onClick={() => {
|
2025-01-23 10:25:21 -05:00
|
|
|
commandBarActor.send({
|
2024-03-04 16:06:43 -05:00
|
|
|
type: isReviewing
|
|
|
|
? 'Edit argument'
|
|
|
|
: 'Change current argument',
|
|
|
|
data: { arg: { ...arg, name: argName } },
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
key={argName}
|
|
|
|
className={`relative w-fit px-2 py-1 rounded-sm flex gap-2 items-center border ${
|
|
|
|
argName === currentArgument?.name
|
2024-04-05 00:59:02 -04:00
|
|
|
? 'disabled:bg-primary/10 dark:disabled:bg-primary/20 disabled:border-primary dark:disabled:border-primary disabled:text-chalkboard-100 dark:disabled:text-chalkboard-10'
|
2024-03-04 16:06:43 -05:00
|
|
|
: 'bg-chalkboard-20/50 dark:bg-chalkboard-80/50 border-chalkboard-20 dark:border-chalkboard-80'
|
|
|
|
}`}
|
|
|
|
>
|
2024-03-06 02:42:27 +11:00
|
|
|
<span
|
|
|
|
data-testid={`arg-name-${argName.toLowerCase()}`}
|
2024-09-23 22:42:51 +10:00
|
|
|
data-test-name="arg-name"
|
2024-03-06 02:42:27 +11:00
|
|
|
className="capitalize"
|
|
|
|
>
|
|
|
|
{argName}
|
|
|
|
</span>
|
2024-07-14 18:15:34 -04:00
|
|
|
<span className="sr-only">: </span>
|
2024-09-23 22:42:51 +10:00
|
|
|
<span data-testid="header-arg-value">
|
|
|
|
{argValue ? (
|
|
|
|
arg.inputType === 'selection' ? (
|
|
|
|
getSelectionTypeDisplayText(argValue as Selections)
|
|
|
|
) : arg.inputType === 'kcl' ? (
|
|
|
|
roundOff(
|
|
|
|
Number(
|
|
|
|
(argValue as KclCommandValue).valueCalculated
|
|
|
|
),
|
|
|
|
4
|
|
|
|
)
|
|
|
|
) : typeof argValue === 'object' ? (
|
|
|
|
arg.valueSummary ? (
|
|
|
|
arg.valueSummary(argValue)
|
|
|
|
) : (
|
|
|
|
JSON.stringify(argValue)
|
|
|
|
)
|
2024-08-04 00:51:30 -04:00
|
|
|
) : (
|
2024-09-23 14:35:38 -04:00
|
|
|
<em>
|
|
|
|
{arg.valueSummary
|
|
|
|
? arg.valueSummary(argValue)
|
|
|
|
: argValue}
|
|
|
|
</em>
|
2024-08-04 00:51:30 -04:00
|
|
|
)
|
2024-09-23 22:42:51 +10:00
|
|
|
) : null}
|
|
|
|
</span>
|
2024-03-04 16:06:43 -05:00
|
|
|
{showShortcuts && (
|
2024-04-05 00:59:02 -04:00
|
|
|
<small className="absolute -top-[1px] right-full translate-x-1/2 px-0.5 rounded-sm bg-chalkboard-80 text-chalkboard-10 dark:bg-primary dark:text-chalkboard-100">
|
2024-03-04 16:06:43 -05:00
|
|
|
<span className="sr-only">Hotkey: </span>
|
|
|
|
{i + 1}
|
|
|
|
</small>
|
2024-02-23 11:24:22 -05:00
|
|
|
)}
|
2024-03-04 16:06:43 -05:00
|
|
|
{arg.inputType === 'kcl' &&
|
|
|
|
!!argValue &&
|
|
|
|
'variableName' in (argValue as KclCommandValue) && (
|
|
|
|
<>
|
|
|
|
<CustomIcon
|
|
|
|
name="make-variable"
|
|
|
|
className="w-4 h-4"
|
|
|
|
/>
|
2024-04-19 10:50:58 -04:00
|
|
|
<Tooltip position="bottom">
|
2024-03-04 16:06:43 -05:00
|
|
|
New variable:{' '}
|
|
|
|
{
|
|
|
|
(
|
|
|
|
argumentsToSubmit[
|
|
|
|
argName
|
|
|
|
] as KclExpressionWithVariable
|
|
|
|
).variableName
|
|
|
|
}
|
|
|
|
</Tooltip>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
</button>
|
|
|
|
)
|
|
|
|
})}
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
</div>
|
|
|
|
{isReviewing ? <ReviewingButton /> : <GatheringArgsButton />}
|
|
|
|
</div>
|
|
|
|
<div className="block w-full my-2 h-[1px] bg-chalkboard-20 dark:bg-chalkboard-80" />
|
|
|
|
{children}
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
function ReviewingButton() {
|
|
|
|
return (
|
|
|
|
<ActionButton
|
|
|
|
Element="button"
|
|
|
|
autoFocus
|
|
|
|
type="submit"
|
|
|
|
form="review-form"
|
2025-01-02 16:10:07 -05:00
|
|
|
className="w-fit !p-0 rounded-sm hover:shadow"
|
2024-05-10 19:02:11 -04:00
|
|
|
iconStart={{
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
icon: 'checkmark',
|
2024-04-05 00:59:02 -04:00
|
|
|
bgClassName: 'p-1 rounded-sm !bg-primary hover:brightness-110',
|
|
|
|
iconClassName: '!text-chalkboard-10',
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
<span className="sr-only">Submit command</span>
|
|
|
|
</ActionButton>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
function GatheringArgsButton() {
|
|
|
|
return (
|
|
|
|
<ActionButton
|
|
|
|
Element="button"
|
|
|
|
type="submit"
|
|
|
|
form="arg-form"
|
2025-01-02 16:10:07 -05:00
|
|
|
className="w-fit !p-0 rounded-sm hover:shadow"
|
2024-05-10 19:02:11 -04:00
|
|
|
iconStart={{
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
icon: 'arrowRight',
|
2024-04-05 00:59:02 -04:00
|
|
|
bgClassName: 'p-1 rounded-sm !bg-primary hover:brightness-110',
|
|
|
|
iconClassName: '!text-chalkboard-10',
|
Command bar: add extrude command, nonlinear editing, etc (#1204)
* Tweak toaster look and feel
* Add icons, tweak plus icon names
* Rename commandBarMeta to commandBarConfig
* Refactor command bar, add support for icons
* Create a tailwind plugin for aria-pressed button state
* Remove overlay from behind command bar
* Clean up toolbar
* Button and other style tweaks
* Icon tweaks follow-up: make old icons work with new sizing
* Delete unused static icons
* More CSS tweaks
* Small CSS tweak to project sidebar
* Add command bar E2E test
* fumpt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fix typo in a comment
* Fix icon padding (built version only)
* Update onboarding and warning banner icons padding
* Misc minor style fixes
* Get Extrude opening and canceling from command bar
* Iconography tweaks
* Get extrude kind of working
* Refactor command bar config types and organization
* Move command bar configs to be co-located with each other
* Start building a state machine for the command bar
* Start converting command bar to state machine
* Add support for multiple args, confirmation step
* Submission behavior, hotkeys, code organization
* Add new test for extruding from command bar
* Polish step back and selection hotkeys, CSS tweaks
* Loading style tweaks
* Validate selection inputs, polish UX of args re-editing
* Prevent submission with multiple selection on singlular arg
* Remove stray console logs
* Tweak test, CSS nit, remove extrude "result" argument
* Fix linting warnings
* Show Ctrl+/ instead of ⌘K on all platforms but Mac
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add "Enter sketch" to command bar
* fix command bar test
* Fix flaky cmd bar extrude test by waiting for engine select response
* Cover both button labels '⌘K' and 'Ctrl+/' in test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 12:49:01 -05:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
<span className="sr-only">Continue</span>
|
|
|
|
</ActionButton>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default CommandBarHeader
|