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(layers): update mobile drawers and other menus for mobile styles (#3019)

Seamus9772b5cc8827
diff --git a/js/app/packages/app/component/mobile/MobileDock.tsx b/js/app/packages/app/component/mobile/MobileDock.tsx
index 408f6b04cb..245f5132f9 100644
--- a/js/app/packages/app/component/mobile/MobileDock.tsx
+++ b/js/app/packages/app/component/mobile/MobileDock.tsx
@@ -15,6 +15,7 @@ import type { ListView } from '@app/constants/list-views';
import { globalSplitManager } from '@app/signal/splitLayout';
import { SearchState } from './mobileSearchState';
import { useLocation } from '@solidjs/router';
+import { Layer } from '@ui';
false && focusInput;
@@ -118,49 +119,51 @@ export function MobileDock() {
};
return (
- <div class="relative z-mobile-nav-bar flex flex-row justify-between">
- <div class="-z-1 absolute left-0 top-0 right-0 w-screen h-40 bg-panel" />
- <MobileDockButton
- icon={AnimatedInboxIcon}
- active={isActive('inbox')}
- onClick={() => {
- navigate('inbox');
- }}
- />
- <MobileDockButton
- icon={AnimatedEmailIcon}
- active={isActive('mail')}
- onClick={() => navigate('mail')}
- />
- <MobileDockButton
- icon={AnimatedChannelIcon}
- active={isActive('channels')}
- onClick={() => {
- navigate('channels');
- }}
- />
- <MobileDockButton
- icon={AnimatedTaskIcon}
- active={isActive('tasks')}
- onClick={() => navigate('tasks')}
- />
- <MobileDockButton
- icon={AnimatedFileMdIcon}
- active={isActive('documents')}
- onClick={() => navigate('documents')}
- />
- <MobileDockButton
- icon={AnimatedStarIcon}
- active={isActive('agents')}
- onClick={() => navigate('agents')}
- />
- <SearchDockButton
- active={isActive('search')}
- onClick={() => {
- SearchState.maybeResetState();
- SearchState.open();
- }}
- />
- </div>
+ <Layer depth={1}>
+ <div class="relative z-mobile-nav-bar flex flex-row justify-between">
+ <div class="-z-1 absolute left-0 top-0 right-0 w-screen h-40 bg-panel" />
+ <MobileDockButton
+ icon={AnimatedInboxIcon}
+ active={isActive('inbox')}
+ onClick={() => {
+ navigate('inbox');
+ }}
+ />
+ <MobileDockButton
+ icon={AnimatedEmailIcon}
+ active={isActive('mail')}
+ onClick={() => navigate('mail')}
+ />
+ <MobileDockButton
+ icon={AnimatedChannelIcon}
+ active={isActive('channels')}
+ onClick={() => {
+ navigate('channels');
+ }}
+ />
+ <MobileDockButton
+ icon={AnimatedTaskIcon}
+ active={isActive('tasks')}
+ onClick={() => navigate('tasks')}
+ />
+ <MobileDockButton
+ icon={AnimatedFileMdIcon}
+ active={isActive('documents')}
+ onClick={() => navigate('documents')}
+ />
+ <MobileDockButton
+ icon={AnimatedStarIcon}
+ active={isActive('agents')}
+ onClick={() => navigate('agents')}
+ />
+ <SearchDockButton
+ active={isActive('search')}
+ onClick={() => {
+ SearchState.maybeResetState();
+ SearchState.open();
+ }}
+ />
+ </div>
+ </Layer>
);
}
diff --git a/js/app/packages/app/component/mobile/MobileDrawer.tsx b/js/app/packages/app/component/mobile/MobileDrawer.tsx
index f3dd6dc91d..ab0de98569 100644
--- a/js/app/packages/app/component/mobile/MobileDrawer.tsx
+++ b/js/app/packages/app/component/mobile/MobileDrawer.tsx
@@ -1,6 +1,7 @@
import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';
import { isEditableInput } from '@core/util/isEditableInput';
import Drawer from '@corvu/drawer';
+import { Layer } from '@ui';
import { cn } from '@ui/utils/classname';
import {
onCleanup,
@@ -56,19 +57,21 @@ function MobileDrawerContent(props: ComponentProps<typeof Drawer.Content>) {
});
return (
- <Drawer.Content
- onFocusIn={(e: FocusEvent) => {
- scrollToFocusedInput(e);
- }}
- class={cn(
- 'bottom-[var(--virtual-keyboard-height,0)] fixed left-0 right-0 z-modal bg-page rounded-t-2xl flex flex-col max-h-[80vh] data-transitioning:transition-transform data-transitioning:duration-200 ease-out',
- virtualKeyboardVisible()
- ? 'pb-0 max-h-[calc(80vh-var(--virtual-keyboard-height))] overflow-y-auto'
- : 'pb-(--safe-bottom)',
- local.class
- )}
- {...rest}
- />
+ <Layer depth={1}>
+ <Drawer.Content
+ onFocusIn={(e: FocusEvent) => {
+ scrollToFocusedInput(e);
+ }}
+ class={cn(
+ 'bottom-[var(--virtual-keyboard-height,0)] fixed left-0 right-0 z-modal bg-panel rounded-t-2xl flex flex-col max-h-[80vh] data-transitioning:transition-transform data-transitioning:duration-200 ease-out',
+ virtualKeyboardVisible()
+ ? 'pb-0 max-h-[calc(80vh-var(--virtual-keyboard-height))] overflow-y-auto'
+ : 'pb-(--safe-bottom)',
+ local.class
+ )}
+ {...rest}
+ />
+ </Layer>
);
}
@@ -89,13 +92,15 @@ function MobileDrawerSection<T extends ValidComponent = 'div'>(
'children',
]);
return (
- <Dynamic
- component={(local.as ?? 'div') as ValidComponent}
- class={cn('bg-menu rounded-2xl mx-3', local.class as string)}
- {...rest}
- >
- {local.children}
- </Dynamic>
+ <Layer depth={2}>
+ <Dynamic
+ component={(local.as ?? 'div') as ValidComponent}
+ class={cn('rounded-2xl mx-3 overflow-clip', local.class as string)}
+ {...rest}
+ >
+ {local.children}
+ </Dynamic>
+ </Layer>
);
}
diff --git a/js/app/packages/app/component/mobile/MobileSearch.tsx b/js/app/packages/app/component/mobile/MobileSearch.tsx
index b5de958b4f..65feca8b47 100644
--- a/js/app/packages/app/component/mobile/MobileSearch.tsx
+++ b/js/app/packages/app/component/mobile/MobileSearch.tsx
@@ -36,6 +36,7 @@ import { windowSearchMatch } from '@core/util/searchHighlight';
import { TailSpinner } from '@core/component/TailSpinner';
import { ScrollIndicators } from '@core/component/VerticalScrollIndicators';
import { itemToBlockName } from '@core/constant/allBlocks';
+import { Layer } from '@ui';
const CATEGORIES: { id: CategoryFilter; label: string }[] = [
{ id: 'all', label: 'All' },
@@ -52,16 +53,18 @@ export function MobileSearchOuter() {
return (
<Dialog open={SearchState.isOpen()} onOpenChange={SearchState.setIsOpen}>
<Dialog.Portal>
- <Dialog.Content
- class={cn(
- 'fixed inset-0 z-modal flex flex-col h-[calc(var(--dvh,1dvh)*100)] pt-(--safe-top) pl-(--safe-left) pr-(--safe-right)',
- {
- 'pb-(--safe-bottom)': !virtualKeyboardVisible(),
- }
- )}
- >
- <MobileSearchInner />
- </Dialog.Content>
+ <Layer depth={2}>
+ <Dialog.Content
+ class={cn(
+ 'fixed inset-0 z-modal flex flex-col h-[calc(var(--dvh,1dvh)*100)] pt-(--safe-top) pl-(--safe-left) pr-(--safe-right)',
+ {
+ 'pb-(--safe-bottom)': !virtualKeyboardVisible(),
+ }
+ )}
+ >
+ <MobileSearchInner />
+ </Dialog.Content>
+ </Layer>
</Dialog.Portal>
</Dialog>
);
diff --git a/js/app/packages/app/component/next-soup/soup-view/SoupEntityActionDrawer.tsx b/js/app/packages/app/component/next-soup/soup-view/SoupEntityActionDrawer.tsx
index ecb7b5d2ab..a78f1e8cf5 100644
--- a/js/app/packages/app/component/next-soup/soup-view/SoupEntityActionDrawer.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/SoupEntityActionDrawer.tsx
@@ -73,7 +73,7 @@ export function SoupEntityActionDrawer() {
<button
type="button"
class={cn(
- 'flex items-center gap-3 px-4 py-3 text-sm hover:bg-hover hover-transition-bg text-left not-last:border-b border-page',
+ 'flex items-center gap-3 px-4 py-3 text-sm hover:bg-hover hover-transition-bg text-left not-last:mb-px bg-panel',
action.destructive ? 'text-failure-ink' : 'text-ink'
)}
onClick={async (e: MouseEvent) => {
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx
index d894d57358..c54d0eff73 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx
@@ -258,7 +258,7 @@ export const MobileFilterDrawer = () => {
type="button"
role="radio"
aria-checked={active()}
- class="w-full flex items-center gap-3 px-3 py-2.5 text-sm hover:bg-hover transition-colors text-left"
+ class="w-full bg-panel flex items-center gap-3 px-3 py-2.5 text-sm hover:bg-hover transition-colors text-left not-last:mb-px"
onClick={() => setSort(option.value)}
>
<Show when={option.icon}>
@@ -302,7 +302,7 @@ export const MobileFilterDrawer = () => {
</div>
</Show>
- <div>
+ <div class="flex flex-col">
<For each={categories()}>
{(category) => {
const activeCount = createMemo(
@@ -315,11 +315,11 @@ export const MobileFilterDrawer = () => {
<MobileDrawer.Section
as={Accordion.Item}
value={category.id}
- class="not-first:mt-3"
+ class="mb-3"
>
<Accordion.Header>
<Accordion.Trigger
- class="w-full flex items-center justify-between px-3 py-3 text-sm text-ink hover:bg-hover transition-colors outline-none group"
+ class="w-full flex bg-panel items-center justify-between px-3 py-3 text-sm text-ink hover:bg-hover transition-colors outline-none group mb-px"
onClick={(e) =>
scrollAccordionItemToTop(e, scrollRef())
}
@@ -337,7 +337,7 @@ export const MobileFilterDrawer = () => {
</div>
</Accordion.Trigger>
</Accordion.Header>
- <Accordion.Content class="pb-1">
+ <Accordion.Content>
<For each={category.options}>
{(option) => {
const active = () =>
@@ -347,12 +347,12 @@ export const MobileFilterDrawer = () => {
type="button"
role="checkbox"
aria-checked={active()}
- class="w-full flex items-center gap-3 px-3 py-2.5 text-sm hover:bg-hover transition-colors text-left"
+ class="w-full flex items-center gap-3 px-3 py-2.5 text-sm hover:bg-hover transition-colors text-left bg-panel not-last:mb-px"
onClick={() => toggleFilter(option.id)}
>
<span
class={cn(
- 'size-4 flex items-center justify-center shrink-0 rounded border transition-colors',
+ 'size-4 flex items-center justify-center shrink-0 border transition-colors',
active()
? 'bg-accent border-accent'
: 'border-edge'
@@ -385,14 +385,10 @@ export const MobileFilterDrawer = () => {
{/* Assignee section for tasks view */}
<Show when={isTasksView()}>
- <MobileDrawer.Section
- as={Accordion.Item}
- value="assignee"
- class="mt-3"
- >
+ <MobileDrawer.Section as={Accordion.Item} value="assignee">
<Accordion.Header>
<Accordion.Trigger
- class="w-full flex items-center justify-between px-3 py-3 text-sm text-ink hover:bg-hover transition-colors outline-none group"
+ class="w-full flex items-center justify-between px-3 py-3 text-sm text-ink hover:bg-hover transition-colors outline-none group bg-panel mb-px"
onClick={(e) =>
scrollAccordionItemToTop(e, scrollRef())
}
@@ -400,7 +396,7 @@ export const MobileFilterDrawer = () => {
<span class="font-medium">Assignee</span>
<div class="flex items-center gap-2">
<Show when={assigneeFilter().length > 0}>
- <span class="group-data-expanded:hidden size-4 flex items-center justify-center rounded-full bg-accent text-page text-[10px] font-medium leading-none">
+ <span class="group-data-expanded:hidden size-4 flex items-center justify-center rounded-full bg-accent text-page text-xxs font-medium leading-none">
{assigneeFilter().length}
</span>
</Show>
@@ -408,9 +404,9 @@ export const MobileFilterDrawer = () => {
</div>
</Accordion.Trigger>
</Accordion.Header>
- <Accordion.Content class="pb-1">
+ <Accordion.Content>
{/* Search */}
- <div class="flex items-center gap-2 px-3 py-2 border-b border-edge-muted mb-1">
+ <div class="flex items-center gap-2 px-3 py-2 muted bg-panel mb-px">
<SearchIcon class="size-3.5 text-ink-muted shrink-0" />
<input
type="text"
@@ -423,7 +419,7 @@ export const MobileFilterDrawer = () => {
class="flex-1 bg-transparent text-sm outline-none placeholder:text-ink-muted"
/>
</div>
- <div class="max-h-[calc(50*var(--dvh))] overflow-y-auto">
+ <div class="max-h-[calc(50*var(--dvh))] overflow-y-auto scrollbar-hidden">
<For each={filteredAssigneeOptions()}>
{(option) => {
const active = () =>
@@ -433,7 +429,7 @@ export const MobileFilterDrawer = () => {
type="button"
role="checkbox"
aria-checked={active()}
- class="w-full flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-hover transition-colors text-left"
+ class="w-full flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-hover transition-colors text-left bg-panel not-last:mb-px"
onClick={() => toggleAssignee(option.id)}
>
<span
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-create-button.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-create-button.tsx
index 13dd0c104c..71cc1d1d3f 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-create-button.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-create-button.tsx
@@ -15,8 +15,7 @@ import { Dynamic } from 'solid-js/web';
import type { ListView } from '@app/constants/list-views';
import { runCreateAction, setCreateMenuOpen } from '../../Launcher';
import { useAnalytics } from '@app/component/analytics-context';
-import { cn } from '@ui/utils/classname';
-import { isThemeDark } from '@theme/utils/themeUtils';
+import { Layer } from '@ui';
const ICON_ANIMATION_DURATION_MS = 500;
@@ -93,24 +92,23 @@ export function SoupViewMobileCreateButton(props: {
return (
<Show when={createAction()}>
- <button
- type="button"
- class={cn(
- 'absolute bottom-4 right-4 z-10 pl-3 pr-4 py-2 rounded-full bg-menu text-accent flex items-center justify-center gap-2 shadow-lg',
- isThemeDark() && 'border border-accent/30'
- )}
- onPointerDown={() => {
- hapticImpact('light');
- setAnimating(true);
- setTimeout(() => setAnimating(false), ICON_ANIMATION_DURATION_MS);
- createAction()?.();
- }}
- >
- <div class="w-5 h-5 [&_svg]:size-5">
- <Dynamic component={createIcon()} triggerAnimation={animating()} />
- </div>
- <div>Create</div>
- </button>
+ <Layer depth={1}>
+ <button
+ type="button"
+ class="absolute bottom-4 right-4 z-10 pl-3 pr-4 py-2 rounded-full bg-panel ring text-accent flex items-center justify-center gap-2 shadow-md ring-accent/20"
+ onPointerDown={() => {
+ hapticImpact('light');
+ setAnimating(true);
+ setTimeout(() => setAnimating(false), ICON_ANIMATION_DURATION_MS);
+ createAction()?.();
+ }}
+ >
+ <div class="w-5 h-5 [&_svg]:size-5">
+ <Dynamic component={createIcon()} triggerAnimation={animating()} />
+ </div>
+ <div>Create</div>
+ </button>
+ </Layer>
</Show>
);
}
diff --git a/js/app/packages/app/component/split-layout/components/SplitContainer.tsx b/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
index 8ad7078d6f..17049eb1cc 100644
--- a/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
@@ -11,7 +11,7 @@ import { useSplitPanelOrThrow } from '../layoutUtils';
import { SplitDrawerGroup } from './SplitDrawerContext';
import { SplitHeader } from './SplitHeader';
import { SplitToolbar } from './SplitToolbar';
-import { Panel } from '@ui';
+import { Layer, Panel } from '@ui';
import { globalSplitManager } from '@app/signal/splitLayout';
import { isMobile } from '@core/mobile/isMobile';
@@ -85,13 +85,15 @@ export function SplitContainer(
<Show
when={!isMobile()}
fallback={
- <div class="flex flex-col min-h-0 size-full bg-panel overflow-hidden">
- <SplitHeader ref={setHeaderRef} />
- <SplitToolbar ref={setToolbarRef} />
- <div class="@container/split size-full overflow-hidden relative">
- {props.children}
+ <Layer depth={1}>
+ <div class="flex flex-col min-h-0 size-full bg-panel overflow-hidden">
+ <SplitHeader ref={setHeaderRef} />
+ <SplitToolbar ref={setToolbarRef} />
+ <div class="@container/split size-full overflow-hidden relative">
+ {props.children}
+ </div>
</div>
- </div>
+ </Layer>
}
>
<Panel
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index f175fc0788..e5d227570d 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -89,9 +89,9 @@
--color-dialog: var(--b0); /* dialog, e.g. dialog background */
--color-input: var(--b0); /* input, e.g. chat/channel input */
--color-button: var(--b0); /* dialog, e.g. dialog background */
- --color-message: var(--b0); /* message background */
+ --color-message: color-mix(in oklch, var(--b1) 50%, var(--b2)); /* message background */
--color-hover: var(--b2); /* hover, e.g. hover state for buttons/items */
- --color-active: var(--b2); /* elements that are selected or activated */
+ --color-active: var(--b1); /* elements that are selected or activated */
--color-overlay: oklch(from var(--b2) l c h / 0.5); /* overlay, e.g. modal background */
--color-edge-muted: var(--b3); /* muted edge */
--color-edge: var(--b4); /* edge (border) */
diff --git a/js/app/packages/channel/Mobile/ActionDrawer.tsx b/js/app/packages/channel/Mobile/ActionDrawer.tsx
index 61a9f66288..620632e25d 100644
--- a/js/app/packages/channel/Mobile/ActionDrawer.tsx
+++ b/js/app/packages/channel/Mobile/ActionDrawer.tsx
@@ -240,7 +240,7 @@ export function ActionDrawer() {
<button
type="button"
data-message-action={action.id}
- class="flex items-center gap-3 px-4 py-3 text-sm text-ink hover:bg-hover hover-transition-bg text-left not-last:border-b border-page"
+ class="flex items-center gap-3 px-4 py-3 text-sm text-ink hover:bg-hover hover-transition-bg text-left not-last:mb-px bg-panel"
ref={(el) => {
const getTarget = action.getFocusTarget;
if (getTarget) focusInput(el, () => ({ getTarget }));
@@ -265,7 +265,7 @@ export function ActionDrawer() {
<button
type="button"
data-message-action={action.id}
- class="flex items-center gap-3 px-4 py-3 text-sm text-failure-ink hover:bg-hover hover-transition-bg text-left not-last:border-b border-panel"
+ class="flex items-center gap-3 px-4 py-3 text-sm text-failure-ink hover:bg-hover hover-transition-bg text-left not-last:mb-px bg-panel"
ref={(el) => {
const getTarget = action.getFocusTarget;
if (getTarget) focusInput(el, () => ({ getTarget }));
diff --git a/js/app/packages/core/component/Toast/Toast.tsx b/js/app/packages/core/component/Toast/Toast.tsx
index d5a2d76af8..a0e735e482 100644
--- a/js/app/packages/core/component/Toast/Toast.tsx
+++ b/js/app/packages/core/component/Toast/Toast.tsx
@@ -314,7 +314,7 @@ function ToastContent(props: {
<Panel
highlightColor={accentColor()}
active
- class="relative w-[90vw] sm:w-md px-2 sm:p-3"
+ class="relative w-[90vw] sm:w-md p-2 sm:p-3"
depth={2}
>
<Switch>
diff --git a/js/app/packages/entity/src/extractors-notification/mobile-notification-stacks.tsx b/js/app/packages/entity/src/extractors-notification/mobile-notification-stacks.tsx
index 905a956442..30272d7475 100644
--- a/js/app/packages/entity/src/extractors-notification/mobile-notification-stacks.tsx
+++ b/js/app/packages/entity/src/extractors-notification/mobile-notification-stacks.tsx
@@ -34,7 +34,7 @@ function MobileStackRowLayout(props: {
}) {
return (
<Entity.Layout
- class="w-full text-sm grid bg-edge border-edge-muted"
+ class="w-full text-sm grid bg-message border-edge"
onClick={props.onClick}
style={{
'grid-template-columns':
diff --git a/js/app/packages/entity/src/extractors-notification/notification-stacks.tsx b/js/app/packages/entity/src/extractors-notification/notification-stacks.tsx
index a4356c5d59..8f511e1e73 100644
--- a/js/app/packages/entity/src/extractors-notification/notification-stacks.tsx
+++ b/js/app/packages/entity/src/extractors-notification/notification-stacks.tsx
@@ -14,7 +14,6 @@ import {
} from '@notifications';
import type { UnifiedNotification } from '@notifications';
import { Button } from '@ui/components/Button';
-import { Layer } from '@ui/components/Layer';
import { cn } from '@ui/utils/classname';
import { createEffect, type JSX, Show } from 'solid-js';
import { createStore, reconcile } from 'solid-js/store';
@@ -102,85 +101,83 @@ function NotificationStackRow(props: {
};
return (
- <Layer depth={0}>
- <ContextMenu>
- <ContextMenu.Trigger class="size-full">
- <div
- class={cn(
- 'flex p-2 pr-0 my-1 border-l-2 border-edge-muted bg-message gap-4 hover:bg-hover min-w-0 overflow-hidden'
- )}
- onClick={handleClick}
- role="button"
- tabIndex={0}
- onKeyDown={(e) => {
- if (e.key === 'Enter' || e.key === ' ') {
- e.preventDefault();
- handleClick(e);
- }
- if (e.key === 'e') {
- e.preventDefault();
- e.stopPropagation();
- handleMarkAsDone();
- }
- }}
- >
- <div class="pt-1 shrink-0">
- <NotificationIcon stack={props.stack} class="size-4" />
- </div>
- <div class="min-w-0 flex-1">
- <div class="flex items-center gap-1 text-xs min-w-0 overflow-hidden">
- <span
- class={cn(
- 'w-0 transition-[width] overflow-hidden duration-500 ease shrink-0',
- {
- 'w-4': unread(),
- }
- )}
- >
- <UnreadIndicator active />
- </span>
- <div class="shrink-0">
- <NotificationSenderIcon stack={props.stack} size="xs" />
- </div>
- <span class="ph-no-capture truncate min-w-0">
- <NotificationDescription stack={props.stack} />
- </span>
- <span class="text-ink-extra-muted/50 shrink-0">
- {' - '}
- <NotificationTimestamp stack={props.stack} />
- </span>
- <div class="ml-auto flex items-center gap-1 pr-2 shrink-0">
- <Button
- onClick={handleMarkAsDone}
- tooltip={'Mark notification done'}
- class="border border-edge-muted text-xs text-ink-muted grid p-0 place-items-center size-6"
- >
- <CheckIcon class="size-3" />
- </Button>
- </div>
- </div>
- <div
- class={cn('ph-no-capture mt-1 min-w-0', {
- 'truncate overflow-hidden':
- props.stack.type !== 'document_mention' && !props.content,
- })}
+ <ContextMenu>
+ <ContextMenu.Trigger class="size-full">
+ <div
+ class={cn(
+ 'flex p-2 pr-0 my-1 border-l-2 border-edge bg-message gap-4 hover:bg-hover min-w-0 overflow-hidden'
+ )}
+ onClick={handleClick}
+ role="button"
+ tabIndex={0}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault();
+ handleClick(e);
+ }
+ if (e.key === 'e') {
+ e.preventDefault();
+ e.stopPropagation();
+ handleMarkAsDone();
+ }
+ }}
+ >
+ <div class="pt-1 shrink-0">
+ <NotificationIcon stack={props.stack} class="size-4" />
+ </div>
+ <div class="min-w-0 flex-1">
+ <div class="flex items-center gap-1 text-xs min-w-0 overflow-hidden">
+ <span
+ class={cn(
+ 'w-0 transition-[width] overflow-hidden duration-500 ease shrink-0',
+ {
+ 'w-4': unread(),
+ }
+ )}
>
- {props.content ?? <NotificationContent stack={props.stack} />}
+ <UnreadIndicator active />
+ </span>
+ <div class="shrink-0">
+ <NotificationSenderIcon stack={props.stack} size="xs" />
+ </div>
+ <span class="ph-no-capture truncate min-w-0">
+ <NotificationDescription stack={props.stack} />
+ </span>
+ <span class="text-ink-extra-muted/50 shrink-0">
+ {' - '}
+ <NotificationTimestamp stack={props.stack} />
+ </span>
+ <div class="ml-auto flex items-center gap-1 pr-2 shrink-0">
+ <Button
+ onClick={handleMarkAsDone}
+ tooltip={'Mark notification done'}
+ class="border border-edge-muted text-xs text-ink-muted grid p-0 place-items-center size-6"
+ >
+ <CheckIcon class="size-3" />
+ </Button>
</div>
</div>
+ <div
+ class={cn('ph-no-capture mt-1 min-w-0', {
+ 'truncate overflow-hidden':
+ props.stack.type !== 'document_mention' && !props.content,
+ })}
+ >
+ {props.content ?? <NotificationContent stack={props.stack} />}
+ </div>
</div>
- </ContextMenu.Trigger>
- <ContextMenu.Portal>
- <div onClick={(e) => e.stopPropagation()}>
- <ContextMenuContent class="text-xs text-ink-muted">
- <MenuItem text="Mark Done" onClick={() => handleMarkAsDone()} />
- <MenuItem text="Mark Read" onClick={handleMarkAsRead} />
- <MenuItem text="Copy Link" onClick={handleCopyLink} />
- </ContextMenuContent>
- </div>
- </ContextMenu.Portal>
- </ContextMenu>
- </Layer>
+ </div>
+ </ContextMenu.Trigger>
+ <ContextMenu.Portal>
+ <div onClick={(e) => e.stopPropagation()}>
+ <ContextMenuContent class="text-xs text-ink-muted">
+ <MenuItem text="Mark Done" onClick={() => handleMarkAsDone()} />
+ <MenuItem text="Mark Read" onClick={handleMarkAsRead} />
+ <MenuItem text="Copy Link" onClick={handleCopyLink} />
+ </ContextMenuContent>
+ </div>
+ </ContextMenu.Portal>
+ </ContextMenu>
);
}
diff --git a/js/app/packages/ui/components/Layer.tsx b/js/app/packages/ui/components/Layer.tsx
index c9ef2bf039..da299a8e1d 100644
--- a/js/app/packages/ui/components/Layer.tsx
+++ b/js/app/packages/ui/components/Layer.tsx
@@ -34,9 +34,11 @@ export function Layer(props: LayerProps) {
'--color-page': 'var(--b0)',
'--color-menu': 'var(--b0)',
'--color-dialog': 'var(--b0)',
- '--color-input': 'var(--b0)',
+ // TODO (seamus): --color-input could be better handled with fractional layer depth
+ '--color-input': `oklch(calc(var(--b0l) + ${depth() + 0.02}) var(--b0c) var(--b0h))`,
'--color-button': 'var(--b0)',
- '--color-message': 'var(--b0)',
+ // TODO (seamus): --color-message could be better handled with fractional layer depth
+ '--color-message': 'color-mix(in oklch, var(--b1) 50%, var(--b2))',
'--color-active': 'var(--b1)',
'--color-hover': 'var(--b2)',
'--color-overlay': 'oklch(from var(--b2) l c h / 0.5)',
diff --git a/js/app/packages/ui/components/Panel.tsx b/js/app/packages/ui/components/Panel.tsx
index 4fe9a66a8c..7c53719583 100644
--- a/js/app/packages/ui/components/Panel.tsx
+++ b/js/app/packages/ui/components/Panel.tsx
@@ -15,7 +15,7 @@ export function Panel(props: PanelProps) {
<Layer depth={local.depth ?? 0}>
<div
style={{
- 'background-image': `linear-gradient(${props.active ? `${props.highlightColor || 'var(--color-acent)'}, var(--color-edge) 80%` : 'var(--color-edge)'})`,
+ 'background-image': `linear-gradient(${local.active ? `${local.highlightColor || 'var(--color-accent)'}, var(--color-edge) 80%` : 'var(--color-edge)'})`,
'display': local.hidden ? 'none' : 'block'
}}
class={cn("p-px h-full w-full box-border rounded-md overflow-clip min-h-0")}