Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(channel): center composer buttons and drop the send button edge (#9905)
Jacob Beckerman4744e5018a72
diff --git a/.agents/rules/web/design-system.md b/.agents/rules/web/design-system.mdindex 6f4db1fef4..7cba3fa9ed 100644--- a/.agents/rules/web/design-system.md+++ b/.agents/rules/web/design-system.md@@ -52,7 +52,7 @@ construction. Browse them at `/app/component/ui` (Foundations → Controls).(`[&_button]:size-8`); use an explicit `icon-*` size for icon actions. Put glyphsizing on the rendered icon, not on Button or ancestor SVG selectors. Enforcedfor wrappers by ast-grep `tsx-no-descendant-button-styles`, warning.-- Use `variant="primary"` for the main create, save, submit, invite, approve, or continue action. Primary is solid neutral: black with white text in light themes, white with black text in dark themes. Keep existing primary consumers on `primary`, including selected-state controls. Use explicit `variant="accent"` only for separately intended theme-color emphasis. Home/AI chat, channel, and email Send actions use the shared primary `SendButton`. Keep the shared New launcher (`ViewCreateButton`) on `variant="secondary" finish="raised"`, and retain secondary, outline, ghost, and danger variants for their own roles.+- Use `variant="primary"` for the main create, save, submit, invite, approve, or continue action. Primary is solid neutral: black with white text in light themes, white with black text in dark themes. Keep existing primary consumers on `primary`, including selected-state controls. Use explicit `variant="accent"` only for separately intended theme-color emphasis. Home/AI chat, channel, and email Send actions use the shared primary `SendButton`, which is flat: no raised edge around the circle in either theme. Keep the shared New launcher (`ViewCreateButton`) on `variant="secondary" finish="raised"`, and retain secondary, outline, ghost, and danger variants for their own roles.- Quiet Back, Close, Cancel, and unframed inline utility actions use explicit `variant="ghost"`; omitting the variant opts into solid neutral primary emphasis, not accent. Keep intentional framed groups and selected-state actions in their own variants. Size every rendered glyph explicitly, including children passed through action wrappers; Button does not size descendant SVGs.- Selected reaction chips are a deliberate local exception: `ReactionChip` uses `appearance="bare"` with accent-tint, accent-text, and overlay classes to preserve its soft selected treatment without a new Button variant. Keep unselected reactions on `secondary`.- Property side-panel pin and add-value actions use standard ghost Buttons at 24px with 16px glyphs and extra-muted resting ink; remove actions use `variant="danger-ghost"` for a transparent resting face, failure-colored ink, and shared danger hover/pressed tokens. Retain shared hover tokens, not `appearance="bare"` or custom surface-hover fills. Keep pin and add-value actions visible; reveal remove and secondary row actions on hover or keyboard focus and keep them available on touch. Place add then pin with no gap between them; secondary actions follow this pair. Without add, keep pinning at the right edge after removal. Pinned glyphs use accent ink; suppress only the resting pressed fill, retaining the ghost hover token and toggle semantics. Keep editor focus restoration on value triggers, not row actions.diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.mdindex 3e57bcfe70..432d8ed340 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -217,7 +217,8 @@ ranking and insertion on desktop and phone.Channel composer draft persistence has a backend-free browser regression:`bunx playwright test --config src/features/channel/Input/browser-test/playwright.config.ts`.It checks draft blank lines across remounts, that a sent message renders its-lines with the spacing the draft showed, and pending sends on desktop and phone: clear immediately, restore failed sends, and preserve a new draft typed during delivery.+lines with the spacing the draft showed, that the one-line composer centers its+buttons on the text line, and pending sends on desktop and phone: clear immediately, restore failed sends, and preserve a new draft typed during delivery.It also pastes a Macro link and Markdown into a code block, which must keep both as literal text.Its phone formatting regression opens the ribbon from the add drawer in theproduction message editor, removes selected strikethrough, and saves; keepdiff --git a/apps/web/src/components/ui/components/SendButton.tsx b/apps/web/src/components/ui/components/SendButton.tsxindex 27b4454dfa..db3896ecb4 100644--- a/apps/web/src/components/ui/components/SendButton.tsx+++ b/apps/web/src/components/ui/components/SendButton.tsx@@ -33,6 +33,9 @@ export function SendButton(props: SendButtonProps) {return (<Buttonvariant="primary"+ // Send sits inside a composer that already frames it; a raised edge+ // reads as a stray border around the solid (or disabled) circle.+ finish="flat"size="icon-md"draggable={false}aria-label={local['aria-label'] ?? 'Send'}diff --git a/apps/web/src/features/channel/Input/Layout.module.css b/apps/web/src/features/channel/Input/Layout.module.cssindex 049709bb8d..4ae8878b61 100644--- a/apps/web/src/features/channel/Input/Layout.module.css+++ b/apps/web/src/features/channel/Input/Layout.module.css@@ -13,6 +13,15 @@padding: 7.5px;--input-editor-padding: 4.6875px 3.75px;+ /* The single-line editor is taller than the 32px buttons, so bottom+ alignment alone would sit them below the text's center. Give the+ action rows the single-line editor's height (the row's min-height+ less its padding) so they center on the last line instead. */+ > [data-input-actions-left],+ > [data-input-actions-right] {+ min-height: calc(48.75px - 2 * 7.5px);+ }+/* On touch this row replaces the CollapsedInput pill, so it keeps thepill's height, gutter, and gap (h-12.5, px-2, gap-1.5) rather thangrowing when the editor takes over. The single line (with thediff --git a/apps/web/src/features/channel/Input/browser-test/spacing.browser.e2e.ts b/apps/web/src/features/channel/Input/browser-test/spacing.browser.e2e.tsindex fddc5b3832..c281d4e41d 100644--- a/apps/web/src/features/channel/Input/browser-test/spacing.browser.e2e.ts+++ b/apps/web/src/features/channel/Input/browser-test/spacing.browser.e2e.ts@@ -63,3 +63,43 @@ test('a sent message keeps the line spacing of the draft that wrote it', async (expect(Math.abs(gap - draftGaps[index])).toBeLessThanOrEqual(1);}});++test('the one-line composer centers its buttons on the text line', async ({+ page,+}) => {+ await page.route('**/*', async (route) => {+ const url = new URL(route.request().url());+ if (url.hostname === 'localhost') {+ await route.continue();+ } else {+ await route.fulfill({+ status: 401,+ contentType: 'application/json',+ body: JSON.stringify({ responses: [] }),+ });+ }+ });+ await page.routeWebSocket('**/*', (socket) => socket.close());+ await page.goto('/src/features/channel/Input/browser-test/spacing.html');++ const editor = page.locator('[data-markdown-editable]');+ await expect(editor).toBeVisible({ timeout: 30_000 });+ await editor.click();+ await page.keyboard.type('One line');++ const offsets = await page.evaluate(() => {+ const layout = document.querySelector('[data-input-layout]');+ const text = document.querySelector('[data-markdown-editable]');+ if (!layout || !text) throw new Error('Composer missing');+ const center = (element: Element) => {+ const rect = element.getBoundingClientRect();+ return rect.top + rect.height / 2;+ };+ const textCenter = center(text);+ return [...layout.querySelectorAll('button')].map((button) =>+ Math.abs(center(button) - textCenter)+ );+ });+ expect(offsets.length).toBeGreaterThan(0);+ for (const offset of offsets) expect(offset).toBeLessThan(0.25);+});