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.

feat(icon): Add animated command and settings icons for sidebar (#1999)

Aidan Holloway-Bidwell127644be90e4
diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsx
index 15badcf98e..23f15a8a9a 100644
--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx
+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx
@@ -1,4 +1,4 @@
-import GearIcon from '@phosphor-icons/core/regular/gear.svg?component-solid';
+import { AnimatedGearIcon } from '@macro-icons/wide/animating/gear';
import { type Component, createSignal, For, type JSX, Show } from 'solid-js';
import { Dynamic } from 'solid-js/web';
import { AnimatedStarIcon } from '@macro-icons/wide/animating/star';
@@ -11,9 +11,9 @@ import { AnimatedInboxIcon } from '@macro-icons/wide/animating/inbox';
import { AnimatedSearchIcon } from '@macro-icons/wide/animating/search';
import { AnimatedSidebarIcon } from '@macro-icons/wide/animating/sidebar';
import { AnimatedPlusIcon } from '@macro-icons/wide/animating/plus';
+import { AnimatedCommandIcon } from '@macro-icons/wide/animating/command';
import { useLocation } from '@solidjs/router';
import LogoIcon from '@macro-icons/macro-logo.svg';
-import CommandIcon from '@phosphor-icons/core/assets/regular/command.svg';
import { LIST_VIEW_PATHS, type ListView } from '@app/constants/list-views';
import { LabelAndHotKey } from '@core/component/Tooltip';
import { setCreateMenuOpen } from '@app/component/Launcher';
@@ -193,6 +193,8 @@ export const AppSidebar = (props: AppSidebarProps) => {
registerHotkeys();
const [sidebarBtnHovering, setSidebarBtnHovering] = createSignal(false);
const [createBtnHovering, setCreateBtnHovering] = createSignal(false);
+ const [commandBtnHovering, setCommandBtnHovering] = createSignal(false);
+ const [settingsBtnHovering, setSettingsBtnHovering] = createSignal(false);
return (
<div
@@ -308,8 +310,14 @@ export const AppSidebar = (props: AppSidebarProps) => {
/>
}
onClick={handleCommandPaletteClick}
+ onMouseEnter={() => setCommandBtnHovering(true)}
+ onMouseLeave={() => setCommandBtnHovering(false)}
>
- <CommandIcon class="size-4 shrink-0" />
+ <div
+ class={`size-4 shrink-0 transition-colors duration-300 ${commandBtnHovering() ? 'text-accent' : ''}`}
+ >
+ <AnimatedCommandIcon triggerAnimation={commandBtnHovering()} />
+ </div>
<span class="whitespace-nowrap group-data-[slim=true]/sidebar:invisible">
Command
</span>
@@ -323,6 +331,8 @@ export const AppSidebar = (props: AppSidebarProps) => {
variant="ghost"
tooltipPlacement="right"
onClick={toggleSettings}
+ onMouseEnter={() => setSettingsBtnHovering(true)}
+ onMouseLeave={() => setSettingsBtnHovering(false)}
tooltip={
<LabelAndHotKey
label="Settings"
@@ -330,7 +340,11 @@ export const AppSidebar = (props: AppSidebarProps) => {
/>
}
>
- <GearIcon class="size-4 shrink-0" />
+ <div
+ class={`size-4 shrink-0 transition-colors duration-300 ${settingsBtnHovering() ? 'text-accent' : ''}`}
+ >
+ <AnimatedGearIcon triggerAnimation={settingsBtnHovering()} />
+ </div>
<span class="whitespace-nowrap group-data-[slim=true]/sidebar:invisible">
Settings
</span>
diff --git a/js/app/packages/macro-icons/wide/animating/command.tsx b/js/app/packages/macro-icons/wide/animating/command.tsx
new file mode 100644
index 0000000000..87bffbfc51
--- /dev/null
+++ b/js/app/packages/macro-icons/wide/animating/command.tsx
@@ -0,0 +1,58 @@
+export const AnimatedCommandIcon = (props: { triggerAnimation?: boolean }) => {
+ // ⌘ symbol from Asset 183.svg (15.05×15.05 viewBox, 1.5px stroke).
+ // On hover: translucent bg appears + icon scales up with spring easing.
+ // stroke-width is compensated (÷1.15) during animation so visual weight stays constant.
+
+ return (
+ <svg
+ width="100%"
+ height="100%"
+ viewBox="-1.5 -1.5 18 18"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="1.5"
+ stroke-miterlimit="10"
+ xmlns="http://www.w3.org/2000/svg"
+ overflow="visible"
+ class={`animated-command-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ >
+ {/*<title>Animated command icon</title>*/}
+ <style>{`
+ .animated-command-icon {
+ .bg-fill { opacity: 0; transition: opacity 0.3s ease; }
+ .command-group {
+ transform-origin: 7.525px 7.525px;
+ transition: transform 0.3s ease, stroke-width 0.3s ease;
+ }
+ }
+ .animated-command-icon.animating {
+ .bg-fill { opacity: 0.1; transition: opacity 0.4s ease; }
+ .command-group {
+ transform: scale(1.15);
+ stroke-width: 1.3;
+ transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
+ stroke-width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
+ }
+ }
+ `}</style>
+
+ <rect
+ class="bg-fill"
+ x="0"
+ y="0"
+ width="15.05"
+ height="15.05"
+ fill="currentColor"
+ stroke="none"
+ />
+
+ <g class="command-group">
+ <rect x="5.27" y="5.27" width="4.52" height="4.52" />
+ <path d="M3.01.75C1.76.75.75,1.76.75,3.01s1.01,2.26,2.26,2.26h2.26v-2.26c0-1.25-1.01-2.26-2.26-2.26Z" />
+ <path d="M14.3,3.01c0-1.25-1.01-2.26-2.26-2.26s-2.26,1.01-2.26,2.26v2.26h2.26c1.25,0,2.26-1.01,2.26-2.26Z" />
+ <path d="M.75,12.04c0,1.25,1.01,2.26,2.26,2.26s2.26-1.01,2.26-2.26v-2.26h-2.26c-1.25,0-2.26,1.01-2.26,2.26Z" />
+ <path d="M12.04,9.78h-2.26v2.26c0,1.25,1.01,2.26,2.26,2.26s2.26-1.01,2.26-2.26-1.01-2.26-2.26-2.26Z" />
+ </g>
+ </svg>
+ );
+};
diff --git a/js/app/packages/macro-icons/wide/animating/gear.tsx b/js/app/packages/macro-icons/wide/animating/gear.tsx
new file mode 100644
index 0000000000..fa4385d421
--- /dev/null
+++ b/js/app/packages/macro-icons/wide/animating/gear.tsx
@@ -0,0 +1,41 @@
+export const AnimatedGearIcon = (props: { triggerAnimation?: boolean }) => {
+ // Gear icon from Asset 181.svg.
+ // On hover: rotates 45° with spring easing, snaps back instantly on mouse leave.
+
+ return (
+ <svg
+ width="100%"
+ height="100%"
+ viewBox="0 0 18 18"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="1.5"
+ stroke-linejoin="round"
+ stroke-miterlimit="10"
+ xmlns="http://www.w3.org/2000/svg"
+ overflow="visible"
+ class={`animated-gear-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ >
+ {/*<title>Animated gear icon</title>*/}
+ <style>{`
+ @keyframes gear-rotate {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(45deg); }
+ }
+
+ .animated-gear-icon .gear-group {
+ transform-origin: 9.03px 9.03px;
+ }
+
+ .animated-gear-icon.animating .gear-group {
+ animation: gear-rotate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
+ }
+ `}</style>
+
+ <g class="gear-group">
+ <path d="M17.18,6.74l-.77-1.85-1.76-.02c-.42-.56-.91-1.05-1.46-1.46l-.02-1.77-1.85-.77-1.26,1.23c-.68-.1-1.37-.1-2.06,0l-1.26-1.23-1.85.77-.02,1.76c-.56.42-1.05.91-1.46,1.46l-1.77.02-.77,1.85,1.23,1.26c-.1.68-.1,1.37,0,2.06l-1.23,1.26.77,1.85,1.76.02c.42.56.91,1.05,1.46,1.46l.02,1.77,1.85.77,1.26-1.23c.68.1,1.37.1,2.06,0l1.26,1.23,1.85-.77.02-1.76c.56-.42,1.05-.91,1.46-1.46l1.77-.02.77-1.85-1.23-1.26c.1-.68.1-1.37,0-2.06l1.23-1.26Z" />
+ <circle cx="9.03" cy="9.03" r="3.25" />
+ </g>
+ </svg>
+ );
+};
diff --git a/js/app/packages/macro-icons/wide/command.svg b/js/app/packages/macro-icons/wide/command.svg
new file mode 100644
index 0000000000..5a3f879704
--- /dev/null
+++ b/js/app/packages/macro-icons/wide/command.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="-1.5 -1.5 18 18" fill="none" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10">
+<rect x="5.27" y="5.27" width="4.52" height="4.52"/>
+<path d="M3.01.75C1.76.75.75,1.76.75,3.01s1.01,2.26,2.26,2.26h2.26v-2.26c0-1.25-1.01-2.26-2.26-2.26Z"/>
+<path d="M14.3,3.01c0-1.25-1.01-2.26-2.26-2.26s-2.26,1.01-2.26,2.26v2.26h2.26c1.25,0,2.26-1.01,2.26-2.26Z"/>
+<path d="M.75,12.04c0,1.25,1.01,2.26,2.26,2.26s2.26-1.01,2.26-2.26v-2.26h-2.26c-1.25,0-2.26,1.01-2.26,2.26Z"/>
+<path d="M12.04,9.78h-2.26v2.26c0,1.25,1.01,2.26,2.26,2.26s2.26-1.01,2.26-2.26-1.01-2.26-2.26-2.26Z"/>
+</svg>
diff --git a/js/app/packages/macro-icons/wide/gear.svg b/js/app/packages/macro-icons/wide/gear.svg
new file mode 100644
index 0000000000..b5e00f30f8
--- /dev/null
+++ b/js/app/packages/macro-icons/wide/gear.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 18.06 18.06" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="10">
+<path d="M17.18,6.74l-.77-1.85-1.76-.02c-.42-.56-.91-1.05-1.46-1.46l-.02-1.77-1.85-.77-1.26,1.23c-.68-.1-1.37-.1-2.06,0l-1.26-1.23-1.85.77-.02,1.76c-.56.42-1.05.91-1.46,1.46l-1.77.02-.77,1.85,1.23,1.26c-.1.68-.1,1.37,0,2.06l-1.23,1.26.77,1.85,1.76.02c.42.56.91,1.05,1.46,1.46l.02,1.77,1.85.77,1.26-1.23c.68.1,1.37.1,2.06,0l1.26,1.23,1.85-.77.02-1.76c.56-.42,1.05-.91,1.46-1.46l1.77-.02.77-1.85-1.23-1.26c.1-.68.1-1.37,0-2.06l1.23-1.26Z"/>
+<circle cx="9.03" cy="9.03" r="3.25"/>
+</svg>