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): remove shake animation for agents (#9090)

Wolf Mermelstein322a0f5b6443
diff --git a/apps/web/src/components/icon/system/README.md b/apps/web/src/components/icon/system/README.md
index 6d5bd760f3..89793f33cc 100644
--- a/apps/web/src/components/icon/system/README.md
+++ b/apps/web/src/components/icon/system/README.md
@@ -102,7 +102,7 @@ All existing and newly authored `data-macro-icon` SVGs inherit this behavior.
or lift for sharing. Do not bounce continuously or delay the action.
- Hover is limited to search, settings, and add glyphs after 160 ms of
pointer intent. Touch does not trigger hover. Most icons respond only to press.
- The agent sparkle never turns; it only presses and settles.
+ The agent sparkle stays still.
- Animate the drawing, never its label, hit target, selection background, or
layout. Individual transform properties preserve existing layout transforms.
- Put `data-icon-motion-target` on a fixed-size wrapper when an action swaps SVGs
diff --git a/apps/web/src/components/icon/system/icon-motion.test.ts b/apps/web/src/components/icon/system/icon-motion.test.ts
index e922817f87..e91eb66fff 100644
--- a/apps/web/src/components/icon/system/icon-motion.test.ts
+++ b/apps/web/src/components/icon/system/icon-motion.test.ts
@@ -165,13 +165,17 @@ it('limits hover to suitable icons and ignores touch hover', () => {
expect(animate).not.toHaveBeenCalled();
});
-it('keeps the agent sparkle from turning on hover or press', () => {
+it('keeps the agent sparkle still on hover or press', () => {
const button = control('sparkle');
pointer(button, 'pointerover');
vi.advanceTimersByTime(200);
- expect(animate).not.toHaveBeenCalled();
pointer(button);
- expect(animate.mock.calls[0][0][1].rotate).toBe('0deg');
+ expect(animate).not.toHaveBeenCalled();
+});
+
+it('keeps the filled agent sparkle still', () => {
+ pointer(control('sparkle-fill'));
+ expect(animate).not.toHaveBeenCalled();
});
it('respects reduced motion immediately and cancels active animations on change', () => {
diff --git a/apps/web/src/components/icon/system/icon-motion.ts b/apps/web/src/components/icon/system/icon-motion.ts
index 19fac47a49..e0d15fef9a 100644
--- a/apps/web/src/components/icon/system/icon-motion.ts
+++ b/apps/web/src/components/icon/system/icon-motion.ts
@@ -5,6 +5,7 @@ const EXCLUDED =
'[data-icon-motion="none"], [disabled], [aria-disabled="true"], [aria-busy="true"], [inert], .animate-spin, .animate-pulse';
const STATE_ICON =
/^(caret|caret-double|arrow|arrows|spinner|circle|dot|check|minus|warning|x)(-|$)/;
+const STILL_ICON = /^(sparkle)(-|$)/;
const HOVER_ICON = /^(magnifying-glass|gear|gear-six|plus)$/;
function controlAt(target: EventTarget | null) {
@@ -20,7 +21,7 @@ function actionIcon(control: HTMLElement) {
)) {
if (svg.closest(CONTROL) !== control || svg.closest(EXCLUDED)) continue;
const name = svg.dataset.macroIcon?.replace(/-(fill|bold)$/, '') ?? '';
- if (STATE_ICON.test(name)) continue;
+ if (STATE_ICON.test(name) || STILL_ICON.test(name)) continue;
const target = svg.closest<HTMLElement>('[data-icon-motion-target]') ?? svg;
const { width, height } = target.getBoundingClientRect();
// Illustrations and hidden glyphs are not interaction feedback.