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
style(ui): move to inline reply style input only in email threads (#4546)
Seamusb0a316f88442
diff --git a/js/app/packages/block-email/component/BaseInput.tsx b/js/app/packages/block-email/component/BaseInput.tsxindex cd66bc8bc7..878b7ddc3c 100644--- a/js/app/packages/block-email/component/BaseInput.tsx+++ b/js/app/packages/block-email/component/BaseInput.tsx@@ -15,7 +15,8 @@ import {import { useHasPaidAccess } from '@core/auth';import { useBlockId } from '@core/block';import { FileDropOverlay } from '@core/component/FileDropOverlay';-import { MarkdownTextarea } from '@core/component/LexicalMarkdown/component/core/MarkdownTextarea';+import { buildConfig } from '@core/component/LexicalMarkdown/builder/MarkdownConfigBuilder';+import { MarkdownShell } from '@core/component/LexicalMarkdown/builder/MarkdownShell';import { setEditorStateFromHtml } from '@core/component/LexicalMarkdown/utils';import {createFilesReadyHandler,@@ -35,6 +36,7 @@ import { fileSelector } from '@core/directive/fileSelector';import { observedSize } from '@core/directive/observedSize';import { TOKENS } from '@core/hotkey/tokens';import { isMobile } from '@core/mobile/isMobile';+import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';import { useTouchOutsideToDismissKeyboard } from '@core/mobile/useTouchOutsideToDismissKeyboard';import { trackMention } from '@core/signal/mention';import { plural } from '@core/util/string';@@ -88,6 +90,7 @@ import type {ApiDraftOutputDbId,ApiMessage,} from '@service-email/generated/schemas';+import { isIOS } from '@solid-primitives/platform';import {Button,cn,@@ -97,14 +100,9 @@ import {Surface,Tooltip,} from '@ui';-import {- defaultSelectionData,- lazyRegister,- type NodeTransformType,- type SelectionData,-} from 'core/component/LexicalMarkdown/plugins';+import { iosCursorScrollPlugin } from 'core/component/LexicalMarkdown/plugins/ios-cursor-scroll';import { registerHotkey, useHotkeyDOMScope } from 'core/hotkey/hotkeys';-import { $getRoot, type LexicalEditor } from 'lexical';+import { $getRoot } from 'lexical';import {type Accessor,createEffect,@@ -121,7 +119,6 @@ import {Switch,untrack,} from 'solid-js';-import { createStore } from 'solid-js/store';import { makeAttachmentPublic } from '../util/makeAttachmentPublic';import { getFirstName } from '../util/name';import {@@ -392,6 +389,54 @@ let restoreUndoCallback:| ((snapshot: UndoReplySnapshot, draftId: string) => void)| null = null;+type CreateConfiguredEmailMarkdownEditorOptions = {+ namespace: string;+ onChange?: (markdown: string) => void;+ onUserMention?: (mention: UserMentionRecord) => void;+ onDocumentMention?: (item: { id: string }) => void;+ onPasteFilesAndDirs?: (+ files: FileSystemFileEntry[],+ directories: FileSystemDirectoryEntry[]+ ) => void;+ scrollContainer?: Accessor<HTMLElement | undefined>;+};++function createConfiguredEmailMarkdownEditor(+ options: CreateConfiguredEmailMarkdownEditorOptions+) {+ const editor = buildConfig('markdown')+ .namespace(options.namespace)+ .withMentions({+ onUserMention: options.onUserMention,+ onDocumentMention: options.onDocumentMention,+ })+ .withEmojis()+ .withLinks({ floatingMenu: true, autoLinkMatchMode: 'common-tlds' })+ .withHistory({ timeGap: 400 })+ .withMedia()+ .withCode()+ .withCheckboxToTask()+ .withRestoreFocus()+ .withSelectionData()+ .withFloatingFormatMenu()+ .use((editor) => registerToggleAppendedThread(editor))+ .onChange(options.onChange);++ if (options.onPasteFilesAndDirs) {+ editor.withFilePaste({+ onPasteFilesAndDirs: options.onPasteFilesAndDirs,+ });+ }++ if ((isIOS || isNativeMobilePlatform()) && options.scrollContainer) {+ editor.use(+ iosCursorScrollPlugin({ scrollContainer: options.scrollContainer })+ );+ }++ return editor;+}+export function BaseInput(props: {replyingTo: Accessor<ApiMessage | undefined>;// TODO: Remove `newMessage` props. It's not used...@@ -407,6 +452,7 @@ export function BaseInput(props: {}) => void;setShowReply?: Setter<boolean>;markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;+ unframed?: boolean;}) {const ctx = useEmailContext();const form = createMemo(() => {@@ -483,18 +529,13 @@ export function BaseInput(props: {: undefined;const [bodyMacro, setBodyMacro] = createSignal<string>('');- const [expandedRecipientsRef, setExpandedRecipientsRef] =- createSignal<HTMLDivElement>();- const [editor, setEditor] = createSignal<LexicalEditor>();+ const [scrollContainer, setScrollContainer] = createSignal<HTMLElement>();const [showExpandedRecipients, setShowExpandedRecipients] =createSignal<boolean>(false);const [isDragging, setIsDragging] = createSignal<boolean>();const [showFormatRibbon, setShowFormatRibbon] = createSignal<boolean>(props.newMessage ?? false);- const [formatState, setFormatState] = createStore<SelectionData>(- structuredClone(defaultSelectionData)- );const [toRef, setToRef] = createSignal<HTMLInputElement>();const [ccRef, setCcRef] = createSignal<HTMLInputElement>();const [bccRef, setBccRef] = createSignal<HTMLInputElement>();@@ -514,6 +555,39 @@ export function BaseInput(props: {undefined);+ const editorConfig = createConfiguredEmailMarkdownEditor({+ namespace: 'email-base-input-markdown',+ scrollContainer,+ onChange: (markdown) => handleChange(markdown),+ onUserMention: (mention) => handleUserMention(mention),+ onDocumentMention: (item) => {+ makeAttachmentPublic(item.id);+ scheduleDraftSave();+ },+ onPasteFilesAndDirs: (files, directories) => {+ handleFileFolderDrop(+ files,+ directories,+ createFilesReadyHandler(+ editor(),+ blockId,+ 'email',+ undefined,+ (uploadedItemIds) => {+ uploadedItemIds.forEach((itemId) => {+ makeAttachmentPublic(itemId);+ });+ scheduleDraftSave();+ },+ { width: 542, height: 542 }+ )+ );+ },+ });++ const markdownHandle = editorConfig.buildHandle();+ const editor = () => markdownHandle.lexical;+// Consume undo-send snapshot if one exists and belongs to this thread (inline reply remount case).// Use bodyHtml as initialHtml for the editor, restore attachments on mount.const restoredSnapshot =@@ -547,6 +621,16 @@ export function BaseInput(props: {restoreUndoCallback = null;});+ const initialHtml = () => restoredSnapshot?.bodyHtml ?? props.preloadedHtml;+ const handleEditorConnect = () => {+ const currentEditor = editor();+ form().setCapturedEditor(currentEditor);+ const html = initialHtml();+ if (html) {+ setEditorStateFromHtml(currentEditor, html);+ }+ };+let pendingMentions: { documentId: string }[] = [];const [shouldMarkDoneOnSuccess, setShouldMarkDoneOnSuccess] =createSignal(false);@@ -725,10 +809,6 @@ export function BaseInput(props: {);});- lazyRegister(editor, (editor) => {- return registerToggleAppendedThread(editor);- });-let draftSaveTimer: number | undefined;let pendingDeletion = false;let pendingSend = false;@@ -953,13 +1033,16 @@ export function BaseInput(props: {untrack(scheduleDraftSave);};- // Handles clicks outside of the expanded recipients area+ // Keep expanded recipients open while composing; collapse only when leaving+ // the composer or selecting outside its recipient popover.const expandedPointerDownHandler = (e: PointerEvent) => {if (showExpandedRecipients()) {+ const target = e.target as Node | null;+ if (!target) return;const combobox = document.querySelector('div[data-popper-positioner]');if (- !expandedRecipientsRef()?.contains(e.target as Node) &&- !combobox?.contains(e.target as Node)+ !composeContainerRef?.contains(target) &&+ !combobox?.contains(target)) {setShowExpandedRecipients(false);setShowCc(form().recipients().cc.length > 0);@@ -1289,10 +1372,9 @@ export function BaseInput(props: {}});- // Focus when external shouldFocus signal is set to true. Gated on- // editor() so the effect re-runs once the Lexical editor is captured —- // when the input is freshly mounted (e.g. opening from BottomReplyButtons),- // shouldFocusInput is true before captureEditor fires.+ // Focus when external shouldFocus signal is set to true. The builder creates+ // the Lexical editor immediately; requestAnimationFrame waits for the root to+ // connect before focusing.createEffect(() => {if (!form().shouldFocusInput()) return;if (isMobile()) {@@ -1447,9 +1529,61 @@ export function BaseInput(props: {const hasBodyText = () => bodyMacro().trim().length > 0;+ const ReplyTypeDropdown = () => (+ <Dropdown>+ <Dropdown.Trigger as={Button} size="md">+ <Switch>+ <Match when={effectiveReplyType() === 'reply'}>+ <Reply class="size-4 shrink-0" />+ <span>Reply</span>+ </Match>++ <Match when={effectiveReplyType() === 'reply-all'}>+ <ReplyAll class="size-4 shrink-0" />+ <span>Reply All</span>+ </Match>+ <Match when={effectiveReplyType() === 'forward'}>+ <Forward class="size-4 shrink-0" />+ <span>Forward</span>+ </Match>+ </Switch>+ <ChevronDown class="size-3" />+ </Dropdown.Trigger>+ <Dropdown.Content>+ <Dropdown.Group>+ <Dropdown.Item onSelect={() => form().setReplyType('reply')}>+ <Reply class="size-4 shrink-0" />+ <span class="flex-1 truncate">Reply</span>+ </Dropdown.Item>+ <Show+ when={+ (props.replyingTo()?.to.length ?? 0) ++ (props.replyingTo()?.cc.length ?? 0) >+ 1+ }+ >+ <Dropdown.Item onSelect={() => form().setReplyType('reply-all')}>+ <ReplyAll class="size-4 shrink-0" />+ <span class="flex-1 truncate">Reply All</span>+ </Dropdown.Item>+ </Show>+ <Dropdown.Item onSelect={() => form().setReplyType('forward')}>+ <Forward class="size-4 shrink-0" />+ <span class="flex-1 truncate">Forward</span>+ </Dropdown.Item>+ </Dropdown.Group>+ </Dropdown.Content>+ </Dropdown>+ );+return (<Surface- class="relative flex flex-col flex-1 rounded-xl max-w-full"+ class={cn(+ 'relative flex flex-col flex-1 max-w-full',+ props.unframed ? 'rounded-none' : 'rounded-xl'+ )}+ style={props.unframed ? { 'background-color': 'transparent' } : undefined}+ hideBorder={props.unframed}onFocusOut={(e) => {const next = e.relatedTarget as Node | null;if (next && e.currentTarget.contains(next)) return;@@ -1463,110 +1597,92 @@ export function BaseInput(props: {depth={2}solid>- {/* Top Bar */}- <div class="relative flex items-start gap-2 px-3 pt-1.5 pb-0.5 min-w-0">- <Dropdown>- <Dropdown.Trigger>- <Switch>- <Match when={effectiveReplyType() === 'reply'}>- <Reply class="size-4 shrink-0" />- <span>Reply</span>- </Match>-- <Match when={effectiveReplyType() === 'reply-all'}>- <ReplyAll class="size-4 shrink-0" />- <span>Reply All</span>- </Match>- <Match when={effectiveReplyType() === 'forward'}>- <Forward class="size-4 shrink-0" />- <span>Forward</span>- </Match>- </Switch>- <ChevronDown class="size-3" />- </Dropdown.Trigger>- <Dropdown.Content>- <Dropdown.Group>- <Dropdown.Item onSelect={() => form().setReplyType('reply')}>- <Reply class="size-4 shrink-0" />- <span class="flex-1 truncate">Reply</span>- </Dropdown.Item>- <Show- when={- (props.replyingTo()?.to.length ?? 0) +- (props.replyingTo()?.cc.length ?? 0) >- 1- }- >- <Dropdown.Item- onSelect={() => form().setReplyType('reply-all')}- >- <ReplyAll class="size-4 shrink-0" />- <span class="flex-1 truncate">Reply All</span>- </Dropdown.Item>- </Show>- <Dropdown.Item onSelect={() => form().setReplyType('forward')}>- <Forward class="size-4 shrink-0" />- <span class="flex-1 truncate">Forward</span>- </Dropdown.Item>- </Dropdown.Group>- </Dropdown.Content>- </Dropdown>+ <div+ class={cn(+ 'relative min-w-0 text-sm text-ink-muted flex items-center gap-2 wrap p-2 pt-4'+ )}+ ><Showwhen={showExpandedRecipients()}fallback={- <div- class="flex flex-1 items-center gap-1.5 min-w-0 mt-1 text-sm text-ink-muted"- onClick={() => setShowExpandedRecipients(true)}- >- <Show- when={!isMobile()}- fallback={- <PencilSimple class="size-4 shrink-0 text-ink-muted ml-auto" />- }+ <>+ <ReplyTypeDropdown />+ <div+ class="flex flex-1 items-center gap-1.5 min-w-0 text-sm text-ink-muted"+ onClick={() => setShowExpandedRecipients(true)}>- <TruncatedRecipientList- toRecipients={form().recipients().to}- ccRecipients={form().recipients().cc}- bccRecipients={form().recipients().bcc}- onClick={() => setShowExpandedRecipients(true)}- />- <Show when={(emailLinksQuery.data?.links.length ?? 0) > 1}>- <span class="shrink-0 text-ink-extra-muted">·</span>- <span class="min-w-0 shrink-[2] truncate">- from {activeInboxEmail()}- </span>+ <Show+ when={!isMobile()}+ fallback={+ <PencilSimple class="size-4 shrink-0 text-ink-muted ml-auto" />+ }+ >+ <TruncatedRecipientList+ toRecipients={form().recipients().to}+ ccRecipients={form().recipients().cc}+ bccRecipients={form().recipients().bcc}+ onClick={() => setShowExpandedRecipients(true)}+ />+ <Show when={(emailLinksQuery.data?.links.length ?? 0) > 1}>+ <span class="shrink-0 text-ink-extra-muted">·</span>+ <span class="min-w-0 shrink-2 truncate">+ from {activeInboxEmail()}+ </span>+ </Show>+ <PencilSimple class="size-3.5 shrink-0 text-ink-extra-muted" /></Show>- <PencilSimple class="size-3.5 shrink-0 text-ink-extra-muted" />- </Show>- </div>+ </div>+ </>}>- <div- ref={setExpandedRecipientsRef}- class="flex-1 min-w-0 text-sm text-ink-muted"- >- {/* Expanded FROM */}- <div class="flex flex-row items-center py-0.5 min-w-0">- <div class="w-10 shrink-0">from</div>- <div class="pl-2 min-w-0 flex-1">+ <div class="min-w-0 w-full">+ <div class="flex items-center gap-2 min-w-0">+ <ReplyTypeDropdown />+ <div class="flex items-center gap-2 min-w-0 flex-1 py-1">+ <div class="text-sm shrink-0 text-ink-placeholder">from</div><FromInboxSelectorlinks={emailLinksQuery.data?.links ?? []}activeLinkId={activeLinkId()}onSelect={persistDraftOnSenderSwitch}/></div>+ <div class="flex items-center ml-auto shrink-0">+ <Show when={!showCc()}>+ <Button+ size="sm"+ class="rounded-lg"+ onClick={() => {+ setShowCc(true);+ queueMicrotask(() => ccRef()?.focus());+ }}+ >+ Cc+ </Button>+ </Show>+ <Show when={!showBcc()}>+ <Button+ size="sm"+ class="rounded-lg"+ onClick={() => {+ setShowBcc(true);+ queueMicrotask(() => bccRef()?.focus());+ }}+ >+ Bcc+ </Button>+ </Show>+ </div></div>- {/* Expanded TO */}<RecipientDropRowfield="to"- class="-mt-0.5"+ class="w-full gap-2 py-3 border-b border-edge-muted focus-within:border-accent items-center"dragState={recipientDragState}onDrop={handleRecipientDrop}>- <div class="w-10 shrink-0 pt-2">to</div>+ <div class="w-14 shrink-0 text-sm text-ink-placeholder">To</div><RecipientSelector<EmailRecipient['kind']>- class="min-w-0"+ class="min-w-0 bg-transparent rounded-none! [&_input]:ml-0!"inputRef={setToRef}options={ctx.recipientOptions}selfEmail={activeInboxEmail()}@@ -1576,6 +1692,7 @@ export function BaseInput(props: {)}triggerMode="input"hideBorder+ noPaddingonChipDragStart={(option, e) =>handleChipDragStart('to', option, e)}@@ -1586,13 +1703,13 @@ export function BaseInput(props: {<Show when={showCc() || form().recipients().cc.length > 0}><RecipientDropRowfield="cc"- class="-mt-1.5"+ class="w-full gap-2 py-3 border-b border-edge-muted focus-within:border-accent items-center"dragState={recipientDragState}onDrop={handleRecipientDrop}>- <div class="w-10 shrink-0 pt-2">cc</div>+ <div class="w-14 shrink-0 text-sm text-ink-placeholder">Cc</div><RecipientSelector<EmailRecipient['kind']>- class="min-w-0"+ class="min-w-0 bg-transparent rounded-none! [&_input]:ml-0!"inputRef={setCcRef}options={ctx.recipientOptions}selfEmail={activeInboxEmail()}@@ -1602,6 +1719,7 @@ export function BaseInput(props: {)}triggerMode="input"hideBorder+ noPaddingonChipDragStart={(option, e) =>handleChipDragStart('cc', option, e)}@@ -1613,13 +1731,15 @@ export function BaseInput(props: {<Show when={showBcc() || form().recipients().bcc.length > 0}><RecipientDropRowfield="bcc"- class="-mt-1.5"+ class="w-full gap-2 py-3 border-b border-edge-muted focus-within:border-accent items-center"dragState={recipientDragState}onDrop={handleRecipientDrop}>- <div class="w-10 shrink-0 pt-2">bcc</div>+ <div class="w-14 shrink-0 text-sm text-ink-placeholder">+ Bcc+ </div><RecipientSelector<EmailRecipient['kind']>- class="min-w-0"+ class="min-w-0 bg-transparent rounded-none! [&_input]:ml-0!"inputRef={setBccRef}options={ctx.recipientOptions}selfEmail={activeInboxEmail()}@@ -1629,6 +1749,7 @@ export function BaseInput(props: {)}triggerMode="input"hideBorder+ noPaddingonChipDragStart={(option, e) =>handleChipDragStart('bcc', option, e)}@@ -1636,35 +1757,6 @@ export function BaseInput(props: {/></RecipientDropRow></Show>- {/* Show to, cc, bcc buttons */}- <div class="flex flex-row justify-end space-x-2 pt-2">- <Show when={!showCc()}>- <Tooltip label="Add cc recipients">- <div- onclick={() => {- setShowCc(true);- ccRef()?.focus();- }}- class="text-xs hover:underline"- >- cc- </div>- </Tooltip>- </Show>- <Show when={!showBcc()}>- <Tooltip label="Add bcc recipients">- <div- onclick={() => {- setShowBcc(true);- bccRef()?.focus();- }}- class="text-xs hover:underline"- >- bcc- </div>- </Tooltip>- </Show>- </div></div></Show></div>@@ -1686,29 +1778,27 @@ export function BaseInput(props: {placeholder="Subject"/></div>- <div class="size-full flex flex-col">+ <div+ class={cn(+ 'size-full flex flex-col',+ showExpandedRecipients() && 'mt-4'+ )}+ ><Show when={showFormatRibbon()}><div class="flex flex-row w-full gap-2 items-center px-3 py-1.5"><FormatButtons- selectionState={() => formatState}+ selectionState={() => editorConfig.selection}onInlineFormat={(format) => {- const editor_ = editor();- if (!editor_) return;- applyInlineFormat(editor_, format);+ applyInlineFormat(editor(), format);}}onNodeFormat={(transform) => {- const editor_ = editor();- if (!editor_) return;- const isActive = formatState.elementsInRange.has(transform);- const targetTransform: NodeTransformType = isActive- ? 'paragraph'- : transform;- applyNodeFormat(editor_, targetTransform);+ applyNodeFormat(editor(), transform);}}/></div></Show><div+ ref={setScrollContainer}class="relative min-h-18 max-h-[calc(60*var(--dvh,1dvh))] mobile:max-h-[calc(32*var(--dvh,1dvh))] overflow-y-auto w-full flex flex-col placeholder:text-ink-placeholder placeholder:opacity-50 px-4 py-1"onclick={() => {editor()?.focus();@@ -1745,54 +1835,24 @@ export function BaseInput(props: {><FileDropOverlay>Drop file(s) to attach</FileDropOverlay></div>- <MarkdownTextarea- autoLinkMatchMode="common-tlds"- floatingFormatMenu- captureEditor={(editor) => {- setEditor(editor);- form().setCapturedEditor(editor);- }}+ <MarkdownShell+ config={editorConfig}class={cn('ph-no-capture cursor-text text-sm wrap-break-word text-ink h-auto overflow-visible',isDragging() && 'blur')}- editable={() => !sendMutation.isPending}- initialValue={props.preloadedBody}- initialHtml={restoredSnapshot?.bodyHtml ?? props.preloadedHtml}+ disabled={sendMutation.isPending}+ initialValue={initialHtml() ? undefined : props.preloadedBody}placeholder="Reply — @mention to share or cc people"- watermark={!hasPaidAccess() ? <MacroSignatureButton /> : undefined}- onChange={handleChange}- onDocumentMention={(item) => {- makeAttachmentPublic(item.id);- scheduleDraftSave();- }}- onUserMention={handleUserMention}portalScope="split"- formatState={formatState}- setFormatState={setFormatState}- domRef={props.markdownDomRef}- onPasteFilesAndDirs={(files, directories) => {- const editor_ = editor();- if (!editor_) return;- handleFileFolderDrop(- files,- directories,- createFilesReadyHandler(- editor_,- blockId,- 'email',- undefined,- (uploadedItemIds) => {- uploadedItemIds.forEach((itemId) => {- makeAttachmentPublic(itemId);- });- scheduleDraftSave();- },- { width: 542, height: 542 }- )- );- }}+ refFn={(el) => props.markdownDomRef?.(el)}+ onConnect={handleEditorConnect}/>+ <Show when={!hasPaidAccess()}>+ <div class="text-ink/50 mt-[1lh]" data-watermark>+ <MacroSignatureButton />+ </div>+ </Show><div class="ph-no-capture flex gap-1 flex-wrap w-full py-2"><For each={form().attachments.list()}>{(attachment) => (@@ -1870,6 +1930,7 @@ export function BaseInput(props: {onclick={() => {setShowFormatRibbon(!showFormatRibbon());}}+ variant="ghost"tooltip="Show formatting toolbar"size="icon-sm">@@ -1909,6 +1970,17 @@ export function BaseInput(props: {<Quotes /></KToggleButton></Tooltip>+ <div aria-hidden="true" class="mx-1 h-4 w-px bg-edge-muted/70" />+ <Button+ onclick={deleteDraftAndReset}+ tooltip={savedDraftId() ? 'Delete draft' : 'Discard'}+ size="icon-sm"+ >+ <Trash />+ </Button>+ </div>++ <div class="flex flex-row items-center gap-1"><Show when={ENABLE_EMAIL_SCHEDULED_SEND}><EmailDateSelectorsendTime={form().sendTime() ?? null}@@ -1921,31 +1993,23 @@ export function BaseInput(props: {disablePortal={isMobile()}/></Show>- <Button- onclick={deleteDraftAndReset}- tooltip={savedDraftId() ? 'Delete draft' : 'Discard'}- size="icon-sm"- >- <Trash />- </Button>+ <SendButton+ disabled={+ uploadAttachmentMutation.isPending ||+ sendMutation.isPending ||+ !!form().sendTime()+ }+ pending={sendMutation.isPending}+ hidden={+ isMobile() &&+ !hasBodyText() &&+ // Forwards carry the quoted thread as content, so send is+ // available without typing anything.+ effectiveReplyType() !== 'forward'+ }+ onClick={() => sendEmail()}+ /></div>-- <SendButton- disabled={- uploadAttachmentMutation.isPending ||- sendMutation.isPending ||- !!form().sendTime()- }- pending={sendMutation.isPending}- hidden={- isMobile() &&- !hasBodyText() &&- // Forwards carry the quoted thread as content, so send is- // available without typing anything.- effectiveReplyType() !== 'forward'- }- onClick={() => sendEmail()}- /></div></div></Surface>diff --git a/js/app/packages/block-email/component/BottomReplyButtons.tsx b/js/app/packages/block-email/component/BottomReplyButtons.tsxindex 9c89e1e556..ad21d4ffef 100644--- a/js/app/packages/block-email/component/BottomReplyButtons.tsx+++ b/js/app/packages/block-email/component/BottomReplyButtons.tsx@@ -20,21 +20,19 @@ function ReplyActionButton(props: {}) {return (<Button- variant="base"- size="sm"// Button wraps itself in Layer depth={0} by default; in the floating// accessory region, match the chrome's depth so the island surface// matches the dock buttons. (The region host's Layer can't help —// Button's own Layer would reset it.)depth={isMobile() ? 3 : undefined}+ variant="base"class={cn(- 'rounded-lg px-3 py-1.5 text-sm text-ink-muted hover:text-ink border border-ink-muted/8 bg-ink-muted/2.5 hover:bg-ink-muted/6',// Island pills when floating in the mobile accessory region.'mobile:island mobile:h-8 mobile:rounded-full mobile:border-0')}onClick={props.onClick}>- <props.icon class="size-3.5" />+ <props.icon class="size-4 shrink-0" /><span>{props.label}</span></Button>);@@ -63,7 +61,7 @@ export function BottomReplyButtons(props: { lastMessage: ApiMessage }) {return (<FloatRegionOrInline region="accessory">- <div class="w-full pt-2 pb-1 mobile:py-0 mobile:px-(--mobile-chrome-gutter)">+ <div class="w-full p-2 pb-2 pt-4 mobile:px-(--mobile-chrome-gutter) mobile:py-0"><div class="flex flex-row items-center gap-2 mobile:pointer-events-auto"><ReplyActionButtonicon={ArrowBendUpLeft}diff --git a/js/app/packages/block-email/component/CollapsedMessage.tsx b/js/app/packages/block-email/component/CollapsedMessage.tsxindex 109b40015f..87accd7605 100644--- a/js/app/packages/block-email/component/CollapsedMessage.tsx+++ b/js/app/packages/block-email/component/CollapsedMessage.tsx@@ -54,10 +54,10 @@ export function CollapsedMessage(props: CollapsedMessageProps) {<div class="macro-message-width macro-message-padding w-full"><divclass={cn(- 'relative flex items-center gap-2 px-3 py-2 rounded-lg cursor-pointer min-w-0 ring-1 ring-inset',+ 'relative flex items-center gap-2 px-4 py-2 rounded-lg min-w-0 ring',props.isFocused? 'bg-active/60 ring-edge'- : 'bg-ink-muted/[0.025] ring-ink-muted/8 hover:bg-active/40 hover:ring-edge'+ : 'bg-ink-muted/2.5 hover:bg-active/40 hover:ring-edge ring-transparent')}data-message-body-id={props.message.db_id}tabIndex={0}diff --git a/js/app/packages/block-email/component/Email.tsx b/js/app/packages/block-email/component/Email.tsxindex 59f43d0e69..ce0e5f2094 100644--- a/js/app/packages/block-email/component/Email.tsx+++ b/js/app/packages/block-email/component/Email.tsx@@ -688,6 +688,9 @@ function EmailContent(props: EmailViewProps) {</Show><MessageListinitialLoadComplete={context.initialLoadComplete()}+ markdownDomRef={(el) => {+ markdownDomRef = el;+ }}onScrollPositionChange={handleScrollPositionChange}title={props.title}underScrollsBottom={!replyInputInFlow()}@@ -697,7 +700,7 @@ function EmailContent(props: EmailViewProps) {scrollContainer={context.messagesListRef}/></div>- <Show when={replyArea()}>+ <Show when={isMobile() && replyArea()}>{(info) => (<divclass={cn(@@ -711,7 +714,7 @@ function EmailContent(props: EmailViewProps) {: 'mobile:hidden')}>- <div class="relative w-full flex flex-row justify-center bg-surface macro-message-width macro-message-padding mx-auto">+ <div class="relative w-full flex flex-row justify-center macro-message-width macro-message-padding mx-auto"><FloatingInputLoaderisLoading={context.query.isFetching}loadingText="Loading messages"diff --git a/js/app/packages/block-email/component/EmailInput.tsx b/js/app/packages/block-email/component/EmailInput.tsxindex 5232a2ce42..4c8b67d2eb 100644--- a/js/app/packages/block-email/component/EmailInput.tsx+++ b/js/app/packages/block-email/component/EmailInput.tsx@@ -14,6 +14,7 @@ interface EmailInputProps {draft?: ApiMessage;setShowReply?: Setter<boolean>;markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;+ unframed?: boolean;}export function EmailInput(props: EmailInputProps) {@@ -52,6 +53,7 @@ export function EmailInput(props: EmailInputProps) {onMarkDone={ctx.archiveThread}setShowReply={props.setShowReply}markdownDomRef={props.markdownDomRef}+ unframed={props.unframed}isEditingExisting={props.replyingTo() == null && props.draft != null}/></Layer>diff --git a/js/app/packages/block-email/component/MessageContainer.tsx b/js/app/packages/block-email/component/MessageContainer.tsxindex 5aa586eb4d..2b94c73a24 100644--- a/js/app/packages/block-email/component/MessageContainer.tsx+++ b/js/app/packages/block-email/component/MessageContainer.tsx@@ -6,11 +6,13 @@ import { EmailInput } from '@block-email/component/EmailInput';import { EmailMessageBody } from '@block-email/component/EmailMessageBody';import { EmailMessageTopBar } from '@block-email/component/EmailMessageTopBar';import { getSenderMacroId } from '@block-email/util/emailUser';+import { FloatingInputLoader } from '@core/component/FloatingInputLoader';import { ImageGalleryPreview } from '@core/component/ImageGalleryPreview';import { Message } from '@core/component/Message';import { toast } from '@core/component/Toast/Toast';import { VideoPreview } from '@core/component/VideoPreview';import { fileTypeToBlockName } from '@core/constant/allBlocks';+import { isMobile } from '@core/mobile/isMobile';import { logger } from '@observability';import { refetchSoupEntity } from '@queries/soup/cache';@@ -18,7 +20,9 @@ import { emailClient } from '@service-email/client';import type { ApiMessage, Attachment } from '@service-email/generated/schemas';import { storageServiceClient } from '@service-storage/client';import type { FileType } from '@service-storage/generated/schemas/fileType';-import { createMemo, createSignal, For, Show } from 'solid-js';+import { cn } from '@ui';+import { createMemo, createSignal, For, Match, Show, Switch } from 'solid-js';+import { BottomReplyButtons } from './BottomReplyButtons';interface MessageContainerProps {message: ApiMessage;@@ -27,6 +31,7 @@ interface MessageContainerProps {isFocused: boolean;isTarget: boolean;isExpanded: boolean;+ markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;}export function MessageContainer(props: MessageContainerProps) {@@ -46,6 +51,27 @@ export function MessageContainer(props: MessageContainerProps) {showReplyInternal() ||context.messages.replyingToMessageId() === props.message.db_id;+ const showInlineReplyInput = createMemo(() => {+ if (!props.isLastMessage) return showReply() || !!draftChild();+ return (+ !isMobile() && (context.messages.bottomReplyOpen() || !!draftChild())+ );+ });++ const showDesktopLastReplyControls = createMemo(+ () =>+ props.isLastMessage &&+ !!props.message.db_id &&+ !isMobile() &&+ context.drafts.initialDraftsSettled()+ );++ const showInlineReplyArea = createMemo(+ () =>+ context.permissions().isOwner &&+ (showInlineReplyInput() || showDesktopLastReplyControls())+ );+const setShowReply = (value: boolean | ((prev: boolean) => boolean)) => {const newValue =typeof value === 'function' ? value(showReplyInternal()) : value;@@ -200,10 +226,10 @@ export function MessageContainer(props: MessageContainerProps) {<div class="shrink-0 flex justify-center w-full"><div class="macro-message-width macro-message-padding w-full"><div- class="relative rounded-lg overflow-hidden pl-1 pr-1.5 py-2 ring-1 ring-inset [&>div]:bg-transparent!"+ class="relative rounded-lg overflow-hidden p-2 ring"classList={{'bg-active/60 ring-edge': props.isFocused,- 'bg-ink-muted/[0.025] ring-ink-muted/8': !props.isFocused,+ 'bg-ink-muted/4 ring-transparent': !props.isFocused,}}><Message@@ -217,9 +243,8 @@ export function MessageContainer(props: MessageContainerProps) {isTarget={props.isTarget}hasReplyInputBelow={true}hideConnectors- hasThreadChildren={- !props.isLastMessage && (showReply() || !!draftChild())- }+ disableHoverBackground+ hasThreadChildren={showInlineReplyArea()}><Message.TopBar><EmailMessageTopBar@@ -325,16 +350,31 @@ export function MessageContainer(props: MessageContainerProps) {</div></Show></Message>- <Show when={(showReply() || draftChild()) && !props.isLastMessage}>- <Show when={context.permissions().isOwner}>- <div class="border-t border-ink-muted/8 -mx-1.5 px-1.5 pt-2 pb-1 [&>*>div]:border-0! [&>*>div]:bg-transparent! [&>*>div]:rounded-none!">- <EmailInput- replyingTo={() => props.message}- setShowReply={setShowReply}- draft={draftChild()}+ <Show when={showInlineReplyArea()}>+ <div class={cn('relative border-t border-edge-muted')}>+ <Show when={props.isLastMessage && !isMobile()}>+ <FloatingInputLoader+ isLoading={context.query.isFetching}+ loadingText="Loading messages"/>- </div>- </Show>+ </Show>+ <Switch>+ <Match when={showInlineReplyInput()}>+ <EmailInput+ replyingTo={() => props.message}+ setShowReply={setShowReply}+ draft={draftChild()}+ markdownDomRef={+ props.isLastMessage ? props.markdownDomRef : undefined+ }+ unframed+ />+ </Match>+ <Match when={props.isLastMessage && !isMobile()}>+ <BottomReplyButtons lastMessage={props.message} />+ </Match>+ </Switch>+ </div></Show></div></div>diff --git a/js/app/packages/block-email/component/MessageList.tsx b/js/app/packages/block-email/component/MessageList.tsxindex d7c0bc21b6..64f7df2763 100644--- a/js/app/packages/block-email/component/MessageList.tsx+++ b/js/app/packages/block-email/component/MessageList.tsx@@ -19,6 +19,7 @@ const LAST_MESSAGE_REST_FRACTION = 0.4;interface MessageListProps {initialLoadComplete: boolean;+ markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;onScrollPositionChange?: (scrollFromTop: number) => void;title?: string;/**@@ -149,6 +150,9 @@ export function MessageList(props: MessageListProps) {isTarget={isTargetSelector(message().db_id ?? undefined)}message={message()}isExpanded={isExpanded()}+ markdownDomRef={+ isLastMessage() ? props.markdownDomRef : undefined+ }/>);}}diff --git a/js/app/packages/block-email/component/compose/ComposeLayout.tsx b/js/app/packages/block-email/component/compose/ComposeLayout.tsxindex 2d0c562c9b..7553ca981c 100644--- a/js/app/packages/block-email/component/compose/ComposeLayout.tsx+++ b/js/app/packages/block-email/component/compose/ComposeLayout.tsx@@ -2,7 +2,7 @@ import { CircleSpinner } from '@core/component/CircleSpinner';import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';import { TOKENS } from '@core/hotkey/tokens';import { isMobile } from '@core/mobile/isMobile';-import { cn } from '@ui';+import { Button, cn } from '@ui';import { createSignal, type JSX, onMount, Show, Suspense } from 'solid-js';import { FromInboxSelector } from '../FromInboxSelector';import { ComposeBody } from './ComposeBody';@@ -222,28 +222,28 @@ export function ComposeLayout(props: {{props.header}</Show><div- class="flex items-center gap-3 ml-auto shrink-0"+ class="flex items-center ml-auto shrink-0"classList={{ hidden: isMobile() }}><Show when={!isCcVisible()}>- <button- type="button"- class="px-1.5 -mx-1.5 py-1 rounded-md text-sm text-ink-muted hover:text-ink hover:bg-hover"+ <Button+ size="sm"+ class="rounded-lg"onClick={() => setShowCc(true)}disabled={ctx.disabled()}>Cc- </button>+ </Button></Show><Show when={!isBccVisible()}>- <button- type="button"- class="px-1.5 -mx-1.5 py-1 rounded-md text-sm text-ink-muted hover:text-ink hover:bg-hover"+ <Button+ size="sm"+ class="rounded-lg"onClick={() => setShowBcc(true)}disabled={ctx.disabled()}>Bcc- </button>+ </Button></Show></div></div>diff --git a/js/app/packages/block-email/component/compose/ComposeToolbar.tsx b/js/app/packages/block-email/component/compose/ComposeToolbar.tsxindex 761d9a4597..fffab4cebc 100644--- a/js/app/packages/block-email/component/compose/ComposeToolbar.tsx+++ b/js/app/packages/block-email/component/compose/ComposeToolbar.tsx@@ -86,7 +86,7 @@ export function EmailComposeToolbar(props: {/>}>- <div class="flex flex-row items-center gap-2">+ <div class="flex flex-row items-center gap-1"><Show when={!ctx.hideAttachments}><div class="relative" ref={attachButtonRef}><Button@@ -114,25 +114,19 @@ export function EmailComposeToolbar(props: {><TextAa /></Button>- <Show when={ENABLE_EMAIL_SCHEDULED_SEND && ctx.onSendTimeChange}>- <EmailDateSelector- sendTime={ctx.sendTime()}- onSendTimeChange={ctx.onSendTimeChange}- disabled={ctx.scheduleSendDisabled?.()}- />- </Show><Show when={ctx.hasDraft()}>+ <div aria-hidden="true" class="mx-1 h-4 w-px bg-edge-muted/70" /><Buttononclick={ctx.onDelete}tooltip="Delete draft"- class="aspect-square *:h-5 p-1"+ size="icon-sm"><Trash /></Button></Show></div>- <div class="flex items-center gap-2">+ <div class="flex items-center gap-1"><Show when={ctx.onSaveDraft}><Buttondisabled={@@ -145,6 +139,13 @@ export function EmailComposeToolbar(props: {{ctx.isSavingDraft?.() ? 'Saving…' : 'Save Draft'}</Button></Show>+ <Show when={ENABLE_EMAIL_SCHEDULED_SEND && ctx.onSendTimeChange}>+ <EmailDateSelector+ sendTime={ctx.sendTime()}+ onSendTimeChange={ctx.onSendTimeChange}+ disabled={ctx.scheduleSendDisabled?.()}+ />+ </Show><Tooltip label={ctx.sendTime() ? 'Send time is scheduled' : ''}><SendButtononClick={() => ctx.onSend()}@@ -192,14 +193,6 @@ function MobileToolbar(props: {</Button></div></Show>- <Show when={ENABLE_EMAIL_SCHEDULED_SEND && ctx.onSendTimeChange}>- <EmailDateSelector- sendTime={ctx.sendTime()}- onSendTimeChange={ctx.onSendTimeChange}- disabled={ctx.scheduleSendDisabled?.()}- compact- />- </Show><Show when={ctx.onSaveDraft}><Buttonvariant="base"@@ -212,6 +205,14 @@ function MobileToolbar(props: {{ctx.isSavingDraft?.() ? 'Saving…' : 'Draft'}</Button></Show>+ <Show when={ENABLE_EMAIL_SCHEDULED_SEND && ctx.onSendTimeChange}>+ <EmailDateSelector+ sendTime={ctx.sendTime()}+ onSendTimeChange={ctx.onSendTimeChange}+ disabled={ctx.scheduleSendDisabled?.()}+ compact+ />+ </Show><SendButtondisabled={ctx.isSending() ||diff --git a/js/app/packages/block-email/component/date-selector.tsx b/js/app/packages/block-email/component/date-selector.tsxindex 7033ef7368..71be316040 100644--- a/js/app/packages/block-email/component/date-selector.tsx+++ b/js/app/packages/block-email/component/date-selector.tsx@@ -6,7 +6,7 @@ import {} from '@kobalte/core/combobox';import SearchIcon from '@phosphor/magnifying-glass.svg';import { useSearchInputFocus } from '@property/utils';-import { cn, Layer } from '@ui';+import { Surface } from '@ui';import { format, setHours, setMinutes, startOfDay } from 'date-fns';import {type Component,@@ -303,83 +303,88 @@ export const DateSelector = (props: DateSelectorProps) => {</Show><DateSelectorPortalWrapper disabled={props.disablePortal}>- <Layer depth={3}>- <Combobox.Content- class="w-full max-w-sm bg-surface text-ink border border-edge"- on:keydown={handleKeyDown}+ <Combobox.Content+ class="rounded-xl size-auto z-action-menu menu-open-animation shadow-menu w-full max-w-70 text-ink"+ as={Surface}+ depth={3}+ bgToken="menu"+ on:keydown={handleKeyDown}+ >+ <WithCustomDateMode+ selectedDate={selectedDate()}+ disablePriorToDate={props.disablePriorToDate}+ disableAfterDate={props.disableAfterDate}+ mode={mode()}+ onSelectDate={(date) => {+ onChange({ type: 'custom', date });+ setInternalOpen(false);+ }}>- <WithCustomDateMode- selectedDate={selectedDate()}- disablePriorToDate={props.disablePriorToDate}- disableAfterDate={props.disableAfterDate}- mode={mode()}- onSelectDate={(date) => {- onChange({ type: 'custom', date });- setInternalOpen(false);- }}- >- <div class="flex w-full items-center py-1 gap-2 px-2 border-b border-edge-muted">- <SearchIcon class="size-4 text-ink-muted" />- <Combobox.Input- ref={setSearchInputRef}- class="w-full caret-accent"- autofocus+ <div class="flex w-full items-center py-2 gap-2 px-2 border-b border-edge-muted">+ <SearchIcon class="size-4 text-ink-muted" />+ <Combobox.Input+ ref={setSearchInputRef}+ class="w-full caret-accent"+ autofocus+ />+ </div>++ <Show when={selectedOption()}>+ {(option) => (+ <CurrentValueDisplay+ selectedOption={option()}+ onClear={() => {+ onChange(null);+ }}/>- </div>-- <Show when={selectedOption()}>- {(option) => (- <CurrentValueDisplay- selectedOption={option()}- onClear={() => {- onChange(null);- }}- />- )}- </Show>- <Show when={dateOptions().length === 0}>- <Show- when={searchQuery().trim()}- fallback={+ )}+ </Show>+ <div class="p-1.5">+ <div class="max-h-56 overflow-y-auto overflow-x-hidden scrollbar-hidden">+ <Show when={dateOptions().length === 0}>+ <Show+ when={searchQuery().trim()}+ fallback={+ <div class="text-center py-2 text-ink-muted text-sm">+ Enter a date or duration+ </div>+ }+ ><div class="text-center py-2 text-ink-muted text-sm">- Enter a date or duration+ No dates match "{searchQuery()}"</div>- }- >- <div class="text-center py-2 text-ink-muted text-sm">- No dates match "{searchQuery()}"- </div>+ </Show></Show>- </Show>- <Combobox.Listbox ref={setListboxRef} />- <Show when={props.withTime}>- <div class="px-2 py-1.5 border-t border-edge-muted">- <label class="flex items-center justify-between text-sm">- Time- <input- type="time"- value={- selectedDate()- ? format(selectedDate()!, 'HH:mm')- : undefined- }- onInput={onTimeInputChange}- />- </label>- </div>- </Show>+ <Combobox.Listbox ref={setListboxRef} />+ </div>+ </div>+ <Show when={props.withTime}><div class="px-2 py-1.5 border-t border-edge-muted">- <div class="text-xs text-ink-muted">- <span>Use queries like </span>- <code class="bg-active px-1">3d</code>,{' '}- <code class="bg-active px-1">1w</code>,{' '}- <code class="bg-active px-1">feb 17</code>, or{' '}- <code class="bg-active px-1">tomorrow</code>- </div>+ <label class="flex items-center justify-between text-sm">+ Time+ <input+ type="time"+ value={+ selectedDate()+ ? format(selectedDate()!, 'HH:mm')+ : undefined+ }+ onInput={onTimeInputChange}+ />+ </label></div>- </WithCustomDateMode>- </Combobox.Content>- </Layer>+ </Show>+ <div class="px-2 py-1.5 border-t border-edge-muted">+ <div class="text-xs text-ink-muted">+ <span>Use queries like </span>+ <code class="bg-active px-1">3d</code>,{' '}+ <code class="bg-active px-1">1w</code>,{' '}+ <code class="bg-active px-1">feb 17</code>, or{' '}+ <code class="bg-active px-1">tomorrow</code>+ </div>+ </div>+ </WithCustomDateMode>+ </Combobox.Content></DateSelectorPortalWrapper></Combobox>);@@ -451,7 +456,7 @@ const DateSelectorItem: Component<if (item.type === 'option') return item.displayText;- return 'Custom date';+ return 'Custom date...';};const description = () => {@@ -461,14 +466,10 @@ const DateSelectorItem: Component<return 'Pick from calendar';};- return (+ const item = () => (<Combobox.Itemitem={props.item}- class={cn(- 'flex flex-row w-full justify-between items-center gap-2 py-1.5 px-2 relative data-highlighted:bg-hover',- props.item.rawValue.type === 'select-custom' &&- 'border-t border-edge-muted'- )}+ class="group rounded-lg w-full flex items-center justify-between gap-1.5 p-1.5 px-2 text-left text-ink font-normal cursor-default outline-none data-highlighted:bg-hover"onPointerDown={(e: PointerEvent) => {// Prevent default to stop input blur on mobile, which would close the// combobox before the selection click event fires.@@ -489,4 +490,10 @@ const DateSelectorItem: Component<</Show></Combobox.Item>);++ return (+ <Show when={props.item.rawValue.type === 'select-custom'} fallback={item()}>+ <div class="border-t border-edge-muted mt-1.5 pt-1.5">{item()}</div>+ </Show>+ );};diff --git a/js/app/packages/core/component/DatePicker/DatePickerUI.tsx b/js/app/packages/core/component/DatePicker/DatePickerUI.tsxindex 37f11f3f99..06e85b7a1f 100644--- a/js/app/packages/core/component/DatePicker/DatePickerUI.tsx+++ b/js/app/packages/core/component/DatePicker/DatePickerUI.tsx@@ -193,7 +193,7 @@ export function DatePickerUI(props: DatePickerUIProps) {<div class="flex items-center justify-between mb-3"><buttontype="button"- class="p-1 hover:bg-active transition-colors"+ class="p-1 rounded-md hover:bg-active transition-colors"onClick={handlePrevMonth}><CaretLeft class="size-4" />@@ -201,7 +201,7 @@ export function DatePickerUI(props: DatePickerUIProps) {<buttontype="button"- class="font-semibold hover:bg-active px-2 py-1 transition-colors"+ class="font-semibold rounded-md hover:bg-active px-2 py-1 transition-colors"onClick={() => setPickerMode('month')}>{MONTHS[displayMonth()]} {displayYear()}@@ -209,7 +209,7 @@ export function DatePickerUI(props: DatePickerUIProps) {<buttontype="button"- class="p-1 hover:bg-active transition-colors"+ class="p-1 rounded-md hover:bg-active transition-colors"onClick={handleNextMonth}><CaretRight class="size-4" />@@ -232,7 +232,7 @@ export function DatePickerUI(props: DatePickerUIProps) {<Show when={day !== null} fallback={<div class="h-8" />}><buttontype="button"- class="size-8 transition-colors disabled:opacity-40"+ class="size-8 rounded-md transition-colors disabled:opacity-40"classList={{'bg-accent text-surface': isSelected(day!),'hover:bg-active': !isSelected(day!),@@ -265,7 +265,7 @@ export function DatePickerUI(props: DatePickerUIProps) {<div class="mb-3"><buttontype="button"- class="w-full font-semibold hover:bg-active px-2 py-1 transition-colors text-center"+ class="w-full font-semibold rounded-md hover:bg-active px-2 py-1 transition-colors text-center"onClick={() => setPickerMode('year')}>{displayYear()}@@ -277,7 +277,7 @@ export function DatePickerUI(props: DatePickerUIProps) {{(month, index) => (<buttontype="button"- class="px-3 py-2 hover:bg-active transition-colors"+ class="px-3 py-2 rounded-md hover:bg-active transition-colors"classList={{'bg-accent text-surface hover:bg-accent':displayMonth() === index(),@@ -303,7 +303,7 @@ export function DatePickerUI(props: DatePickerUIProps) {{(year) => (<buttontype="button"- class="px-3 py-2 hover:bg-active transition-colors"+ class="px-3 py-2 rounded-md hover:bg-active transition-colors"classList={{'bg-accent text-surface hover:bg-accent':displayYear() === year,@@ -326,7 +326,7 @@ export function DatePickerUI(props: DatePickerUIProps) {inputmode="numeric"maxLength={2}aria-label="Hour"- class="w-10 text-center bg-active border border-edge-muted p-1 text-sm focus:outline-none focus:border-accent"+ class="w-10 text-center bg-active border border-edge-muted rounded-md p-1 text-sm focus:outline-none focus:border-accent"value={hourDisplay()}onKeyDown={(e) => {if (e.key.length === 1 && !/\d/.test(e.key)) {@@ -351,7 +351,7 @@ export function DatePickerUI(props: DatePickerUIProps) {inputmode="numeric"maxLength={2}aria-label="Minute"- class="w-10 text-center bg-active border border-edge-muted p-1 text-sm focus:outline-none focus:border-accent"+ class="w-10 text-center bg-active border border-edge-muted rounded-md p-1 text-sm focus:outline-none focus:border-accent"value={minuteDisplay()}onKeyDown={(e) => {if (e.key.length === 1 && !/\d/.test(e.key)) {@@ -371,7 +371,7 @@ export function DatePickerUI(props: DatePickerUIProps) {}}/></div>- <div class="flex border border-edge-muted text-sm">+ <div class="flex border border-edge-muted rounded-md overflow-hidden text-sm"><buttontype="button"class="px-2 py-1 transition-colors"@@ -398,7 +398,7 @@ export function DatePickerUI(props: DatePickerUIProps) {<buttontype="button"aria-label="Confirm scheduled time"- class="p-1 bg-surface text-accent hover:bg-active transition-colors disabled:opacity-40 disabled:cursor-not-allowed"+ class="p-1 rounded-md bg-surface text-accent hover:bg-active transition-colors disabled:opacity-40 disabled:cursor-not-allowed"disabled={isTimeInPast()}onClick={() => props.onChange(buildDateWithTime(selectedDate()))}>diff --git a/js/app/packages/core/component/LexicalMarkdown/builder/MarkdownShell.tsx b/js/app/packages/core/component/LexicalMarkdown/builder/MarkdownShell.tsxindex c43fde16bb..75ad488f40 100644--- a/js/app/packages/core/component/LexicalMarkdown/builder/MarkdownShell.tsx+++ b/js/app/packages/core/component/LexicalMarkdown/builder/MarkdownShell.tsx@@ -256,6 +256,9 @@ export const MarkdownShell: Component<showOpenTabs={builderConfig.mentions?.showOpenTabs}entities={builderConfig.mentions?.entities}users={builderConfig.mentions?.users}+ onUserMention={builderConfig.mentions?.onUserMention}+ onDocumentMention={builderConfig.mentions?.onDocumentMention}+ onEmailMention={builderConfig.mentions?.onEmailMention}disableMentionTracking={builderConfig.mentions?.disableMentionTracking}diff --git a/js/app/packages/core/component/LexicalMarkdown/builder/types.ts b/js/app/packages/core/component/LexicalMarkdown/builder/types.tsindex d406092b81..e8e1da60c5 100644--- a/js/app/packages/core/component/LexicalMarkdown/builder/types.ts+++ b/js/app/packages/core/component/LexicalMarkdown/builder/types.ts@@ -1,5 +1,8 @@import type { PortalScope } from '@core/component/ScopedPortal';+import type { ChannelWithParticipants } from '@core/user';+import type { EmailEntity } from '@entity';import type { EditorType } from '@lexical-core';+import type { HistoryItem } from '@queries/history/history';import type { LexicalEditor, SerializedEditorState } from 'lexical';import type { Store } from 'solid-js/store';import type { MentionBucketId } from '../component/menu/MentionsMenu/MentionsMenuController';@@ -15,6 +18,7 @@ import type {} from '../plugins';import type { Action } from '../plugins/actions/types';import type { createMenuOperations } from '../shared/inlineMenu';+import type { UserMentionRecord } from '../utils/mentionsUtils';export interface ActionsOptions {useBlockBoundary?: boolean;@@ -28,6 +32,9 @@ export interface MentionsOptions {sources?: MentionBucketId[];onRemove?: (mention: ItemMention) => void;onCreate?: (mention: ItemMention) => void;+ onUserMention?: (mention: UserMentionRecord) => void;+ onDocumentMention?: (item: HistoryItem | ChannelWithParticipants) => void;+ onEmailMention?: (item: EmailEntity) => void;block?: string;showOpenTabs?: boolean;sourceDocumentId?: string;diff --git a/js/app/packages/core/component/Message.tsx b/js/app/packages/core/component/Message.tsxindex 376a1d1f93..f93daeb41a 100644--- a/js/app/packages/core/component/Message.tsx+++ b/js/app/packages/core/component/Message.tsx@@ -49,6 +49,12 @@ type MessageRootProps = {setThreadAppendMountTarget?: (el: HTMLElement) => void;onThreadAppend?: () => void;hideConnectors?: boolean;+ /**+ * When true, disables the default `bg-hover` background applied on hover.+ * Useful when a consumer applies its own hover/background styling to the+ * message wrapper and the core hover background would conflict.+ */+ disableHoverBackground?: boolean;children: JSX.Element;setMessageBodyRef?: Setter<HTMLDivElement | undefined>;isTarget?: boolean;@@ -219,7 +225,7 @@ const Root: Component<MessageRootProps> = (props) => {classList={{'bg-accent': props.isTarget,'bg-active': props.focused,- 'bg-hover': hover(),+ 'bg-hover': hover() && !props.disableHoverBackground,}}onMouseEnter={() => setHover(true)}onMouseLeave={() => setHover(false)}