Skip to content

Commit 40cf504

Browse files
authored
More Redo/Undo and Reload button tweaks (#9013)
1 parent 3e2a463 commit 40cf504

File tree

8 files changed

+27
-35
lines changed

8 files changed

+27
-35
lines changed

src/components/CustomIcon.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,21 @@ const CustomIconMap = Object.freeze({
7676
/>
7777
</svg>
7878
),
79+
arrowRotateFullRight: (
80+
<svg
81+
viewBox="0 0 20 20"
82+
fill="none"
83+
xmlns="http://www.w3.org/2000/svg"
84+
aria-label="arrow rotate right"
85+
>
86+
<path
87+
fillRule="evenodd"
88+
clipRule="evenodd"
89+
d="M11.6777 4.76126C10.4784 4.37716 9.18277 4.41676 8.00879 4.87259C6.83489 5.32851 5.85238 6.1743 5.22656 7.26712C4.601 8.35996 4.3693 9.63537 4.57031 10.8784C4.77154 12.1216 5.39368 13.2583 6.33203 14.0982C7.27064 14.9381 8.46951 15.4303 9.72754 15.4927C10.9855 15.5551 12.227 15.1838 13.2441 14.4409L12.9492 14.0376L12.6543 13.6333C11.8222 14.2411 10.8065 14.5447 9.77734 14.4937C8.74807 14.4426 7.76697 14.0403 6.99902 13.3531C6.23119 12.6658 5.7222 11.7355 5.55762 10.7183C5.39315 9.7011 5.58273 8.65743 6.09473 7.76321C6.60681 6.86915 7.41062 6.17719 8.37109 5.80423C9.33165 5.43132 10.3918 5.40006 11.373 5.71439C12.3541 6.02873 13.1977 6.67039 13.7627 7.53177C14.206 8.20787 14.4562 8.98795 14.4941 9.78763L12.8535 8.147L12.1465 8.85403L14.9707 11.6783L15.3252 11.3326L17.8496 8.85794L17.1504 8.1431L15.4941 9.76517C15.452 8.77931 15.1459 7.81717 14.5996 6.98392C13.9089 5.93074 12.8771 5.14549 11.6777 4.76126Z"
90+
fill="currentColor"
91+
/>
92+
</svg>
93+
),
7994
arrowRotateLeft: (
8095
<svg
8196
viewBox="0 0 20 20"
@@ -106,18 +121,18 @@ const CustomIconMap = Object.freeze({
106121
/>
107122
</svg>
108123
),
109-
arrowShortLeft: (
124+
arrowTurnLeft: (
110125
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
111126
<path
112-
d="M10.8535 4.85349L6.20697 9.49997H14.9999V10.5H6.20697L10.8535 15.1465L10.1464 15.8535L4.29291 9.99997L10.1464 4.14645L10.8535 4.85349Z"
127+
d="M8.56055 6.85349L5.91406 9.49997H12.207C14.4162 9.49997 16.207 11.2908 16.207 13.5H15.207C15.207 11.8431 13.8639 10.5 12.207 10.5H5.91406L8.56055 13.1465L7.85352 13.8535L4 9.99997L7.85352 6.14645L8.56055 6.85349Z"
113128
fill="currentColor"
114129
/>
115130
</svg>
116131
),
117-
arrowShortRight: (
132+
arrowTurnRight: (
118133
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
119134
<path
120-
d="M15.7071 9.99997L9.85358 15.8535L9.14655 15.1465L13.793 10.5H5.00006V9.49997H13.793L9.14655 4.85349L9.85358 4.14645L15.7071 9.99997Z"
135+
d="M16.4141 9.99997L12.5605 13.8535L11.8535 13.1465L14.5 10.5H8.20703C6.55022 10.5 5.20705 11.8432 5.20703 13.5H4.20703C4.20705 11.2909 5.99794 9.50001 8.20703 9.49997H14.5L11.8535 6.85349L12.5605 6.14645L16.4141 9.99997Z"
121136
fill="currentColor"
122137
/>
123138
</svg>

src/components/UndoRedoButtons.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ export function UndoRedoButtons({
1717
<UndoOrRedoButton
1818
label="Undo"
1919
keyboardShortcut="mod+z"
20-
iconName="arrowShortLeft"
20+
iconName="arrowTurnLeft"
2121
onClick={() => editorManager.undo()}
2222
className="rounded-r-none"
2323
disabled={undoDepth(editorManager.editorState) === 0}
2424
/>
2525
<UndoOrRedoButton
2626
label="Redo"
2727
keyboardShortcut="mod+shift+z"
28-
iconName="arrowShortRight"
28+
iconName="arrowTurnRight"
2929
onClick={() => editorManager.redo()}
3030
className="rounded-none"
3131
disabled={redoDepth(editorManager.editorState) === 0}
3232
/>
3333
{/** TODO: Remove the refresh button when users don't need it so much. */}
3434
<UndoOrRedoButton
35-
label="Refresh"
36-
iconName="arrowRotateRight"
35+
label="Reload"
36+
iconName="arrowRotateFullRight"
3737
onClick={() => {
3838
refreshPage('Top app bar').catch(reportRejection)
3939
}}
@@ -47,7 +47,7 @@ export function UndoRedoButtons({
4747
interface UndoOrRedoButtonProps extends HTMLProps<HTMLButtonElement> {
4848
label: string
4949
onClick: MouseEventHandler
50-
iconName: 'arrowShortRight' | 'arrowShortLeft' | 'arrowRotateRight'
50+
iconName: 'arrowTurnRight' | 'arrowTurnLeft' | 'arrowRotateFullRight'
5151
keyboardShortcut?: string
5252
disabled: boolean
5353
}

src/lib/commandBarConfigs/authCommandConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function createAuthCommands({
2121
{
2222
groupId: ACTOR_IDS.AUTH,
2323
name: 'refresh',
24-
displayName: 'Refresh app',
24+
displayName: 'Reload app',
2525
description: 'Force the scene, features, and editor to reload.',
2626
icon: 'exclamationMark',
2727
needsReview: false,

src/lib/layout/configs/playwright.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ export const playwrightLayoutConfig: Layout = {
101101
icon: 'printer3d',
102102
actionType: ActionType.Make,
103103
},
104-
{
105-
id: 'refresh',
106-
label: 'Refresh app',
107-
icon: 'exclamationMark',
108-
actionType: ActionType.Refresh,
109-
},
110104
],
111105
},
112106
{

src/lib/layout/configs/textToCADFocus.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ export const textToCADFocusConfig: Layout = {
8686
icon: 'printer3d',
8787
actionType: ActionType.Make,
8888
},
89-
{
90-
id: 'refresh',
91-
label: 'Refresh app',
92-
icon: 'exclamationMark',
93-
actionType: ActionType.Refresh,
94-
},
9589
],
9690
},
9791
{

src/lib/layout/defaultActionLibrary.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { refreshPage } from '@src/lib/utils'
2-
import { reportRejection } from '@src/lib/trap'
31
import { commandBarActor, settingsActor } from '@src/lib/singletons'
42
import { useContext } from 'react'
53
import { MachineManagerContext } from '@src/components/MachineManagerProvider'
@@ -45,14 +43,6 @@ export const defaultActionLibrary = Object.freeze({
4543
})
4644
},
4745
},
48-
refreshApp: {
49-
execute: () => {
50-
refreshPage('Sidebar button').catch(reportRejection)
51-
},
52-
shortcut: undefined,
53-
useDisabled: () => undefined,
54-
useHidden: () => false,
55-
},
5646
make: {
5747
useDisabled: () => {
5848
const machineManager = useContext(MachineManagerContext)

src/lib/layout/parse.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const validSplitLayout = {
3232
const validAction = {
3333
id: crypto.randomUUID(),
3434
label: 'Test action',
35-
icon: 'refresh',
36-
actionType: ActionType.Refresh,
35+
icon: 'filePlus',
36+
actionType: ActionType.AddFile,
3737
} satisfies Action
3838

3939
const validPaneLayout = {

src/lib/layout/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export type AreaTypeDefinition = {
4242
export enum ActionType {
4343
Export = 'export',
4444
AddFile = 'addFileToProject',
45-
Refresh = 'refreshApp',
4645
Make = 'make',
4746
}
4847

0 commit comments

Comments
 (0)