Modeling view appearance final tweaks (#6425)

* Remove bug button from LowerRightControls

There is a "report a bug" button in the help menus, both native and
lower-right corner. This is overkill, and users are not using coredump
well.

* Remove coredump from refresh UI button

* Add a "Refresh app" command to palette

* Update snapshots

* Rework "Refresh and report bug" menu item to "Report a bug"

* Add refresh button to sidebar

* Convert upper-right refresh button to Share

* Tweak styles of command button

* Make anonymous user icon same size as known user image

* Remove ModelStateIndicator

* Use hotkeyDisplay for the sidebar too

* Update snapshots

* Remove tooltip from command bar open button

* tsc, lint, and fmt
This commit is contained in:
Frank Noirot
2025-04-23 15:20:45 -04:00
committed by GitHub
parent 45e17c50e7
commit f03a684eec
44 changed files with 156 additions and 291 deletions

View File

@ -25,6 +25,10 @@ import { isDesktop } from '@src/lib/isDesktop'
import { useSettings } from '@src/machines/appMachine'
import { commandBarActor } from '@src/machines/commandBarMachine'
import { onboardingPaths } from '@src/routes/Onboarding/paths'
import { reportRejection } from '@src/lib/trap'
import { refreshPage } from '@src/lib/utils'
import { hotkeyDisplay } from '@src/lib/hotkeyWrapper'
import usePlatform from '@src/hooks/usePlatform'
interface ModelingSidebarProps {
paneOpacity: '' | 'opacity-20' | 'opacity-40'
@ -86,18 +90,6 @@ export function ModelingSidebar({ paneOpacity }: ModelingSidebarProps) {
data: { name: 'load-external-model', groupId: 'code' },
}),
},
{
id: 'share-link',
title: 'Share part via Zoo link',
sidebarName: 'Share part via Zoo link',
icon: 'link',
keybinding: 'Mod + Alt + S',
action: () =>
commandBarActor.send({
type: 'Find and select command',
data: { name: 'share-file-link', groupId: 'code' },
}),
},
{
id: 'export',
title: 'Export part',
@ -130,6 +122,17 @@ export function ModelingSidebar({ paneOpacity }: ModelingSidebarProps) {
return machineManager.noMachinesReason()
},
},
{
id: 'refresh',
title: 'Refresh app',
sidebarName: 'Refresh app',
icon: 'arrowRotateRight',
keybinding: 'Mod + R',
// eslint-disable-next-line @typescript-eslint/no-misused-promises
action: async () => {
refreshPage('Sidebar button').catch(reportRejection)
},
},
]
const filteredActions: SidebarAction[] = sidebarActions.filter(
(action) =>
@ -340,6 +343,7 @@ function ModelingPaneButton({
disabledText,
...props
}: ModelingPaneButtonProps) {
const platform = usePlatform()
useHotkeys(paneConfig.keybinding, onClick, {
scopes: ['modeling'],
})
@ -379,7 +383,7 @@ function ModelingPaneButton({
{paneIsOpen !== undefined ? ` pane` : ''}
</span>
<kbd className="hotkey text-xs capitalize">
{paneConfig.keybinding}
{hotkeyDisplay(paneConfig.keybinding, platform)}
</kbd>
</Tooltip>
</button>