Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(sidebar): move settings and shortcuts button to bottom of sidebar (#1850)

dev-rb984045f0bc0b
diff --git a/js/app/packages/app/component/Layout.tsx b/js/app/packages/app/component/Layout.tsx
index 2c6aadf36c..666e7920b2 100644
--- a/js/app/packages/app/component/Layout.tsx
+++ b/js/app/packages/app/component/Layout.tsx
@@ -23,7 +23,6 @@ import { createMenuOpen, Launcher, setCreateMenuOpen } from './Launcher';
import { Paywall } from './paywall/Paywall';
import { PropertyEditorModal } from './property-edit-modal/PropertyEditorModal';
import { SettingsWrapper } from './settings/SettingsWrapper';
-import { ShortcutsHelper } from './settings/ShortcutsHelper';
import { useAppSquishHandlers } from './useAppSquishHandlers';
import {
AppSidebar,
@@ -110,7 +109,6 @@ export function Layout(props: RouteSectionProps) {
</Suspense>
<GlobalBulkEditEntityModal />
<GlobalShareModal />
- <ShortcutsHelper />
</Show>
<Show
when={
diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsx
index 9432e5f7c4..40f05cc1fd 100644
--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx
+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx
@@ -1,3 +1,4 @@
+import KeyboardIcon from '@icon/regular/keyboard.svg';
import GearIcon from '@phosphor-icons/core/regular/gear.svg?component-solid';
import { type Component, createSignal, For, type JSX, Show } from 'solid-js';
import { Dynamic } from 'solid-js/web';
@@ -110,7 +111,7 @@ type AppSidebarProps = {
export const AppSidebar = (props: AppSidebarProps) => {
const layout = useSplitLayout();
- const { toggleSettings } = useSettingsState();
+ const { toggleSettings, openSettings } = useSettingsState();
const handleCommandPaletteClick = () => {
CommandState.toggle();
@@ -172,7 +173,7 @@ export const AppSidebar = (props: AppSidebarProps) => {
</Show>
<div
class={cn(
- 'group/sidebar h-full bg-page pt-2 flex flex-col gap-4 mobile:absolute mobile:z-modal-content transition-[width_transform_opacity] duration-150 ease-in-out',
+ 'group/sidebar h-full bg-page py-2 flex flex-col gap-4 mobile:absolute mobile:z-modal-content transition-[width_transform_opacity] duration-150 ease-in-out',
isExpanded() &&
'max-w-56 w-full mobile:max-w-2/3 translate-x-0 opacity-100',
props.sidebarState === 'hidden' &&
@@ -207,19 +208,14 @@ export const AppSidebar = (props: AppSidebarProps) => {
</Button>
</Tooltip>
<Tooltip
- tooltip={
- <LabelAndHotKey
- label="Settings"
- hotkeyToken="global.toggleSettings"
- />
- }
+ tooltip={<LabelAndHotKey label="Create new" shortcut="c" />}
>
<Button
variant="tertiary"
size="icon-sm"
- onClick={toggleSettings}
+ onClick={handleCreateClick}
>
- <GearIcon />
+ <PlusIcon />
</Button>
</Tooltip>
</Show>
@@ -281,6 +277,44 @@ export const AppSidebar = (props: AppSidebarProps) => {
{/* <UnreadNotificationsWidget /> */}
{/* </div> */}
</Show>
+
+ <div class="mt-auto w-full px-2">
+ <Tooltip
+ class="w-full"
+ tooltip={
+ <LabelAndHotKey
+ label="Settings"
+ hotkeyToken="global.toggleSettings"
+ />
+ }
+ >
+ <Button
+ class={cn(
+ 'flex items-center justify-start text-sm gap-2 cursor-default',
+ isSlim() ? 'justify-center aspect-square' : 'w-full'
+ )}
+ variant="ghost"
+ size={isSlim() ? 'icon-sm' : 'sm'}
+ onClick={toggleSettings}
+ >
+ <GearIcon class="size-4 shrink-0" />
+ <span class={cn(isSlim() ? 'sr-only' : 'block')}>Settings</span>
+ </Button>
+ </Tooltip>
+
+ <Button
+ class={cn(
+ 'flex items-center justify-start text-sm gap-2 cursor-default',
+ isSlim() ? 'justify-center aspect-square' : 'w-full'
+ )}
+ variant="ghost"
+ size={isSlim() ? 'icon-sm' : 'sm'}
+ onClick={() => openSettings('Shortcuts')}
+ >
+ <KeyboardIcon class="size-4 shrink-0" />
+ <span class={cn(isSlim() ? 'sr-only' : 'block')}>Shortcuts</span>
+ </Button>
+ </div>
</div>
</>
);