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.

feat: various mobile ui improvements (#1010)

Peter Chinman829f854289d1
diff --git a/js/app/packages/app/asset/fonts/FormaMacroVariable.woff2 b/js/app/packages/app/asset/fonts/FormaMacroVariable.woff2
deleted file mode 100644
index c5523708c9..0000000000
Binary files a/js/app/packages/app/asset/fonts/FormaMacroVariable.woff2 and /dev/null differ
diff --git a/js/app/packages/app/component/Layout.tsx b/js/app/packages/app/component/Layout.tsx
index feb99aebe5..53e8c0814e 100644
--- a/js/app/packages/app/component/Layout.tsx
+++ b/js/app/packages/app/component/Layout.tsx
@@ -19,7 +19,6 @@ import GlobalShortcuts from './GlobalHotkeys';
import { ItemDndProvider } from './ItemDragAndDrop';
import { createMenuOpen, Launcher, setCreateMenuOpen } from './Launcher';
import { Paywall } from './paywall/Paywall';
-import { QuickCreateMenu } from './QuickCreateMenu';
import { RightbarWrapper } from './rightbar/Rightbar';
import { SettingsWrapper } from './settings/SettingsWrapper';
import { ShortcutsHelper } from './settings/ShortcutsHelper';
@@ -130,7 +129,6 @@ export function Layout(props: RouteSectionProps) {
<Suspense>
<KommandMenu />
</Suspense>
- <QuickCreateMenu />
<GlobalBulkEditEntityModal />
<ShortcutsHelper />
</Show>
diff --git a/js/app/packages/app/component/PropertyFilter/FilterAction.tsx b/js/app/packages/app/component/PropertyFilter/FilterAction.tsx
index f1526cf938..d3b6bf9bce 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterAction.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterAction.tsx
@@ -67,7 +67,7 @@ export const FilterActionSelect: Component<FilterActionSelectProps> = (
<button
type="button"
onClick={() => setIsOpen(!isOpen())}
- class="h-6 px-2 min-w-fit text-[10px] border border-edge hover:bg-hover text-left font-mono flex items-center"
+ class="h-6 px-2 min-w-fit text-xxs border border-edge hover:bg-hover text-left font-mono flex items-center"
classList={{
'text-ink': props.selectedAction !== null,
'text-ink-muted': props.selectedAction === null,
@@ -85,7 +85,7 @@ export const FilterActionSelect: Component<FilterActionSelectProps> = (
<Show
when={validActions().length > 0}
fallback={
- <div class="px-3 py-2 text-[10px] text-ink-muted text-center">
+ <div class="px-3 py-2 text-xxs text-ink-muted text-center">
No actions available
</div>
}
@@ -99,7 +99,7 @@ export const FilterActionSelect: Component<FilterActionSelectProps> = (
e.stopPropagation();
handleSelectAction(action);
}}
- class="w-full px-2 py-1.5 text-[10px] text-ink hover:bg-hover text-left"
+ class="w-full px-2 py-1.5 text-xxs text-ink hover:bg-hover text-left"
classList={{
'bg-hover': props.selectedAction === action,
}}
diff --git a/js/app/packages/app/component/PropertyFilter/FilterProperty.tsx b/js/app/packages/app/component/PropertyFilter/FilterProperty.tsx
index ac830c420a..a0ce225b90 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterProperty.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterProperty.tsx
@@ -109,7 +109,7 @@ export const FilterPropertySelect: Component<FilterPropertySelectProps> = (
}}
onFocus={() => setIsDropdownOpen(true)}
placeholder="Search Properties..."
- class="w-full h-full pl-6 pr-2 font-mono text-[10px] text-ink placeholder-ink-muted bg-transparent border border-edge focus:ring-2 focus:ring-accent/50 focus:border-accent"
+ class="w-full h-full pl-6 pr-2 font-mono text-xxs text-ink placeholder-ink-muted bg-transparent border border-edge focus:ring-2 focus:ring-accent/50 focus:border-accent"
/>
<Show when={isDropdownOpen()}>
<div
@@ -119,7 +119,7 @@ export const FilterPropertySelect: Component<FilterPropertySelectProps> = (
<Show
when={filteredProperties().length > 0}
fallback={
- <div class="px-3 py-2 text-[10px] text-ink-muted text-center">
+ <div class="px-3 py-2 text-xxs text-ink-muted text-center">
No filterable properties found
</div>
}
@@ -133,7 +133,7 @@ export const FilterPropertySelect: Component<FilterPropertySelectProps> = (
e.stopPropagation();
handleSelectProperty(property);
}}
- class="w-full px-2 py-1.5 text-[10px] text-ink hover:bg-hover flex items-center gap-2 text-left"
+ class="w-full px-2 py-1.5 text-xxs text-ink hover:bg-hover flex items-center gap-2 text-left"
>
<PropertyDataTypeIcon property={property} />
<span class="truncate flex-1">{property.displayName}</span>
diff --git a/js/app/packages/app/component/PropertyFilter/FilterPropertyPill.tsx b/js/app/packages/app/component/PropertyFilter/FilterPropertyPill.tsx
index f2396f9f7d..cee3b38cb9 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterPropertyPill.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterPropertyPill.tsx
@@ -475,7 +475,7 @@ export const FilterPropertyPill: Component<FilterPillProps> = (props) => {
<button
type="button"
onClick={handleStartEditProperty}
- class="h-6 px-2 text-[10px] text-ink border border-edge hover:bg-hover text-left flex items-center gap-1.5 font-mono shrink-0"
+ class="h-6 px-2 text-xxs text-ink border border-edge hover:bg-hover text-left flex items-center gap-1.5 font-mono shrink-0"
>
<PropertyDataTypeIcon
property={selectedProperty()!}
@@ -501,7 +501,7 @@ export const FilterPropertyPill: Component<FilterPillProps> = (props) => {
fallback={
<button
type="button"
- class="h-6 px-2 w-fit text-[10px] text-ink-muted font-mono border border-edge hover:bg-hover text-left flex items-center"
+ class="h-6 px-2 w-fit text-xxs text-ink-muted font-mono border border-edge hover:bg-hover text-left flex items-center"
>
{values().length > 0 ? values().join(', ') : '...'}
</button>
diff --git a/js/app/packages/app/component/PropertyFilter/FilterValueBoolean.tsx b/js/app/packages/app/component/PropertyFilter/FilterValueBoolean.tsx
index 002698544b..213e013894 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterValueBoolean.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterValueBoolean.tsx
@@ -50,7 +50,7 @@ export const FilterValueBoolean: Component<FilterValueBooleanProps> = (
<button
type="button"
onClick={() => setIsOpen(!isOpen())}
- class="h-6 px-2 w-fit text-[10px] border border-edge hover:bg-hover text-left font-mono flex items-center"
+ class="h-6 px-2 w-fit text-xxs border border-edge hover:bg-hover text-left font-mono flex items-center"
classList={{
'text-ink': props.value !== null,
'text-ink-muted': props.value === null,
@@ -70,7 +70,7 @@ export const FilterValueBoolean: Component<FilterValueBooleanProps> = (
e.stopPropagation();
handleSelect(true);
}}
- class="w-full px-2 py-1.5 text-[10px] text-ink hover:bg-hover text-left"
+ class="w-full px-2 py-1.5 text-xxs text-ink hover:bg-hover text-left"
classList={{ 'bg-hover': props.value === true }}
>
True
@@ -82,7 +82,7 @@ export const FilterValueBoolean: Component<FilterValueBooleanProps> = (
e.stopPropagation();
handleSelect(false);
}}
- class="w-full px-2 py-1.5 text-[10px] text-ink hover:bg-hover text-left"
+ class="w-full px-2 py-1.5 text-xxs text-ink hover:bg-hover text-left"
classList={{ 'bg-hover': props.value === false }}
>
False
diff --git a/js/app/packages/app/component/PropertyFilter/FilterValueDate.tsx b/js/app/packages/app/component/PropertyFilter/FilterValueDate.tsx
index 8d8c2fcf64..1783be10e1 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterValueDate.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterValueDate.tsx
@@ -51,7 +51,7 @@ export const FilterValueDate: Component<FilterValueDateProps> = (props) => {
ref={buttonRef}
type="button"
onClick={() => setIsOpen(true)}
- class="h-6 px-2 w-fit text-[10px] border border-edge hover:bg-hover text-left font-mono flex items-center"
+ class="h-6 px-2 w-fit text-xxs border border-edge hover:bg-hover text-left font-mono flex items-center"
classList={{
'text-ink': props.value !== null,
'text-ink-muted': props.value === null,
diff --git a/js/app/packages/app/component/PropertyFilter/FilterValueDateMulti.tsx b/js/app/packages/app/component/PropertyFilter/FilterValueDateMulti.tsx
index 5f2d2273bc..75479cb006 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterValueDateMulti.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterValueDateMulti.tsx
@@ -56,7 +56,7 @@ export const FilterValueDateMulti: Component<FilterValueDateMultiProps> = (
{/* Selected date pills */}
<For each={props.values}>
{(dateStr) => (
- <div class="group relative h-6 px-1.5 text-[10px] text-ink border border-edge bg-panel font-mono flex items-center">
+ <div class="group relative h-6 px-1.5 text-xxs text-ink border border-edge bg-panel font-mono flex items-center">
<span class="whitespace-nowrap">{formatDisplayDate(dateStr)}</span>
{/* X shows on hover, overlays the text */}
<button
@@ -76,7 +76,7 @@ export const FilterValueDateMulti: Component<FilterValueDateMultiProps> = (
ref={addButtonRef}
type="button"
onClick={() => setIsPickerOpen(true)}
- class="h-6 px-2 text-[10px] text-ink-muted border border-edge hover:bg-hover font-mono flex items-center"
+ class="h-6 px-2 text-xxs text-ink-muted border border-edge hover:bg-hover font-mono flex items-center"
>
{props.values.length === 0 ? 'Add date...' : '+'}
</button>
diff --git a/js/app/packages/app/component/PropertyFilter/FilterValueEntity.tsx b/js/app/packages/app/component/PropertyFilter/FilterValueEntity.tsx
index 42ba8311d0..ca5dd8eff2 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterValueEntity.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterValueEntity.tsx
@@ -49,7 +49,7 @@ const EntityPill: Component<{
);
return (
- <div class="group relative h-6 px-1.5 text-[10px] text-ink border border-edge bg-panel font-mono flex items-center gap-1.5">
+ <div class="group relative h-6 px-1.5 text-xxs text-ink border border-edge bg-panel font-mono flex items-center gap-1.5">
<span class="size-3 flex items-center justify-center shrink-0">
{icon()}
</span>
@@ -281,7 +281,7 @@ export const FilterValueEntity: Component<FilterValueEntityProps> = (props) => {
<button
type="button"
onClick={handleAddClick}
- class="h-6 px-2 text-[10px] text-ink-muted border border-edge hover:bg-hover font-mono flex items-center"
+ class="h-6 px-2 text-xxs text-ink-muted border border-edge hover:bg-hover font-mono flex items-center"
>
{getPlaceholderText()}
</button>
@@ -293,7 +293,7 @@ export const FilterValueEntity: Component<FilterValueEntityProps> = (props) => {
value={searchQuery()}
onInput={(e) => setSearchQuery(e.currentTarget.value)}
placeholder="Search..."
- class="h-6 px-2 min-w-16 w-fit text-[10px] text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
+ class="h-6 px-2 min-w-16 w-fit text-xxs text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
/>
<div
ref={dropdownRef}
@@ -302,7 +302,7 @@ export const FilterValueEntity: Component<FilterValueEntityProps> = (props) => {
<Show
when={availableEntities().length > 0}
fallback={
- <div class="px-3 py-2 text-[10px] text-ink-muted text-center">
+ <div class="px-3 py-2 text-xxs text-ink-muted text-center">
{entities().length === 0
? 'No entities available'
: searchQuery()
@@ -345,7 +345,7 @@ const DropdownEntityRow: Component<{
e.stopPropagation();
props.onSelect();
}}
- class="w-full px-2 py-1.5 text-[10px] text-ink hover:bg-hover text-left flex items-center gap-2"
+ class="w-full px-2 py-1.5 text-xxs text-ink hover:bg-hover text-left flex items-center gap-2"
>
<span class="size-3 flex items-center justify-center shrink-0">
{icon()}
diff --git a/js/app/packages/app/component/PropertyFilter/FilterValueNumber.tsx b/js/app/packages/app/component/PropertyFilter/FilterValueNumber.tsx
index 82303924bc..31cd68616b 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterValueNumber.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterValueNumber.tsx
@@ -66,7 +66,7 @@ export const FilterValueNumber: Component<FilterValueNumberProps> = (props) => {
<button
type="button"
onClick={handleClick}
- class="h-6 px-2 w-fit text-[10px] border border-edge hover:bg-hover text-left font-mono flex items-center"
+ class="h-6 px-2 w-fit text-xxs border border-edge hover:bg-hover text-left font-mono flex items-center"
classList={{
'text-ink': props.value !== null,
'text-ink-muted': props.value === null,
@@ -86,7 +86,7 @@ export const FilterValueNumber: Component<FilterValueNumberProps> = (props) => {
onBlur={handleBlur}
onKeyDown={handleKeyDown}
placeholder="Enter value..."
- class="h-6 px-2 min-w-8 w-fit text-[10px] text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
+ class="h-6 px-2 min-w-8 w-fit text-xxs text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
/>
</Show>
);
diff --git a/js/app/packages/app/component/PropertyFilter/FilterValueNumberMulti.tsx b/js/app/packages/app/component/PropertyFilter/FilterValueNumberMulti.tsx
index 0104888512..ad1724ae00 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterValueNumberMulti.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterValueNumberMulti.tsx
@@ -61,7 +61,7 @@ export const FilterValueNumberMulti: Component<FilterValueNumberMultiProps> = (
{/* Selected value pills */}
<For each={props.values}>
{(value) => (
- <div class="group relative h-6 px-1.5 text-[10px] text-ink border border-edge bg-panel font-mono flex items-center">
+ <div class="group relative h-6 px-1.5 text-xxs text-ink border border-edge bg-panel font-mono flex items-center">
<span class="whitespace-nowrap">{String(value)}</span>
{/* X shows on hover, overlays the text */}
<button
@@ -83,7 +83,7 @@ export const FilterValueNumberMulti: Component<FilterValueNumberMultiProps> = (
<button
type="button"
onClick={handleAddClick}
- class="h-6 px-2 text-[10px] text-ink-muted border border-edge hover:bg-hover font-mono flex items-center"
+ class="h-6 px-2 text-xxs text-ink-muted border border-edge hover:bg-hover font-mono flex items-center"
>
{props.values.length === 0 ? 'Add value...' : '+'}
</button>
@@ -98,7 +98,7 @@ export const FilterValueNumberMulti: Component<FilterValueNumberMultiProps> = (
onBlur={handleConfirm}
onKeyDown={handleKeyDown}
placeholder="Enter value..."
- class="h-6 px-2 min-w-8 w-fit text-[10px] text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
+ class="h-6 px-2 min-w-8 w-fit text-xxs text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
/>
</Show>
</div>
diff --git a/js/app/packages/app/component/PropertyFilter/FilterValueSelect.tsx b/js/app/packages/app/component/PropertyFilter/FilterValueSelect.tsx
index 6cf2bcc8d2..34db7b181c 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterValueSelect.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterValueSelect.tsx
@@ -122,7 +122,7 @@ export const FilterValueSelect: Component<FilterValueSelectProps> = (props) => {
<button
type="button"
onClick={handleClick}
- class="h-6 px-2 w-fit text-[10px] border border-edge hover:bg-hover text-left font-mono flex items-center"
+ class="h-6 px-2 w-fit text-xxs border border-edge hover:bg-hover text-left font-mono flex items-center"
classList={{
'text-ink': props.value !== null,
'text-ink-muted': props.value === null,
@@ -138,7 +138,7 @@ export const FilterValueSelect: Component<FilterValueSelectProps> = (props) => {
value={searchQuery()}
onInput={(e) => setSearchQuery(e.currentTarget.value)}
placeholder="Search..."
- class="h-6 px-2 min-w-16 w-fit text-[10px] text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
+ class="h-6 px-2 min-w-16 w-fit text-xxs text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
/>
<div
ref={dropdownRef}
@@ -147,7 +147,7 @@ export const FilterValueSelect: Component<FilterValueSelectProps> = (props) => {
<Show
when={filteredOptions().length > 0}
fallback={
- <div class="px-3 py-2 text-[10px] text-ink-muted text-center">
+ <div class="px-3 py-2 text-xxs text-ink-muted text-center">
{isLoading()
? 'Loading...'
: options().length === 0
@@ -165,7 +165,7 @@ export const FilterValueSelect: Component<FilterValueSelectProps> = (props) => {
e.stopPropagation();
handleSelectOption(option);
}}
- class="w-full px-2 py-1.5 text-[10px] text-ink hover:bg-hover text-left"
+ class="w-full px-2 py-1.5 text-xxs text-ink hover:bg-hover text-left"
classList={{
'bg-hover': props.value === option.id,
}}
diff --git a/js/app/packages/app/component/PropertyFilter/FilterValueSelectMulti.tsx b/js/app/packages/app/component/PropertyFilter/FilterValueSelectMulti.tsx
index 0c1aa09fbd..ead41d9efa 100644
--- a/js/app/packages/app/component/PropertyFilter/FilterValueSelectMulti.tsx
+++ b/js/app/packages/app/component/PropertyFilter/FilterValueSelectMulti.tsx
@@ -133,14 +133,14 @@ export const FilterValueSelectMulti: Component<FilterValueSelectMultiProps> = (
<Show
when={!isLoading() || props.values.length === 0}
fallback={
- <div class="h-6 px-1.5 text-[10px] text-ink-muted border border-edge font-mono flex items-center">
+ <div class="h-6 px-1.5 text-xxs text-ink-muted border border-edge font-mono flex items-center">
...
</div>
}
>
<For each={props.values}>
{(optionId) => (
- <div class="group relative h-6 px-1.5 text-[10px] text-ink border border-edge bg-panel font-mono flex items-center">
+ <div class="group relative h-6 px-1.5 text-xxs text-ink border border-edge bg-panel font-mono flex items-center">
<span class="whitespace-nowrap">{getDisplayValue(optionId)}</span>
{/* X shows on hover, overlays the text */}
<button
@@ -163,7 +163,7 @@ export const FilterValueSelectMulti: Component<FilterValueSelectMultiProps> = (
<button
type="button"
onClick={handleAddClick}
- class="h-6 px-2 text-[10px] text-ink-muted border border-edge hover:bg-hover font-mono flex items-center"
+ class="h-6 px-2 text-xxs text-ink-muted border border-edge hover:bg-hover font-mono flex items-center"
>
{isLoading()
? '...'
@@ -179,7 +179,7 @@ export const FilterValueSelectMulti: Component<FilterValueSelectMultiProps> = (
value={searchQuery()}
onInput={(e) => setSearchQuery(e.currentTarget.value)}
placeholder="Search..."
- class="h-6 px-2 min-w-16 w-fit text-[10px] text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
+ class="h-6 px-2 min-w-16 w-fit text-xxs text-ink border border-edge hover:bg-hover focus:ring-1 focus:ring-accent font-mono placeholder:text-ink-muted"
/>
<div
ref={dropdownRef}
@@ -188,7 +188,7 @@ export const FilterValueSelectMulti: Component<FilterValueSelectMultiProps> = (
<Show
when={availableOptions().length > 0}
fallback={
- <div class="px-3 py-2 text-[10px] text-ink-muted text-center">
+ <div class="px-3 py-2 text-xxs text-ink-muted text-center">
{isLoading()
? 'Loading...'
: options().length === 0
@@ -208,7 +208,7 @@ export const FilterValueSelectMulti: Component<FilterValueSelectMultiProps> = (
e.stopPropagation();
handleSelectOption(option);
}}
- class="w-full px-2 py-1.5 text-[10px] text-ink hover:bg-hover text-left"
+ class="w-full px-2 py-1.5 text-xxs text-ink hover:bg-hover text-left"
>
{getOptionDisplayValue(option)}
</button>
diff --git a/js/app/packages/app/component/PropertyFilterControl.tsx b/js/app/packages/app/component/PropertyFilterControl.tsx
index d8c1dd8065..9cd81ded3c 100644
--- a/js/app/packages/app/component/PropertyFilterControl.tsx
+++ b/js/app/packages/app/component/PropertyFilterControl.tsx
@@ -181,7 +181,7 @@ export const PropertyFilterControl: Component<PropertyFilterControlProps> = (
onCancel={() => removeFilter(filter.id)}
/>
<Show when={index() < filters.length - 1}>
- <span class="text-[10px] text-ink-muted font-mono pl-3 pt-0.25 leading-none">
+ <span class="text-xxs text-ink-muted font-mono pl-3 pt-0.25 leading-none">
AND
</span>
</Show>
diff --git a/js/app/packages/app/component/QuickCreateMenu.tsx b/js/app/packages/app/component/QuickCreateMenu.tsx
deleted file mode 100644
index 68fca6f0c6..0000000000
--- a/js/app/packages/app/component/QuickCreateMenu.tsx
+++ /dev/null
@@ -1,911 +0,0 @@
-import { BozzyBracketInnerSibling } from '@core/component/BozzyBracket';
-import { DeprecatedTextButton } from '@core/component/DeprecatedTextButton';
-import { Hotkey } from '@core/component/Hotkey';
-import { DecoratorRenderer } from '@core/component/LexicalMarkdown/component/core/DecoratorRenderer';
-import { NodeAccessoryRenderer } from '@core/component/LexicalMarkdown/component/core/NodeAccessoryRenderer';
-import { ActionMenu } from '@core/component/LexicalMarkdown/component/menu/ActionsMenu';
-import { EmojiMenu } from '@core/component/LexicalMarkdown/component/menu/EmojiMenu';
-import { MentionsMenu } from '@core/component/LexicalMarkdown/component/menu/MentionsMenu';
-import {
- createLexicalWrapper,
- LexicalWrapperContext,
-} from '@core/component/LexicalMarkdown/context/LexicalWrapperContext';
-import {
- actionsPlugin,
- autoRegister,
- DefaultShortcuts,
- type ItemMention,
- keyboardShortcutsPlugin,
- linksPlugin,
- markdownPastePlugin,
- mentionsPlugin,
- NODE_TRANSFORM,
- type NodeTransformType,
- selectionDataPlugin,
- tabIndentationPlugin,
-} from '@core/component/LexicalMarkdown/plugins';
-import { codePlugin } from '@core/component/LexicalMarkdown/plugins/code/codePlugin';
-import { emojisPlugin } from '@core/component/LexicalMarkdown/plugins/emojis/emojisPlugin';
-import { createAccessoryStore } from '@core/component/LexicalMarkdown/plugins/node-accessory';
-import { textPastePlugin } from '@core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin';
-import { createMenuOperations } from '@core/component/LexicalMarkdown/shared/inlineMenu';
-import {
- editorIsEmpty,
- initializeEditorEmpty,
-} from '@core/component/LexicalMarkdown/utils';
-import { getDestinationFromOptions } from '@core/component/NewMessage';
-import { RecipientSelector } from '@core/component/RecipientSelector';
-import { toast } from '@core/component/Toast/Toast';
-import { LabelAndHotKey, Tooltip } from '@core/component/Tooltip';
-import { IS_MAC } from '@core/constant/isMac';
-import { useEmailLinksStatus } from '@core/email-link';
-import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';
-import { TOKENS } from '@core/hotkey/tokens';
-import { useCombinedRecipients } from '@core/signal/useCombinedRecipient';
-import type { ContactInfo, WithCustomUserInput } from '@core/user';
-import { useSendMessageToPeople } from '@core/util/channels';
-import { createMarkdownFile } from '@core/util/create';
-import { isErr } from '@core/util/maybeResult';
-import TextBold from '@icon/bold/text-b-bold.svg';
-import CommentIcon from '@icon/regular/chat-circle-text.svg';
-import TextCode from '@icon/regular/code.svg';
-import EnvelopeIcon from '@icon/regular/envelope.svg';
-import ListBullets from '@icon/regular/list-bullets.svg';
-import ListChecks from '@icon/regular/list-checks.svg';
-import ListNumbers from '@icon/regular/list-numbers.svg';
-import NoteIcon from '@icon/regular/note.svg';
-import FormatIcon from '@icon/regular/text-aa.svg';
-import TextItalic from '@icon/regular/text-italic.svg';
-import TextStriketrough from '@icon/regular/text-strikethrough.svg';
-import { Dialog } from '@kobalte/core/dialog';
-import { $generateHtmlFromNodes } from '@lexical/html';
-import MacroGridLoader from '@macro-icons/macro-grid-noise-loader-4.svg';
-import { useEmailLinksQuery } from '@queries/email/link';
-import type { SimpleMention } from '@service-comms/generated/models/simpleMention';
-import { emailClient } from '@service-email/client';
-import type { MessageToSend } from '@service-email/generated/schemas/messageToSend';
-import { GlitchText } from '@ui/components/GlitchText';
-import { normalizeEnterPlugin } from 'core/component/LexicalMarkdown/plugins/normalize-enter';
-import {
- $getRoot,
- COMMAND_PRIORITY_CRITICAL,
- COMMAND_PRIORITY_HIGH,
- FORMAT_TEXT_COMMAND,
- KEY_ENTER_COMMAND,
- KEY_ESCAPE_COMMAND,
- type TextFormatType,
-} from 'lexical';
-import {
- type Accessor,
- createMemo,
- createSignal,
- For,
- type JSXElement,
- Match,
- onCleanup,
- onMount,
- type ParentProps,
- type Setter,
- Show,
- type Signal,
- Switch,
- useContext,
-} from 'solid-js';
-import { useSplitLayout } from './split-layout/layout';
-
-type CreateType = 'note' | 'email' | 'message';
-
-interface QuickCreateConfig {
- id: CreateType;
- label: string;
- shortcut: string;
- icon: typeof NoteIcon;
-}
-
-const tabs: QuickCreateConfig[] = [
- { id: 'note', label: 'Note', shortcut: 'n', icon: NoteIcon },
- { id: 'email', label: 'Email', shortcut: 'e', icon: EnvelopeIcon },
- { id: 'message', label: 'Message', shortcut: 'm', icon: CommentIcon },
-];
-
-function mentionToSimpleMention({
- itemType,
- itemId,
-}: ItemMention): SimpleMention {
- return {
- entity_type: itemType,
- entity_id: itemId,
- };
-}
-
-interface QuickCreateMenuProps {
- quickCreateMenuOpenSignal: Signal<boolean>;
- selectedTypeSignal: Signal<CreateType>;
-}
-
-export const quickCreateMenuOpenSignal = createSignal(false);
-const [quickCreateMenuOpen, setQuickCreateMenuOpen] = quickCreateMenuOpenSignal;
-export const selectedQuickCreateTypeSignal = createSignal<CreateType>('note');
-
-export function QuickCreateMenu() {
- return (
- <Dialog
- open={quickCreateMenuOpen()}
- onOpenChange={setQuickCreateMenuOpen}
- modal={true}
- >
- <Dialog.Portal>
- <Dialog.Overlay class="fixed inset-0 z-modal bg-modal-overlay" />
- <div class="fixed inset-0 z-modal w-screen h-screen flex items-center justify-center">
- <Dialog.Content class="flex items-center justify-center w-[620px]">
- <QuickCreateMenuInner
- quickCreateMenuOpenSignal={quickCreateMenuOpenSignal}
- selectedTypeSignal={selectedQuickCreateTypeSignal}
- />
- </Dialog.Content>
- </div>
- </Dialog.Portal>
- </Dialog>
- );
-}
-
-export function QuickCreateMenuInner(props: QuickCreateMenuProps) {
- let menuRef!: HTMLDivElement;
- // Item setup
- let tabButtonsRef: HTMLDivElement | undefined;
- const [selectedType, setSelectedType] = props.selectedTypeSignal;
- const [_, setCreateMenuOpen] = props.quickCreateMenuOpenSignal;
- let noteTitleRef: HTMLInputElement | undefined;
- const emailActive = useEmailLinksStatus();
- const emailLinksQuery = useEmailLinksQuery();
- const [selectedEmailOptions, setSelectedEmailOptions] = createSignal<
- WithCustomUserInput<'user' | 'contact'>[]
- >([]);
- const [selectedOptions, setSelectedOptions] = createSignal<
- WithCustomUserInput<'user' | 'contact' | 'channel'>[]
- >([]);
- const [triedToSubmitEmail, _setTriedToSubmitEmail] = createSignal(false);
-
- const { users: usersAndContacts, all: destinationOptions } =
- useCombinedRecipients();
-
- const [triedToSubmit, _setTriedToSubmit] = createSignal(false);
-
- // Content Editor setup
- let contentContainerRef: HTMLDivElement | undefined;
- let editorContentRef: HTMLDivElement | undefined;
- const [content, setContent] = createSignal('');
- const [isInteractable, setIsInteractable] = createSignal(false);
- const lexicalWrapper = createLexicalWrapper({
- type: 'markdown',
- namespace: 'create-menu-content',
- isInteractable,
- });
- const { editor, plugins, cleanup } = lexicalWrapper;
-
- // Editor Plugins setup
- const [showFormatRibbon, setShowFormatRibbon] = createSignal(false);
- const [mentions, setMentions] = createSignal<ItemMention[]>([]);
- const mentionsMenuOperations = createMenuOperations();
- const emojisMenuOperations = createMenuOperations();
- const actionsMenuOperations = createMenuOperations();
- const [accessories, setAccessories] = createAccessoryStore();
- const { replaceOrInsertSplit } = useSplitLayout();
-
- // Submit handlers setup
- const createNewNote = async (goToNote = false) => {
- const documentId = await createMarkdownFile({
- content: content(),
- title: noteTitleRef?.value || '',
- });
-
- if (!documentId) {
- toast.failure('Failed to create note');
- return false;
- }
-
- if (goToNote && documentId) {
- replaceOrInsertSplit(
- {
- type: 'md',
- id: documentId,
- },
- 'launcher'
- );
- return true;
- }
-
- return true;
- };
-
- const sendEmail = async (goTo = false) => {
- // Extract recipients from selectedEmailOptions
- const options = selectedEmailOptions();
- if (options.length === 0) {
- toast.failure('Please add at least one recipient');
- return false;
- }
-
- // Convert selected options to email contacts
- const toContacts: ContactInfo[] = options.map((option) => {
- const email = option.data.email;
-
- const getNameFromEmail = (email: string) => email.split('@').at(0);
- let name: string | undefined;
- switch (option.kind) {
- case 'custom':
- name = getNameFromEmail(email);
- break;
- case 'contact':
- name = getNameFromEmail(email);
- break;
- default:
- name = option.data.name;
- }
-
- return {
- email,
- name,
- };
- });
-
- if (emailLinksQuery.isPending) {
- toast.alert('Loading email accounts...');
- return false;
- }
-
- if (emailLinksQuery.isError) {
- toast.failure('Failed to send email: Could not load email accounts');
- return false;
- }
-
- const linksData = emailLinksQuery.data;
- if (!linksData || linksData.links.length < 1) {
- toast.failure('Failed to send email: No email account connected');
- return false;
- }
-
- const parser = new DOMParser();
- const dom = editor
- .getEditorState()
- .read(() =>
- parser.parseFromString($generateHtmlFromNodes(editor), 'text/html')
- );
- const body_html = btoa(unescape(encodeURIComponent(dom.body.outerHTML)))
- .replace(/\+/g, '-') // Convert '+' to '-'
- .replace(/\//g, '_') // Convert '/' to '_'
- .replace(/={1,}$/, ''); // Remove padding '='
- const body_text = editor.read(() => $getRoot().getTextContent());
- const body_macro = content();
-
- const message: MessageToSend = {
- to: toContacts,
- cc: [],
- bcc: [],
- subject: '', // CreateMenu doesn't have a subject field yet
- body_html,
- body_text,
- body_macro,
- link_id: linksData.links[0].id,
- };
-
- const sendRequest = await emailClient.sendMessage({
- message,
- });
-
- if (isErr(sendRequest)) {
- toast.failure('Failed to send email');
- return false;
- }
-
- if (goTo) {
- replaceOrInsertSplit(
- {
- type: 'email',
- id: 'new',
- },
- 'launcher'
- );
- }
-
- return true;
- };
-
- const { sendToUsers, sendToChannel } = useSendMessageToPeople();
- const sendMessage = (goTo = false) => {
- const options = selectedOptions();
- if (!options || options.length === 0) {
- toast.failure('Please select at least one recipient');
- return false;
- }
-
- const destination = getDestinationFromOptions(options);
- if (!destination) return;
-
- if (destination.type === 'users') {
- return sendToUsers({
- users: destination.users,
- content: content(),
- mentions: mentions().map(mentionToSimpleMention),
- navigate: { navigate: goTo },
- }).then((res) => {
- if (res) {
- toast.success('Message sent successfully');
- } else {
- toast.failure('Failed to send message');
- }
- return res;
- });
- } else if (destination.type === 'channel') {
- return sendToChannel({
- channelId: destination.id,
- content: content(),
- mentions: mentions().map(mentionToSimpleMention),
- navigate: { navigate: goTo },
- }).then((res) => {
- if (res) {
- toast.success('Message sent successfully');
- } else {
- toast.failure('Failed to send message');
- }
- return res;
- });
- }
- };
-
- const [isLoading, setIsLoading] = createSignal(false);
-
- const submit = async (goTo = false) => {
- let success = false;
- switch (selectedType()) {
- case 'note':
- setIsLoading(true);
- success = await createNewNote(goTo);
- setIsLoading(false);
- break;
- case 'email':
- setIsLoading(true);
- success = await sendEmail();
-
- setIsLoading(false);
- break;
- case 'message':
- setIsLoading(true);
- success = !!(await sendMessage(goTo));
-
- setIsLoading(false);
- break;
- }
- if (success) {
- setCreateMenuOpen(false);
- } else {
- toast.failure('Failed');
- }
- };
-
- const contentPlaceHolder = createMemo(() => {
- content();
- if (!editorIsEmpty(editor)) return;
-
- if (!isInteractable()) return 'Press Tab or click to start writing...';
-
- switch (selectedType()) {
- case 'note':
- case 'email':
- case 'message':
- return `Press '/' for commands, '@' to reference files or people.`;
- }
- });
-
- plugins
- .richText()
- .list()
- .markdownShortcuts()
- .delete()
- .state<string>(setContent, 'markdown')
- .use(selectionDataPlugin(lexicalWrapper))
- .use(emojisPlugin({ menu: emojisMenuOperations }))
- .use(
- codePlugin({
- accessories: accessories,
- setAccessories: setAccessories,
- })
- )
- .use(tabIndentationPlugin())
- .use(textPastePlugin())
- .use(markdownPastePlugin())
- .use(normalizeEnterPlugin())
- .use(
- keyboardShortcutsPlugin({
- shortcuts: DefaultShortcuts,
- })
- )
- .use(
- mentionsPlugin({
- menu: mentionsMenuOperations,
- setMentions,
- })
- )
- .use(
- actionsPlugin({
- menu: actionsMenuOperations,
- })
- )
- .use(linksPlugin({}));
-
- const focusEditor = () => {
- setIsInteractable(true);
- editor.setEditable(true);
- editor.focus();
- };
-
- const returnFocusToMenu = () => {
- menuRef.focus();
- };
-
- autoRegister(
- editor.registerCommand(
- KEY_ESCAPE_COMMAND,
- (e: KeyboardEvent) => {
- returnFocusToMenu();
- e.preventDefault();
- e.stopPropagation();
- return true;
- },
- COMMAND_PRIORITY_CRITICAL
- ),
- editor.registerCommand(
- KEY_ENTER_COMMAND,
- (e: KeyboardEvent) => {
- if (e.shiftKey) {
- Object.defineProperty(e, 'shiftKey', { value: false });
- return false;
- }
-
- e.preventDefault();
- e.stopPropagation();
- const goTo = (!IS_MAC && e.ctrlKey) || (IS_MAC && e.metaKey);
- submit(goTo);
- return true;
- },
- // Run at HIGH here to that the mentions menu can run at CRITICAL
- COMMAND_PRIORITY_HIGH
- )
- );
-
- // Hotkeys setup
- const [attachSelectionTypeHotkeys, typeSelectionHotKeyScope] =
- useHotkeyDOMScope('create-menu.type', true);
- registerHotkey({
- hotkey: 'n',
- scopeId: typeSelectionHotKeyScope,
- description: 'select note',
- keyDownHandler: () => {
- setSelectedType('note');
- return true;
- },
- });
- registerHotkey({
- hotkey: 'e',
- scopeId: typeSelectionHotKeyScope,
- description: 'select email',
- keyDownHandler: () => {
- if (!emailActive()) {
- toast.failure('Please enable email in settings first');
- return false;
- }
-
- setSelectedType('email');
- return true;
- },
- });
-
- registerHotkey({
- hotkey: 'm',
- scopeId: typeSelectionHotKeyScope,
- description: 'select message',
- keyDownHandler: () => {
- setSelectedType('message');
- return true;
- },
- });
-
- const [attachContentHotkeys, contentHotKeyScope] = useHotkeyDOMScope(
- 'create-menu.content',
- false
- );
- registerHotkey({
- hotkey: 'tab',
- scopeId: contentHotKeyScope,
- description: 'focus content',
- keyDownHandler: () => {
- focusEditor();
- return true;
- },
- runWithInputFocused: true,
- });
-
- registerHotkey({
- hotkey: 'tab',
- scopeId: typeSelectionHotKeyScope,
- description: 'focus content',
- keyDownHandler: () => {
- return false;
- },
- runWithInputFocused: true,
- });
-
- registerHotkey({
- hotkey: 'escape',
- scopeId: contentHotKeyScope,
- description: 'change type',
- keyDownHandler: () => {
- returnFocusToMenu();
- return true;
- },
- runWithInputFocused: true,
- });
-
- registerHotkey({
- hotkeyToken: TOKENS.global.quickCreate.menuFormat,
- hotkey: 'cmd+f',
- scopeId: contentHotKeyScope,
- description: 'Toggle Format',
- keyDownHandler: () => {
- setShowFormatRibbon((v) => !v);
- return true;
- },
- runWithInputFocused: true,
- });
-
- onMount(() => {
- if (!editorContentRef || !tabButtonsRef || !menuRef || !contentContainerRef)
- return;
- editor.setRootElement(editorContentRef);
- attachSelectionTypeHotkeys(menuRef);
- attachContentHotkeys(contentContainerRef);
- initializeEditorEmpty(editor);
- menuRef.focus();
- });
-
- onCleanup(() => cleanup());
-
- return (
- <div
- class="relative flex flex-col w-5/6 max-w-xl bg-dialog border-edge border-1 shadow-lg text-ink placeholder:text-ink-placeholder suppress-css-brackets pulse-corners portal-scope"
- tabindex={-1}
- ref={(ref) => {
- menuRef = ref;
- }}
- >
- <BozzyBracketInnerSibling animOnOpen={true} />
- <Show when={isLoading()}>
- <div class="absolute top-0 left-0 w-full h-full z-10 bg-modal-overlay stripe-diagonal-8 flex items-center justify-center">
- <div class="flex flex-col items-center justify-center">
- <div class="p-2 font-mono text-sm flex items-center gap-2">
- <MacroGridLoader width={20} height={20} class="text-accent" />
- <GlitchText from="Synthesizing request..." continuous />
- </div>
- </div>
- </div>
- </Show>
-
- {/* Type */}
- <div class="px-4 pt-4 w-auto suppress-css-brackets" tabindex={-1}>
- <div class="dotted-banner" tabIndex={-1}>
- <div class="w-auto inline-block bg-dialog ml-4" tabindex={-1}>
- <div
- class="flex pb-0 w-auto suppress-css-brackets"
- ref={tabButtonsRef}
- tabindex={-1}
- >
- <For each={tabs}>
- {(tab) => (
- <button
- class={`flex items-center font-mono uppercase gap-1 px-2 py-2 text-sm font-medium transition-colors ${
- selectedType() === tab.id
- ? 'text-ink font-extrabold'
- : 'text-ink-extra-muted hover:text-ink'
- }`}
- onClick={() => {
- if (tab.id === 'email' && !emailActive())
- return toast.failure(
- 'Please enable email in settings first'
- );
-
- setSelectedType(tab.id);
- }}
- tabindex={-1}
- >
- <Hotkey shortcut={tab.shortcut} />
- <span>{tab.label}</span>
- </button>
- )}
- </For>
- </div>
- </div>
- </div>
- </div>
- {/* Content */}
- <div class="flex flex-col gap-2 p-4 pt-3" ref={contentContainerRef}>
- <Switch>
- <Match when={selectedType() === 'note'}>
- <div class="flex w-full h-[38px] shrink-0 bg-input border-2 border-edge overflow-hidden focus-within:bracket">
- <input
- ref={noteTitleRef}
- class="flex size-full text-sm break-words px-2 placeholder:text-ink-placeholder "
- placeholder="New Note"
- />
- </div>
- </Match>
-
- <Match when={selectedType() === 'email'}>
- <div class="flex w-full focus-within:bracket">
- <RecipientSelector<'user' | 'contact'>
- options={usersAndContacts}
- selectedOptions={selectedEmailOptions()}
- setSelectedOptions={setSelectedEmailOptions}
- placeholder="Add recipients by email"
- triedToSubmit={triedToSubmitEmail}
- />
- </div>
- </Match>
- <Match when={selectedType() === 'message'}>
- <div class="flex w-full focus-within:bracket">
- <RecipientSelector<'user' | 'contact' | 'channel'>
- options={destinationOptions}
- selectedOptions={selectedOptions()}
- setSelectedOptions={setSelectedOptions}
- placeholder="Add by email or channel"
- triedToSubmit={triedToSubmit}
- triggerMode="input"
- />
- </div>
- </Match>
- </Switch>
-
- {/* Editor */}
- <div
- class="flex flex-col h-[136px] size-full bg-input border-2 border-edge justify-between overflow-auto p-1 focus-within:bracket"
- onfocusout={() => setIsInteractable(false)}
- >
- <LexicalWrapperContext.Provider value={lexicalWrapper}>
- <div
- class="relative size-full overflow-hidden p-1"
- onClick={focusEditor}
- >
- <div
- class="size-full"
- ref={editorContentRef}
- contentEditable={true}
- />
- <Show when={contentPlaceHolder()}>
- {(placeholder) => (
- <div class="pointer-events-none absolute top-1">
- <p class="my-1.5 text-ink-placeholder">{placeholder()}</p>
- </div>
- )}
- </Show>
- <DecoratorRenderer editor={editor} />
- <NodeAccessoryRenderer editor={editor} store={accessories} />
- <EmojiMenu
- editor={editor}
- menu={emojisMenuOperations}
- portalScope="local"
- />
- <MentionsMenu
- editor={editor}
- menu={mentionsMenuOperations}
- portalScope="local"
- emails={() => []}
- />
- <ActionMenu
- editor={editor}
- menu={actionsMenuOperations}
- portalScope="local"
- />
- </div>
- <TogglingFormatRibbon
- showFormatRibbon={showFormatRibbon()}
- setShowFormatRibbon={setShowFormatRibbon}
- />
- </LexicalWrapperContext.Provider>
- </div>
- </div>
-
- {/* Footer */}
- <div class="flex justify-between items-center px-4 pb-3">
- <div class="flex items-center gap-2 text-xs text-ink-muted font-mono">
- <Hotkey shortcut="enter" />
- <span>to create</span>
- <span class="text-ink-extra-muted">·</span>
- <Hotkey shortcut="cmd+enter" />
- <span>to create & open</span>
- </div>
- <div class="flex w-32 justify-between font-mono">
- <Dialog.CloseButton
- as={DeprecatedTextButton}
- text="Cancel"
- theme="clear"
- />
- <DeprecatedTextButton
- text={selectedType() === 'note' ? 'CREATE' : 'SEND'}
- theme="accentFill"
- class="w-18"
- tabIndex={0}
- onClick={() => submit(false)}
- />
- </div>
- </div>
- </div>
- );
-}
-
-interface TogglingFormatRibbonProps {
- showFormatRibbon: boolean;
- setShowFormatRibbon: Setter<boolean>;
-}
-function TogglingFormatRibbon(props: TogglingFormatRibbonProps) {
- const lexicalWrapper = useContext(LexicalWrapperContext);
- const setInlineFormat = (format: TextFormatType): void => {
- lexicalWrapper?.editor.focus();
- lexicalWrapper?.editor.dispatchCommand(FORMAT_TEXT_COMMAND, format);
- };
- const setNodeFormat = (transform: NodeTransformType): void => {
- lexicalWrapper?.editor.focus();
- lexicalWrapper?.editor.dispatchCommand(NODE_TRANSFORM, transform);
- };
- return (
- <Show
- when={props.showFormatRibbon && lexicalWrapper?.selection}
- fallback={
- <div class="flex size-fit">
- <Tooltip
- placement="top"
- tooltip={
- <LabelAndHotKey
- label="Format"
- hotkeyToken={TOKENS.global.quickCreate.menuFormat}
- />
- }
- >
- <button
- class="flex flex-col items-center justify-center size-7 hover:bg-hover hover-transition-bg m-2"
- onClick={() => {
- props.setShowFormatRibbon(true);
- if (lexicalWrapper?.isInteractable()) {
- lexicalWrapper.editor.focus();
- }
- }}
- >
- <FormatIcon width={20} height={20} />
- </button>
- </Tooltip>
- </div>
- }
- >
- {(selectionData) => (
- <div class="flex flex-row w-full gap-2 items-center bg-input p-2">
- <ActionButton
- tooltip="Bold"
- shortcut="meta+b"
- clicked={selectionData().bold}
- onClick={() => setInlineFormat('bold')}
- >
- <TextBold width={20} height={20} />
- </ActionButton>
- <ActionButton
- tooltip="Italic"
- shortcut="meta+i"
- clicked={selectionData().italic}
- onClick={() => setInlineFormat('italic')}
- >
- <TextItalic width={20} height={20} />
- </ActionButton>
- <ActionButton
- tooltip="Strikethrough"
- shortcut="meta+shift+x"
- clicked={selectionData().strikethrough}
- onClick={() => setInlineFormat('strikethrough')}
- >
- <TextStriketrough width={20} height={20} />
- </ActionButton>
- <ActionButton
- tooltip="Code"
- shortcut="meta+e"
- clicked={selectionData().strikethrough}
- onClick={() => setInlineFormat('code')}
- >
- <TextCode width={20} height={20} />
- </ActionButton>
- <div class="w-[1px] h-[20px] bg-edge" />
- <ActionButton
- tooltip="Bullet List"
- clicked={selectionData().elementsInRange.has('list-bullet')}
- onClick={() => setNodeFormat('list-bullet')}
- >
- <ListBullets width={20} height={20} />
- </ActionButton>
- <ActionButton
- tooltip="Numbered List"
- clicked={selectionData().elementsInRange.has('list-number')}
- onClick={() => setNodeFormat('list-number')}
- >
- <ListNumbers width={20} height={20} />
- </ActionButton>
- <ActionButton
- tooltip="Checklist"
- clicked={selectionData().elementsInRange.has('list-check')}
- onClick={() => setNodeFormat('list-check')}
- >
- <ListChecks width={20} height={20} />
- </ActionButton>
- </div>
- )}
- </Show>
- );
-}
-
-interface ActionButtonProps {
- onClick: (e: MouseEvent) => void;
- tooltip: string;
- shortcut?: string;
- clicked?: boolean;
-}
-function ActionButton(props: ParentProps<ActionButtonProps>) {
- return (
- <Tooltip
- placement="top"
- floatingOptions={{ offset: 12 }}
- tooltip={
- <LabelAndHotKey label={props.tooltip} shortcut={props.shortcut} />
- }
- >
- <button
- class={`flex flex-col items-center justify-center h-[28px] w-[28px] hover:bg-hover hover-transition-bg `}
- onClick={props.onClick}
- >
- {props.children}
- </button>
- </Tooltip>
- );
-}
-
-type UseQuickCreateMenu = {
- QuickCreateMenu: () => JSXElement;
- openMenuWithType: (type: CreateType) => void;
- quickCreateMenuOpen: Accessor<boolean>;
- setQuickCreateMenuOpen: Setter<boolean>;
- closeMenu: () => void;
- openMenu: () => void;
-};
-
-export function useQuickCreateMenu(): UseQuickCreateMenu {
- const selectedTypeSignal = createSignal<CreateType>('note');
- const quickCreateMenuOpenSignal = createSignal(false);
- const setSelectedType = selectedTypeSignal[1];
- const [quickCreateMenuOpen, setQuickCreateMenuOpen] =
- quickCreateMenuOpenSignal;
-
- const openMenuWithType = (type: CreateType) => {
- setSelectedType(type);
- setQuickCreateMenuOpen(true);
- };
-
- const closeMenu = () => {
- setQuickCreateMenuOpen(false);
- };
-
- const openMenu = () => {
- setQuickCreateMenuOpen(true);
- };
-
- return {
- QuickCreateMenu: () => <QuickCreateMenu />,
- quickCreateMenuOpen: quickCreateMenuOpen,
- setQuickCreateMenuOpen: setQuickCreateMenuOpen,
- openMenuWithType,
- closeMenu,
- openMenu,
- };
-}
diff --git a/js/app/packages/app/component/dock/Dock.tsx b/js/app/packages/app/component/dock/Dock.tsx
index 724d80a4d2..3e6907f8fa 100644
--- a/js/app/packages/app/component/dock/Dock.tsx
+++ b/js/app/packages/app/component/dock/Dock.tsx
@@ -299,9 +299,9 @@ export function Dock() {
}
}
}}
- class="p-1 *:h-4"
+ class="p-1"
>
- <SplitIcon />
+ <SplitIcon class="h-4"/>
</Button>
</div>
diff --git a/js/app/packages/app/component/dock/QuickAccess.tsx b/js/app/packages/app/component/dock/QuickAccess.tsx
index e3f57f40b8..5461a7087b 100644
--- a/js/app/packages/app/component/dock/QuickAccess.tsx
+++ b/js/app/packages/app/component/dock/QuickAccess.tsx
@@ -163,7 +163,7 @@ function QuickAccessItem(props: QuickAccessItemProps) {
class="relative flex justify-center items-center bg-panel hover:bg-panel-highlight border border-edge rounded-full size-8 transition-colors cursor-pointer select-none shrink-0"
>
<Show when={unreadNotifications().length > 0}>
- <div class="-top-1 -right-1 z-10 absolute bg-accent px-px rounded-full min-w-[1lh] font-mono font-bold text-[10px] text-panel text-center">
+ <div class="-top-1 -right-1 z-10 absolute bg-accent px-px rounded-full min-w-[1lh] font-mono font-bold text-xxs text-panel text-center">
{unreadNotifications().length}
</div>
</Show>
diff --git a/js/app/packages/app/component/settings/Organization/ActiveTable/ActiveTable.tsx b/js/app/packages/app/component/settings/Organization/ActiveTable/ActiveTable.tsx
index 01901e2085..94ba51a8b6 100644
--- a/js/app/packages/app/component/settings/Organization/ActiveTable/ActiveTable.tsx
+++ b/js/app/packages/app/component/settings/Organization/ActiveTable/ActiveTable.tsx
@@ -161,7 +161,7 @@ const UserRow: Component<UserRowProps> = (props) => {
onClick={patchUserAdmin}
>
<span class="font-semibold text-sm">Admin</span>
- <p class="text-[10px] leading-[12px] mt-1 max-w-xs">
+ <p class="text-xxs leading-[12px] mt-1 max-w-xs">
Can change organization settings and invite new members to the
organization.
</p>
@@ -175,7 +175,7 @@ const UserRow: Component<UserRowProps> = (props) => {
onClick={patchUserMember}
>
<span class="font-semibold text-sm">Member</span>
- <p class="text-[10px] leading-[12px] mt-1 max-w-xs">
+ <p class="text-xxs leading-[12px] mt-1 max-w-xs">
Cannot change organization settings or invite new members to the
organization.
</p>
diff --git a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
index eddc9ec038..77c661f1c1 100644
--- a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
@@ -38,14 +38,14 @@ function SplitBackButton() {
if (!context) return null;
return (
<Button
- class="p-1 *:h-4"
+ class="p-1"
tooltip={
<LabelAndHotKey label="Go Back" hotkeyToken={TOKENS.split.go.back} />
}
disabled={!context.handle.canGoBack()}
onClick={context.handle.goBack}
>
- <CaretLeft />
+ <CaretLeft class="h-4" />
</Button>
);
}
@@ -55,7 +55,7 @@ function SplitForwardButton() {
if (!context) return '';
return (
<Button
- class="p-1 *:h-4"
+ class="p-1"
tooltip={
<LabelAndHotKey
label="Go Forward"
@@ -65,7 +65,7 @@ function SplitForwardButton() {
disabled={!context.handle.canGoForward()}
onClick={context.handle.goForward}
>
- <CaretRight />
+ <CaretRight class="h-4" />
</Button>
);
}
@@ -77,7 +77,7 @@ function SplitSpotlightButton() {
return (
<Show when={canSpotlight(layout.manager)}>
<Button
- class="p-1 *:h-4"
+ class="p-1"
tooltip={
<LabelAndHotKey
label={
@@ -90,7 +90,11 @@ function SplitSpotlightButton() {
}
onClick={() => context.handle.toggleSpotlight()}
>
- {context.handle.isSpotLight() ? <CollapseIcon /> : <ExpandIcon />}
+ {context.handle.isSpotLight() ? (
+ <CollapseIcon class="h-4" />
+ ) : (
+ <ExpandIcon class="h-4" />
+ )}
</Button>
</Show>
);
@@ -102,11 +106,11 @@ function SplitCloseButton() {
return (
<Button
- class="p-1 *:h-4"
+ class="p-1"
tooltip={<LabelAndHotKey label="Close" />}
onClick={context.handle.close}
>
- <CloseIcon />
+ <CloseIcon class="h-4" />
</Button>
);
}
@@ -128,7 +132,7 @@ function _SplitPreviewToggle() {
<Show when={isUnifiedList()}>
<div class="max-sm:rotate-90">
<Button
- class="p-1 *:h-4"
+ class="p-1"
classList={{
'bg-accent/20 text-accent': preview(),
}}
@@ -141,7 +145,7 @@ function _SplitPreviewToggle() {
tabIndex={-1}
onClick={() => setPreview((prev) => !prev)}
>
- <SplitIcon />
+ <SplitIcon class="h-4" />
</Button>
</div>
</Show>
@@ -171,7 +175,7 @@ function SplitSettingsButton() {
return (
<Button
- class="p-1 *:h-4"
+ class="p-1"
classList={{
'bg-accent/20 text-accent': isSettingsSplitOpen(),
}}
@@ -189,7 +193,7 @@ function SplitSettingsButton() {
replaceSplit({ content: { type: 'component', id: 'settings' } });
}}
>
- <IconGear />
+ <IconGear class="h-4" />
</Button>
);
}
@@ -201,7 +205,7 @@ export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {
return (
<div
- class="isolate relative w-full h-10 overflow-clip text-ink shrink-0 border-b border-edge-muted/50"
+ class="isolate relative w-full h-10 touch:h-11 overflow-clip text-ink shrink-0 border-b border-edge-muted/50"
data-split-header
ref={props.ref}
>
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index bef9be2d7b..746530cfaf 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -505,6 +505,8 @@
--font-mono: "Forma DJR Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--font-serif: "Georgia", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
+ --text-xxs: 0.625rem;
+
/* Colors */
--color-macro-accent: #00c4ff;
--color-macro-input-border: #e4e4e4;
@@ -582,6 +584,7 @@
@layer base {
html {
overscroll-behavior: none;
+ font: -apple-system-body;
}
/* Custom cursor is set via JavaScript in index.tsx to match theme accent color */
@@ -598,7 +601,6 @@
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
- font-size: 16px;
/* Need to set opsz here so that it will apply to MD */
font-variation-settings: "opsz" 11;
font-synthesis: none;
@@ -611,17 +613,6 @@
src: url("./asset/fonts/OoohBaby-Regular.woff2") format("truetype");
}
- @font-face {
- font-family: "Forma Macro";
- src: url("./asset/fonts/FormaMacroVariable.woff2") format("woff2");
- font-weight: 200 700;
- font-style: oblique 0deg 13deg;
- font-feature-settings: "ss17" on, "calt", "liga", "rlig", "rvrn", "kern", "rclt";
-
- font-display: swap;
- /* ascent-override: 100%; No longer needed but keeping just in case */
- }
-
@font-face {
font-family: "Forma Macro Mono";
src: url("./asset/fonts/FormaMacroMonoVariable.woff2") format("woff2");
@@ -631,12 +622,6 @@
font-feature-settings: "ss11" on, "ss19" on, "calt", "liga", "rlig", "rvrn", "kern", "rclt";
}
- .text-xs { @apply optical-9; }
- .text-sm { @apply optical-10; }
- .text-base { @apply optical-11; }
- .text-xl { @apply optical-15; }
- .text-2xl { @apply optical-27; }
-
/* This is ugly, and we can probably do better, but it stops text from being selectable by default, which is important for mobile usage */
:where(*, ::before, ::after) {
user-select: none;
@@ -742,6 +727,22 @@ html[data-modality="keyboard"] [contenteditable="true"]:focus-visible::after {
--documentation: "Set this element as a bounding scope for the ScopedPortal component";
}
+:root {
+ --thread-shift: 23px;
+ --user-icon-width: 30px;
+ --left-of-connector: 20px;
+ --left-of-user-icon: calc(var(--left-of-connector) - var(--user-icon-width) / 2);
+}
+
+@media (min-width: 640px) {
+ :root {
+ --thread-shift: 46px;
+ --user-icon-width: 40px;
+ --left-of-connector: 28px;
+ --left-of-user-icon: calc(var(--left-of-connector) - var(--user-icon-width) / 2);
+ }
+}
+
@utility macro-message-width {
@media (min-width: 640px) {
max-width: 800px;
@@ -757,8 +758,6 @@ html[data-modality="keyboard"] [contenteditable="true"]:focus-visible::after {
}
-
-
::-webkit-scrollbar {
height: 8px;
/* Thickness of horizontal scrollbar */
diff --git a/js/app/packages/block-channel/component/AttachMenu.tsx b/js/app/packages/block-channel/component/AttachMenu.tsx
index cfca9fc747..40559dd9c8 100644
--- a/js/app/packages/block-channel/component/AttachMenu.tsx
+++ b/js/app/packages/block-channel/component/AttachMenu.tsx
@@ -108,6 +108,8 @@ export function AttachMenu(props: AttachMenuProps) {
const handleOverlayClick = (e: MouseEvent) => {
if (e.target === e.currentTarget) {
+ e.preventDefault();
+ e.stopPropagation();
props.close();
}
};
@@ -116,13 +118,16 @@ export function AttachMenu(props: AttachMenuProps) {
<Show when={props.open}>
<div
class="fixed inset-0 bg-transparent z-item-options-menu"
- onClick={handleOverlayClick}
- onMouseDown={handleOverlayClick}
+ onPointerDown={handleOverlayClick}
>
<div
class="absolute z-item-options-menu"
ref={setPopupRef}
- use:clickOutside={props.close}
+ use:clickOutside={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ props.close();
+ }}
style={{
left: `${position().x}px`,
top: `${position().y}px`,
diff --git a/js/app/packages/block-channel/component/BaseInput.tsx b/js/app/packages/block-channel/component/BaseInput.tsx
index 47fcb02bfe..3e456e7969 100644
--- a/js/app/packages/block-channel/component/BaseInput.tsx
+++ b/js/app/packages/block-channel/component/BaseInput.tsx
@@ -9,7 +9,7 @@ import {
toSimpleMention,
} from '@block-channel/utils/mentionExpansion';
import { isInBlock } from '@core/block';
-import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';
+import { LabelAndHotKey } from '@core/component/Tooltip';
import { FileDropOverlay } from '@core/component/FileDropOverlay';
import { setEditorStateFromMarkdown } from '@core/component/LexicalMarkdown/utils';
import { fileFolderDrop } from '@core/directive/fileFolderDrop';
@@ -36,6 +36,7 @@ import type { SimpleMention } from '@service-comms/generated/models/simpleMentio
import { staticFileClient } from '@service-static-files/client';
import { createCallback } from '@solid-primitives/rootless';
import { leading, throttle } from '@solid-primitives/scheduled';
+import { Button } from '@ui/components/Button';
import { activeElement } from 'app/signal/focus';
import { toast } from 'core/component/Toast/Toast';
import { registerHotkey, useHotkeyDOMScope } from 'core/hotkey/hotkeys';
@@ -52,7 +53,6 @@ import {
} from 'solid-js';
import type { SetStoreFunction } from 'solid-js/store';
import { tabbable } from 'tabbable';
-import { ActionButton } from './ActionButton';
import { AttachMenu } from './AttachMenu';
import { Attachment } from './Attachment';
import { FormatRibbon } from './FormatRibbon';
@@ -458,7 +458,7 @@ export function BaseInput(props: BaseInputProps) {
/>
</Show>
<div
- class="transition-all duration-150 px-3 pt-2 sm:pb-4 overflow-y-auto placeholder:text-ink-placeholder text-ink w-full text-sm"
+ class="transition-all duration-150 px-3 pt-2 sm:pb-4 overflow-y-auto placeholder:text-ink-placeholder text-ink w-full text-sm touch:mobile-width:text-base"
onClick={(e) => {
e.stopPropagation();
focusMarkdownArea();
@@ -538,51 +538,61 @@ export function BaseInput(props: BaseInputProps) {
/>
</Show>
<div class="flex flex-row items-center gap-2">
- <DeprecatedIconButton
- icon={showAttachMenu() ? XIcon : PlusIcon}
- theme="base"
+ <Button
ref={setAttachMenuAnchorRef}
- onClick={() => setShowAttachMenu((prev) => !prev)}
- />
+ // We use onPointerDown here to integrate correctly with attach menu onMouseDown behavior.
+ onPointerDown={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ setShowAttachMenu((prev) => !prev);
+ }}
+ >
+ <Show
+ when={showAttachMenu()}
+ fallback={<PlusIcon width={20} height={20} />}
+ >
+ <XIcon width={20} height={20} />
+ </Show>
+ </Button>
- <ActionButton
- tooltip="Format"
+ <Button
+ tooltip={<LabelAndHotKey label="Format" />}
onClick={(e) => {
e.preventDefault();
setShowFormatRibbon((prev) => !prev);
}}
- clicked={showFormatRibbon()}
+ classList={{ 'bg-active': showFormatRibbon() }}
>
<FormatIcon width={20} height={20} />
- </ActionButton>
+ </Button>
<Show when={props.isReplyInput && props.closeDraft}>
- <ActionButton
- tooltip="Delete reply"
+ <Button
+ tooltip={<LabelAndHotKey label="Delete reply" />}
onClick={(e) => {
e.preventDefault();
props.closeDraft?.();
}}
>
<Trash width={20} height={20} />
- </ActionButton>
+ </Button>
</Show>
</div>
- <button
+ <Button
disabled={hasPendingAttachments()}
onClick={() => {
handleSend();
}}
- class="text-ink-muted hover:scale-115 transition ease-in-out flex flex-col justify-center items-center size-6 rounded-full"
+ class="group transition ease-in-out hover:bg-transparent"
>
<Show
when={!hasPendingAttachments() && !isPendingSend()}
fallback={<Spinner class="size-6 animate-spin cursor-disabled" />}
>
- <div class="group hover:bg-accent transition ease-in-out size-6 border border-accent rounded-full flex items-center justify-center">
+ <div class="group-hover:scale-115 group-hover:bg-accent transition ease-in-out size-6 touch:size-8 border border-accent rounded-full flex items-center justify-center">
<ArrowUp class="group-hover:!text-input group-hover:!fill-input !text-accent-ink !fill-accent size-4 transition ease-in-out" />
</div>
</Show>
- </button>
+ </Button>
</div>
</div>
);
diff --git a/js/app/packages/block-channel/component/Message/MessageContainer.tsx b/js/app/packages/block-channel/component/Message/MessageContainer.tsx
index ff913ac305..24c0d8d728 100644
--- a/js/app/packages/block-channel/component/Message/MessageContainer.tsx
+++ b/js/app/packages/block-channel/component/Message/MessageContainer.tsx
@@ -477,8 +477,7 @@ export function MessageContainer(props: MessageProps) {
return (
<div
- class={`shrink-0 flex justify-center w-full ${isTouchDevice() ? 'no-select-children' : ''}
- [--thread-shift:23px] @sm:[--thread-shift:46px] [--user-icon-width:30px] @sm:[--user-icon-width:40px] [--left-of-connector:20px] @sm:[--left-of-connector:28px] [--left-of-user-icon:calc(var(--left-of-connector)-var(--user-icon-width)/2)]`}
+ class={`shrink-0 flex justify-center w-full ${isTouchDevice() ? 'no-select-children' : ''}`}
ref={(el) => {
props.setMessageContainerRef?.(el);
messageContainerRef = el;
@@ -512,230 +511,197 @@ export function MessageContainer(props: MessageProps) {
/>
</Show>
{/* Message item */}
- <Show
- when={!message.content.startsWith('%%MEETING_NOTIFICATION%%')}
- fallback={
- <div class="bg-accent-light p-2 rounded-md w-full flex justify-center items-center">
- <p class="text-xs text-ink-muted">
- {(() => {
- const content =
- message.content?.replace('%%MEETING_NOTIFICATION%%', '') ||
- '';
- const senderId = message.sender_id;
- const currentUserId = userId();
- // Handle contextual messages
- if (content.startsWith('Call not answered')) {
- // Extract timestamp if present
- const match = content.match(/at (.+)$/);
- const timestamp = match ? match[1] : '';
- // If the current user is the sender, they initiated the call
- // If not, they missed the call
- return senderId === currentUserId
- ? content
- : timestamp
- ? `Missed call at ${timestamp}`
- : 'Missed call';
- }
- // For all other messages, just return as is
- return content;
- })()}
- </p>
- </div>
- }
+
+ <ContextMenu
+ onOpenChange={(isOpen) => {
+ setContextMenuOpen(isOpen);
+ }}
>
- <ContextMenu
- onOpenChange={(isOpen) => {
- setContextMenuOpen(isOpen);
- }}
- >
- <ContextMenu.Trigger>
- <MessageComponent
- id={message.id}
- focused={props.isFocused}
- senderId={message.sender_id}
- isFirstMessage={isFirstMessage()}
- isLastMessage={isLastMessage()}
- isConsecutive={isConsecutive()}
- shouldHover={contextMenuOpen() || topBarEmojiMenuOpen()}
- hoverActions={
- <ActionMenu
- messageId={message.id}
- actions={actions()}
- setReactionMenuActivated={setTopBarEmojiMenuOpen}
+ <ContextMenu.Trigger>
+ <MessageComponent
+ id={message.id}
+ focused={props.isFocused}
+ senderId={message.sender_id}
+ isFirstMessage={isFirstMessage()}
+ isLastMessage={isLastMessage()}
+ isConsecutive={isConsecutive()}
+ shouldHover={contextMenuOpen() || topBarEmojiMenuOpen()}
+ hoverActions={
+ <ActionMenu
+ messageId={message.id}
+ actions={actions()}
+ setReactionMenuActivated={setTopBarEmojiMenuOpen}
+ />
+ }
+ threadDepth={threadDepth()}
+ hasThreadChildren={hasThreadChildren() || shouldShowFirstReply()}
+ isFirstInThread={isFirstInThread()}
+ isLastInThread={isLastInThread()}
+ isDeleted={!!message.deleted_at}
+ isNewMessage={isNewMessage()}
+ isParentNewMessage={isParentNewMessage()}
+ onThreadAppend={onThreadAppend}
+ shouldShowThreadAppendInput={shouldShowThreadAppendInput()}
+ isTarget={props.isTarget}
+ setThreadAppendMountTarget={(el) => {
+ if (!message.thread_id) return;
+
+ listContext.registerThreadAppendMountTarget(
+ message.thread_id,
+ el
+ );
+ }}
+ setMessageBodyRef={setMessageBodyRef}
+ >
+ <MessageComponent.TopBar
+ name={displayName()}
+ timestamp={message.created_at}
+ />
+ <Show
+ when={!editing()}
+ fallback={
+ <EditMessageInput
+ content={props.message?.content ?? ''}
+ setEditing={setEditing}
+ save={editMessage}
/>
}
- threadDepth={threadDepth()}
- hasThreadChildren={
- hasThreadChildren() || shouldShowFirstReply()
- }
- isFirstInThread={isFirstInThread()}
- isLastInThread={isLastInThread()}
- isDeleted={!!message.deleted_at}
- isNewMessage={isNewMessage()}
- isParentNewMessage={isParentNewMessage()}
- onThreadAppend={onThreadAppend}
- shouldShowThreadAppendInput={shouldShowThreadAppendInput()}
- isTarget={props.isTarget}
- setThreadAppendMountTarget={(el) => {
- if (!message.thread_id) return;
-
- listContext.registerThreadAppendMountTarget(
- message.thread_id,
- el
- );
- }}
- setMessageBodyRef={setMessageBodyRef}
>
- <MessageComponent.TopBar
- name={displayName()}
- timestamp={message.created_at}
- />
- <Show
- when={!editing()}
- fallback={
- <EditMessageInput
- content={props.message?.content ?? ''}
- setEditing={setEditing}
- save={editMessage}
+ <MessageComponent.Body isDeleted={!!message.deleted_at}>
+ <Show when={!isEmptyMessage()}>
+ <StaticMarkdown
+ markdown={message.content ?? ''}
+ theme={channelTheme}
+ target="internal"
/>
- }
- >
- <MessageComponent.Body isDeleted={!!message.deleted_at}>
- <Show when={!isEmptyMessage()}>
- <StaticMarkdown
- markdown={message.content ?? ''}
- theme={channelTheme}
- target="internal"
- />
- </Show>
- </MessageComponent.Body>
- </Show>
- <MessageAttachments
- videoAttachments={videoAttachments}
- imageAttachments={imageAttachments}
- documentAttachments={documentAttachments}
- isDeleted={() => !!message.deleted_at}
- isCurrentUser={() => userId() === message.sender_id}
- channelId={message.channel_id}
- messageId={message.id}
- content={message.content}
- />
- <Show when={!message.deleted_at}>
- <MessageReactions messageId={props.message?.id ?? ''} />
- </Show>
- </MessageComponent>
- <Show when={isLastInCollapsedThread()}>
+ </Show>
+ </MessageComponent.Body>
+ </Show>
+ <MessageAttachments
+ videoAttachments={videoAttachments}
+ imageAttachments={imageAttachments}
+ documentAttachments={documentAttachments}
+ isDeleted={() => !!message.deleted_at}
+ isCurrentUser={() => userId() === message.sender_id}
+ channelId={message.channel_id}
+ messageId={message.id}
+ content={message.content}
+ />
+ <Show when={!message.deleted_at}>
+ <MessageReactions messageId={props.message?.id ?? ''} />
+ </Show>
+ </MessageComponent>
+ <Show when={isLastInCollapsedThread()}>
+ <div
+ class="border-l border-edge-muted pb-1"
+ style={{
+ 'margin-left': `var(--left-of-connector)`,
+ }}
+ >
<div
- class="border-l border-edge-muted pb-1"
+ class="relative"
style={{
- 'margin-left': `var(--left-of-connector)`,
+ 'margin-left': `calc(var(--thread-shift) * ${threadDepth()} - 1px - var(--user-icon-width) / 2)`,
}}
>
- <div
- class="relative"
- style={{
- 'margin-left': `calc(var(--thread-shift) * ${threadDepth()} - 1px - var(--user-icon-width) / 2)`,
+ <ThreadReplyIndicator
+ countCollapsedMessages={
+ collapsedThreadMessages()?.length || 0
+ }
+ timestamp={lastReplyTimestamp()}
+ users={threadReplyUsers()}
+ onClick={handleThreadToggle}
+ isThreadOpen={threadState()?.threadExpanded}
+ />
+ </div>
+ </div>
+ </Show>
+ </ContextMenu.Trigger>
+ <ContextMenu.Portal>
+ <ContextMenuContent
+ onCloseAutoFocus={() => {
+ setReactionSearchOpen(false);
+ }}
+ mobileFullScreen
+ overrideStyling
+ >
+ <Switch>
+ <Match when={!reactionSearchOpen()}>
+ <ReactionQuickSelector
+ onEmojiClick={(emoji) => react(emoji.emoji)}
+ handleClose={() => {
+ setReactionSearchOpen(false);
+ }}
+ setSearchOpen={setReactionSearchOpen}
+ insideMenu
+ showFocusRing={true}
+ />
+ </Match>
+ <Match when={reactionSearchOpen()}>
+ <EmojiSearchSelector
+ onEmojiClick={(emoji) => react(emoji.emoji)}
+ handleClose={() => {
+ setReactionSearchOpen(false);
}}
+ fullWidth={isTouchDevice() && isMobileWidth()}
+ insideMenu={true}
+ />
+ </Match>
+ </Switch>
+ <Show when={isTouchDevice() && isMobileWidth()}>
+ <ContextMenu.Item class="mt-4 shrink-1 overflow-y-scroll overflow-x-hidden">
+ <MessageComponent
+ focused={props.isFocused}
+ senderId={message.sender_id}
+ isFirstMessage={isFirstMessage()}
+ isLastMessage={isLastMessage()}
+ hideConnectors
>
- <ThreadReplyIndicator
- countCollapsedMessages={
- collapsedThreadMessages()?.length || 0
- }
- timestamp={lastReplyTimestamp()}
- users={threadReplyUsers()}
- onClick={handleThreadToggle}
- isThreadOpen={threadState()?.threadExpanded}
- />
- </div>
- </div>
- </Show>
- </ContextMenu.Trigger>
- <ContextMenu.Portal>
- <ContextMenuContent
- onCloseAutoFocus={() => {
- setReactionSearchOpen(false);
- }}
- mobileFullScreen
- overrideStyling
- >
- <Switch>
- <Match when={!reactionSearchOpen()}>
- <ReactionQuickSelector
- onEmojiClick={(emoji) => react(emoji.emoji)}
- handleClose={() => {
- setReactionSearchOpen(false);
- }}
- setSearchOpen={setReactionSearchOpen}
- insideMenu
- showFocusRing={true}
- />
- </Match>
- <Match when={reactionSearchOpen()}>
- <EmojiSearchSelector
- onEmojiClick={(emoji) => react(emoji.emoji)}
- handleClose={() => {
- setReactionSearchOpen(false);
- }}
- fullWidth={isTouchDevice() && isMobileWidth()}
- insideMenu={true}
+ <MessageComponent.TopBar
+ name={displayName()}
+ timestamp={message.created_at}
/>
- </Match>
- </Switch>
- <Show when={isTouchDevice() && isMobileWidth()}>
- <ContextMenu.Item class="mt-4 shrink-1 overflow-y-scroll overflow-x-hidden">
- <MessageComponent
- focused={props.isFocused}
- senderId={message.sender_id}
- isFirstMessage={isFirstMessage()}
- isLastMessage={isLastMessage()}
- hideConnectors
- >
- <MessageComponent.TopBar
- name={displayName()}
- timestamp={message.created_at}
+ <MessageComponent.Body>
+ <StaticMarkdown
+ markdown={message.content ?? ''}
+ theme={channelTheme}
+ target="internal"
/>
- <MessageComponent.Body>
- <StaticMarkdown
- markdown={message.content ?? ''}
- theme={channelTheme}
- target="internal"
+ </MessageComponent.Body>
+ <MessageAttachments
+ videoAttachments={videoAttachments}
+ imageAttachments={imageAttachments}
+ documentAttachments={documentAttachments}
+ isDeleted={() => !!message.deleted_at}
+ isCurrentUser={() => userId() === message.sender_id}
+ channelId={message.channel_id}
+ messageId={message.id}
+ content={message.content}
+ />
+ </MessageComponent>
+ </ContextMenu.Item>
+ </Show>
+ <Show when={!reactionSearchOpen()}>
+ <div class={`${MENU_CONTENT_CLASS} mt-4`}>
+ <For each={actions().filter((a) => a.enabled)}>
+ {(a) => (
+ <>
+ <Show when={a.dividerBefore}>
+ <MenuSeparator />
+ </Show>
+ <MenuItem
+ onClick={a.onClick}
+ text={a.text}
+ icon={a.icon}
/>
- </MessageComponent.Body>
- <MessageAttachments
- videoAttachments={videoAttachments}
- imageAttachments={imageAttachments}
- documentAttachments={documentAttachments}
- isDeleted={() => !!message.deleted_at}
- isCurrentUser={() => userId() === message.sender_id}
- channelId={message.channel_id}
- messageId={message.id}
- content={message.content}
- />
- </MessageComponent>
- </ContextMenu.Item>
- </Show>
- <Show when={!reactionSearchOpen()}>
- <div class={`${MENU_CONTENT_CLASS} mt-4`}>
- <For each={actions().filter((a) => a.enabled)}>
- {(a) => (
- <>
- <Show when={a.dividerBefore}>
- <MenuSeparator />
- </Show>
- <MenuItem
- onClick={a.onClick}
- text={a.text}
- icon={a.icon}
- />
- </>
- )}
- </For>
- </div>
- </Show>
- </ContextMenuContent>
- </ContextMenu.Portal>
- </ContextMenu>
- </Show>
+ </>
+ )}
+ </For>
+ </div>
+ </Show>
+ </ContextMenuContent>
+ </ContextMenu.Portal>
+ </ContextMenu>
<Show when={shouldShowFirstReply()}>
<MessageComponent
focused={false}
diff --git a/js/app/packages/block-email/component/BaseInput.tsx b/js/app/packages/block-email/component/BaseInput.tsx
index 5460e49547..24c44a8e6e 100644
--- a/js/app/packages/block-email/component/BaseInput.tsx
+++ b/js/app/packages/block-email/component/BaseInput.tsx
@@ -1047,9 +1047,9 @@ export function BaseInput(props: {
setShowFormatRibbon(!showFormatRibbon());
}}
tooltip="Show formatting toolbar"
- class="aspect-square *:h-5 p-1"
+ class="aspect-square p-1"
>
- <TextAa />
+ <TextAa class="h-5" />
</Button>
<Tooltip
@@ -1092,9 +1092,9 @@ export function BaseInput(props: {
<Button
onclick={deleteDraftAndReset}
tooltip="Delete draft"
- class="aspect-square *:h-5 p-1"
+ class="aspect-square p-1"
>
- <Trash />
+ <Trash class="h-5" />
</Button>
</Show>
</div>
diff --git a/js/app/packages/block-email/component/CollapsedMessage.tsx b/js/app/packages/block-email/component/CollapsedMessage.tsx
index 3c994d15a3..cbc9bded4e 100644
--- a/js/app/packages/block-email/component/CollapsedMessage.tsx
+++ b/js/app/packages/block-email/component/CollapsedMessage.tsx
@@ -52,12 +52,9 @@ export function CollapsedMessage(props: CollapsedMessageProps) {
return (
<div class="shrink-0 flex justify-center w-full">
- <div class="macro-message-width w-full">
- <BozzyBracket
- active={props.isFocused}
- hover={hover()}
- class="[--user-icon-width:30px] @sm:[--user-icon-width:40px] [--left-of-connector:20px] @sm:[--left-of-connector:28px]"
- >
+ {/* These pl/pr below are needed to align with expanded messages at mobile width. */}
+ <div class="macro-message-width w-full pl-2 pr-4 sm:px-0">
+ <BozzyBracket active={props.isFocused} hover={hover()} class="">
<div
class="relative flex flex-row items-center w-full py-2 cursor-pointer opacity-60 hover:opacity-100 transition-all"
data-message-body-id={props.message.db_id}
@@ -74,7 +71,6 @@ export function CollapsedMessage(props: CollapsedMessageProps) {
left: 'var(--left-of-connector)',
}}
/>
-
{/* Avatar - centered on the rail, in front of rail */}
<div
class="relative z-10 flex justify-center items-center shrink-0"
@@ -94,10 +90,9 @@ export function CollapsedMessage(props: CollapsedMessageProps) {
suppressClick={true}
/>
</div>
-
{/* Sender + Snippet - aligned with expanded message content */}
<div
- class="flex-1 flex items-center min-w-0 text-sm"
+ class="flex-1 flex items-center min-w-0"
style={{
'padding-left':
'calc(var(--left-of-connector) - var(--user-icon-width) / 2)',
@@ -108,9 +103,8 @@ export function CollapsedMessage(props: CollapsedMessageProps) {
</span>
<span class="text-ink-extra-muted truncate">{snippet()}</span>
</div>
-
{/* Date */}
- <div class="text-xs text-ink-muted shrink-0 ml-4 pr-2">
+ <div class="text-xs touch:mobile-width:text-sm text-ink-muted shrink-0 ml-4 pr-2">
{props.message.internal_date_ts &&
new Date(props.message.internal_date_ts).toLocaleDateString(
'en-US',
diff --git a/js/app/packages/block-email/component/EmailMessageBody.tsx b/js/app/packages/block-email/component/EmailMessageBody.tsx
index 0ea4ce8045..763f5fde7b 100644
--- a/js/app/packages/block-email/component/EmailMessageBody.tsx
+++ b/js/app/packages/block-email/component/EmailMessageBody.tsx
@@ -219,7 +219,7 @@ export function EmailMessageBody(props: EmailMessageBodyProps) {
}}
>
<div
- class="text-sm relative"
+ class="relative"
classList={{
isPersonal: isPersonal(),
'line-clamp-3': !props.isBodyExpanded(),
diff --git a/js/app/packages/block-email/component/MessageActions.tsx b/js/app/packages/block-email/component/MessageActions.tsx
index 0bf17417bb..1e9920f25d 100644
--- a/js/app/packages/block-email/component/MessageActions.tsx
+++ b/js/app/packages/block-email/component/MessageActions.tsx
@@ -1,9 +1,9 @@
-import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';
import ArrowBendDoubleUpLeft from '@icon/regular/arrow-bend-double-up-left.svg';
import ArrowBendUpLeft from '@icon/regular/arrow-bend-up-left.svg';
import ArrowBendUpRight from '@icon/regular/arrow-bend-up-right.svg';
import type { MessageWithBodyReplyless } from '@service-email/generated/schemas';
import { useEmail } from '@service-gql/client';
+import { Button } from '@ui/components/Button';
import { type Setter, Show } from 'solid-js';
import { getEmailFormRegistry } from './EmailFormContext';
@@ -53,9 +53,8 @@ export function MessageActions(props: {
}
fallback={
<Show when={!props.hiddenActions?.includes('reply')}>
- <DeprecatedIconButton
- icon={ArrowBendUpLeft}
- theme="clear"
+ <Button
+ class="h-8 w-8 p-0 border-0 bg-transparent hover:bg-hover hover-transition-bg text-ink gap-0.5 active:bg-hover active:text-ink active:border-transparent"
onClick={() => {
if (!props.isLastMessage) {
props.setShowReply(true);
@@ -64,16 +63,15 @@ export function MessageActions(props: {
form.setReplyType('reply');
form.setShouldFocusInput(true);
}}
- tooltip={{
- label: 'Reply',
- }}
- />
+ tooltip={<span>Reply</span>}
+ >
+ <ArrowBendUpLeft class="h-5 w-5" />
+ </Button>
</Show>
}
>
- <DeprecatedIconButton
- icon={ArrowBendDoubleUpLeft}
- theme="clear"
+ <Button
+ class="h-8 w-8 p-0 border-0 bg-transparent hover:bg-hover hover-transition-bg text-ink gap-0.5 active:bg-hover active:text-ink active:border-transparent"
onClick={() => {
if (!props.isLastMessage) {
props.setShowReply(true);
@@ -82,15 +80,14 @@ export function MessageActions(props: {
form.setReplyType('reply-all');
form.setShouldFocusInput(true);
}}
- tooltip={{
- label: 'Reply all',
- }}
- />
+ tooltip={<span>Reply all</span>}
+ >
+ <ArrowBendDoubleUpLeft class="h-5 w-5" />
+ </Button>
</Show>
<Show when={!props.hiddenActions?.includes('forward')}>
- <DeprecatedIconButton
- icon={ArrowBendUpRight}
- theme="clear"
+ <Button
+ class="h-8 w-8 p-0 border-0 bg-transparent hover:bg-hover hover-transition-bg text-ink gap-0.5 active:bg-hover active:text-ink active:border-transparent"
onClick={() => {
if (!props.isLastMessage) {
props.setShowReply(true);
@@ -99,10 +96,10 @@ export function MessageActions(props: {
form.setReplyType('forward');
form.setShouldFocusInput(true);
}}
- tooltip={{
- label: 'Forward',
- }}
- />
+ tooltip={<span>Forward</span>}
+ >
+ <ArrowBendUpRight class="h-5 w-5" />
+ </Button>
</Show>
</div>
);
diff --git a/js/app/packages/block-email/component/MessageList.tsx b/js/app/packages/block-email/component/MessageList.tsx
index 4948327a0b..302f539f72 100644
--- a/js/app/packages/block-email/component/MessageList.tsx
+++ b/js/app/packages/block-email/component/MessageList.tsx
@@ -23,7 +23,7 @@ export function MessageList(props: MessageListProps) {
return (
<div
- class="pt-3 w-full flex flex-col-reverse items-center overflow-y-scroll overflow-x-hidden suppress-css-brackets"
+ class="pt-3 w-full flex flex-col-reverse items-center overflow-y-scroll overflow-x-hidden suppress-css-brackets text-sm touch:mobile-width:text-base"
ref={context.registerMessagesList}
onscroll={(e) => {
// Don't load more if we're programmatically scrolling to a message
diff --git a/js/app/packages/core/component/FormControls/DeprecatedButton.tsx b/js/app/packages/core/component/FormControls/DeprecatedButton.tsx
index a8fcca2bce..4a817e670b 100644
--- a/js/app/packages/core/component/FormControls/DeprecatedButton.tsx
+++ b/js/app/packages/core/component/FormControls/DeprecatedButton.tsx
@@ -12,7 +12,7 @@ type Size = 'SM' | 'Base' | 'XS';
type Theme = 'primary' | 'secondary' | 'primary' | 'secondary';
const sizeClass: Record<Size, string> = {
- XS: 'text-[10px] p-1',
+ XS: 'text-xxs p-1',
SM: 'text-xs p-1',
Base: 'text-[14px] p-1 px-[8px]',
};
diff --git a/js/app/packages/core/component/LiveIndicators.tsx b/js/app/packages/core/component/LiveIndicators.tsx
index a301a3f259..9d12975958 100644
--- a/js/app/packages/core/component/LiveIndicators.tsx
+++ b/js/app/packages/core/component/LiveIndicators.tsx
@@ -51,7 +51,7 @@ export function LiveIndicators(props: {
.map((user) => user.split('|').at(1)?.split('@')[0])
.join(', ')}
>
- <div class="size-6 bg-menu border-2 text-[10px] -mr-3 border-panel rounded-full flex flex-col justify-center items-center">
+ <div class="size-6 bg-menu border-2 text-xxs -mr-3 border-panel rounded-full flex flex-col justify-center items-center">
<span>{`+${remaining()}`}</span>
</div>
</Tooltip>
diff --git a/js/app/packages/core/component/Message.tsx b/js/app/packages/core/component/Message.tsx
index 830f17c92a..e3a831579a 100644
--- a/js/app/packages/core/component/Message.tsx
+++ b/js/app/packages/core/component/Message.tsx
@@ -114,12 +114,12 @@ const TopBar: Component<MessageTopBarProps> = (props) => {
<Show when={!context.isConsecutive}>
<div class="font-mono flex flex-row items-center justify-between">
{/* Name */}
- <div class="shrink-1 min-w-0 text-sm truncate text-ink-muted">
+ <div class="shrink-1 min-w-0 text-sm touch:mobile-width:text-base truncate text-ink-muted">
{local.name}
</div>
{/* Tag */}
<Show when={local.tagLabel}>
- <div class="inline-flex items-center ml-2 px-0.5 text-xs bg-edge/15 text-ink border-1 border-edge/30 max-w-[240px] min-w-0">
+ <div class="inline-flex items-center ml-2 px-0.5 text-xs touch:mobile-width:text-sm bg-edge/15 text-ink border-1 border-edge/30 max-w-[240px] min-w-0">
<div class="flex-shrink-0 px-0.5">
<Show when={local.tagIcon}>
<CustomEntityIcon icon={local.tagIcon!} size="xs" />
@@ -130,7 +130,7 @@ const TopBar: Component<MessageTopBarProps> = (props) => {
</Show>
{/* Date */}
<Show when={local.timestamp}>
- <div class="text-xs text-ink-muted">
+ <div class="text-xs touch:mobile-width:text-sm text-ink-muted">
{local.timestamp &&
formatDate(new Date(local.timestamp).getTime() / 1000)}
</div>
@@ -152,10 +152,14 @@ const Body: Component<MessageBodyProps> = (props) => {
<Show
when={!props.isDeleted}
fallback={
- <div class="text-xs text-ink-muted font-mono">Message Deleted</div>
+ <div class="text-xs touch:mobile-width:text-sm text-ink-muted font-mono">
+ Message Deleted
+ </div>
}
>
- <div class="text-sm text-ink pr-4">{props.children}</div>
+ <div class="text-sm touch:mobile-width:text-base text-ink pr-4">
+ {props.children}
+ </div>
</Show>
);
};
@@ -217,7 +221,7 @@ const Root: Component<MessageRootProps> = (props) => {
return (
<MessageContext.Provider value={ctx}>
<div
- class={`relative flex flex-row items-stretch w-full suppress-css-brackets [--thread-shift:23px] @sm:[--thread-shift:46px] [--user-icon-width:30px] @sm:[--user-icon-width:40px] [--left-of-connector:20px] @sm:[--left-of-connector:28px] [--left-of-user-icon:calc(var(--left-of-connector)-var(--user-icon-width)/2)] transition-colors duration-1000 ease`}
+ class={`relative flex flex-row items-stretch w-full suppress-css-brackets transition-colors duration-1000 ease`}
classList={{
'bg-accent': props.isTarget,
}}
diff --git a/js/app/packages/core/hotkey/tokens.ts b/js/app/packages/core/hotkey/tokens.ts
index 672be0e4cf..6f304a953b 100644
--- a/js/app/packages/core/hotkey/tokens.ts
+++ b/js/app/packages/core/hotkey/tokens.ts
@@ -58,13 +58,6 @@ export const TOKENS = {
// global
global: {
createCommand: 'global.createCommand',
- quickCreateCommand: 'global.quickCreateCommand',
- quickCreate: {
- note: 'global.quickCreate.note',
- email: 'global.quickCreate.email',
- message: 'global.quickCreate.message',
- menuFormat: 'global.quickCreate.menuFormat',
- },
commandMenu: 'global.commandMenu',
toggleBigChat: 'global.toggleBigChat',
instructions: 'global.instructions',
diff --git a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
index 56661c5ab6..3f2d11a9bb 100644
--- a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
+++ b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
@@ -96,7 +96,7 @@ function SharedBadge(props: { ownerId: string }) {
function GenericContentHit(props: { data: ContentHitData }) {
return (
- <div class="text-sm text-ink-muted truncate flex items-center">
+ <div class="text-ink-muted truncate flex items-center">
<StaticMarkdown
markdown={props.data.content}
theme={unifiedListMarkdownTheme}
@@ -114,14 +114,12 @@ function ChannelMessageContentHit(props: { data: ChannelContentHitData }) {
<div class="flex size-5 shrink-0 items-center justify-center">
<UserIcon id={props.data.senderId} size="xs" />
</div>
- <div class="flex gap-2 text-sm w-full min-w-0 overflow-hidden items-baseline">
- <div class="text-sm shrink-0 truncate min-w-0 font-medium">
- {userName()}
- </div>
- <div class="shrink-0 font-mono text-xs uppercase text-ink-extra-muted">
+ <div class="flex gap-2 w-full min-w-0 overflow-hidden items-baseline">
+ <div class="shrink-0 truncate min-w-0 font-medium">{userName()}</div>
+ <div class="shrink-0 font-mono text-xs touch:mobile-width:text-sm uppercase text-ink-extra-muted">
{createFormattedDate(props.data.sentAt)}
</div>
- <div class="text-sm text-ink-muted truncate flex items-center flex-1 min-w-0">
+ <div class="text-ink-muted truncate flex items-center flex-1 min-w-0">
<StaticMarkdown
markdown={props.data.content}
theme={unifiedListMarkdownTheme}
@@ -160,18 +158,18 @@ function EmailMessageContentHit(props: {
<div class="flex size-5 shrink-0 items-center justify-center">
<UserIcon id={props.data.senderId} size="xs" />
</div>
- <div class="flex gap-2 text-sm w-full min-w-0 overflow-hidden items-baseline">
+ <div class="flex gap-2 w-full min-w-0 overflow-hidden items-baseline">
<Show when={!isSingleMatch() && !isSingleSender()}>
- <div class="text-sm shrink-0 truncate min-w-0 font-medium">
+ <div class="shrink-0 truncate min-w-0 font-medium">
{props.data.sender}
</div>
</Show>
<Show when={!isSingleMatch() && !isSingleSentAt()}>
- <div class="shrink-0 font-mono text-xs uppercase text-ink-extra-muted">
+ <div class="shrink-0 font-mono text-xs touch:mobile-width:text-sm uppercase text-ink-extra-muted">
{createFormattedDate(props.data.sentAt)}
</div>
</Show>
- <div class="text-sm text-ink-muted truncate flex items-center flex-1 min-w-0">
+ <div class="text-ink-muted truncate flex items-center flex-1 min-w-0">
<StaticMarkdown
markdown={props.data.content}
theme={unifiedListMarkdownTheme}
@@ -257,7 +255,7 @@ function CollapsibleList<T>(props: {
<ThreadBorder />
</Show>
<button
- class="block w-fit px-2 py-0.5 text-[10px] border border-edge uppercase font-mono hover:font-medium"
+ class="block w-fit px-2 py-0.5 text-xxs border border-edge uppercase font-mono hover:font-medium"
onClick={(e) => {
e.stopPropagation();
setShowAll((prev) => !prev);
@@ -360,8 +358,8 @@ function NotificationRow(props: {
<div class="flex size-5 shrink-0 items-center justify-center mr-1">
<UserIcon id={props.notification.senderId!} size="xs" />
</div>
- <div class="flex gap-1 text-sm w-full min-w-0 overflow-hidden items-baseline">
- <div class="text-sm w-[20cqw] shrink-0 truncate min-w-0">
+ <div class="flex gap-1 w-full min-w-0 overflow-hidden items-baseline">
+ <div class="w-[20cqw] shrink-0 truncate min-w-0">
{userName()}{' '}
<span class="opacity-70 uppercase font-mono text-[0.625rem] ml-2">
{ActionContent()}
@@ -369,7 +367,7 @@ function NotificationRow(props: {
</div>
<MessageContent />
</div>
- <div class="shrink-0 font-mono text-xs uppercase text-ink-extra-muted ml-2">
+ <div class="shrink-0 font-mono text-xs touch:mobile-width:text-sm uppercase text-ink-extra-muted ml-2">
{createFormattedDate(props.notification.createdAt)}
</div>
</CollapsibleListRow>
@@ -414,7 +412,7 @@ function ContentHitRow(props: {
<Show when={match()}>
{(match) => {
return (
- <span class="font-mono text-xs text-ink-disabled/50">
+ <span class="font-mono text-xs touch:mobile-width:text-sm text-ink-disabled/50">
{match()[0] + 1}/{match()[1]}
</span>
);
@@ -593,7 +591,7 @@ export function EntityWithEverything(
};
return (
- <div class="flex gap-1 items-center text-sm min-w-0 w-full truncate overflow-hidden @max-md/uList:flex-col @max-md/uList:items-start @max-md/uList:gap-1 @max-md/uList:truncate-none">
+ <div class="flex gap-1 items-center min-w-0 w-full truncate overflow-hidden @max-md/uList:flex-col @max-md/uList:items-start @max-md/uList:gap-1 @max-md/uList:truncate-none">
{/* sometimes senderName and senderEmail are the same */}
<div
class="flex gap-2 items-center font-semibold shrink-0 @max-md/uList:w-full @max-md/uList:truncate"
@@ -691,14 +689,14 @@ export function EntityWithEverything(
{/* Timestamp inline with subject in narrow mode */}
<Show when={props.timestamp ?? props.entity.updatedAt}>
{(date) => (
- <span class="hidden @max-md/uList:inline shrink-0 whitespace-nowrap text-xs font-mono uppercase text-ink-extra-muted">
+ <span class="hidden @max-md/uList:inline shrink-0 whitespace-nowrap text-xs touch:mobile-width:text-sm font-mono uppercase text-ink-extra-muted">
{createFormattedDate(date())}
</span>
)}
</Show>
</div>
{/* Body snippet - below subject in narrow mode */}
- <div class="hidden @max-md/uList:block truncate w-full text-xs opacity-60">
+ <div class="hidden @max-md/uList:block truncate w-full text-xs touch:mobile-width:text-sm opacity-60">
{props.entity.snippet}
</div>
</div>
@@ -729,7 +727,7 @@ export function EntityWithEverything(
return (
<div class="flex gap-2 items-center min-w-0 w-fit max-w-full overflow-hidden @max-md/uList:flex-col @max-md/uList:items-start @max-md/uList:w-full @max-md/uList:gap-1">
- <span class="flex gap-1 truncate font-medium text-sm shrink-0 items-center @max-md/uList:w-full @max-md/uList:flex-col @max-md/uList:items-start @max-md/uList:gap-1">
+ <span class="flex gap-1 truncate font-medium shrink-0 items-center @max-md/uList:w-full @max-md/uList:flex-col @max-md/uList:items-start @max-md/uList:gap-1">
<div class="flex items-center gap-2 w-full @max-md/uList:justify-between @max-md/uList:min-w-0">
{/* Icon inline with title in narrow mode */}
<div class="hidden @max-md/uList:flex size-[1em] shrink-0 items-center justify-center relative group/icon-checkbox-nonemail">
@@ -802,7 +800,7 @@ export function EntityWithEverything(
{/* Timestamp inline with title in narrow mode */}
<Show when={props.timestamp ?? props.entity.updatedAt}>
{(date) => (
- <span class="hidden @max-md/uList:inline shrink-0 whitespace-nowrap text-xs font-mono uppercase text-ink-extra-muted">
+ <span class="hidden @max-md/uList:inline shrink-0 whitespace-nowrap text-xs touch:mobile-width:text-sm font-mono uppercase text-ink-extra-muted">
{createFormattedDate(date())}
</span>
)}
@@ -817,7 +815,7 @@ export function EntityWithEverything(
</span>
<Show when={latestMessage()}>
{(lastMessage) => (
- <div class="truncate shrink grow opacity-60 flex items-center @max-md/uList:w-full @max-md/uList:text-xs">
+ <div class="truncate shrink grow opacity-60 flex items-center @max-md/uList:w-full @max-md/uList:text-xs @max-md/uList:touch:mobile-width:text-sm">
{/* TODO (seamus): Channels endpoint does not return any information about attachments. If we have an empty message, assume it's attachments.*/}
<Show
when={lastMessage().content.trim()}
@@ -892,7 +890,7 @@ export function EntityWithEverything(
use:draggable
use:droppable
data-checked={props.checked}
- class="everything-entity w-full relative group/entity hover:bg-hover/30 mx-[1px]"
+ class="everything-entity w-full relative group/entity hover:bg-hover/30 text-sm touch:mobile-width:text-base mx-[1px]"
style={{
'min-height': `${ENTITY_HEIGHT}px`,
}}
@@ -965,7 +963,7 @@ export function EntityWithEverything(
>
<button
type="button"
- class="col-1 size-full relative group/button flex items-center justify-center bracket-never @max-md/uList:hidden"
+ class="col-1 size-full relative group/button flex items-center justify-center bracket-never @max-md/uList:hidden touch:hidden"
onMouseDown={(e) => {
e.stopPropagation();
}}
@@ -1107,7 +1105,7 @@ export function EntityWithEverything(
</Show>
<Show when={props.timestamp ?? props.entity.updatedAt}>
{(date) => (
- <span class="w-[8ch] text-right shrink-0 whitespace-nowrap text-xs font-mono uppercase text-ink-extra-muted @max-md/uList:hidden">
+ <span class="w-[8ch] text-right shrink-0 whitespace-nowrap text-xs touch:mobile-width:text-sm font-mono uppercase text-ink-extra-muted @max-md/uList:hidden">
{createFormattedDate(date())}
</span>
)}
@@ -1306,7 +1304,7 @@ function EntityProject(props: {
onPointerDown={(e) =>
openProjectEntity({ event: e, eventHandler: props.onPointerdown })
}
- class="flex gap-1 items-center text-xs text-ink-extra-muted min-w-0"
+ class="flex gap-1 items-center text-xs touch:mobile-width:text-sm text-ink-extra-muted min-w-0"
classList={{
'hover:text-accent': projectQuery.isSuccess,
}}
diff --git a/js/app/packages/ui/components/Button.tsx b/js/app/packages/ui/components/Button.tsx
index c3f45db730..40f8e6e910 100644
--- a/js/app/packages/ui/components/Button.tsx
+++ b/js/app/packages/ui/components/Button.tsx
@@ -61,6 +61,8 @@ export const Button: ParentComponent<ButtonProps> = (props) => {
'focus:[--focus-border-inset:-4px]',
'active:border-accent active:bg-accent active:text-panel',
'disabled:opacity-50 disabled:cursor-not-allowed',
+ 'touch:min-h-11 touch:min-w-11 touch:[&_svg]:size-6',
+
{
'bg-ink border-ink text-panel hover:bg-accent hover:opacity-80 active:opacity-100':
'primary' === local.variant,