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(properties): property style overhaul first pass (#861)

Seamuse119a963f7ab
diff --git a/js/app/packages/app/component/split-layout/componentRegistry.tsx b/js/app/packages/app/component/split-layout/componentRegistry.tsx
index c9d384ff64..19f2aed37a 100644
--- a/js/app/packages/app/component/split-layout/componentRegistry.tsx
+++ b/js/app/packages/app/component/split-layout/componentRegistry.tsx
@@ -126,6 +126,11 @@ if (LOCAL_ONLY) {
}))
)
);
+
+ registerComponent(
+ 'properties-debug',
+ lazy(() => import('@core/component/Properties/debug/PropertiesDebug'))
+ );
}
if (DEV_MODE_ENV) {
diff --git a/js/app/packages/block-md/component/ComposeTask.tsx b/js/app/packages/block-md/component/ComposeTask.tsx
index a6edac93d0..52ebeaa2b2 100644
--- a/js/app/packages/block-md/component/ComposeTask.tsx
+++ b/js/app/packages/block-md/component/ComposeTask.tsx
@@ -12,12 +12,14 @@ import {
propertyValueToApi,
} from '@core/component/Properties/api/converters';
import { Modals } from '@core/component/Properties/component/modal';
-import { PropertyRow } from '@core/component/Properties/component/panel';
-import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
+import { PropertyGrid } from '@core/component/Properties/component/panel';
+import {
+ PROPERTY_OPTION_IDS,
+ SYSTEM_PROPERTY_IDS,
+} from '@core/component/Properties/constants';
import {
PropertiesProvider,
type PropertySaveHandler,
- usePropertiesContext,
} from '@core/component/Properties/context/PropertiesContext';
import type {
Property,
@@ -29,14 +31,28 @@ import { itemToSafeName } from '@core/constant/allBlocks';
import { createTask } from '@core/util/create';
import { filterMap } from '@core/util/list';
import { isErr } from '@core/util/maybeResult';
+import TrashIcon from '@icon/regular/trash.svg';
import XIcon from '@icon/regular/x.svg';
+import {
+ queryKeys,
+ useQueryClient as useEntityQueryClient,
+} from '@macro-entity';
+import { useUserId } from '@service-gql/client';
import { propertiesServiceClient } from '@service-properties/client';
import type { PropertyDefinition } from '@service-properties/generated/schemas/propertyDefinition';
+import { refetchHistory } from '@service-storage/history';
+import { debounce } from '@solid-primitives/scheduled';
import { useQuery } from '@tanstack/solid-query';
import type { LexicalEditor } from 'lexical';
-import { createSignal, For, Show, Suspense } from 'solid-js';
+import { createEffect, createSignal, Show, Suspense } from 'solid-js';
import { createStore, reconcile, type Store, unwrap } from 'solid-js/store';
import { tabbable } from 'tabbable';
+import {
+ clearTaskComposerDraft,
+ loadTaskComposerDraft,
+ saveTaskComposerDraft,
+ updateDraftTimestamp,
+} from '../util/taskComposerStorage';
// Show these props in the composer.
const COMPOSER_PROPERTIES = [
@@ -88,6 +104,13 @@ async function createTaskWithProperties(
}
);
+ // Invalidate queries to refresh DSS and history
+ const entityQueryClient = useEntityQueryClient();
+ entityQueryClient.invalidateQueries({
+ queryKey: queryKeys.all.dss,
+ });
+ refetchHistory();
+
return documentId;
}
@@ -116,7 +139,7 @@ function extractPropertyValue(
if (Array.isArray(value)) {
return filterMap(value as string[], (id) => {
const opt = opts.find((opt) => opt.id === id);
- return opt ? opt.value.value : undefined;
+ return opt ? opt.id : undefined;
});
}
} else {
@@ -132,7 +155,7 @@ function extractPropertyValue(
function TaskToastPreview(props: { title: string; body: string; id: string }) {
return (
<BlockLink blockOrFileName="task" id={props.id}>
- <div class="text-ink size-full">
+ <div class="text-ink size-full w-44">
<div class="flex row items-center gap-2 mb-4">
<EntityIcon targetType="task" />
<span class="text-base font-medium">
@@ -162,14 +185,76 @@ export interface ComposeTaskProps {
export function ComposeTask(props: ComposeTaskProps) {
const splitPanel = useSplitPanelOrThrow();
- const [title, setTitle] = createSignal(props.initialTitle ?? '');
- const [content, setContent] = createSignal(props.initialContent ?? '');
+ const currentUserId = useUserId();
+
+ const getDefaultPropertyValues = (): Record<string, PropertyApiValues> => {
+ const id = currentUserId();
+ return {
+ [SYSTEM_PROPERTY_IDS.ASSIGNEES]: {
+ valueType: 'ENTITY' as const,
+ refs: id ? [{ entity_id: id, entity_type: 'USER' as const }] : [],
+ },
+ [SYSTEM_PROPERTY_IDS.STATUS]: {
+ valueType: 'SELECT_STRING' as const,
+ values: [PROPERTY_OPTION_IDS.STATUS.NOT_STARTED],
+ },
+ };
+ };
+
+ // draft init logic
+ const initializeFromDraft = () => {
+ if (!props.initialTitle && !props.initialContent) {
+ const draft = loadTaskComposerDraft();
+ if (draft) {
+ return {
+ title: draft.title,
+ content: draft.content,
+ propertyValues: draft.propertyValues,
+ isDraftLoaded: true,
+ };
+ }
+ }
+ return {
+ title: props.initialTitle ?? '',
+ content: props.initialContent ?? '',
+ propertyValues: getDefaultPropertyValues(),
+ isDraftLoaded: false,
+ };
+ };
+
+ const initialState = initializeFromDraft();
+ const [title, setTitle] = createSignal(initialState.title);
+ const [content, setContent] = createSignal(initialState.content);
const [bodyEditor, setBodyEditor] = createSignal<LexicalEditor>();
const [containerRef, setContainerRef] = createSignal<HTMLDivElement>();
+ const [isDraftLoaded, setIsDraftLoaded] = createSignal(
+ initialState.isDraftLoaded
+ );
const [propertyValues, setPropertyValues] = createStore<
Record<string, PropertyApiValues>
- >({});
+ >(initialState.propertyValues);
+
+ // draft saving logic
+ let hasInitializedFromDraft = isDraftLoaded();
+ const debouncedSave = debounce(saveTaskComposerDraft, 300);
+
+ createEffect(() => {
+ const currentTitle = title();
+ const currentContent = content();
+ const currentProperties = { ...unwrap(propertyValues) };
+
+ if (hasInitializedFromDraft) {
+ hasInitializedFromDraft = false;
+ return;
+ }
+
+ debouncedSave({
+ title: currentTitle,
+ content: currentContent,
+ propertyValues: currentProperties,
+ });
+ });
const systemPropertiesQuery = useQuery(() => ({
queryKey: ['compose-task', 'system-properties'],
@@ -230,6 +315,7 @@ export function ComposeTask(props: ComposeTaskProps) {
createdAt: '',
valueType: definition.data_type,
value: extractPropertyValue(definition, propertyValues, options()),
+ options: options().get(definition.id),
} as Property;
});
};
@@ -255,8 +341,12 @@ export function ComposeTask(props: ComposeTaskProps) {
createTaskWithProperties(taskTitle, taskContent, properties, definitions());
+ // Clear draft and reset form
+ clearTaskComposerDraft();
setTitle('');
- setPropertyValues(reconcile({}));
+ setContent('');
+ setPropertyValues(reconcile(getDefaultPropertyValues()));
+ setIsDraftLoaded(false);
const ed = bodyEditor();
ed && initializeEditorEmpty(ed);
@@ -269,6 +359,28 @@ export function ComposeTask(props: ComposeTaskProps) {
props.onClose?.();
};
+ const handleClose = () => {
+ // Update timestamp when closing to extend draft life
+ const currentTitle = title();
+ const currentContent = content();
+
+ if (currentTitle || currentContent) {
+ updateDraftTimestamp();
+ }
+
+ props.onClose?.();
+ };
+
+ const handleClearDraft = () => {
+ clearTaskComposerDraft();
+ setTitle('');
+ setContent('');
+ setPropertyValues(reconcile(getDefaultPropertyValues()));
+ setIsDraftLoaded(false);
+ const ed = bodyEditor();
+ ed && initializeEditorEmpty(ed);
+ };
+
const editorFocusChange = (e: KeyboardEvent, dir: 1 | -1) => {
const root = bodyEditor()?.getRootElement();
const container = containerRef();
@@ -294,17 +406,27 @@ export function ComposeTask(props: ComposeTaskProps) {
<Show when={splitPanel?.handle.isPopover()}>
<DeprecatedIconButton
icon={XIcon}
- onClick={splitPanel?.handle.close}
+ onClick={handleClose}
size="sm"
tabIndex={-1}
theme="current"
/>
</Show>
- <div class="flex items-center gap-2">
+ <div class="flex items-center gap-2 flex-1">
<span class="text-sm font-medium text-ink-disabled/50">
Create Task
</span>
</div>
+ <Show when={title() || content()}>
+ <DeprecatedIconButton
+ icon={TrashIcon}
+ onClick={handleClearDraft}
+ size="sm"
+ tabIndex={-1}
+ theme="current"
+ title="Clear draft"
+ />
+ </Show>
</div>
<div class="w-full border-b border-edge-muted/50" />
<div class="p-2">
@@ -341,7 +463,7 @@ export function ComposeTask(props: ComposeTaskProps) {
<MarkdownTextarea
editable={() => true}
onChange={(value) => setContent(value)}
- initialValue={props.initialContent}
+ initialValue={content()}
placeholder={props.placeholder ?? 'Add description...'}
captureEditor={setBodyEditor}
onEscape={() => {
@@ -364,39 +486,13 @@ export function ComposeTask(props: ComposeTaskProps) {
onPropertyDeleted={() => {}}
saveHandler={saveHandler}
>
- <div class="w-full grid grid-cols-2 gap-1 flex-wrap text-xs font-mono text-ink-muted mt-8">
- <For each={properties()}>
- {(prop) => {
- const { openPropertyEditor, openDatePicker } =
- usePropertiesContext();
- const handleValueClick = (
- property: Property,
- anchor?: HTMLElement
- ) => {
- if (property.valueType === 'DATE') {
- openDatePicker(property, anchor);
- } else if (
- property.valueType === 'SELECT_STRING' ||
- property.valueType === 'SELECT_NUMBER' ||
- property.valueType === 'ENTITY'
- ) {
- openPropertyEditor(property, anchor);
- }
- };
- return (
- <div class="grid grid-cols-[8rem_auto] rounded-xs items-center p-1">
- <PropertyRow
- property={prop}
- onValueClick={handleValueClick}
- withDelete={false}
- withPin={false}
- />
- </div>
- );
- }}
- </For>
+ <div class="text-sm">
+ <PropertyGrid
+ properties={properties()}
+ columns={2}
+ ></PropertyGrid>
+ <Modals />
</div>
- <Modals />
</PropertiesProvider>
</Suspense>
</div>
diff --git a/js/app/packages/block-md/component/FrontMatterProperties.tsx b/js/app/packages/block-md/component/FrontMatterProperties.tsx
index d9e964b7fd..56ff691b79 100644
--- a/js/app/packages/block-md/component/FrontMatterProperties.tsx
+++ b/js/app/packages/block-md/component/FrontMatterProperties.tsx
@@ -182,7 +182,7 @@ export function FrontMatterProperties(props: FrontMatterPropertiesProps) {
>
{/* Collapsible header with horizontal line */}
<div class="flex items-center gap-2 pt-2">
- <div class="w-8 border-t-2 border-edge" />
+ <div class="w-6 border-t border-edge-muted" />
<button
class="flex items-center gap-1 px-2 cursor-pointer hover:opacity-70 transition-opacity"
onClick={toggleExpanded}
@@ -192,14 +192,14 @@ export function FrontMatterProperties(props: FrontMatterPropertiesProps) {
) : (
<CaretRight class="w-3 h-3" />
)}
- <span class="text-sm font-mono">Properties</span>
+ <span class="text-xs">Properties</span>
</button>
- <div class="flex-1 border-t-2 border-edge" />
+ <div class="flex-1 border-t border-edge-muted" />
</div>
{/* Collapsible content */}
<Show when={isExpanded()}>
- <div class="font-mono pt-2 pb-2 px-4">
+ <div class="py-2 text-xs">
<Show when={isLoading()}>
<div class="flex items-center justify-center py-8">
<div class="w-5 h-5 animate-spin">
@@ -220,21 +220,19 @@ export function FrontMatterProperties(props: FrontMatterPropertiesProps) {
emptyMessage="No properties pinned yet"
/>
- <div class="pl-2 pt-4 pb-2">
+ <div class="pt-4 pb-2">
<button
class="flex items-center gap-1 cursor-pointer opacity-75 hover:opacity-50 transition-opacity"
onClick={toggleExpanded}
>
<EyeSlash class="w-3 h-3 mr-2" />
- <span class="text-sm text-ink font-mono">
- Hide Properties
- </span>
+ <span class="text-ink-muted">Hide Properties</span>
</button>
</div>
<Modals />
</div>
- <div class="border-t-2 border-edge pt-2" />
+ <div class="border-t border-edge-muted pt-2" />
</Show>
</PropertiesProvider>
</div>
diff --git a/js/app/packages/block-md/component/MarkdownPropertiesModal.tsx b/js/app/packages/block-md/component/MarkdownPropertiesModal.tsx
index a757d53616..acbd0e6264 100644
--- a/js/app/packages/block-md/component/MarkdownPropertiesModal.tsx
+++ b/js/app/packages/block-md/component/MarkdownPropertiesModal.tsx
@@ -99,7 +99,7 @@ function MarkdownPropertiesContent(_props: { documentId: string }) {
};
return (
- <div class="flex flex-col h-full">
+ <div class="flex flex-col h-full text-sm">
{/* Future: Add markdown-specific sections here */}
{/* e.g., word count, reading time, headings outline, etc. */}
diff --git a/js/app/packages/block-md/util/taskComposerStorage.ts b/js/app/packages/block-md/util/taskComposerStorage.ts
new file mode 100644
index 0000000000..38c5770968
--- /dev/null
+++ b/js/app/packages/block-md/util/taskComposerStorage.ts
@@ -0,0 +1,88 @@
+import type { PropertyApiValues } from '@core/component/Properties/types';
+
+const STORAGE_KEY = 'task-composer-draft';
+const EXPIRY_TIME_MS = 2 * 60 * 1000; // 2 minutes
+
+export interface TaskComposerDraft {
+ title: string;
+ content: string;
+ propertyValues: Record<string, PropertyApiValues>;
+ timestamp: number;
+}
+
+/**
+ * Save task composer draft to local storage
+ */
+export function saveTaskComposerDraft(
+ draft: Omit<TaskComposerDraft, 'timestamp'>
+): void {
+ try {
+ const draftWithTimestamp: TaskComposerDraft = {
+ ...draft,
+ timestamp: Date.now(),
+ };
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(draftWithTimestamp));
+ } catch (error) {
+ console.warn('Failed to save task composer draft:', error);
+ }
+}
+
+/**
+ * Load task composer draft from local storage if not expired
+ */
+export function loadTaskComposerDraft(): TaskComposerDraft | null {
+ try {
+ const stored = localStorage.getItem(STORAGE_KEY);
+ if (!stored) return null;
+
+ const draft: TaskComposerDraft = JSON.parse(stored);
+ const now = Date.now();
+ const elapsed = now - draft.timestamp;
+
+ if (elapsed > EXPIRY_TIME_MS) {
+ // Draft expired, remove it
+ clearTaskComposerDraft();
+ return null;
+ }
+
+ return draft;
+ } catch (error) {
+ console.warn('Failed to load task composer draft:', error);
+ clearTaskComposerDraft();
+ return null;
+ }
+}
+
+/**
+ * Clear task composer draft from local storage
+ */
+export function clearTaskComposerDraft(): void {
+ try {
+ localStorage.removeItem(STORAGE_KEY);
+ } catch (error) {
+ console.warn('Failed to clear task composer draft:', error);
+ }
+}
+
+/**
+ * Update timestamp of existing draft (used when closing composer)
+ */
+export function updateDraftTimestamp(): void {
+ try {
+ const stored = localStorage.getItem(STORAGE_KEY);
+ if (!stored) return;
+
+ const draft: TaskComposerDraft = JSON.parse(stored);
+ draft.timestamp = Date.now();
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(draft));
+ } catch (error) {
+ console.warn('Failed to update draft timestamp:', error);
+ }
+}
+
+/**
+ * Check if there's a valid draft available
+ */
+export function hasValidDraft(): boolean {
+ return loadTaskComposerDraft() !== null;
+}
diff --git a/js/app/packages/core/component/DatePicker/index.tsx b/js/app/packages/core/component/DatePicker/index.tsx
index ac5cd900f9..76422222ef 100644
--- a/js/app/packages/core/component/DatePicker/index.tsx
+++ b/js/app/packages/core/component/DatePicker/index.tsx
@@ -141,7 +141,7 @@ export function DatePicker(props: DatePickerProps) {
return (
<div
- class="absolute z-action-menu bg-dialog ring-1 ring-edge shadow-xl p-4 w-80 font-mono"
+ class="absolute z-action-menu bg-dialog ring-1 ring-edge-muted p-4 w-80 font-mono"
use:floatWithElement={{ element: () => props.anchorRef }}
use:clickOutside={props.onClose}
>
diff --git a/js/app/packages/core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin.ts b/js/app/packages/core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin.ts
index 5599b48aff..cde266f199 100644
--- a/js/app/packages/core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin.ts
+++ b/js/app/packages/core/component/LexicalMarkdown/plugins/text-paste/textPastePlugin.ts
@@ -1,4 +1,4 @@
-import type { BlockName } from '@core/block';
+import type { BlockAlias, BlockName } from '@core/block';
import { mergeRegister } from '@lexical/utils';
import {
$getSelection,
@@ -12,7 +12,7 @@ import { INSERT_DOCUMENT_MENTION_COMMAND } from '../mentions';
type MacroAppUrlParsed = {
isValid: boolean;
id: string | undefined;
- block: BlockName | undefined;
+ block: BlockName | BlockAlias | undefined;
params: Record<string, string> | undefined;
};
const Hosts = {
@@ -66,11 +66,12 @@ export function parseMacroAppUrl(text: string): MacroAppUrlParsed {
};
}
- const validTypes: BlockName[] = [
+ const validTypes: Array<BlockName | BlockAlias> = [
'chat',
'write',
'pdf',
'md',
+ 'task',
'code',
'image',
'canvas',
@@ -87,7 +88,7 @@ export function parseMacroAppUrl(text: string): MacroAppUrlParsed {
params: undefined,
};
}
- const block: BlockName = _block as BlockName;
+ const block: BlockName | BlockAlias = _block as BlockName | BlockAlias;
const idRegex =
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
diff --git a/js/app/packages/core/component/Properties/PropertiesView.tsx b/js/app/packages/core/component/Properties/PropertiesView.tsx
index da2c9d2ee1..91e6f253b8 100644
--- a/js/app/packages/core/component/Properties/PropertiesView.tsx
+++ b/js/app/packages/core/component/Properties/PropertiesView.tsx
@@ -17,8 +17,7 @@ import type {
PropertyApiValues,
} from './types';
-const CONTAINER_CLASSES =
- 'h-full overflow-hidden relative font-mono flex flex-col';
+const CONTAINER_CLASSES = 'h-full overflow-hidden relative flex flex-col';
const LOADING_CONTAINER_CLASSES = 'flex items-center justify-center py-8';
const SPINNER_CLASSES = 'w-5 h-5 animate-spin';
diff --git a/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx b/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx
index fd915e06d7..c8df3bdeb3 100644
--- a/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx
@@ -1,15 +1,16 @@
-import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';
import { ScopedPortal } from '@core/component/ScopedPortal';
+import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';
import {
constrainModalToViewport,
MODAL_VIEWPORT_CLASSES,
} from '@core/util/modalUtils';
-import XIcon from '@icon/regular/x.svg';
import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
+import { mergeRefs } from '@solid-primitives/refs';
import {
createEffect,
createMemo,
createSignal,
+ onCleanup,
onMount,
Show,
} from 'solid-js';
@@ -17,7 +18,6 @@ import { MODAL_DIMENSIONS } from '../../constants';
import { usePropertiesContext } from '../../context/PropertiesContext';
import { usePropertyEditor } from '../../hooks/usePropertyEditor';
import type { PropertyApiValues, PropertyEditorProps } from '../../types';
-import { getValueTypeDisplay } from '../../utils';
import {
entityReferencesToIdSet,
updateEntityReferences,
@@ -27,13 +27,18 @@ import { PropertyOptionSelector } from './shared/PropertyOptionSelector';
// Common CSS classes
const MODAL_BASE =
- 'absolute bg-dialog border-3 border-edge shadow-xl max-h-96 overflow-hidden flex flex-col w-full max-w-md';
-const HEADER_CLASSES = 'flex items-center justify-between pt-3 pb-2 px-4';
-const CONTENT_CLASSES = 'flex-1 max-h-64 pt-2 px-4 pb-4';
+ 'absolute bg-menu border border-edge-muted max-h-96 overflow-hidden flex flex-col w-full max-w-md';
export function EditPropertyValueModal(props: PropertyEditorProps) {
const { saveHandler } = usePropertiesContext();
+ let modalRef!: HTMLDivElement;
+
+ const [attachHotkeys, modalScopeId] = useHotkeyDOMScope(
+ 'property-edit-modal',
+ false
+ );
+
const [selectedEntityRefs, setSelectedEntityRefs] = createSignal<
EntityReference[]
>(
@@ -127,8 +132,6 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
}
};
- let modalRef!: HTMLDivElement;
-
onMount(() => {
initializeSelectedOptions();
if (
@@ -137,6 +140,21 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
) {
fetchOptions();
}
+
+ // Attach hotkeys to modal element
+ attachHotkeys(modalRef);
+
+ // Register escape key handler
+ registerHotkey({
+ hotkey: 'escape',
+ scopeId: modalScopeId,
+ description: 'Close property modal',
+ keyDownHandler: () => {
+ handleClose();
+ return true;
+ },
+ runWithInputFocused: true,
+ });
});
createEffect(() => {
@@ -154,15 +172,18 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
};
window.addEventListener('resize', handleResize);
- return () => window.removeEventListener('resize', handleResize);
+ onCleanup(() => window.removeEventListener('resize', handleResize));
});
return (
<ScopedPortal scope="local">
<div class="fixed inset-0 z-modal" onClick={handleClose}>
<div
- ref={modalRef}
+ ref={mergeRefs((ref) => {
+ modalRef = ref;
+ })}
class={`${MODAL_BASE} ${MODAL_VIEWPORT_CLASSES}`}
+ tabIndex={-1}
style={createMemo(() => {
if (!props.position) {
return {
@@ -185,8 +206,8 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
})()}
onClick={(e) => e.stopPropagation()}
>
- <div class="bg-dialog text-ink font-mono">
- <div class={HEADER_CLASSES}>
+ <div class="bg-dialog text-ink">
+ {/*<div class={HEADER_CLASSES}>
<div>
<h3 class="text-base font-semibold text-ink">
{props.property.displayName}
@@ -203,9 +224,9 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
onClick={handleClose}
/>
</div>
- </div>
+ </div>*/}
- <div class={CONTENT_CLASSES}>
+ <div>
<Show
when={
props.property.valueType === 'SELECT_STRING' ||
@@ -229,6 +250,7 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
setSelectedEntityRefs(updatedRefs);
}}
setHasChanges={() => {}} // Not needed with new hook
+ onClose={handleClose}
/>
</Show>
}
@@ -244,6 +266,7 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
onAddOption={
props.property.isSystemProperty ? undefined : addOption
}
+ onClose={handleClose}
/>
</Show>
</div>
diff --git a/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx b/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx
index d60aad184b..23fddc7a02 100644
--- a/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/SelectPropertyModal.tsx
@@ -141,7 +141,7 @@ export function SelectPropertyModal(props: PropertySelectorProps) {
return (
<Portal>
<div
- class="fixed inset-0 bg-overlay z-modal-overlay"
+ class="fixed inset-0 z-modal-overlay"
onClick={() => props.onClose()}
onKeyDown={(e) => e.key === 'Escape' && props.onClose()}
role="dialog"
diff --git a/js/app/packages/core/component/Properties/component/modal/shared/Dropdown.tsx b/js/app/packages/core/component/Properties/component/modal/shared/Dropdown.tsx
index cf3147c712..a510e8c814 100644
--- a/js/app/packages/core/component/Properties/component/modal/shared/Dropdown.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/shared/Dropdown.tsx
@@ -116,7 +116,7 @@ export const Dropdown = <T extends string | number>(
ref={buttonRef}
type="button"
onClick={() => setIsOpen(!isOpen())}
- class="w-full px-3 py-1.5 border border-edge bg-menu text-sm text-ink text-left flex items-center gap-2 hover:bg-hover font-mono"
+ class="w-full px-3 py-1.5 border border-edge-muted bg-menu text-sm text-ink text-left flex items-center gap-2 hover:bg-hover font-mono"
>
{props.renderValue?.(selectedOption()) ??
defaultRenderValue(selectedOption())}
diff --git a/js/app/packages/core/component/Properties/component/modal/shared/OptionCheckBox.tsx b/js/app/packages/core/component/Properties/component/modal/shared/OptionCheckBox.tsx
new file mode 100644
index 0000000000..7c52994bc2
--- /dev/null
+++ b/js/app/packages/core/component/Properties/component/modal/shared/OptionCheckBox.tsx
@@ -0,0 +1,29 @@
+import CheckIcon from '@icon/bold/check-bold.svg';
+import { type Component, Show } from 'solid-js';
+
+/**
+ * CheckBox component for property option menus.
+ * @param props.checked Show the box as checked or not
+ * @param props.multiselect Show the box as a regular-multi-selectable checkbox
+ * or if explicitly false, as a rounded radio button.
+ * @returns
+ */
+export const OptionCheckBox: Component<{
+ checked: boolean;
+ multiselect?: boolean;
+}> = (props) => {
+ return (
+ <div
+ class="size-4 flex items-center justify-center"
+ classList={{
+ 'bg-accent border-accent border': props.checked,
+ 'bg-transparent border-edge-muted border': !props.checked,
+ 'rounded-full': props.multiselect === false,
+ }}
+ >
+ <Show when={props.checked && props.multiselect !== false}>
+ <CheckIcon class="size-3 text-panel" />
+ </Show>
+ </div>
+ );
+};
diff --git a/js/app/packages/core/component/Properties/component/modal/shared/PropertyEntitySelector.tsx b/js/app/packages/core/component/Properties/component/modal/shared/PropertyEntitySelector.tsx
index 58d2a47e4e..8541ff2049 100644
--- a/js/app/packages/core/component/Properties/component/modal/shared/PropertyEntitySelector.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/shared/PropertyEntitySelector.tsx
@@ -6,7 +6,6 @@ import { fileTypeToBlockName } from '@core/constant/allBlocks';
import type { ChannelWithParticipants, IUser } from '@core/user';
import { idToEmail, tryMacroId, useContacts, useDisplayName } from '@core/user';
import { createFreshSearch } from '@core/util/freshSort';
-import CheckIcon from '@icon/bold/check-bold.svg';
import CompanyIcon from '@icon/duotone/building-duotone.svg';
import ChannelBuildingIcon from '@icon/duotone/building-office-duotone.svg';
import ThreadIcon from '@icon/duotone/envelope-duotone.svg';
@@ -31,12 +30,14 @@ import {
createSignal,
For,
on,
+ onCleanup,
+ onMount,
Show,
} from 'solid-js';
import { usePropertiesContext } from '../../../context/PropertiesContext';
-import { PROPERTY_STYLES } from '../../../styles/styles';
import type { Property } from '../../../types';
import { useSearchInputFocus } from '../../../utils';
+import { OptionCheckBox } from './OptionCheckBox';
type EntityInputProps = {
property: Property;
@@ -46,12 +47,9 @@ type EntityInputProps = {
entityInfo?: { id: string; entity_type: string }[]
) => void;
setHasChanges: (hasChanges: boolean) => void;
+ onClose?: () => void;
};
-const INPUT_CLASSES = PROPERTY_STYLES.input.search;
-const ENTITY_ITEM_BASE =
- 'flex items-center justify-between gap-2 py-1.5 px-2 border border-edge cursor-pointer min-w-0';
-const CHECKBOX_BASE = 'w-4 h-4 border flex items-center justify-center';
const ICON_CLASSES = 'size-4 text-ink-muted';
function getEntityTypePluralLabel(
@@ -198,6 +196,9 @@ function getEntityIcon(entity: CombinedEntity) {
export function PropertyEntitySelector(props: EntityInputProps) {
const [inputValue, setInputValue] = createSignal('');
const [searchTerm, setSearchTerm] = createSignal('');
+ const [selectedIndex, setSelectedIndex] = createSignal(0);
+ const [keyboardNavigationTimeout, setKeyboardNavigationTimeout] =
+ createSignal<number | null>(null);
// Debounce search term updates (60ms like MentionsMenu)
const debouncedSetSearchTerm = debounce(
@@ -454,73 +455,155 @@ export function PropertyEntitySelector(props: EntityInputProps) {
},
]);
props.setHasChanges(true);
+
+ if (!props.property.isMultiSelect && props.onClose) {
+ props.onClose();
+ } else if (props.property.isMultiSelect && searchInputRef) {
+ // Keep input focused when multiselect is enabled
+ setTimeout(() => searchInputRef.focus(), 0);
+ }
+ };
+
+ // Reset selected index when sortedEntities change
+ createEffect(() => {
+ const entities = sortedEntities();
+ if (entities.length === 0) {
+ setSelectedIndex(0);
+ } else {
+ setSelectedIndex(Math.min(selectedIndex(), entities.length - 1));
+ }
+ });
+
+ const isKeyboardNavigating = () => {
+ const timeout = keyboardNavigationTimeout();
+ return timeout !== null && Date.now() - timeout < 150;
+ };
+
+ const scrollSelectedIntoView = () => {
+ const entities = sortedEntities();
+ const currentIndex = selectedIndex();
+ if (currentIndex >= 0 && currentIndex < entities.length) {
+ const element = document.querySelector(
+ `[data-entity-index="${currentIndex}"]`
+ );
+ if (element) {
+ element.scrollIntoView({ block: 'nearest' });
+ }
+ }
+ };
+
+ const handleKeyDown = (e: KeyboardEvent) => {
+ const entities = sortedEntities();
+ if (entities.length === 0) return;
+
+ if (e.key === 'ArrowDown' || (e.ctrlKey && e.key === 'j')) {
+ e.preventDefault();
+ setKeyboardNavigationTimeout(Date.now());
+ setSelectedIndex((prev) => (prev + 1) % entities.length);
+ scrollSelectedIntoView();
+ } else if (e.key === 'ArrowUp' || (e.ctrlKey && e.key === 'k')) {
+ e.preventDefault();
+ setKeyboardNavigationTimeout(Date.now());
+ setSelectedIndex(
+ (prev) => (prev - 1 + entities.length) % entities.length
+ );
+ scrollSelectedIntoView();
+ } else if (e.key === 'Enter') {
+ e.preventDefault();
+ const selectedEntity = entities[selectedIndex()];
+ if (selectedEntity) {
+ toggleEntity(selectedEntity);
+ }
+ }
};
+ onMount(() => {
+ document.addEventListener('keydown', handleKeyDown);
+ });
+
+ onCleanup(() => {
+ document.removeEventListener('keydown', handleKeyDown);
+ });
+
useSearchInputFocus(() => searchInputRef);
return (
- <div class="space-y-3">
- <div class="space-y-2" data-entity-search>
- <div class="relative">
- <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none z-10">
- <SearchIcon class="h-4 w-4 text-ink-muted" />
- </div>
+ <div>
+ <div class="relative">
+ <div class="flex w-full items-center py-1 gap-2 px-2 border-b border-edge-muted">
+ <SearchIcon class="h-4 w-4 text-ink-muted" />
<input
+ class="w-full caret-accent"
ref={searchInputRef}
type="text"
value={inputValue()}
onInput={(e) => setInputValue(e.currentTarget.value)}
- placeholder={`Search ${props.property.valueType === 'ENTITY' ? 'entities' : props.property.valueType + 's'}...`}
- class={`${INPUT_CLASSES} relative z-0`}
+ onKeyDown={(e) => {
+ if (e.key === 'Escape') {
+ e.preventDefault();
+ e.stopPropagation();
+ if (props.onClose) {
+ props.onClose();
+ }
+ }
+ }}
+ placeholder={`${props.property.isMultiSelect ? 'Add' : 'Change'} ${props.property.displayName.toLowerCase()}...`}
/>
</div>
+ </div>
- <Show when={sortedEntities().length > 0}>
- <div class="max-h-48 overflow-y-auto overflow-x-hidden space-y-1">
+ <Show when={sortedEntities().length > 0}>
+ <div class="p-1">
+ <div class="max-h-48 overflow-y-auto overflow-x-hidden scrollbar-hidden">
<For each={sortedEntities()}>
- {(entity, _index) => {
+ {(entity, index) => {
const isSelected = () => props.selectedOptions().has(entity.id);
+ const isKeyboardSelected = () => index() === selectedIndex();
return (
<div
- class={`${ENTITY_ITEM_BASE} ${isSelected() ? 'bg-active text-accent-ink' : 'hover:bg-hover text-ink'}`}
+ data-entity-index={index()}
+ class="flex items-center justify-between gap-2 py-1.5 px-2 min-w-0 h-8"
+ classList={{
+ 'bg-hover': isKeyboardSelected(),
+ 'bg-accent/10': isSelected(),
+ }}
onClick={() => toggleEntity(entity)}
onKeyDown={(e) => e.key === 'Enter' && toggleEntity(entity)}
+ onMouseEnter={() => {
+ if (!isKeyboardNavigating()) {
+ setSelectedIndex(index());
+ }
+ }}
>
<div class="flex items-center gap-2 flex-1 min-w-0">
<div class="flex-shrink-0">{getEntityIcon(entity)}</div>
- <span class="text-sm truncate min-w-0">
+ <span class="truncate min-w-0">
{getEntityName(entity)}
</span>
</div>
<div class="flex-shrink-0">
- <div
- class={`${CHECKBOX_BASE} border-edge bg-transparent`}
- >
- <Show when={isSelected()}>
- <CheckIcon class="w-3 h-3 text-accent" />
- </Show>
- </div>
+ <OptionCheckBox
+ checked={isSelected()}
+ multiselect={props.property.isMultiSelect}
+ />
</div>
</div>
);
}}
</For>
</div>
- </Show>
-
- <Show when={sortedEntities().length === 0}>
- <div class="text-center py-4 text-ink-muted text-sm">
- <Show
- when={!isLoadingEntities()}
- fallback={<span>Loading...</span>}
- >
- No {getEntityTypePluralLabel(props.property.specificEntityType)}{' '}
- found
- </Show>
- </div>
- </Show>
- </div>
+ </div>
+ </Show>
+
+ <Show when={sortedEntities().length === 0}>
+ <div class="text-center py-4 text-ink-muted text-sm">
+ <Show when={!isLoadingEntities()} fallback={<span>Loading...</span>}>
+ No {getEntityTypePluralLabel(props.property.specificEntityType)}{' '}
+ found
+ </Show>
+ </div>
+ </Show>
</div>
);
}
diff --git a/js/app/packages/core/component/Properties/component/modal/shared/PropertyOptionSelector.tsx b/js/app/packages/core/component/Properties/component/modal/shared/PropertyOptionSelector.tsx
index 85dd6f45c3..af3c499bf0 100644
--- a/js/app/packages/core/component/Properties/component/modal/shared/PropertyOptionSelector.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/shared/PropertyOptionSelector.tsx
@@ -1,14 +1,23 @@
-import CheckIcon from '@icon/bold/check-bold.svg';
+import { Hotkey } from '@core/component/Hotkey';
import SearchIcon from '@icon/regular/magnifying-glass.svg';
import PlusIcon from '@icon/regular/plus.svg';
import LoadingSpinner from '@icon/regular/spinner.svg';
import type * as schemas from '@service-properties/generated/zod';
-import { createMemo, createSignal, For, Show } from 'solid-js';
+import {
+ createEffect,
+ createMemo,
+ createSignal,
+ For,
+ onCleanup,
+ onMount,
+ Show,
+} from 'solid-js';
import type { z } from 'zod';
-import { PROPERTY_STYLES } from '../../../styles/styles';
import type { Property } from '../../../types';
import { formatOptionValue, useSearchInputFocus } from '../../../utils';
import { ERROR_MESSAGES } from '../../../utils/errorHandling';
+import { PropertyValueIcon } from '../../propertyValue';
+import { OptionCheckBox } from './OptionCheckBox';
type PropertyOption = z.infer<typeof schemas.getPropertyOptionsResponseItem>;
@@ -21,14 +30,15 @@ type SelectOptionsProps = {
onToggleOption: (value: string) => void;
onRetry: () => void;
onAddOption?: (value: string) => Promise<void>;
+ onClose?: () => void;
};
-const ADD_OPTION_BASE_CLASSES =
- 'flex flex-row w-full justify-between items-center gap-4 cursor-pointer p-2 border border-dashed border-accent/50 hover:border-accent hover:bg-accent/5 text-accent';
-
export const PropertyOptionSelector = (props: SelectOptionsProps) => {
const [searchQuery, setSearchQuery] = createSignal('');
const [isAddingOption, setIsAddingOption] = createSignal(false);
+ const [selectedIndex, setSelectedIndex] = createSignal(0);
+ const [keyboardNavigationTimeout, setKeyboardNavigationTimeout] =
+ createSignal<number | null>(null);
let searchInputRef!: HTMLInputElement;
@@ -118,29 +128,125 @@ export const PropertyOptionSelector = (props: SelectOptionsProps) => {
return allOptions;
});
+ // Get selectable items (filtered options + add option if available)
+ const selectableItems = createMemo(() => {
+ const options = filteredOptions();
+ const items: Array<{ type: 'option' | 'add'; option?: PropertyOption }> =
+ [];
+
+ options.forEach((option) => {
+ items.push({ type: 'option', option });
+ });
+
+ if (isValidNewOption() && props.onAddOption) {
+ items.push({ type: 'add' });
+ }
+
+ return items;
+ });
+
+ // Reset selected index when filteredOptions change
+ createEffect(() => {
+ const items = selectableItems();
+ if (items.length === 0) {
+ setSelectedIndex(0);
+ } else {
+ setSelectedIndex(Math.min(selectedIndex(), items.length - 1));
+ }
+ });
+
+ const isKeyboardNavigating = () => {
+ const timeout = keyboardNavigationTimeout();
+ return timeout !== null && Date.now() - timeout < 150;
+ };
+
+ const shouldShowHotkeys = createMemo(() => {
+ return !searchQuery().trim() && selectableItems().length <= 9;
+ });
+
+ const handleKeyDown = (e: KeyboardEvent) => {
+ const items = selectableItems();
+ if (items.length === 0) return;
+
+ // Handle number keys (1-9) when no search term and 9 or fewer options
+ if (shouldShowHotkeys() && /^[1-9]$/.test(e.key)) {
+ e.preventDefault();
+ const index = parseInt(e.key) - 1;
+ if (index < items.length) {
+ const selectedItem = items[index];
+ if (selectedItem?.type === 'add') {
+ handleAddOption();
+ } else if (selectedItem?.type === 'option' && selectedItem.option) {
+ props.onToggleOption(selectedItem.option.id);
+
+ // If not multi-select, close the modal after selection
+ if (!props.property.isMultiSelect && props.onClose) {
+ props.onClose();
+ }
+ }
+ }
+ return;
+ }
+
+ if (e.key === 'ArrowDown' || (e.ctrlKey && e.key === 'j')) {
+ e.preventDefault();
+ setKeyboardNavigationTimeout(Date.now());
+ setSelectedIndex((prev) => (prev + 1) % items.length);
+ } else if (e.key === 'ArrowUp' || (e.ctrlKey && e.key === 'k')) {
+ e.preventDefault();
+ setKeyboardNavigationTimeout(Date.now());
+ setSelectedIndex((prev) => (prev - 1 + items.length) % items.length);
+ } else if (e.key === 'Enter') {
+ e.preventDefault();
+ const selectedItem = items[selectedIndex()];
+
+ if (selectedItem?.type === 'add') {
+ handleAddOption();
+ } else if (selectedItem?.type === 'option' && selectedItem.option) {
+ props.onToggleOption(selectedItem.option.id);
+
+ // If not multi-select, close the modal after selection
+ if (!props.property.isMultiSelect && props.onClose) {
+ props.onClose();
+ }
+ }
+ }
+ };
+
+ onMount(() => {
+ document.addEventListener('keydown', handleKeyDown);
+ });
+
+ onCleanup(() => {
+ document.removeEventListener('keydown', handleKeyDown);
+ });
+
useSearchInputFocus(
() => searchInputRef,
() => !props.isLoading && !props.error
);
- const AddOptionButton = () => (
+ const AddOptionButton = (props: {
+ isSelected: boolean;
+ hotkeyNumber?: number;
+ }) => (
<div
- class={`${ADD_OPTION_BASE_CLASSES} ${
- isAddingOption() ? 'opacity-50 pointer-events-none' : ''
- }`}
onClick={handleAddOption}
+ class={`flex flex-row w-full justify-between items-center gap-2 py-1.5 px-2 ${
+ props.isSelected ? 'bg-hover' : ''
+ }`}
>
<div class="flex items-center gap-2 flex-1 text-left">
- <div class="w-4 h-4 flex-shrink-0">
+ <div class="size-3 flex-shrink-0">
<Show
when={!isAddingOption()}
fallback={
- <div class="w-4 h-4 animate-spin">
+ <div class="size-3 animate-spin">
<LoadingSpinner />
</div>
}
>
- <PlusIcon class="w-4 h-4" />
+ <PlusIcon class="size-3" />
</Show>
</div>
<p class="text-sm font-medium">Add "{searchQuery().trim()}"</p>
@@ -174,27 +280,32 @@ export const PropertyOptionSelector = (props: SelectOptionsProps) => {
</div>
}
>
- <div class="space-y-3">
+ <div>
<div class="relative">
- <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none z-10">
+ <div class="flex w-full items-center py-1 gap-2 px-2 border-b border-edge-muted">
<SearchIcon class="h-4 w-4 text-ink-muted" />
+ <input
+ class="w-full caret-accent"
+ ref={searchInputRef}
+ type={
+ props.property.valueType === 'SELECT_NUMBER'
+ ? 'number'
+ : 'text'
+ }
+ value={searchQuery()}
+ onInput={(e) => setSearchQuery(e.currentTarget.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Escape') {
+ e.preventDefault();
+ e.stopPropagation();
+ if (props.onClose) {
+ props.onClose();
+ }
+ }
+ }}
+ placeholder={`${props.property.isMultiSelect ? 'Add' : 'Change'} ${props.property.displayName.toLowerCase()}...`}
+ />
</div>
- <input
- ref={searchInputRef}
- type={
- props.property.valueType === 'SELECT_NUMBER' ? 'number' : 'text'
- }
- value={searchQuery()}
- onInput={(e) => setSearchQuery(e.currentTarget.value)}
- placeholder={
- props.onAddOption
- ? props.property.valueType === 'SELECT_NUMBER'
- ? 'Search or add new number...'
- : 'Search or add new option...'
- : 'Search options...'
- }
- class={`${PROPERTY_STYLES.input.search} relative z-0`}
- />
</div>
<Show
@@ -209,51 +320,90 @@ export const PropertyOptionSelector = (props: SelectOptionsProps) => {
</div>
}
>
- <AddOptionButton />
+ <div class="p-1">
+ <AddOptionButton
+ isSelected={selectedIndex() === filteredOptions().length}
+ />
+ </div>
</Show>
</div>
}
>
- <div class="space-y-2 max-h-48 overflow-y-auto">
- <Show when={isValidNewOption() && props.onAddOption}>
- <AddOptionButton />
- </Show>
-
- <Show
- when={filteredOptions().length > 0}
- fallback={
- <Show when={!isValidNewOption() || !props.onAddOption}>
+ <div class="p-1">
+ <div class="max-h-[200px] overflow-y-auto overflow-x-hidden scrollbar-hidden">
+ <Show
+ when={selectableItems().length > 0}
+ fallback={
<div class="text-center py-4 text-ink-muted text-sm">
No options match your search
</div>
- </Show>
- }
- >
- <For each={filteredOptions()}>
- {(option) => {
- const optionId = option.id;
- const displayValue = formatOptionValue(option);
-
- return (
- <div
- class={`flex flex-row w-full justify-between items-center gap-4 cursor-pointer py-1.5 px-2 border ${isOptionSelected(optionId) ? 'bg-active border-accent text-accent-ink' : 'hover:bg-hover border-edge text-ink'}`}
- onClick={() => props.onToggleOption(optionId)}
- >
- <div class="flex-1 text-left">
- <p class="text-sm font-medium">{displayValue}</p>
- </div>
- <div class="flex-shrink-0">
- <div class="w-4 h-4 border border-edge bg-transparent flex items-center justify-center">
- <Show when={isOptionSelected(optionId)}>
- <CheckIcon class="w-3 h-3 text-accent" />
- </Show>
+ }
+ >
+ <For each={selectableItems()}>
+ {(item, index) => (
+ <Show
+ when={item.type === 'add'}
+ fallback={
+ <div
+ class={`flex flex-row w-full justify-between items-center gap-2 py-1.5 px-2 ${
+ index() === selectedIndex() ? 'bg-hover' : ''
+ }`}
+ onClick={() => {
+ if (item.option) {
+ props.onToggleOption(item.option.id);
+ // If not multi-select, close the modal after selection
+ if (
+ !props.property.isMultiSelect &&
+ props.onClose
+ ) {
+ props.onClose();
+ }
+ }
+ }}
+ onMouseEnter={() => {
+ if (!isKeyboardNavigating()) {
+ setSelectedIndex(index());
+ }
+ }}
+ >
+ <PropertyValueIcon optionId={item.option!.id} />
+ <div class="flex-1 text-left">
+ <p class="text-sm font-medium">
+ {formatOptionValue(item.option!)}
+ </p>
+ </div>
+ <div class="flex items-center gap-2 flex-shrink-0">
+ <Show when={shouldShowHotkeys() && index() < 9}>
+ <div class="text-[0.625rem] px-1.5 py-0.5 border border-edge-muted text-ink-muted font-mono rounded-xs">
+ <Hotkey shortcut={`${index() + 1}`} />
+ </div>
+ </Show>
+ <Show when={props.property.isMultiSelect}>
+ <OptionCheckBox
+ checked={isOptionSelected(item.option!.id)}
+ multiselect={props.property.isMultiSelect}
+ />
+ </Show>
+ </div>
</div>
+ }
+ >
+ <div
+ onMouseEnter={() => {
+ if (!isKeyboardNavigating()) {
+ setSelectedIndex(index());
+ }
+ }}
+ >
+ <AddOptionButton
+ isSelected={index() === selectedIndex()}
+ />
</div>
- </div>
- );
- }}
- </For>
- </Show>
+ </Show>
+ )}
+ </For>
+ </Show>
+ </div>
</div>
</Show>
</div>
diff --git a/js/app/packages/core/component/Properties/component/panel/PanelContainer.tsx b/js/app/packages/core/component/Properties/component/panel/PanelContainer.tsx
index d09eaf6259..76ba3caf9c 100644
--- a/js/app/packages/core/component/Properties/component/panel/PanelContainer.tsx
+++ b/js/app/packages/core/component/Properties/component/panel/PanelContainer.tsx
@@ -25,7 +25,7 @@ export const PanelContainer: Component<PropertiesContentProps> = (props) => {
</Show>
<Show when={hasProperties()}>
- <div class="flex-1 overflow-y-auto overflow-x-auto px-2 pb-2">
+ <div class="flex-1 overflow-y-auto overflow-x-auto pb-2">
<PropertyGrid properties={props.properties()} />
</div>
</Show>
diff --git a/js/app/packages/core/component/Properties/component/panel/PropertyGrid.tsx b/js/app/packages/core/component/Properties/component/panel/PropertyGrid.tsx
index 308c6275e0..42fcc62fa5 100644
--- a/js/app/packages/core/component/Properties/component/panel/PropertyGrid.tsx
+++ b/js/app/packages/core/component/Properties/component/panel/PropertyGrid.tsx
@@ -1,4 +1,4 @@
-import { useBlockAliasedName } from '@core/block';
+import { useMaybeBlockAliasedName } from '@core/block';
import { type Component, createMemo, For, Show } from 'solid-js';
import { getBuiltinPropertyIds } from '../../constants';
import { usePropertiesContext } from '../../context/PropertiesContext';
@@ -7,12 +7,14 @@ import { PropertyRow } from './PropertyRow';
interface PropertiesListProps {
properties: Property[];
+ columns?: number;
}
export const PropertyGrid: Component<PropertiesListProps> = (props) => {
const { openPropertyEditor, openDatePicker } = usePropertiesContext();
- const blockName = useBlockAliasedName();
- const builtinPropertyIds = getBuiltinPropertyIds(blockName);
+
+ const blockName = useMaybeBlockAliasedName();
+ const builtinPropertyIds = blockName ? getBuiltinPropertyIds(blockName) : [];
// Single pass through properties array to split into metadata, builtin, and user properties
const propertyGroups = createMemo(() => {
@@ -78,7 +80,12 @@ export const PropertyGrid: Component<PropertiesListProps> = (props) => {
</div>
}
>
- <div class="grid grid-cols-[minmax(120px,50%)_minmax(150px,1fr)] gap-x-4 gap-y-3 pt-2 min-w-fit">
+ <div
+ class="grid gap-x-4 gap-y-2 pt-2 min-w-fit"
+ style={{
+ 'grid-template-columns': `repeat(${props.columns ?? 1}, minmax(4rem, 12rem) minmax(8rem, 1fr))`,
+ }}
+ >
{/* Metadata properties */}
<Show when={propertyGroups().metadata.length > 0}>
<For each={propertyGroups().metadata}>
@@ -97,7 +104,7 @@ export const PropertyGrid: Component<PropertiesListProps> = (props) => {
<Show when={propertyGroups().builtinProperties.length > 0}>
{/* Separator above builtin */}
<Show when={showSeparatorAboveBuiltin()}>
- <div class="col-span-2 border-t border-edge my-4" />
+ <div class="col-span-2 border-t border-edge-muted my-4" />
</Show>
<For each={propertyGroups().builtinProperties}>
@@ -116,7 +123,7 @@ export const PropertyGrid: Component<PropertiesListProps> = (props) => {
<Show when={propertyGroups().userProperties.length > 0}>
{/* Separator between above user */}
<Show when={showSeparatorAboveUser()}>
- <div class="col-span-2 border-t border-edge my-4" />
+ <div class="col-span-2 border-t border-edge-muted my-4" />
</Show>
<For each={propertyGroups().userProperties}>
diff --git a/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx b/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx
index 0d0df59999..201dc339b7 100644
--- a/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx
+++ b/js/app/packages/core/component/Properties/component/panel/PropertyLabel.tsx
@@ -80,7 +80,7 @@ export const PropertyLabel: Component<PropertyLabelProps> = (props) => {
return (
<>
<div
- class="flex items-center gap-1.5 min-w-0"
+ class="flex items-center gap-1.5 min-w-0 py-0.5"
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
@@ -89,9 +89,9 @@ export const PropertyLabel: Component<PropertyLabelProps> = (props) => {
data_type: props.property.valueType,
specific_entity_type: props.property.specificEntityType,
}}
- class="size-4 text-ink-muted shrink-0"
+ class="size-4 shrink-0 opacity-40"
/>
- <span class="text-sm text-ink-muted truncate flex-shrink min-w-0">
+ <span class="truncate flex-shrink min-w-0">
{props.property.displayName}
</span>
{/* Always reserve space for delete button to prevent layout shift */}
@@ -150,7 +150,7 @@ export const PropertyLabel: Component<PropertyLabelProps> = (props) => {
<Dialog.Portal>
<Dialog.Overlay class="fixed inset-0 z-modal-overlay bg-overlay" />
<div class="fixed inset-0 z-modal-content flex items-center justify-center p-4">
- <Dialog.Content class="bg-dialog border-3 border-edge shadow-xl max-w-md w-full font-mono">
+ <Dialog.Content class="bg-dialog border-3 border-edge shadow-xl max-w-md w-full">
<div class="flex items-center justify-between p-4">
<Dialog.Title class="text-lg font-semibold text-ink">
Delete Property
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/BooleanValue.tsx b/js/app/packages/core/component/Properties/component/propertyValue/BooleanValue.tsx
index b1bee5d45c..4ded31e039 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/BooleanValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/BooleanValue.tsx
@@ -37,13 +37,21 @@ export const BooleanValue: Component<BooleanValueProps> = (props) => {
<button
onClick={handleClick}
disabled={isSaving() || isReadOnly()}
- class={`flex items-center justify-end ${
- isReadOnly() ? 'cursor-default' : 'hover:bg-hover cursor-pointer'
- } ${isSaving() ? 'opacity-50 cursor-not-allowed' : ''}`}
+ class="flex items-center justify-end p-1"
+ classList={{
+ 'cursor-default': isReadOnly() || isSaving(),
+ 'hover:bg-hover': !isReadOnly() && !isSaving(),
+ }}
>
- <div class="w-6 h-6 border border-edge bg-transparent flex items-center justify-center">
+ <div
+ class="size-4 flex items-center justify-center"
+ classList={{
+ 'bg-accent border-accent border': isChecked(),
+ 'bg-transparent border-edge-muted border': !isChecked(),
+ }}
+ >
<Show when={isChecked()}>
- <CheckIcon class="w-4.5 h-4.5 text-accent" />
+ <CheckIcon class="size-3 text-panel" />
</Show>
</div>
</button>
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/DateValue.tsx b/js/app/packages/core/component/Properties/component/propertyValue/DateValue.tsx
index 7c3633fe55..0155d4656e 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/DateValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/DateValue.tsx
@@ -1,13 +1,16 @@
import type { Component } from 'solid-js';
-import { Show } from 'solid-js';
+import { createSignal, Show } from 'solid-js';
+import { usePropertiesContext } from '../../context/PropertiesContext';
import type { Property } from '../../types';
import { formatDate } from '../../utils';
-import { EmptyValue } from './ValueComponents';
+import { ERROR_MESSAGES, handlePropertyError } from '../../utils/errorHandling';
+import { EmptyValue, PropertyValueDeleteButton } from './ValueComponents';
type DateValueProps = {
property: Property;
canEdit: boolean;
onEdit?: (property: Property, anchor?: HTMLElement) => void;
+ onRefresh?: () => void;
};
/**
@@ -15,12 +18,41 @@ type DateValueProps = {
* Opens date picker modal on click
*/
export const DateValue: Component<DateValueProps> = (props) => {
+ const { saveHandler } = usePropertiesContext();
+ const [isHovered, setIsHovered] = createSignal(false);
+ const [isSaving, setIsSaving] = createSignal(false);
+
const handleClick = (e: MouseEvent) => {
if (props.canEdit && !props.property.isMetadata) {
props.onEdit?.(props.property, e.currentTarget as HTMLElement);
}
};
+ const handleDelete = async () => {
+ if (isReadOnly() || isSaving()) return;
+
+ setIsSaving(true);
+
+ try {
+ const result = await saveHandler.saveProperty(props.property, {
+ valueType: 'DATE',
+ value: null,
+ });
+
+ if (
+ handlePropertyError(
+ result,
+ ERROR_MESSAGES.PROPERTY_SAVE,
+ 'DateValue.handleDelete'
+ )
+ ) {
+ props.onRefresh?.();
+ }
+ } finally {
+ setIsSaving(false);
+ }
+ };
+
const isReadOnly = () => props.property.isMetadata || !props.canEdit;
const displayValue =
@@ -29,17 +61,30 @@ export const DateValue: Component<DateValueProps> = (props) => {
: '';
return (
- <button
- onClick={handleClick}
- class={`text-left text-xs px-2 py-1 border border-edge ${
- isReadOnly()
- ? 'bg-transparent text-ink-muted cursor-default'
- : 'hover:bg-hover cursor-pointer bg-transparent text-ink'
- } inline-block max-w-full break-words`}
+ <div
+ class="relative inline-flex max-w-full shrink-0"
+ onMouseEnter={() => setIsHovered(true)}
+ onMouseLeave={() => setIsHovered(false)}
>
- <Show when={displayValue} fallback={<EmptyValue />}>
- <span class="block truncate max-w-full">{displayValue}</span>
+ <button
+ onClick={handleClick}
+ class="text-left px-2 py-0.5 border border-edge-muted bg-transparent inline-block max-w-full break-words shrink-0"
+ classList={{
+ 'text-ink-muted cursor-default': true,
+ }}
+ >
+ <Show when={displayValue} fallback={<EmptyValue />}>
+ <span class="block truncate max-w-full">{displayValue}</span>
+ </Show>
+ </button>
+ <Show when={!isReadOnly() && isHovered() && displayValue && !isSaving()}>
+ <div class="absolute right-1 inset-y-0 flex items-center">
+ <PropertyValueDeleteButton
+ onClick={handleDelete}
+ disabled={isSaving()}
+ />
+ </div>
</Show>
- </button>
+ </div>
);
};
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx b/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx
index 03ca71e45e..521662e892 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/EntityIcon.tsx
@@ -1,10 +1,12 @@
-import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';
import { BlockLink } from '@core/component/LexicalMarkdown/component/core/BlockLink';
-import DeleteIcon from '@icon/bold/x-bold.svg';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import { type Component, createSignal, type ParentProps, Show } from 'solid-js';
import { usePropertyEntityDisplay } from '../../hooks';
import type { Property } from '../../types';
+import {
+ PropertyValueDeleteButton,
+ PropertyValueEditButton,
+} from './ValueComponents';
type EntityValueDisplayProps = ParentProps<{
property: Property;
@@ -13,11 +15,13 @@ type EntityValueDisplayProps = ParentProps<{
specificMessageId?: string | null;
canEdit?: boolean;
onRemove?: () => void;
+ onEdit?: (anchor?: HTMLElement) => void;
isSaving?: boolean;
}>;
export const EntityIcon: Component<EntityValueDisplayProps> = (props) => {
const [isHovered, setIsHovered] = createSignal(false);
+ let containerRef: HTMLDivElement | undefined;
const { name, icon, blockOrFileType, linkParams } = usePropertyEntityDisplay(
() => props.entityId,
@@ -30,7 +34,7 @@ export const EntityIcon: Component<EntityValueDisplayProps> = (props) => {
const content = (
<div class="flex items-center gap-2">
<div class="flex-shrink-0">{icon()}</div>
- <span class="truncate font-mono">{name()}</span>
+ <span class="truncate">{name()}</span>
</div>
);
@@ -50,27 +54,34 @@ export const EntityIcon: Component<EntityValueDisplayProps> = (props) => {
return (
<div
+ ref={containerRef}
class="relative inline-flex max-w-[140px] shrink-0"
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
- <div
- class={`text-xs px-2 py-1 border border-edge hover:bg-hover cursor-pointer bg-transparent text-ink inline-flex items-center w-full min-h-[24px]`}
- >
+ <div class="px-2 py-0.5 border border-edge-muted hover:bg-hover bg-transparent text-ink inline-flex items-center w-full">
<span class="truncate flex-1">{innerContent}</span>
<Show
when={
- props.canEdit && isHovered() && !props.isSaving && props.onRemove
+ props.canEdit &&
+ isHovered() &&
+ !props.isSaving &&
+ (props.onRemove || props.onEdit)
}
>
- <div class="absolute right-1 inset-y-0 flex items-center">
- <DeprecatedIconButton
- icon={DeleteIcon}
- theme="clear"
- size="xs"
- class="!text-failure !bg-[#2a2a2a] hover:!bg-[#444444] !cursor-pointer !w-4 !h-4 !min-w-4 !min-h-4"
- onClick={props.onRemove}
- />
+ <div class="absolute right-1 inset-y-0 flex items-center gap-1">
+ <Show when={props.onEdit}>
+ <PropertyValueEditButton
+ onClick={() => props.onEdit!(containerRef)}
+ disabled={props.isSaving}
+ />
+ </Show>
+ <Show when={props.onRemove}>
+ <PropertyValueDeleteButton
+ onClick={props.onRemove!}
+ disabled={props.isSaving}
+ />
+ </Show>
</div>
</Show>
</div>
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/EntityValue.tsx b/js/app/packages/core/component/Properties/component/propertyValue/EntityValue.tsx
index e58be40a0c..166a0d49fb 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/EntityValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/EntityValue.tsx
@@ -31,6 +31,12 @@ export const EntityValue: Component<EntityValueProps> = (props) => {
}
};
+ const handleEditEntity = (anchor?: HTMLElement) => {
+ if (props.canEdit && !props.property.isMetadata) {
+ props.onEdit?.(props.property, anchor);
+ }
+ };
+
const handleRemoveEntity = async (entityToRemove: EntityReference) => {
if (isReadOnly() || isSaving()) return;
@@ -76,6 +82,9 @@ export const EntityValue: Component<EntityValueProps> = (props) => {
specificMessageId={entityRef.specific_message_id}
canEdit={!isReadOnly()}
onRemove={() => handleRemoveEntity(entityRef)}
+ onEdit={
+ !props.property.isMultiSelect ? handleEditEntity : undefined
+ }
isSaving={isSaving()}
/>
)}
@@ -84,7 +93,7 @@ export const EntityValue: Component<EntityValueProps> = (props) => {
when={!isReadOnly()}
fallback={
<Show when={entities.length === 0}>
- <div class="text-ink-muted text-xs px-2 py-1 border border-edge bg-transparent inline-block shrink-0">
+ <div class="text-ink-muted px-2 py-0.5 border border-edge-muted bg-transparent inline-block shrink-0">
<EmptyValue />
</div>
</Show>
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/LinkValue.tsx b/js/app/packages/core/component/Properties/component/propertyValue/LinkValue.tsx
index 287f9cf6af..884fa732c3 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/LinkValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/LinkValue.tsx
@@ -1,6 +1,4 @@
-import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';
import { useUnfurl } from '@core/signal/unfurl';
-import DeleteIcon from '@icon/bold/x-bold.svg';
import LinkIcon from '@icon/regular/link.svg';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import { proxyResource } from '@service-unfurl/client';
@@ -16,7 +14,11 @@ import {
normalizeUrl,
} from '../../utils';
import { ERROR_MESSAGES } from '../../utils/errorHandling';
-import { AddPropertyValueButton, EmptyValue } from './ValueComponents';
+import {
+ AddPropertyValueButton,
+ EmptyValue,
+ PropertyValueDeleteButton,
+} from './ValueComponents';
type LinkValueProps = {
property: Property;
@@ -149,10 +151,10 @@ export const LinkValue: Component<LinkValueProps> = (props) => {
}}
placeholder="Enter URL..."
disabled={isSaving()}
- class="text-left text-xs px-2 py-1 border border-edge bg-transparent focus:outline-none focus:border-accent text-ink inline-block shrink-0"
+ class="text-left px-2 py-0.5 border border-edge-muted bg-transparent focus:outline-none focus:border-accent text-ink inline-block shrink-0"
/>
<Show when={error()}>
- <div class="text-failure-ink text-xs mt-1 w-full">{error()}</div>
+ <div class="text-failure-ink mt-1 w-full">{error()}</div>
</Show>
</>
);
@@ -177,7 +179,7 @@ export const LinkValue: Component<LinkValueProps> = (props) => {
when={!isReadOnly()}
fallback={
<Show when={linkValues.length === 0}>
- <div class="text-ink-muted text-xs px-2 py-1 border border-edge bg-transparent inline-block shrink-0">
+ <div class="text-ink-muted px-2 py-0.5 border border-edge-muted bg-transparent inline-block shrink-0">
<EmptyValue />
</div>
</Show>
@@ -254,9 +256,7 @@ const LinkDisplay: Component<LinkDisplayProps> = (props) => {
>
<button
onClick={handleLinkClick}
- class={`text-left text-xs px-2 py-1 border border-edge cursor-pointer bg-transparent text-ink inline-flex items-center gap-2 w-full ${
- props.canEdit ? 'hover:bg-hover' : ''
- }`}
+ class="text-left px-2 py-0.5 border border-edge-muted bg-transparent text-ink inline-flex items-center gap-2 w-full cursor-default"
title={props.url}
disabled={props.isRemoving}
>
@@ -286,12 +286,9 @@ const LinkDisplay: Component<LinkDisplayProps> = (props) => {
</button>
<Show when={props.canEdit && isHovered() && !props.isRemoving}>
<div class="absolute right-1 inset-y-0 flex items-center">
- <DeprecatedIconButton
- icon={DeleteIcon}
- theme="clear"
- size="xs"
- class="!text-failure !bg-[#2a2a2a] hover:!bg-[#444444] !cursor-pointer !w-4 !h-4 !min-w-4 !min-h-4"
+ <PropertyValueDeleteButton
onClick={handleRemoveClick}
+ disabled={props.isRemoving}
/>
</div>
</Show>
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/NumberValue.tsx b/js/app/packages/core/component/Properties/component/propertyValue/NumberValue.tsx
index da7f49e9c8..30b2802964 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/NumberValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/NumberValue.tsx
@@ -52,11 +52,11 @@ export const NumberValue: Component<NumberValueProps> = (props) => {
fallback={
<button
onClick={handleClick}
- class={`text-left text-xs px-2 py-1 border border-edge ${
- supportsInline()
- ? 'hover:bg-hover cursor-pointer bg-transparent text-ink'
- : 'bg-transparent text-ink-muted cursor-default'
- } block max-w-full break-words`}
+ class="text-left px-2 py-0.5 border border-edge-muted bg-transparent block max-w-full break-words cursor-default"
+ classList={{
+ 'text-ink': supportsInline(),
+ 'text-ink-muted': !supportsInline(),
+ }}
>
<Show when={hasValue()} fallback={<EmptyValue />}>
<span class="block truncate max-w-full">{displayValue}</span>
@@ -78,7 +78,7 @@ export const NumberValue: Component<NumberValueProps> = (props) => {
onKeyDown={handleKeyDown}
disabled={editor.isSaving()}
placeholder="Enter number..."
- class="w-full text-left text-ink text-xs px-2 py-1 border border-edge bg-transparent focus:outline-none focus:border-accent"
+ class="w-full text-left text-ink px-2 py-0.5 border border-edge-muted bg-transparent focus:outline-none focus:border-accent"
/>
</Show>
);
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/PropertyValue.tsx b/js/app/packages/core/component/Properties/component/propertyValue/PropertyValue.tsx
index 76b5ebe8c5..1fcc38b1a5 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/PropertyValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/PropertyValue.tsx
@@ -59,6 +59,7 @@ export const PropertyValue: Component<PropertyValueProps> = (props) => {
property={props.property}
canEdit={canEdit}
onEdit={props.onEdit}
+ onRefresh={onRefresh}
/>
);
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/PropertyValueIcon.tsx b/js/app/packages/core/component/Properties/component/propertyValue/PropertyValueIcon.tsx
new file mode 100644
index 0000000000..37c971ee82
--- /dev/null
+++ b/js/app/packages/core/component/Properties/component/propertyValue/PropertyValueIcon.tsx
@@ -0,0 +1,77 @@
+import StatusCanceled from '@macro-icons/square/task-cancelled.svg';
+import StatusCreated from '@macro-icons/square/task-created.svg';
+import StatusDone from '@macro-icons/square/task-done.svg';
+import StatusInProgress from '@macro-icons/square/task-in-progress.svg';
+import StatusInReview from '@macro-icons/square/task-in-review.svg';
+import PriorityHigh from '@macro-icons/wide/priority-high.svg';
+import PriorityLow from '@macro-icons/wide/priority-low.svg';
+import PriorityMedium from '@macro-icons/wide/priority-medium.svg';
+import PriorityUrgent from '@macro-icons/wide/priority-urgent.svg';
+import { type Component, Match, Switch } from 'solid-js';
+import { twMerge } from 'tailwind-merge';
+import { PROPERTY_OPTION_IDS } from '../../constants';
+
+type PropertyValueIconProps = {
+ optionId: string;
+ class?: string;
+};
+
+/**
+ * Render appropriate icons for property option values - based on common,
+ * hard-coded property option ids.
+ *
+ * @example
+ * ```tsx
+ * <PropertyValueIcon
+ * optionId={PROPERTY_OPTION_IDS.PRIORITY.HIGH}
+ * />
+ * ```
+ */
+export const PropertyValueIcon: Component<PropertyValueIconProps> = (props) => {
+ return (
+ <Switch>
+ {/* Priority */}
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.PRIORITY.LOW}>
+ <PriorityLow
+ class={twMerge('size-3', props.class, 'text-ink-extra-muted')}
+ />
+ </Match>
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.PRIORITY.MEDIUM}>
+ <PriorityMedium
+ class={twMerge('size-3', props.class, 'text-ink-extra-muted')}
+ />
+ </Match>
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.PRIORITY.HIGH}>
+ <PriorityHigh
+ class={twMerge('size-3', props.class, 'text-ink-extra-muted')}
+ />
+ </Match>
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.PRIORITY.URGENT}>
+ <PriorityUrgent class={twMerge('size-3', props.class, 'text-accent')} />
+ </Match>
+
+ {/* Status */}
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.STATUS.NOT_STARTED}>
+ <StatusCreated
+ class={twMerge('size-3', props.class, 'text-ink-extra-muted')}
+ />
+ </Match>
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.STATUS.IN_PROGRESS}>
+ <StatusInProgress class={twMerge('size-3', props.class, 'text-ink')} />
+ </Match>
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.STATUS.IN_REVIEW}>
+ <StatusInReview
+ class={twMerge('size-3', props.class, 'text-success-ink')}
+ />
+ </Match>
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.STATUS.COMPLETED}>
+ <StatusDone class={twMerge('size-3', props.class, 'text-accent')} />
+ </Match>
+ <Match when={props.optionId === PROPERTY_OPTION_IDS.STATUS.CANCELED}>
+ <StatusCanceled
+ class={twMerge('size-3', props.class, 'text-ink-extra-muted')}
+ />
+ </Match>
+ </Switch>
+ );
+};
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/SelectValue.tsx b/js/app/packages/core/component/Properties/component/propertyValue/SelectValue.tsx
index b94e4575a2..05a01f0181 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/SelectValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/SelectValue.tsx
@@ -1,5 +1,3 @@
-import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';
-import DeleteIcon from '@icon/bold/x-bold.svg';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import type { Component } from 'solid-js';
import { createSignal, For, Show } from 'solid-js';
@@ -8,7 +6,12 @@ import { PROPERTY_STYLES } from '../../styles/styles';
import type { Property } from '../../types';
import { formatPropertyValue, getSelectValues } from '../../utils';
import { ERROR_MESSAGES, handlePropertyError } from '../../utils/errorHandling';
-import { AddPropertyValueButton, EmptyValue } from './ValueComponents';
+import { PropertyValueIcon } from './PropertyValueIcon';
+import {
+ AddPropertyValueButton,
+ EmptyValue,
+ PropertyValueDeleteButton,
+} from './ValueComponents';
type SelectValueProps = {
property: Property;
@@ -70,9 +73,7 @@ export const SelectValue: Component<SelectValueProps> = (props) => {
const displayValues = getSelectValues(props.property);
return (
- <div
- class={`flex flex-wrap gap-1 justify-start items-start w-full min-w-0`}
- >
+ <div class="flex flex-wrap gap-2 justify-start items-start w-full min-w-0">
<For each={displayValues}>
{(value) => {
const formatted = formatPropertyValue(props.property, value);
@@ -83,17 +84,24 @@ export const SelectValue: Component<SelectValueProps> = (props) => {
onMouseEnter={() => setHoveredValue(value)}
onMouseLeave={() => setHoveredValue(null)}
>
- <div class={PROPERTY_STYLES.value.multiButton} title={formatted}>
+ <div
+ class={PROPERTY_STYLES.value.multiButton}
+ title={formatted}
+ onClick={
+ !props.property.isMultiSelect ? handleClick : undefined
+ }
+ style={{
+ cursor: 'default',
+ }}
+ >
+ <PropertyValueIcon optionId={value} />
<span class="block truncate">{formatted}</span>
</div>
<Show when={!isReadOnly() && isHovered() && !isSaving()}>
<div class="absolute right-1 inset-y-0 flex items-center">
- <DeprecatedIconButton
- icon={DeleteIcon}
- theme="clear"
- size="xs"
- class="!text-failure !bg-[#2a2a2a] hover:!bg-[#444444] !cursor-pointer !w-4 !h-4 !min-w-4 !min-h-4"
+ <PropertyValueDeleteButton
onClick={() => handleRemoveValue(value)}
+ disabled={isSaving()}
/>
</div>
</Show>
@@ -105,7 +113,7 @@ export const SelectValue: Component<SelectValueProps> = (props) => {
when={!isReadOnly()}
fallback={
<Show when={displayValues.length === 0}>
- <div class="text-ink-muted text-xs px-2 py-1 border border-edge bg-transparent inline-block shrink-0">
+ <div class="text-ink-muted px-2 py-0.5 border border-edge-muted bg-transparent inline-block shrink-0">
<EmptyValue />
</div>
</Show>
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/TextValue.tsx b/js/app/packages/core/component/Properties/component/propertyValue/TextValue.tsx
index 92f54e41bd..4670e2be47 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/TextValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/TextValue.tsx
@@ -51,11 +51,11 @@ export const TextValue: Component<TextValueProps> = (props) => {
fallback={
<button
onClick={handleClick}
- class={`text-left text-xs px-2 py-1 border border-edge ${
- supportsInline()
- ? 'hover:bg-hover cursor-pointer bg-transparent text-ink'
- : 'bg-transparent text-ink-muted cursor-default'
- } block max-w-full break-words`}
+ class="text-left px-2 py-0.5 border border-edge-muted bg-transparent block max-w-full break-words cursor-default"
+ classList={{
+ 'text-ink': supportsInline(),
+ 'text-ink-muted': !supportsInline(),
+ }}
>
<Show when={hasValue()} fallback={<EmptyValue />}>
<span class="block max-w-full">
@@ -80,7 +80,7 @@ export const TextValue: Component<TextValueProps> = (props) => {
onBlur={editor.save}
onKeyDown={handleKeyDown}
disabled={editor.isSaving()}
- class="w-full field-sizing-content resize-none text-left text-ink text-xs px-2 py-1 border border-edge bg-transparent focus:outline-none focus:border-accent"
+ class="w-full field-sizing-content resize-none text-left text-ink px-2 py-0.5 border border-edge-muted bg-transparent focus:outline-none focus:border-accent"
/>
</Show>
);
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/ValueComponents.tsx b/js/app/packages/core/component/Properties/component/propertyValue/ValueComponents.tsx
index 28e91299f8..317edf4d79 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/ValueComponents.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/ValueComponents.tsx
@@ -1,4 +1,8 @@
+import SwapIcon from '@icon/bold/swap-bold.svg';
+import DeleteIcon from '@icon/bold/x-bold.svg';
+import { Button } from '@ui/components/Button';
import type { Component, JSX } from 'solid-js';
+import { twMerge } from 'tailwind-merge';
/**
* Shared UI primitives for property value display components
@@ -8,7 +12,7 @@ import type { Component, JSX } from 'solid-js';
/** CSS classes for common property value UI patterns */
const STYLES = {
addButton:
- 'text-ink-muted hover:text-ink text-xs hover:bg-hover px-2 py-1 cursor-pointer border border-edge bg-transparent inline-block shrink-0',
+ 'text-ink-muted hover:text-ink hover:bg-hover px-2 py-0.5 border border-edge-muted inline-block shrink-0',
} as const;
/**
@@ -16,7 +20,7 @@ const STYLES = {
* Consistent component used everywhere
*/
export const EmptyValue: Component = () => {
- return <>—</>;
+ return <span class="opacity-20">Empty</span>;
};
/**
@@ -31,7 +35,7 @@ export const AddPropertyValueButton: Component<{
<button
onClick={props.onClick as (e: MouseEvent) => void}
disabled={props.disabled}
- class={STYLES.addButton}
+ class={twMerge(STYLES.addButton, 'cursor-default')}
>
+
</button>
@@ -55,13 +59,62 @@ export const PropertyValueButton: Component<{
onClick={props.onClick}
disabled={props.disabled}
title={props.title}
- class={`text-left text-xs px-2 py-1 border border-edge ${
- props.isReadOnly
- ? 'bg-transparent text-ink-muted cursor-default'
- : 'hover:bg-hover cursor-pointer bg-transparent text-ink'
- } ${props.class || ''}`}
+ class={twMerge(
+ 'text-left px-2 py-0.5 border border-edge-muted bg-transparent cursor-default',
+ props.class
+ )}
+ classList={{
+ 'text-ink-muted': props.isReadOnly,
+ 'text-ink': !props.isReadOnly,
+ }}
>
{props.children}
</button>
);
};
+
+/**
+ * Edit button for modifying property values
+ * Consistent styling and behavior for all property types
+ */
+export const PropertyValueEditButton: Component<{
+ onClick: () => void;
+ disabled?: boolean;
+}> = (props) => {
+ return (
+ <Button
+ onClick={props.onClick}
+ disabled={props.disabled}
+ class={twMerge(
+ 'bg-panel size-4 p-0.5 border border-edge-muted text-ink-muted cursor-default',
+ 'hover:bg-hover hover:text-ink',
+ 'active:bg-panel active:border-edge active:text-ink'
+ )}
+ >
+ <SwapIcon class="size-3" />
+ </Button>
+ );
+};
+
+/**
+ * Delete button for removing property values
+ * Consistent styling and behavior for all property types
+ */
+export const PropertyValueDeleteButton: Component<{
+ onClick: () => void;
+ disabled?: boolean;
+}> = (props) => {
+ return (
+ <Button
+ onClick={props.onClick}
+ disabled={props.disabled}
+ class={twMerge(
+ 'bg-panel floating-failure-bg size-4 p-0.5 border border-edge-muted text-failure-ink cursor-default',
+ 'hover:bg-panel hover:floating-failure-bg',
+ 'active:bg-failure-ink active:border-failure-ink active:text-panel'
+ )}
+ >
+ <DeleteIcon class="size-3" />
+ </Button>
+ );
+};
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/index.ts b/js/app/packages/core/component/Properties/component/propertyValue/index.ts
index 5d38f9dbc3..a0b38f2a3d 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/index.ts
+++ b/js/app/packages/core/component/Properties/component/propertyValue/index.ts
@@ -5,6 +5,7 @@ export { EntityValue } from './EntityValue';
export { LinkValue } from './LinkValue';
export { NumberValue } from './NumberValue';
export { PropertyValue } from './PropertyValue';
+export { PropertyValueIcon } from './PropertyValueIcon';
export { SelectValue } from './SelectValue';
export { TextValue } from './TextValue';
export * from './ValueComponents';
diff --git a/js/app/packages/core/component/Properties/constants.ts b/js/app/packages/core/component/Properties/constants.ts
index e863fa1711..46026ea4f4 100644
--- a/js/app/packages/core/component/Properties/constants.ts
+++ b/js/app/packages/core/component/Properties/constants.ts
@@ -100,3 +100,20 @@ export const MODAL_DIMENSIONS = {
SELECTOR_SMALL_SCREEN_THRESHOLD: 600, // Mobile breakpoint
SELECTOR_SMALL_SCREEN_TOP_PERCENTAGE: 0.1, // 10% from top
} as const;
+
+// Common option ids for mapping to custom icons.
+export const PROPERTY_OPTION_IDS = {
+ PRIORITY: {
+ LOW: '00000001-0000-0000-0003-000000000001',
+ MEDIUM: '00000001-0000-0000-0003-000000000002',
+ HIGH: '00000001-0000-0000-0003-000000000003',
+ URGENT: '00000001-0000-0000-0003-000000000004',
+ },
+ STATUS: {
+ NOT_STARTED: '00000001-0000-0000-0002-000000000001',
+ IN_PROGRESS: '00000001-0000-0000-0002-000000000002',
+ IN_REVIEW: '00000001-0000-0000-0002-000000000003',
+ COMPLETED: '00000001-0000-0000-0002-000000000004',
+ CANCELED: '00000001-0000-0000-0002-000000000005',
+ },
+} as const;
diff --git a/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx b/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx
new file mode 100644
index 0000000000..b20e7e896d
--- /dev/null
+++ b/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx
@@ -0,0 +1,309 @@
+import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeader';
+import { StaticSplitLabel } from '@app/component/split-layout/components/SplitLabel';
+import { filterMap } from '@core/util/list';
+import { isErr } from '@core/util/maybeResult';
+import { propertiesServiceClient } from '@service-properties/client';
+import type { PropertyDefinition } from '@service-properties/generated/schemas/propertyDefinition';
+import { useQuery } from '@tanstack/solid-query';
+import { type Component, createSignal, Show, Suspense } from 'solid-js';
+import { createStore, type Store } from 'solid-js/store';
+import { propertyApiValuesToNormalized } from '../api/converters';
+import { Modals } from '../component/modal';
+import { PropertyGrid } from '../component/panel/PropertyGrid';
+import { SYSTEM_PROPERTY_IDS } from '../constants';
+import {
+ PropertiesProvider,
+ type PropertySaveHandler,
+} from '../context/PropertiesContext';
+import type { Property, PropertyApiValues, PropertyOption } from '../types';
+
+const DEBUG_SYSTEM_PROPERTIES = Object.values(SYSTEM_PROPERTY_IDS);
+
+/**
+ * Helper to get display value of local property (copied from ComposeTask)
+ */
+function extractPropertyValue(
+ definition: PropertyDefinition,
+ savedValues: Store<Record<string, PropertyApiValues>>,
+ options: Map<string, PropertyOption[]>
+) {
+ const { type, value } = propertyApiValuesToNormalized(
+ savedValues[definition.id]
+ );
+ if (type === 'EMPTY') return null;
+ if (
+ definition.data_type === 'SELECT_NUMBER' ||
+ definition.data_type === 'SELECT_STRING'
+ ) {
+ const opts = options.get(definition.id);
+ if (!opts) return null;
+ if (Array.isArray(value)) {
+ return filterMap(value as string[], (id) => {
+ const opt = opts.find((opt) => opt.id === id);
+ return opt ? opt.id : undefined;
+ });
+ }
+ } else {
+ return value;
+ }
+}
+
+const PropertiesDebug: Component = () => {
+ const [refreshKey] = createSignal(0);
+
+ // Local property state (like ComposeTask)
+ const [propertyValues, setPropertyValues] = createStore<
+ Record<string, PropertyApiValues>
+ >({});
+
+ // Fetch system properties (copied from ComposeTask)
+ const systemPropertiesQuery = useQuery(() => ({
+ queryKey: ['properties-debug', 'system-properties', refreshKey()],
+ queryFn: async () => {
+ const result = await propertiesServiceClient.listProperties({
+ scope: 'system',
+ include_options: true,
+ });
+ if (isErr(result)) {
+ throw new Error('Failed to fetch system properties');
+ }
+ const [, data] = result;
+ return data;
+ },
+ staleTime: 1000 * 60 * 10,
+ retry: 1,
+ refetchOnWindowFocus: false,
+ refetchOnMount: false,
+ refetchOnReconnect: false,
+ placeholderData: (prev) => prev,
+ }));
+
+ // Build property definitions map (copied from ComposeTask)
+ const definitions = () => {
+ if (!systemPropertiesQuery.isSuccess) return new Map();
+ const data = systemPropertiesQuery.data;
+ return new Map(
+ data.map((p) => {
+ const definition = 'definition' in p ? p.definition : p;
+ return [definition.id, definition];
+ })
+ );
+ };
+
+ // Build options map (copied from ComposeTask)
+ const options = () => {
+ if (!systemPropertiesQuery.isSuccess) return new Map();
+ const data = systemPropertiesQuery.data;
+ return new Map(
+ data.map((p) => {
+ const definition = 'definition' in p ? p.definition : p;
+ const options = 'property_options' in p ? p.property_options : [];
+ return [definition.id, options];
+ })
+ );
+ };
+
+ // Build properties list (copied from ComposeTask)
+ const properties = () => {
+ return filterMap(DEBUG_SYSTEM_PROPERTIES, (id) => {
+ const definition = definitions().get(id);
+ if (!definition) return;
+ return {
+ propertyId: `debug-${definition.display_name}`,
+ propertyDefinitionId: definition.id,
+ displayName: definition.display_name,
+ isMultiSelect: definition.is_multi_select,
+ owner: definition.owner,
+ specificEntityType: definition.specific_entity_type ?? null,
+ updatedAt: '',
+ createdAt: '',
+ valueType: definition.data_type,
+ value: extractPropertyValue(definition, propertyValues, options()),
+ options: options().get(definition.id),
+ } as Property;
+ });
+ };
+
+ // Spoof properties for testing string, boolean, and link types
+ const spoofProperties = (): Property[] => {
+ return [
+ {
+ propertyId: 'spoof-string-input',
+ propertyDefinitionId: 'spoof-string-input',
+ displayName: 'Test String Input',
+ isMultiSelect: false,
+ owner: { scope: 'system' },
+ specificEntityType: null,
+ updatedAt: new Date().toISOString(),
+ createdAt: new Date().toISOString(),
+ valueType: 'STRING',
+ value: (propertyValues['spoof-string-input'] as any)?.value || null,
+ options: [],
+ isMetadata: false,
+ },
+ {
+ propertyId: 'spoof-boolean-checkbox',
+ propertyDefinitionId: 'spoof-boolean-checkbox',
+ displayName: 'Test Boolean Checkbox',
+ isMultiSelect: false,
+ owner: { scope: 'system' },
+ specificEntityType: null,
+ updatedAt: new Date().toISOString(),
+ createdAt: new Date().toISOString(),
+ valueType: 'BOOLEAN',
+ value:
+ (propertyValues['spoof-boolean-checkbox'] as any)?.value || false,
+ options: [],
+ isMetadata: false,
+ },
+ {
+ propertyId: 'spoof-link-url',
+ propertyDefinitionId: 'spoof-link-url',
+ displayName: 'Test Link URL',
+ isMultiSelect: false,
+ owner: { scope: 'system' },
+ specificEntityType: null,
+ updatedAt: new Date().toISOString(),
+ createdAt: new Date().toISOString(),
+ valueType: 'LINK',
+ value: (propertyValues['spoof-link-url'] as any)?.value || null,
+ options: [],
+ isMetadata: false,
+ },
+ ];
+ };
+
+ const saveHandler: PropertySaveHandler = {
+ saveProperty: async (property: Property, value: PropertyApiValues) => {
+ console.log('Properties Debug - Saving property:', {
+ propertyName: property.displayName,
+ propertyId: property.propertyDefinitionId,
+ valueType: value.valueType,
+ value: value,
+ });
+
+ setPropertyValues(property.propertyDefinitionId, value);
+ return { ok: true, value: undefined };
+ },
+ saveDate: async (property: Property, date: Date) => {
+ console.log('Properties Debug - Saving date:', {
+ propertyName: property.displayName,
+ propertyId: property.propertyDefinitionId,
+ date: date.toISOString(),
+ });
+
+ setPropertyValues(property.propertyDefinitionId, {
+ valueType: 'DATE',
+ value: date.toISOString(),
+ });
+ return { ok: true, value: undefined };
+ },
+ };
+
+ return (
+ <>
+ <SplitHeaderLeft>
+ <StaticSplitLabel label="Properties Playground" />
+ </SplitHeaderLeft>
+ <div class="flex flex-col h-full w-full">
+ <div class="flex flex-col gap-4 p-4">
+ <Suspense
+ fallback={<div class="text-center py-4">Loading Properties...</div>}
+ >
+ <Show
+ when={systemPropertiesQuery.isSuccess && properties().length > 0}
+ >
+ <div class="border border-edge-muted p-2 text-sm">
+ <div class="bg-surface-secondary rounded-lg">
+ <PropertiesProvider
+ entityType="DOCUMENT"
+ canEdit={true}
+ documentName="Playground"
+ properties={() => properties()}
+ onRefresh={() => console.log('On refresh callback')}
+ onPropertyAdded={() =>
+ console.log('Property added callback')
+ }
+ onPropertyDeleted={() =>
+ console.log('Property deleted callback')
+ }
+ saveHandler={saveHandler}
+ >
+ <PropertyGrid properties={properties()} />
+ <Modals />
+ </PropertiesProvider>
+ </div>
+ </div>
+
+ <div class="border border-edge-muted p-2 text-sm">
+ <div class="bg-surface-secondary rounded-lg">
+ <PropertiesProvider
+ entityType="DOCUMENT"
+ canEdit={true}
+ documentName="Playground"
+ properties={() => properties()}
+ onRefresh={() => console.log('On refresh callback')}
+ onPropertyAdded={() =>
+ console.log('Property added callback')
+ }
+ onPropertyDeleted={() =>
+ console.log('Property deleted callback')
+ }
+ saveHandler={saveHandler}
+ >
+ <PropertyGrid properties={properties()} columns={2} />
+ <Modals />
+ </PropertiesProvider>
+ </div>
+ </div>
+ </Show>
+
+ {/* Spoof Properties Section */}
+ <div class="border border-edge-muted p-2 text-sm">
+ <h3 class="text-text-primary font-medium mb-2">
+ Spoof Properties (String, Boolean & Link)
+ </h3>
+ <div class="bg-surface-secondary rounded-lg">
+ <PropertiesProvider
+ entityType="DOCUMENT"
+ canEdit={true}
+ documentName="Spoof Playground"
+ properties={() => spoofProperties()}
+ onRefresh={() =>
+ console.log('Spoof properties refresh callback')
+ }
+ onPropertyAdded={() =>
+ console.log('Spoof property added callback')
+ }
+ onPropertyDeleted={() =>
+ console.log('Spoof property deleted callback')
+ }
+ saveHandler={saveHandler}
+ >
+ <PropertyGrid properties={spoofProperties()} />
+ <Modals />
+ </PropertiesProvider>
+ </div>
+ </div>
+
+ <Show
+ when={
+ systemPropertiesQuery.isSuccess && properties().length === 0
+ }
+ >
+ <div class="border border-edge rounded-lg p-2 text-center">
+ <div class="text-text-secondary">
+ No system properties found for the debug property IDs.
+ <br />
+ Available property definitions: {definitions().size}
+ </div>
+ </div>
+ </Show>
+ </Suspense>
+ </div>
+ </div>
+ </>
+ );
+};
+
+export default PropertiesDebug;
diff --git a/js/app/packages/core/component/Properties/styles/styles.ts b/js/app/packages/core/component/Properties/styles/styles.ts
index 8c1245b2dc..a7f5a884c9 100644
--- a/js/app/packages/core/component/Properties/styles/styles.ts
+++ b/js/app/packages/core/component/Properties/styles/styles.ts
@@ -17,7 +17,7 @@ export const PROPERTY_STYLES = {
value: {
multiButton:
- 'text-right text-ink text-xs hover:bg-hover px-2 py-1 cursor-pointer border border-edge bg-transparent inline-block shrink-0 max-w-[140px] break-words',
+ 'text-right text-ink hover:bg-hover px-2 py-0.5 border border-edge-muted inline-flex items-center gap-2 shrink-0 max-w-[140px] break-words',
},
checkbox: {
diff --git a/js/app/packages/core/component/Tooltip.tsx b/js/app/packages/core/component/Tooltip.tsx
index 9c6dc979a6..b6de328807 100644
--- a/js/app/packages/core/component/Tooltip.tsx
+++ b/js/app/packages/core/component/Tooltip.tsx
@@ -16,6 +16,7 @@ export type TooltipProps = ParentProps<{
delayOverride?: number;
spanMode?: boolean;
hide?: boolean;
+ unstyled?: boolean;
}>;
/**
@@ -23,6 +24,7 @@ export type TooltipProps = ParentProps<{
* @param props.tooltip - The JSX element to render in the tooltip.
* @param props.placement - A optional floating ui placement string.
* @param props.floatingOptions - A optional floating ui options object.
+ * @param props.unstyled - When true, removes default styling from the tooltip content.
* @example
* <Tooltip tooltip={<div class="text-xs">Hello</div>}>
* <DeprecatedButton>Hover over me</DeprecatedButton>
@@ -79,12 +81,14 @@ export function Tooltip(props: TooltipProps) {
'max-width': `calc(100vw - ${2 * padding()}px)`,
}}
>
- <div
- class="flex items-center justify-center bg-ink p-1.5 text-panel text-xs wrap-break-word"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
- >
- {props.tooltip}
- </div>
+ <Show when={!props.unstyled} fallback={props.tooltip}>
+ <div
+ class="flex items-center justify-center bg-ink p-1.5 text-panel text-xs wrap-break-word"
+ style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ >
+ {props.tooltip}
+ </div>
+ </Show>
{/* Note disabling arrows for now. I think its more on-brand - seamus */}
{/*<CorvuTooltip.Arrow />*/}
</CorvuTooltip.Content>
diff --git a/js/app/packages/core/component/TopBar/ShareButton.tsx b/js/app/packages/core/component/TopBar/ShareButton.tsx
index 6967cf49d9..527c983f61 100644
--- a/js/app/packages/core/component/TopBar/ShareButton.tsx
+++ b/js/app/packages/core/component/TopBar/ShareButton.tsx
@@ -4,6 +4,7 @@ import { useIsAuthenticated } from '@core/auth';
import {
createBlockEffect,
createBlockResource,
+ useBlockAliasedName,
useBlockId,
useBlockName,
} from '@core/block';
@@ -625,7 +626,7 @@ export function ShareButton(props: ShareButtonProps) {
const [permissionsResource] = permissionsBlockResource;
const blockScopeId = blockHotkeyScopeSignal.get;
const isAuthenticated = useIsAuthenticated();
- const blockType = useBlockName();
+ const blockType = useBlockAliasedName();
const blockId = useBlockId();
onMount(() => {
diff --git a/js/app/packages/core/component/UserIcon.tsx b/js/app/packages/core/component/UserIcon.tsx
index dd02936b1e..1149a940be 100644
--- a/js/app/packages/core/component/UserIcon.tsx
+++ b/js/app/packages/core/component/UserIcon.tsx
@@ -1,19 +1,20 @@
import { toast } from '@core/component/Toast/Toast';
import { macroIdToEmail, tryMacroId, useDisplayName } from '@core/user';
import { isOk } from '@core/util/maybeResult';
-import { Tooltip } from '@kobalte/core/tooltip';
import Trash from '@phosphor-icons/core/regular/trash.svg?component-solid';
import { commsServiceClient } from '@service-comms/client';
import { debounce } from '@solid-primitives/scheduled';
import { createMemo, createSignal, Match, Show, Switch } from 'solid-js';
import { useSplitLayout } from '../../app/component/split-layout/layout';
import { ProfilePicture } from './ProfilePicture';
+import { Tooltip } from './Tooltip';
import { UserTooltip } from './UserTooltip';
export type UserIconProps = {
isDeleted?: boolean;
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'fill';
suppressClick?: boolean;
+ showTooltip?: boolean;
// TODO: remove imageUrl. not actively used.
imageURL?: string;
fetchUrl?: boolean;
@@ -141,23 +142,27 @@ export function UserIcon(props: UserIconProps) {
}
return (
- <Show when={displayName().length > 0 || email()} fallback={icon()}>
- <Tooltip placement="bottom" gutter={8} overflowPadding={16}>
- <Tooltip.Trigger as="div" class={sizeClasses().container}>
- {icon()}
- </Tooltip.Trigger>
- <Tooltip.Portal>
- <Tooltip.Content class="z-tool-tip">
- <UserTooltip
- displayName={displayName()() || ''}
- email={email()}
- id={props.id}
- isDeleted={props.isDeleted}
- copied={copied()}
- onCopyEmail={handleCopyEmail}
- />
- </Tooltip.Content>
- </Tooltip.Portal>
+ <Show
+ when={
+ props.showTooltip !== false && (displayName().length > 0 || email())
+ }
+ fallback={icon()}
+ >
+ <Tooltip
+ placement="bottom"
+ unstyled
+ tooltip={
+ <UserTooltip
+ displayName={displayName()() || ''}
+ email={email()}
+ id={props.id}
+ isDeleted={props.isDeleted}
+ copied={copied()}
+ onCopyEmail={handleCopyEmail}
+ />
+ }
+ >
+ {icon()}
</Tooltip>
</Show>
);
diff --git a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
index 4a4a905c6a..ef1972a0e2 100644
--- a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
+++ b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
@@ -50,7 +50,7 @@ import type {
WithSearch,
} from '../types/search';
import type { EntityClickEvent, EntityClickHandler } from './Entity';
-import { PropertyPills } from './PropertyPills';
+import { KeyPropertiesGrid, PropertyPills } from './PropertyPills';
export const ENTITY_HEIGHT = 40;
@@ -1019,6 +1019,9 @@ export function EntityWithEverything(
</div>
</div>
<EntityTitle />
+ <Show when={isTaskEntity(props.entity) && properties().length > 0}>
+ <KeyPropertiesGrid properties={properties()} />
+ </Show>
</div>
{/* Date and user - top right on mobile, end on desktop */}
<div
@@ -1030,7 +1033,10 @@ export function EntityWithEverything(
<div class="flex flex-row items-center justify-end gap-2 min-w-0 @max-md/split:justify-start @max-md/split:flex-wrap">
<Show when={properties().length > 0}>
<div class="pr-2 overflow-hidden shrink min-w-0">
- <PropertyPills properties={properties()} />
+ <PropertyPills
+ properties={properties()}
+ excludeKeyProperties={isTaskEntity(props.entity)}
+ />
</div>
</Show>
<Show when={sharedData()}>
diff --git a/js/app/packages/macro-entity/src/components/PropertyPills/BooleanPropertyPill.tsx b/js/app/packages/macro-entity/src/components/PropertyPills/BooleanPropertyPill.tsx
index a66108cb35..824975eb1c 100644
--- a/js/app/packages/macro-entity/src/components/PropertyPills/BooleanPropertyPill.tsx
+++ b/js/app/packages/macro-entity/src/components/PropertyPills/BooleanPropertyPill.tsx
@@ -1,11 +1,12 @@
import type { Property } from '@core/component/Properties/types';
import { PropertyDataTypeIcon } from '@core/component/Properties/utils';
import { Tooltip } from '@core/component/Tooltip';
-import { cornerClip } from '@core/util/clipPath';
+
import { PropertyPillTooltip } from './PropertyPillTooltip';
type BooleanPropertyPillProps = {
property: Property & { valueType: 'BOOLEAN' };
+ compressed?: boolean;
};
/**
@@ -26,23 +27,25 @@ export const BooleanPropertyPill = (props: BooleanPropertyPillProps) => {
}}
>
<div
- class="p-px bg-edge box-border h-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ class="inline-flex items-center gap-1.5 text-xs leading-none text-ink-muted border border-edge-muted h-fit p-1.5"
+ classList={{
+ '@3xl/soup:px-2 @3xl/soup:py-1': !props.compressed,
+ }}
>
- <div
- class="inline-flex items-center gap-1.5 p-1.5 @3xl/soup:px-2 @3xl/soup:py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
+ <PropertyDataTypeIcon
+ property={{
+ data_type: 'BOOLEAN',
+ }}
+ class="size-3.5 shrink-0"
+ />
+ <span
+ class="truncate max-w-[120px] hidden"
+ classList={{
+ '@3xl/soup:inline': !props.compressed,
+ }}
>
- <PropertyDataTypeIcon
- property={{
- data_type: 'BOOLEAN',
- }}
- class="size-3.5 shrink-0"
- />
- <span class="truncate max-w-[120px] hidden @3xl/soup:inline">
- {props.property.displayName}
- </span>
- </div>
+ {props.property.displayName}
+ </span>
</div>
</Tooltip>
);
@@ -54,16 +57,8 @@ const BooleanTooltipContent = (props: {
return (
<PropertyPillTooltip property={props.property}>
<div class="flex items-center gap-1.5 flex-wrap">
- <div
- class="p-px bg-edge box-border h-fit w-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
- >
- <div
- class="inline-flex items-center px-2 py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
- >
- <span>True</span>
- </div>
+ <div class="inline-flex items-center px-2 py-1 text-xs leading-none text-ink-muted border border-edge-muted h-fit w-fit">
+ <span>True</span>
</div>
</div>
</PropertyPillTooltip>
diff --git a/js/app/packages/macro-entity/src/components/PropertyPills/EntityPropertyPill.tsx b/js/app/packages/macro-entity/src/components/PropertyPills/EntityPropertyPill.tsx
index 98e01a08dc..a8ce60d77a 100644
--- a/js/app/packages/macro-entity/src/components/PropertyPills/EntityPropertyPill.tsx
+++ b/js/app/packages/macro-entity/src/components/PropertyPills/EntityPropertyPill.tsx
@@ -2,14 +2,15 @@ import { usePropertyEntityDisplay } from '@core/component/Properties/hooks';
import type { Property } from '@core/component/Properties/types';
import { PropertyDataTypeIcon } from '@core/component/Properties/utils';
import { Tooltip } from '@core/component/Tooltip';
-import { cornerClip } from '@core/util/clipPath';
+import { UserIcon } from '@core/component/UserIcon';
import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
-import { For, Show } from 'solid-js';
+import { createMemo, For, Show } from 'solid-js';
import { PropertyPillTooltip } from './PropertyPillTooltip';
type EntityPropertyPillProps = {
property: Property & { valueType: 'ENTITY' };
+ compressed?: boolean;
};
/**
@@ -23,20 +24,42 @@ export const EntityPropertyPill = (props: EntityPropertyPillProps) => {
if (count() === 0) return null;
+ // Show user avatars for multiselect user entity properties
+ if (props.property.specificEntityType === 'USER') {
+ return (
+ <UserEntityPill
+ property={props.property}
+ entities={entities()}
+ compressed={props.compressed}
+ />
+ );
+ }
+
// Single entity - show name directly in pill
if (count() === 1) {
return (
- <SingleEntityPill property={props.property} entity={entities()[0]} />
+ <SingleEntityPill
+ property={props.property}
+ entity={entities()[0]}
+ compressed={props.compressed}
+ />
);
}
// Multiple entities - show count with tooltip
- return <MultiEntityPill property={props.property} entities={entities()} />;
+ return (
+ <MultiEntityPill
+ property={props.property}
+ entities={entities()}
+ compressed={props.compressed}
+ />
+ );
};
type SingleEntityPillProps = {
property: Property & { valueType: 'ENTITY' };
entity: EntityReference;
+ compressed?: boolean;
};
const SingleEntityPill = (props: SingleEntityPillProps) => {
@@ -57,6 +80,7 @@ const SingleEntityPill = (props: SingleEntityPillProps) => {
return (
<Tooltip
+ unstyled
tooltip={
<SingleEntityTooltipContent
property={props.property}
@@ -70,18 +94,20 @@ const SingleEntityPill = (props: SingleEntityPillProps) => {
}}
>
<div
- class="p-px bg-edge box-border h-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ class="inline-flex items-center gap-1.5 text-xs leading-none text-ink-muted border border-edge-muted h-fit p-1.5"
+ classList={{
+ '@3xl/soup:px-2 @3xl/soup:py-1': !props.compressed,
+ }}
>
- <div
- class="inline-flex items-center gap-1.5 p-1.5 @3xl/soup:px-2 @3xl/soup:py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
+ <Show when={icon()}>{icon()}</Show>
+ <span
+ class="truncate max-w-[120px] hidden"
+ classList={{
+ '@3xl/soup:inline': !props.compressed,
+ }}
>
- <Show when={icon()}>{icon()}</Show>
- <span class="truncate max-w-[120px] hidden @3xl/soup:inline">
- {name()}
- </span>
- </div>
+ {name()}
+ </span>
</div>
</Tooltip>
);
@@ -105,11 +131,13 @@ const SingleEntityTooltipContent = (props: SingleEntityTooltipContentProps) => {
type MultiEntityPillProps = {
property: Property & { valueType: 'ENTITY' };
entities: EntityReference[];
+ compressed?: boolean;
};
const MultiEntityPill = (props: MultiEntityPillProps) => {
return (
<Tooltip
+ unstyled
tooltip={
<EntityTooltipContent
property={props.property}
@@ -123,24 +151,26 @@ const MultiEntityPill = (props: MultiEntityPillProps) => {
}}
>
<div
- class="p-px bg-edge box-border h-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ class="inline-flex items-center gap-1.5 text-xs leading-none text-ink-muted border border-edge-muted h-fit p-1.5"
+ classList={{
+ '@3xl/soup:px-2 @3xl/soup:py-1': !props.compressed,
+ }}
>
- <div
- class="inline-flex items-center gap-1.5 p-1.5 @3xl/soup:px-2 @3xl/soup:py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
+ <PropertyDataTypeIcon
+ property={{
+ data_type: 'ENTITY',
+ specific_entity_type: props.property.specificEntityType,
+ }}
+ class="size-3.5 shrink-0"
+ />
+ <span
+ class="truncate max-w-[120px] hidden"
+ classList={{
+ '@3xl/soup:inline': !props.compressed,
+ }}
>
- <PropertyDataTypeIcon
- property={{
- data_type: 'ENTITY',
- specific_entity_type: props.property.specificEntityType,
- }}
- class="size-3.5 shrink-0"
- />
- <span class="truncate max-w-[120px] hidden @3xl/soup:inline">
- {props.property.displayName} ({props.entities.length})
- </span>
- </div>
+ {props.property.displayName} ({props.entities.length})
+ </span>
</div>
</Tooltip>
);
@@ -175,17 +205,101 @@ const EntityValuePill = (props: EntityValuePillProps) => {
);
return (
- <div
- class="p-px bg-edge box-border h-fit w-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ <div class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted border border-edge-muted h-fit w-fit">
+ <Show when={icon()}>{icon()}</Show>
+ <span class="truncate max-w-[150px]">{name()}</span>
+ </div>
+ );
+};
+
+const MAX_USER_AVATARS = 3;
+
+type UserEntityPillProps = {
+ property: Property & { valueType: 'ENTITY' };
+ entities: EntityReference[];
+ compressed?: boolean;
+};
+
+/**
+ * Pill for multiselect user entity properties that shows user avatars in LiveIndicators style
+ */
+const UserEntityPill = (props: UserEntityPillProps) => {
+ const remaining = createMemo(() => {
+ if (props.entities.length <= MAX_USER_AVATARS) return undefined;
+ return props.entities.length - MAX_USER_AVATARS;
+ });
+
+ const displayEntities = () => props.entities.slice(0, MAX_USER_AVATARS);
+
+ return (
+ <Tooltip
+ unstyled
+ tooltip={
+ <UserEntityTooltipContent
+ property={props.property}
+ entities={props.entities}
+ />
+ }
+ floatingOptions={{
+ offset: 4,
+ flip: true,
+ shift: { padding: 8 },
+ }}
>
- <div
- class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
- >
- <Show when={icon()}>{icon()}</Show>
- <span class="truncate max-w-[150px]">{name()}</span>
+ <div class="flex items-center h-fit shrink-0 overflow-hidden w-fit isolate pr-2">
+ <For each={displayEntities()}>
+ {(entity) => (
+ <div class="bg-panel rounded-full p-[2px] -mr-2">
+ <UserIcon id={entity.entity_id} isDeleted={false} size="xs" />
+ </div>
+ )}
+ </For>
+ <Show when={remaining()}>
+ <div class="z-4">
+ <div class="size-6 bg-menu border-2 text-[10px] -mr-2 border-panel rounded-full flex flex-col justify-center items-center">
+ <span>+{remaining()}</span>
+ </div>
+ </div>
+ </Show>
+ </div>
+ </Tooltip>
+ );
+};
+
+type UserEntityTooltipContentProps = {
+ property: Property & { valueType: 'ENTITY' };
+ entities: EntityReference[];
+};
+
+const UserEntityTooltipContent = (props: UserEntityTooltipContentProps) => {
+ return (
+ <PropertyPillTooltip property={props.property}>
+ <div class="flex flex-col gap-1.5">
+ <For each={props.entities}>
+ {(entity) => <UserEntityTooltipItem entity={entity} />}
+ </For>
+ </div>
+ </PropertyPillTooltip>
+ );
+};
+
+type UserEntityTooltipItemProps = {
+ entity: EntityReference;
+};
+
+const UserEntityTooltipItem = (props: UserEntityTooltipItemProps) => {
+ const { name } = usePropertyEntityDisplay(
+ () => props.entity.entity_id,
+ () => props.entity.entity_type as EntityType,
+ { fallbackIcon: null }
+ );
+
+ return (
+ <div class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted border border-edge-muted h-fit w-fit">
+ <div class="size-4 rounded-full overflow-hidden shrink-0">
+ <UserIcon id={props.entity.entity_id} isDeleted={false} size="fill" />
</div>
+ <span class="truncate max-w-[150px]">{name()}</span>
</div>
);
};
diff --git a/js/app/packages/macro-entity/src/components/PropertyPills/KeyPropertiesGrid.tsx b/js/app/packages/macro-entity/src/components/PropertyPills/KeyPropertiesGrid.tsx
new file mode 100644
index 0000000000..704f60c4d7
--- /dev/null
+++ b/js/app/packages/macro-entity/src/components/PropertyPills/KeyPropertiesGrid.tsx
@@ -0,0 +1,90 @@
+import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
+import type { Property } from '@core/component/Properties/types';
+import { Tooltip } from '@core/component/Tooltip';
+import CircleDashed from '@icon/regular/circle-dashed.svg';
+
+import { createMemo, For, Show } from 'solid-js';
+import { PropertyPills } from './PropertyPills';
+
+type KeyPropertiesGridProps = {
+ properties: Property[];
+};
+
+const KEY_PROPERTY_ORDER = [
+ SYSTEM_PROPERTY_IDS.STATUS,
+ SYSTEM_PROPERTY_IDS.PRIORITY,
+ SYSTEM_PROPERTY_IDS.ASSIGNEES,
+];
+
+/**
+ * Grid layout for key task properties: Status, Priority, Assignees
+ * Always shows 3 cells in a row, empty cells when property is not present
+ * Uses regular PropertyPills with compressed=true for consistency
+ */
+export const KeyPropertiesGrid = (props: KeyPropertiesGridProps) => {
+ const keyProperties = createMemo(() => {
+ const propertyMap = new Map<string, Property>();
+ for (const property of props.properties) {
+ propertyMap.set(property.propertyDefinitionId, property);
+ }
+
+ return KEY_PROPERTY_ORDER.map((id) => propertyMap.get(id) || null);
+ });
+
+ return (
+ <div class="grid grid-cols-[1fr_1fr_4fr] gap-2 w-fit">
+ <For each={keyProperties()}>
+ {(property, index) => (
+ <div
+ class="h-6 flex items-center"
+ classList={{
+ 'w-6 justify-center': index() < 2, // Status and Priority get fixed width, centered
+ 'min-w-6 justify-start': index() === 2, // Assignees get flexible width, left aligned
+ }}
+ >
+ <Show when={property}>
+ {(prop) =>
+ prop().value === null ? (
+ <PlaceholderPill property={prop()} index={index()} />
+ ) : (
+ <PropertyPills properties={[prop()]} compressed={true} />
+ )
+ }
+ </Show>
+ </div>
+ )}
+ </For>
+ </div>
+ );
+};
+
+type PlaceholderPillProps = {
+ property: Property;
+ index: number;
+};
+
+const PlaceholderPill = (props: PlaceholderPillProps) => {
+ return (
+ <Tooltip
+ unstyled
+ tooltip={
+ <div class="bg-panel border border-edge-muted text-xs text-ink-muted p-2">{`No ${props.property.displayName.toLowerCase()} set`}</div>
+ }
+ floatingOptions={{
+ offset: 4,
+ flip: true,
+ shift: { padding: 8 },
+ }}
+ >
+ <div
+ class="inline-flex items-center justify-center text-xs leading-none text-ink-muted"
+ classList={{
+ 'p-1.5': props.property.valueType !== 'ENTITY',
+ 'py-1.5 px-0.5': props.property.valueType === 'ENTITY',
+ }}
+ >
+ <CircleDashed class="size-4 opacity-20" />
+ </div>
+ </Tooltip>
+ );
+};
diff --git a/js/app/packages/macro-entity/src/components/PropertyPills/LinkPropertyPill.tsx b/js/app/packages/macro-entity/src/components/PropertyPills/LinkPropertyPill.tsx
index fd84674d1e..5f90fce288 100644
--- a/js/app/packages/macro-entity/src/components/PropertyPills/LinkPropertyPill.tsx
+++ b/js/app/packages/macro-entity/src/components/PropertyPills/LinkPropertyPill.tsx
@@ -5,7 +5,7 @@ import {
} from '@core/component/Properties/utils';
import { Tooltip } from '@core/component/Tooltip';
import { useUnfurl } from '@core/signal/unfurl';
-import { cornerClip } from '@core/util/clipPath';
+
import LinkIcon from '@icon/regular/link.svg';
import { proxyResource } from '@service-unfurl/client';
import { createSignal, For, Show } from 'solid-js';
@@ -13,6 +13,7 @@ import { PropertyPillTooltip } from './PropertyPillTooltip';
type LinkPropertyPillProps = {
property: Property & { valueType: 'LINK' };
+ compressed?: boolean;
};
/**
@@ -28,16 +29,29 @@ export const LinkPropertyPill = (props: LinkPropertyPillProps) => {
// Single link - show title/domain directly in pill
if (count() === 1) {
- return <SingleLinkPill property={props.property} url={links()[0]} />;
+ return (
+ <SingleLinkPill
+ property={props.property}
+ url={links()[0]}
+ compressed={props.compressed}
+ />
+ );
}
// Multiple links - show count with tooltip
- return <MultiLinkPill property={props.property} urls={links()} />;
+ return (
+ <MultiLinkPill
+ property={props.property}
+ urls={links()}
+ compressed={props.compressed}
+ />
+ );
};
type SingleLinkPillProps = {
property: Property & { valueType: 'LINK' };
url: string;
+ compressed?: boolean;
};
const SingleLinkPill = (props: SingleLinkPillProps) => {
@@ -77,29 +91,31 @@ const SingleLinkPill = (props: SingleLinkPillProps) => {
}}
>
<div
- class="p-px bg-edge box-border h-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ class="inline-flex items-center gap-1.5 text-xs leading-none text-ink-muted border border-edge-muted h-fit p-1.5"
+ classList={{
+ '@3xl/soup:px-2 @3xl/soup:py-1': !props.compressed,
+ }}
>
- <div
- class="inline-flex items-center gap-1.5 p-1.5 @3xl/soup:px-2 @3xl/soup:py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
+ <Show
+ when={faviconUrl() && !imageError()}
+ fallback={<LinkIcon class="size-4 text-ink-muted shrink-0" />}
>
- <Show
- when={faviconUrl() && !imageError()}
- fallback={<LinkIcon class="size-4 text-ink-muted shrink-0" />}
- >
- <img
- src={faviconUrl()!}
- class="size-4 object-cover rounded shrink-0"
- crossorigin="anonymous"
- alt=""
- onError={() => setImageError(true)}
- />
- </Show>
- <span class="truncate max-w-[100px] hidden @3xl/soup:inline">
- {title()}
- </span>
- </div>
+ <img
+ src={faviconUrl()!}
+ class="size-4 object-cover rounded shrink-0"
+ crossorigin="anonymous"
+ alt=""
+ onError={() => setImageError(true)}
+ />
+ </Show>
+ <span
+ class="truncate max-w-[100px] hidden"
+ classList={{
+ '@3xl/soup:inline': !props.compressed,
+ }}
+ >
+ {title()}
+ </span>
</div>
</Tooltip>
);
@@ -118,33 +134,27 @@ const SingleLinkTooltipContent = (props: SingleLinkTooltipContentProps) => {
return (
<PropertyPillTooltip property={props.property}>
<div class="flex items-center gap-1.5 flex-wrap">
- <div
- class="p-px bg-edge box-border h-fit w-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ <a
+ href={props.url}
+ target="_blank"
+ rel="noopener noreferrer"
+ class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted border border-edge-muted h-fit w-fit"
+ title={props.url}
>
- <a
- href={props.url}
- target="_blank"
- rel="noopener noreferrer"
- class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
- title={props.url}
+ <Show
+ when={props.faviconUrl && !imageError()}
+ fallback={<LinkIcon class="size-4 text-ink-muted" />}
>
- <Show
- when={props.faviconUrl && !imageError()}
- fallback={<LinkIcon class="size-4 text-ink-muted" />}
- >
- <img
- src={props.faviconUrl!}
- class="size-4 object-cover rounded"
- crossorigin="anonymous"
- alt=""
- onError={() => setImageError(true)}
- />
- </Show>
- <span class="truncate max-w-[150px]">{props.title}</span>
- </a>
- </div>
+ <img
+ src={props.faviconUrl!}
+ class="size-4 object-cover rounded"
+ crossorigin="anonymous"
+ alt=""
+ onError={() => setImageError(true)}
+ />
+ </Show>
+ <span class="truncate max-w-[150px]">{props.title}</span>
+ </a>
</div>
</PropertyPillTooltip>
);
@@ -153,6 +163,7 @@ const SingleLinkTooltipContent = (props: SingleLinkTooltipContentProps) => {
type MultiLinkPillProps = {
property: Property & { valueType: 'LINK' };
urls: string[];
+ compressed?: boolean;
};
const MultiLinkPill = (props: MultiLinkPillProps) => {
@@ -168,23 +179,25 @@ const MultiLinkPill = (props: MultiLinkPillProps) => {
}}
>
<div
- class="p-px bg-edge box-border h-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ class="inline-flex items-center gap-1.5 text-xs leading-none text-ink-muted border border-edge-muted h-fit p-1.5"
+ classList={{
+ '@3xl/soup:px-2 @3xl/soup:py-1': !props.compressed,
+ }}
>
- <div
- class="inline-flex items-center gap-1.5 p-1.5 @3xl/soup:px-2 @3xl/soup:py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
+ <PropertyDataTypeIcon
+ property={{
+ data_type: 'LINK',
+ }}
+ class="size-3.5 shrink-0"
+ />
+ <span
+ class="truncate max-w-[120px] hidden"
+ classList={{
+ '@3xl/soup:inline': !props.compressed,
+ }}
>
- <PropertyDataTypeIcon
- property={{
- data_type: 'LINK',
- }}
- class="size-3.5 shrink-0"
- />
- <span class="truncate max-w-[120px] hidden @3xl/soup:inline">
- {props.property.displayName} ({props.urls.length})
- </span>
- </div>
+ {props.property.displayName} ({props.urls.length})
+ </span>
</div>
</Tooltip>
);
@@ -230,32 +243,26 @@ const LinkValuePill = (props: LinkValuePillProps) => {
};
return (
- <div
- class="p-px bg-edge box-border h-fit w-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ <a
+ href={props.url}
+ target="_blank"
+ rel="noopener noreferrer"
+ class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted border border-edge-muted h-fit w-fit"
+ title={props.url}
>
- <a
- href={props.url}
- target="_blank"
- rel="noopener noreferrer"
- class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
- title={props.url}
+ <Show
+ when={faviconUrl() && !imageError()}
+ fallback={<LinkIcon class="size-4 text-ink-muted" />}
>
- <Show
- when={faviconUrl() && !imageError()}
- fallback={<LinkIcon class="size-4 text-ink-muted" />}
- >
- <img
- src={faviconUrl()!}
- class="size-4 object-cover rounded"
- crossorigin="anonymous"
- alt=""
- onError={() => setImageError(true)}
- />
- </Show>
- <span class="truncate max-w-[150px]">{title()}</span>
- </a>
- </div>
+ <img
+ src={faviconUrl()!}
+ class="size-4 object-cover rounded"
+ crossorigin="anonymous"
+ alt=""
+ onError={() => setImageError(true)}
+ />
+ </Show>
+ <span class="truncate max-w-[150px]">{title()}</span>
+ </a>
);
};
diff --git a/js/app/packages/macro-entity/src/components/PropertyPills/PropertyPillTooltip.tsx b/js/app/packages/macro-entity/src/components/PropertyPills/PropertyPillTooltip.tsx
index 7a13022f2c..0cb22aea1f 100644
--- a/js/app/packages/macro-entity/src/components/PropertyPills/PropertyPillTooltip.tsx
+++ b/js/app/packages/macro-entity/src/components/PropertyPills/PropertyPillTooltip.tsx
@@ -1,6 +1,5 @@
import type { Property } from '@core/component/Properties/types';
import { PropertyDataTypeIcon } from '@core/component/Properties/utils';
-import { cornerClip } from '@core/util/clipPath';
import type { ParentProps } from 'solid-js';
type PropertyPillTooltipProps = ParentProps<{
@@ -13,30 +12,32 @@ type PropertyPillTooltipProps = ParentProps<{
* Children are rendered as the values body
*/
export const PropertyPillTooltip = (props: PropertyPillTooltipProps) => {
+ const singleSelect = () => !props.property.isMultiSelect;
return (
<div
- class="-m-1.5 p-[0.5px] bg-edge box-border"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ class="p-2 border border-edge-muted bg-panel"
+ classList={{
+ 'flex flex-row gap-2 items-center': singleSelect(),
+ 'min-w-48 max-w-72': !singleSelect(),
+ }}
>
<div
- class="flex flex-col gap-2 p-2 bg-menu min-w-[240px] max-w-[280px] box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
+ class="flex items-center gap-2 text-ink-muted"
+ classList={{
+ 'border-b border-edge-muted/50 pb-1.5 mb-1.5': !singleSelect(),
+ }}
>
- <div class="flex items-center gap-2 text-ink-muted pb-1.5 border-b border-edge/50">
- <PropertyDataTypeIcon
- property={{
- data_type: props.property.valueType,
- specific_entity_type:
- props.property.specificEntityType ?? undefined,
- }}
- class="size-3.5 text-ink-muted"
- />
- <span class="text-sm font-semibold">
- {props.property.displayName}
- </span>
- </div>
- {props.children}
+ <PropertyDataTypeIcon
+ property={{
+ data_type: props.property.valueType,
+ specific_entity_type:
+ props.property.specificEntityType ?? undefined,
+ }}
+ class="size-3.5 text-ink-muted"
+ />
+ <span class="text-xs">{props.property.displayName}</span>
</div>
+ {props.children}
</div>
);
};
diff --git a/js/app/packages/macro-entity/src/components/PropertyPills/PropertyPills.tsx b/js/app/packages/macro-entity/src/components/PropertyPills/PropertyPills.tsx
index ad194df30a..245903c242 100644
--- a/js/app/packages/macro-entity/src/components/PropertyPills/PropertyPills.tsx
+++ b/js/app/packages/macro-entity/src/components/PropertyPills/PropertyPills.tsx
@@ -1,10 +1,12 @@
+import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
+import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
import type { Property } from '@core/component/Properties/types';
import {
formatPropertyValue,
PropertyDataTypeIcon,
} from '@core/component/Properties/utils';
import { Tooltip } from '@core/component/Tooltip';
-import { cornerClip } from '@core/util/clipPath';
+
import { For, Match, Show, Switch } from 'solid-js';
import { BooleanPropertyPill } from './BooleanPropertyPill';
import { EntityPropertyPill } from './EntityPropertyPill';
@@ -13,6 +15,10 @@ import { PropertyPillTooltip } from './PropertyPillTooltip';
type PropertyPillsProps = {
properties: Property[];
+ /** For tasks, exclude key properties (status, priority, assignees) that are shown in KeyPropertiesGrid */
+ excludeKeyProperties?: boolean;
+ /** Force compressed styling regardless of container query */
+ compressed?: boolean;
};
/**
@@ -21,14 +27,33 @@ type PropertyPillsProps = {
*/
const MAX_DISPLAY_PILLS = 4;
+const TASK_KEY_PROPERTY_IDS = [
+ SYSTEM_PROPERTY_IDS.STATUS,
+ SYSTEM_PROPERTY_IDS.PRIORITY,
+ SYSTEM_PROPERTY_IDS.ASSIGNEES,
+] as const;
+
export const PropertyPills = (props: PropertyPillsProps) => {
- const displayProperties = () => props.properties.slice(0, MAX_DISPLAY_PILLS);
+ const filteredProperties = () => {
+ if (props.excludeKeyProperties) {
+ return props.properties.filter(
+ (property) =>
+ !TASK_KEY_PROPERTY_IDS.includes(property.propertyDefinitionId as any)
+ );
+ }
+ return props.properties;
+ };
+
+ const displayProperties = () =>
+ filteredProperties().slice(0, MAX_DISPLAY_PILLS);
return (
- <Show when={props.properties.length > 0}>
+ <Show when={filteredProperties().length > 0}>
<div class="flex items-center gap-1 justify-end">
<For each={displayProperties()}>
- {(property) => <PropertyPill property={property} />}
+ {(property) => (
+ <PropertyPill property={property} compressed={props.compressed} />
+ )}
</For>
</div>
</Show>
@@ -37,6 +62,7 @@ export const PropertyPills = (props: PropertyPillsProps) => {
type PropertyPillProps = {
property: Property;
+ compressed?: boolean;
};
/**
@@ -44,20 +70,30 @@ type PropertyPillProps = {
*/
const PropertyPill = (props: PropertyPillProps) => {
return (
- <Switch fallback={<TextPropertyPill property={props.property} />}>
+ <Switch
+ fallback={
+ <TextPropertyPill
+ property={props.property}
+ compressed={props.compressed}
+ />
+ }
+ >
<Match when={props.property.valueType === 'BOOLEAN'}>
<BooleanPropertyPill
property={props.property as Property & { valueType: 'BOOLEAN' }}
+ compressed={props.compressed}
/>
</Match>
<Match when={props.property.valueType === 'ENTITY'}>
<EntityPropertyPill
property={props.property as Property & { valueType: 'ENTITY' }}
+ compressed={props.compressed}
/>
</Match>
<Match when={props.property.valueType === 'LINK'}>
<LinkPropertyPill
property={props.property as Property & { valueType: 'LINK' }}
+ compressed={props.compressed}
/>
</Match>
</Switch>
@@ -66,9 +102,10 @@ const PropertyPill = (props: PropertyPillProps) => {
/**
* Pill - shows icon + text when wide, icon only when narrow
- * Uses @container/soup from Soup.tsx
- * - >= @3xl (~768px): full (icon + text)
- * - < @3xl: compact (icon only)
+ * Uses @container/soup from Soup.tsx and compressed prop
+ * - >= @3xl (~768px) AND not compressed: full (icon + text)
+ * - < @3xl OR compressed: compact (icon only)
+ * - Status and Priority properties always show as compact (icon only)
*/
const TextPropertyPill = (props: PropertyPillProps) => {
const displayValue = () => formatPillValue(props.property);
@@ -78,6 +115,7 @@ const TextPropertyPill = (props: PropertyPillProps) => {
return (
<Tooltip
+ unstyled
tooltip={<TextTooltipContent property={props.property} />}
floatingOptions={{
offset: 4,
@@ -86,24 +124,20 @@ const TextPropertyPill = (props: PropertyPillProps) => {
}}
>
<div
- class="p-px bg-edge box-border h-fit flex items-center shrink-0"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
+ class="inline-flex items-center gap-1.5 text-xs leading-none text-ink-muted border border-edge-muted/50 h-fit shrink-0 p-1.5"
+ classList={{
+ '@3xl/soup:px-2 @3xl/soup:py-1': !props.compressed,
+ }}
>
- <div
- class="inline-flex items-center gap-1.5 p-1.5 @3xl/soup:px-2 @3xl/soup:py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{ 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0) }}
+ <PillIcon property={props.property} />
+ <span
+ class="truncate max-w-[100px] hidden"
+ classList={{
+ '@3xl/soup:inline': !props.compressed,
+ }}
>
- <PropertyDataTypeIcon
- property={{
- data_type: props.property.valueType,
- specific_entity_type: props.property.specificEntityType,
- }}
- class="size-3.5 shrink-0"
- />
- <span class="truncate max-w-[100px] hidden @3xl/soup:inline">
- {value}
- </span>
- </div>
+ {value}
+ </span>
</div>
</Tooltip>
);
@@ -140,19 +174,13 @@ const TextTooltipContent = (props: { property: Property }) => {
<PropertyPillTooltip property={props.property}>
<div class="flex items-center gap-1.5 flex-wrap">
<For each={getValues(props.property)}>
- {(value) => (
- <div
- class="p-px bg-edge box-border h-fit w-fit flex items-center"
- style={{ 'clip-path': cornerClip('0.2rem', 0, 0, 0) }}
- >
- <div
- class="inline-flex items-center px-2 py-1 text-xs leading-none text-ink-muted bg-panel box-border"
- style={{
- 'clip-path': cornerClip('calc(0.2rem - 0.5px)', 0, 0, 0),
- }}
- >
- <span class="truncate max-w-[150px]">{value}</span>
- </div>
+ {(value, index) => (
+ <div class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted border border-edge-muted/50 h-fit w-fit">
+ <TooltipValueIcon
+ property={props.property}
+ valueIndex={index()}
+ />
+ <span class="truncate max-w-[150px]">{value}</span>
</div>
)}
</For>
@@ -199,3 +227,51 @@ const formatPillValue = (property: Property): string | null => {
return null;
};
+
+/**
+ * Icon component for property pills - uses special icons for select values when available
+ */
+const PillIcon = (props: { property: Property }) => {
+ // For SELECT_STRING and SELECT_NUMBER with single value, try to use special icon
+ if (
+ (props.property.valueType === 'SELECT_STRING' ||
+ props.property.valueType === 'SELECT_NUMBER') &&
+ props.property.value &&
+ props.property.value.length === 1
+ ) {
+ const optionId = props.property.value[0];
+ return <PropertyValueIcon optionId={optionId} class="size-3.5 shrink-0" />;
+ }
+
+ // Default to data type icon
+ return (
+ <PropertyDataTypeIcon
+ property={{
+ data_type: props.property.valueType,
+ specific_entity_type: props.property.specificEntityType,
+ }}
+ class="size-3.5 shrink-0"
+ />
+ );
+};
+
+/**
+ * Icon component for tooltip values - uses special icons for select values when available
+ */
+const TooltipValueIcon = (props: {
+ property: Property;
+ valueIndex: number;
+}) => {
+ // For SELECT_STRING and SELECT_NUMBER, try to use special icon for the specific value
+ if (
+ (props.property.valueType === 'SELECT_STRING' ||
+ props.property.valueType === 'SELECT_NUMBER') &&
+ props.property.value &&
+ props.property.value[props.valueIndex]
+ ) {
+ const optionId = props.property.value[props.valueIndex];
+ return <PropertyValueIcon optionId={optionId} class="size-3 shrink-0" />;
+ }
+
+ return null;
+};
diff --git a/js/app/packages/macro-entity/src/components/PropertyPills/index.tsx b/js/app/packages/macro-entity/src/components/PropertyPills/index.tsx
index 4437a916e0..9a5ec4f5c1 100644
--- a/js/app/packages/macro-entity/src/components/PropertyPills/index.tsx
+++ b/js/app/packages/macro-entity/src/components/PropertyPills/index.tsx
@@ -1 +1,2 @@
+export { KeyPropertiesGrid } from './KeyPropertiesGrid';
export { PropertyPills } from './PropertyPills';
diff --git a/js/app/packages/macro-icons/square/task-cancelled.svg b/js/app/packages/macro-icons/square/task-cancelled.svg
new file mode 100644
index 0000000000..d6bba9c7f9
--- /dev/null
+++ b/js/app/packages/macro-icons/square/task-cancelled.svg
@@ -0,0 +1,3 @@
+<svg width="100%" height="100%" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+<path d="M6 0C2.69 0 0 2.69 0 6C0 9.31 2.69 12 6 12C9.31 12 12 9.31 12 6C12 2.69 9.31 0 6 0ZM9 7.94L7.94 9L6 7.06L4.06 9L3 7.94L4.94 6L3 4.06L4.06 3L6 4.94L7.94 3L9 4.06L7.06 6L9 7.94Z"/>
+</svg>
diff --git a/js/app/packages/macro-icons/square/task-created.svg b/js/app/packages/macro-icons/square/task-created.svg
new file mode 100644
index 0000000000..61267e1c87
--- /dev/null
+++ b/js/app/packages/macro-icons/square/task-created.svg
@@ -0,0 +1,4 @@
+<svg width="100%" height="100%" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+<path d="M6.75 1.52C8.87 1.88 10.5 3.72 10.5 5.94C10.5 6.49 10.39 7.01 10.2 7.5L11.53 8.27C11.83 7.55 12 6.77 12 5.94C12 2.89 9.71 0.37 6.75 0V1.52Z"/>
+<path d="M9.45 8.8C8.62 9.8 7.39 10.44 6 10.44C3.52 10.44 1.5 8.42 1.5 5.94C1.5 3.72 3.13 1.88 5.25 1.52V0C2.29 0.37 0 2.89 0 5.95C0 9.26 2.69 11.95 6 11.95C7.95 11.95 9.68 11.01 10.77 9.57L9.44 8.8H9.45Z"/>
+</svg>
diff --git a/js/app/packages/macro-icons/square/task-done.svg b/js/app/packages/macro-icons/square/task-done.svg
new file mode 100644
index 0000000000..eb4d4eca51
--- /dev/null
+++ b/js/app/packages/macro-icons/square/task-done.svg
@@ -0,0 +1,3 @@
+<svg width="100%" height="100%" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+<path d="M6 0C2.69 0 0 2.69 0 6C0 9.31 2.69 12 6 12C9.31 12 12 9.31 12 6C12 2.69 9.31 0 6 0ZM5.52 8.66C5.38 8.8 5.19 8.88 4.99 8.88C4.79 8.88 4.6 8.8 4.46 8.66L2.34 6.54L3.4 5.48L4.99 7.07L8.7 3.36L9.76 4.42L5.52 8.66Z"/>
+</svg>
diff --git a/js/app/packages/macro-icons/square/task-in-progress.svg b/js/app/packages/macro-icons/square/task-in-progress.svg
new file mode 100644
index 0000000000..7394d9d529
--- /dev/null
+++ b/js/app/packages/macro-icons/square/task-in-progress.svg
@@ -0,0 +1,4 @@
+<svg width="100%" height="100%" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+<path d="M1.8 7.51C1.61 7.02 1.5 6.5 1.5 5.95C1.5 3.72 3.13 1.88 5.25 1.52V0C2.29 0.37 0 2.89 0 5.95C0 6.78 0.17 7.56 0.47 8.27L1.8 7.5V7.51Z"/>
+<path d="M6.75 0V3.05C8.04 3.39 9 4.55 9 5.94C9 7.59 7.65 8.94 6 8.94C5.19 8.94 4.42 8.6 3.86 8.04L1.22 9.56C1.22 9.56 1.26 9.62 1.29 9.65C1.59 10.03 1.93 10.37 2.31 10.66C2.34 10.69 2.38 10.71 2.41 10.74C2.58 10.87 2.77 10.99 2.95 11.1C2.97 11.11 2.99 11.13 3.01 11.14C3.43 11.38 3.89 11.57 4.37 11.71C4.41 11.72 4.46 11.73 4.5 11.74C4.69 11.79 4.88 11.83 5.08 11.86C5.14 11.86 5.19 11.88 5.25 11.89C5.49 11.92 5.73 11.94 5.98 11.94C9.29 11.94 11.98 9.25 11.98 5.94C12 2.89 9.71 0.38 6.75 0Z"/>
+</svg>
diff --git a/js/app/packages/macro-icons/square/task-in-review.svg b/js/app/packages/macro-icons/square/task-in-review.svg
new file mode 100644
index 0000000000..12d6583d64
--- /dev/null
+++ b/js/app/packages/macro-icons/square/task-in-review.svg
@@ -0,0 +1,3 @@
+<svg width="100%" height="100%" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+<path d="M6.75 0V3.05C8.04 3.39 9 4.55 9 5.94C9 7.59 7.65 8.94 6 8.94C4.35 8.94 3 7.59 3 5.94C3 4.55 3.96 3.38 5.25 3.05V0C2.29 0.37 0 2.89 0 5.95C0 9.26 2.69 11.95 6 11.95C9.31 11.95 12 9.26 12 5.95C12 2.89 9.71 0.37 6.75 0Z"/>
+</svg>
diff --git a/js/app/packages/macro-icons/square/user.svg b/js/app/packages/macro-icons/square/user.svg
new file mode 100644
index 0000000000..cc0d84b860
--- /dev/null
+++ b/js/app/packages/macro-icons/square/user.svg
@@ -0,0 +1,6 @@
+<svg width="100%" height="100%" viewBox="0 0 12 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+<path d="M6 8.75C4.48 8.75 3.25 7.52 3.25 6C3.25 4.48 4.48 3.25 6 3.25C7.52 3.25 8.75 4.48 8.75 6C8.75 7.52 7.52 8.75 6 8.75ZM6 4.75C5.31 4.75 4.75 5.31 4.75 6C4.75 6.69 5.31 7.25 6 7.25C6.69 7.25 7.25 6.69 7.25 6C7.25 5.31 6.69 4.75 6 4.75Z"/>
+<path d="M3.14 12C3.68 10.96 4.75 10.25 6 10.25C7.25 10.25 8.32 10.96 8.86 12H10.48C9.85 10.12 8.09 8.75 5.99 8.75C3.89 8.75 2.14 10.12 1.5 12H3.14Z"/>
+<path d="M1.5 12H0.75C0.34 12 0 11.66 0 11.25V1.5H1.5V12Z"/>
+<path d="M12 10.5H10.5V1.5H1.5V0H11.25C11.66 0 12 0.34 12 0.75V10.5Z"/>
+</svg>
diff --git a/js/app/packages/macro-icons/wide/priority-high.svg b/js/app/packages/macro-icons/wide/priority-high.svg
new file mode 100644
index 0000000000..47aee4fe51
--- /dev/null
+++ b/js/app/packages/macro-icons/wide/priority-high.svg
@@ -0,0 +1,5 @@
+<svg width="100%" height="100%" viewBox="0 0 18 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 6H5V12H0.75C0.34 12 0 11.66 0 11.25V6Z" fill="currentColor"/>
+<path d="M11.5 3H6.5V12H11.5V3Z" fill="currentColor"/>
+<path d="M13 0H17.25C17.66 0 18 0.33 18 0.75V12H13V0Z" fill="currentColor"/>
+</svg>
diff --git a/js/app/packages/macro-icons/wide/priority-low.svg b/js/app/packages/macro-icons/wide/priority-low.svg
new file mode 100644
index 0000000000..682e7ffa53
--- /dev/null
+++ b/js/app/packages/macro-icons/wide/priority-low.svg
@@ -0,0 +1,5 @@
+<svg width="100%" height="100%" viewBox="0 0 18 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 6H5V12H0.75C0.34 12 0 11.66 0 11.25V6Z" fill="currentColor"/>
+<path d="M11.5 3H6.5V12H11.5V3Z" opacity="0.3" fill="currentColor"/>
+<path d="M13 0H17.25C17.66 0 18 0.33 18 0.75V12H13V0Z" opacity="0.3" fill="currentColor"/>
+</svg>
diff --git a/js/app/packages/macro-icons/wide/priority-medium.svg b/js/app/packages/macro-icons/wide/priority-medium.svg
new file mode 100644
index 0000000000..a8105cfb15
--- /dev/null
+++ b/js/app/packages/macro-icons/wide/priority-medium.svg
@@ -0,0 +1,5 @@
+<svg width="100%" height="100%" viewBox="0 0 18 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 6H5V12H0.75C0.34 12 0 11.66 0 11.25V6Z" fill="currentColor"/>
+<path d="M11.5 3H6.5V12H11.5V3Z" fill="currentColor"/>
+<path d="M13 0H17.25C17.66 0 18 0.33 18 0.75V12H13V0Z" opacity="0.3" fill="currentColor"/>
+</svg>
diff --git a/js/app/packages/macro-icons/wide/priority-urgent.svg b/js/app/packages/macro-icons/wide/priority-urgent.svg
new file mode 100644
index 0000000000..a505bee8a9
--- /dev/null
+++ b/js/app/packages/macro-icons/wide/priority-urgent.svg
@@ -0,0 +1,5 @@
+<svg width="100%" height="100%" viewBox="0 0 18 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+<path d="M8.96 0L2.96 6L8.96 12L14.96 6L8.96 0ZM8.22 2.35C8.22 2.3 8.25 2.27 8.3 2.27H9.62C9.67 2.27 9.7 2.3 9.7 2.35V7.24C9.7 7.29 9.67 7.32 9.62 7.32H8.3C8.25 7.32 8.22 7.29 8.22 7.24V2.35ZM9.63 9.73H8.29C8.24 9.73 8.21 9.7 8.21 9.65V8.39C8.21 8.34 8.24 8.31 8.29 8.31H9.63C9.68 8.31 9.71 8.34 9.71 8.39V9.65C9.71 9.7 9.68 9.73 9.63 9.73Z"/>
+<path d="M4.41 3H3L0 6L3 9H4.41L1.41 6L4.41 3Z"/>
+<path d="M13.5 3H14.91L17.91 6L14.91 9H13.5L16.5 6L13.5 3Z"/>
+</svg>