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.

style(new-layout): lots of style nits for new layout (#1873)

Seamus750be1b910c3
diff --git a/js/app/packages/app/component/Launcher.tsx b/js/app/packages/app/component/Launcher.tsx
index 722d287394..90080453fe 100644
--- a/js/app/packages/app/component/Launcher.tsx
+++ b/js/app/packages/app/component/Launcher.tsx
@@ -592,7 +592,7 @@ const LauncherInner = (props: LauncherInnerProps) => {
return (
<div>
<div
- class="relative grid grid-cols-2 sm:grid-cols-4 gap-3 p-6 isolate bg-menu border border-edge-muted suppress-css-brackets"
+ class="relative grid grid-cols-2 sm:grid-cols-4 gap-3 p-6 isolate bg-menu ring-1 ring-edge-muted rounded-sm suppress-css-brackets"
classList={{
[gridColsClass()]: true,
}}
diff --git a/js/app/packages/app/component/PreviewPanel.tsx b/js/app/packages/app/component/PreviewPanel.tsx
index f287626a95..f60be74673 100644
--- a/js/app/packages/app/component/PreviewPanel.tsx
+++ b/js/app/packages/app/component/PreviewPanel.tsx
@@ -120,7 +120,7 @@ const PreviewPanelContent: Component<NonNullableFields<PreviewPanel>> = (
>
{/* Preview-specific toolbar slots so blocks can render the "share" bar (via SplitToolbarLeft/Right) */}
<div
- class="relative w-full flex items-center justify-between shrink-0 h-10 pr-1 border-b border-edge-muted/50 bg-panel"
+ class="relative w-full flex items-center justify-between shrink-0 h-10 bg-panel px-2 border-b border-edge-muted/50"
classList={{
// In spotlight/fullscreen, avoid hugging the screen edge
'pl-2': splitPanelContext.handle.isSpotLight(),
@@ -131,7 +131,7 @@ const PreviewPanelContent: Component<NonNullableFields<PreviewPanel>> = (
<div
// In preview mode, anchor left-side controls (e.g. file menu) to the top-left
// so the dropdown doesn't feel like it's "hanging" from the middle of the bar.
- class="flex h-full items-start pt-1 flex-1"
+ class="flex h-full items-center"
ref={(ref) => {
scopedLayoutRefs.toolbarLeft = ref;
}}
diff --git a/js/app/packages/app/component/SoupChatInput.tsx b/js/app/packages/app/component/SoupChatInput.tsx
index 60d2155d7d..20d3cf4d41 100644
--- a/js/app/packages/app/component/SoupChatInput.tsx
+++ b/js/app/packages/app/component/SoupChatInput.tsx
@@ -115,7 +115,7 @@ function SoupChatInputInner() {
<Show when={!soup.previewEntity()}>
<div
ref={containerRef}
- class="absolute bottom-px right-px left-px pb-2 flex justify-center pointer-events-none"
+ class="absolute bottom-px right-px left-px pb-2 px-2 flex justify-center pointer-events-none"
style={{
'background-image': `linear-gradient(transparent, var(--color-panel) 85%)`,
}}
diff --git a/js/app/packages/app/component/app-sidebar/channels-unread-widget.tsx b/js/app/packages/app/component/app-sidebar/channels-unread-widget.tsx
index 7efe6ad779..999e3c0770 100644
--- a/js/app/packages/app/component/app-sidebar/channels-unread-widget.tsx
+++ b/js/app/packages/app/component/app-sidebar/channels-unread-widget.tsx
@@ -188,7 +188,7 @@ export const ChannelsUnreadWidget = () => {
return (
<section class="w-full h-full px-2 py-1.5 flex flex-col justify-center">
- <header class="text-xs font-medium text-ink-muted tracking-wide">
+ <header class="text-xs font-medium text-ink-muted ml-3">
<h1>Unread</h1>
</header>
diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsx
index 5822a30c7d..61c90cc485 100644
--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx
+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx
@@ -30,6 +30,8 @@ import type { ValidHotkey } from '@core/hotkey/types';
import { registerHotkey } from '@core/hotkey/hotkeys';
import { GO_TO_COMMAND_SCOPE, GO_TO_LEADER_KEY } from '@app/constants/hotkeys';
import { ROUTER_BASE } from '@app/constants/routerBase';
+import { TOKENS } from '@core/hotkey/tokens';
+import { Hotkey } from '@core/component/Hotkey';
interface SidebarItem {
id: ListView;
@@ -133,6 +135,18 @@ export const AppSidebar = (props: AppSidebarProps) => {
registrationType: 'add',
});
+ registerHotkey({
+ hotkey: 'cmd+b',
+ scopeId: 'global',
+ hotkeyToken: TOKENS.global.toggleSidebar,
+ description: 'Toggle sidebar',
+ keyDownHandler: (e) => {
+ e?.preventDefault();
+ props.onOpenChange(isSlim());
+ return true;
+ },
+ });
+
// Register navigation shortcuts in the global GO_TO command scope
for (const link of SIDEBAR_LINKS) {
registerHotkey({
@@ -167,13 +181,13 @@ export const AppSidebar = (props: AppSidebarProps) => {
<>
<Show when={isMobile() && isExpanded()}>
<div
- class="absolute z-modal-overlay pattern-panel pattern-diagonal-4 w-screen h-full inset-0 bg-edge-muted mask-l-from-0 pointer-events-[all] transition-opacity opacity-100"
+ class="absolute z-modal-overlay pattern-panel pattern-diagonal-4 w-screen h-full inset-0 mask-l-from-0 pointer-events-[all] transition-opacity opacity-100"
onClick={() => props.onOpenChange(false)}
/>
</Show>
<div
class={cn(
- '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',
+ 'group/sidebar h-full py-2 flex flex-col gap-4 mobile:absolute mobile:z-modal-content ease-in-out',
isExpanded() &&
'max-w-56 w-full mobile:max-w-2/3 translate-x-0 opacity-100',
props.sidebarState === 'hidden' &&
@@ -184,6 +198,10 @@ export const AppSidebar = (props: AppSidebarProps) => {
)}
data-expanded={isExpanded()}
data-slim={isSlim()}
+ style={{
+ 'transition-property': 'transform, max-width, opacity',
+ 'transition-duration': '100ms',
+ }}
>
<div
class={cn(
@@ -196,12 +214,16 @@ export const AppSidebar = (props: AppSidebarProps) => {
<Show when={isExpanded()}>
<Tooltip
tooltip={
- <LabelAndHotKey label="Command palette" shortcut="⌘K" />
+ <LabelAndHotKey
+ label="Command palette"
+ hotkeyToken={TOKENS.global.commandMenu}
+ />
}
>
<Button
- variant="tertiary"
+ variant="secondary"
size="icon-sm"
+ class="rounded-xs"
onClick={handleCommandPaletteClick}
>
<CommandIcon />
@@ -209,10 +231,19 @@ export const AppSidebar = (props: AppSidebarProps) => {
</Tooltip>
</Show>
<Show when={!isMobile()}>
- <Tooltip tooltip={isSlim() ? 'Expand sidebar' : 'Shrink sidebar'}>
+ {/*<Tooltip tooltip={isSlim() ? 'Expand sidebar' : 'Shrink sidebar'}>*/}
+ <Tooltip
+ tooltip={
+ <LabelAndHotKey
+ label={isSlim() ? 'Expand sidebar' : 'Shrink sidebar'}
+ hotkeyToken={TOKENS.global.toggleSidebar}
+ />
+ }
+ >
<Button
- variant="ghost"
+ variant="secondary"
size="icon-sm"
+ class="rounded-xs"
onClick={() => props.onOpenChange(isSlim())}
>
<SidebarIcon />
@@ -230,15 +261,19 @@ export const AppSidebar = (props: AppSidebarProps) => {
>
<Button
class={
- 'justify-center group-data-[slim=true]/sidebar:aspect-square group-data-[expanded=true]/sidebar:justify-start group-data-[expanded=true]/sidebar:w-full'
+ 'rounded-xs justify-center group-data-[expanded=true]/sidebar:justify-start group-data-[expanded=true]/sidebar:w-full font-bold text-sm ring-1 ring-edge-muted p-1.5 flex gap-2'
}
- variant="tertiary"
+ variant="ghost"
+ size="sm"
onClick={handleCreateClick}
>
<PlusIcon class="size-4 shrink-0" />
- <span class="opacity-100 group-data-[slim=true]/sidebar:sr-only group-data-[slim=true]/sidebar:opacity-0">
+ <span class="opacity-100 group-data-[slim=true]/sidebar:sr-only group-data-[slim=true]/sidebar:opacity-0 grow text-left">
Create
</span>
+ <span class="opacity-100 group-data-[slim=true]/sidebar:sr-only group-data-[slim=true]/sidebar:opacity-0 rounded-sm px-2 py-0.5 text-xs border border-edge-muted">
+ <Hotkey shortcut="C" />
+ </span>
</Button>
</Tooltip>
@@ -340,8 +375,8 @@ const SidebarLink = (props: SidebarLinkProps) => {
variant="ghost"
size={props.sidebarState === 'slim' ? 'icon-sm' : 'sm'}
class={cn(
- 'flex items-center justify-start text-sm gap-2 cursor-default',
- isActive() && 'bg-ink/15 not-disabled:hover:bg-ink/15 text-ink',
+ 'flex items-center justify-start text-sm gap-2 cursor-default rounded-xs',
+ isActive() && 'bg-ink/7 not-disabled:hover:bg-ink/15 text-ink',
props.sidebarState === 'slim' && 'size-8 justify-center aspect-square',
props.sidebarState !== 'slim' && 'w-full'
)}
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/button.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/button.tsx
index e93622e702..3a59040e77 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/button.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/button.tsx
@@ -67,7 +67,7 @@ export const Button = <T extends ValidComponent = 'button'>(
return (
<KButton
class={cn(
- 'inline-flex items-center justify-center font-medium rounded-md transition-colors',
+ 'inline-flex items-center justify-center font-medium rounded-md',
'focus-visible:outline-none',
'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',
variantStyles[variant()],
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/filter-primitives.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/filter-primitives.tsx
index fbe4b79342..13773d518f 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/filter-primitives.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/filter-primitives.tsx
@@ -90,7 +90,7 @@ export const FilterSelect = (props: FilterSelectProps) => {
>
<span class="font-medium">{props.label}</span>
<Show when={multiple() && hasActiveFilters()}>
- <span class="absolute -top-2 -right-2 flex items-center justify-center size-4 rounded-full text-xs font-semibold bg-accent text-page">
+ <span class="absolute -top-2 -right-2 flex items-center justify-center size-4 z-1 rounded-full text-xs font-semibold bg-accent text-page">
{activeCount()}
</span>
</Show>
@@ -274,7 +274,7 @@ export const FilterCombobox = (props: FilterComboboxProps) => {
>
<span class="font-medium">{props.label}</span>
<Show when={hasActiveFilters()}>
- <span class="absolute -top-2 -right-2 flex items-center justify-center size-4 rounded-full text-xs font-semibold bg-accent text-page">
+ <span class="absolute -top-2 -right-2 flex items-center justify-center size-4 z-1 rounded-full text-xs font-semibold bg-accent text-page">
{activeCount()}
</span>
</Show>
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
index eda3b01386..5a61f209c2 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
@@ -28,7 +28,7 @@ export const SoupFiltersBar = () => {
return (
<Switch>
<Match when={isComponentListView('search')}>
- <div class="w-full flex flex-col gap-2 p-2">
+ <div class="w-full flex flex-col gap-2 p-2 border-b border-edge-muted/50">
<SoupSearchbar autoFocus />
</div>
</Match>
diff --git a/js/app/packages/app/component/split-layout/components/SplitDrawer.tsx b/js/app/packages/app/component/split-layout/components/SplitDrawer.tsx
index fb30ee15b3..7a031e47eb 100644
--- a/js/app/packages/app/component/split-layout/components/SplitDrawer.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitDrawer.tsx
@@ -63,7 +63,7 @@ export function SplitDrawer(
};
const getPositionClasses = () => {
- const baseClasses = `absolute bg-menu border-edge/50 z-2 flex flex-col`;
+ const baseClasses = `absolute bg-panel border-edge-muted/50 z-2 flex flex-col`;
let positionClasses = '';
switch (props.side) {
case 'top':
@@ -73,10 +73,10 @@ export function SplitDrawer(
positionClasses = 'top-unset left-px right-px bottom-px border-t';
break;
case 'left':
- positionClasses = 'bottom-px left-px border-r';
+ positionClasses = 'bottom-px left-px border-r border-t';
break;
case 'right':
- positionClasses = 'bottom-px right-px border-l';
+ positionClasses = 'bottom-px right-px border-l border-t';
break;
default:
break;
@@ -121,9 +121,9 @@ export function SplitDrawer(
/>
<div class={getPositionClasses()} style={{ ...getSizeStyle() }}>
<div class={getGradientMaskClasses()} />
- <div class="flex items-center justify-start gap-2 shrink-0">
+ <div class="flex items-center justify-start gap-2 shrink-0 px-2">
<Show when={props.title}>
- <h3 class="text-md font-medium text-content-secondary shrink truncate m-3">
+ <h3 class="text-md font-medium text-content-secondary shrink truncate my-3">
{props.title}
</h3>
</Show>
diff --git a/js/app/packages/app/component/split-layout/components/SplitToolbar.tsx b/js/app/packages/app/component/split-layout/components/SplitToolbar.tsx
index 072fb70014..8081cafd6d 100644
--- a/js/app/packages/app/component/split-layout/components/SplitToolbar.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitToolbar.tsx
@@ -46,7 +46,7 @@ export function SplitToolbar(props: { ref: Setter<HTMLDivElement | null> }) {
<div
class={cn(
'relative w-full flex items-center justify-between shrink-0',
- hasContent() && 'h-10 px-1 border-b border-edge-muted/50',
+ hasContent() && 'h-10 border-b border-edge-muted/50',
preview() && 'hidden'
)}
data-split-toolbar
diff --git a/js/app/packages/core/hotkey/tokens.ts b/js/app/packages/core/hotkey/tokens.ts
index 51aa69f3b8..0f0ae9b875 100644
--- a/js/app/packages/core/hotkey/tokens.ts
+++ b/js/app/packages/core/hotkey/tokens.ts
@@ -67,6 +67,7 @@ export const TOKENS = {
createCommand: 'global.createCommand',
commandMenu: 'global.commandMenu',
toggleBigChat: 'global.toggleBigChat',
+ toggleSidebar: 'global.toggleSidebar',
instructions: 'global.instructions',
searchMenu: 'global.searchMenu',
toggleSettings: 'global.toggleSettings',