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(tasks): simple grid-based task view (#3056)

Seamus443a0bc95995
diff --git a/js/app/packages/app/component/bulk-edit-entity/BulkDeleteView.tsx b/js/app/packages/app/component/bulk-edit-entity/BulkDeleteView.tsx
index 92399663a9..dffab59b80 100644
--- a/js/app/packages/app/component/bulk-edit-entity/BulkDeleteView.tsx
+++ b/js/app/packages/app/component/bulk-edit-entity/BulkDeleteView.tsx
@@ -44,9 +44,12 @@ export const BulkDeleteView = (props: {
<For each={props.entities.slice(0, 2)}>
{(entity) => (
<div
- class={cn('bg-edge px-2 py-1 truncate text-xs rounded-xs', {
- 'max-w-[50%]': props.entities.length === 2,
- })}
+ class={cn(
+ 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',
+ {
+ 'max-w-[50%]': props.entities.length === 2,
+ }
+ )}
>
<InlineEntity entity={entity} />
</div>
diff --git a/js/app/packages/app/component/bulk-edit-entity/BulkMoveToProjectView.tsx b/js/app/packages/app/component/bulk-edit-entity/BulkMoveToProjectView.tsx
index af11b356bf..ac90474f43 100644
--- a/js/app/packages/app/component/bulk-edit-entity/BulkMoveToProjectView.tsx
+++ b/js/app/packages/app/component/bulk-edit-entity/BulkMoveToProjectView.tsx
@@ -376,9 +376,12 @@ export const BulkMoveToProjectView = (props: {
<For each={props.entities.slice(0, 2)}>
{(entity) => (
<div
- class={cn('bg-edge px-2 py-1 truncate text-xs rounded-xs', {
- 'max-w-[50%]': props.entities.length === 2,
- })}
+ class={cn(
+ 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',
+ {
+ 'max-w-[50%]': props.entities.length === 2,
+ }
+ )}
>
<InlineEntity entity={entity} />
</div>
diff --git a/js/app/packages/app/component/bulk-edit-entity/BulkRenameEntitiesView.tsx b/js/app/packages/app/component/bulk-edit-entity/BulkRenameEntitiesView.tsx
index 49f1af7f35..707f5e60e8 100644
--- a/js/app/packages/app/component/bulk-edit-entity/BulkRenameEntitiesView.tsx
+++ b/js/app/packages/app/component/bulk-edit-entity/BulkRenameEntitiesView.tsx
@@ -115,9 +115,12 @@ export const BulkRenameEntitiesView = (props: {
<For each={props.entities.slice(0, 2)}>
{(entity) => (
<div
- class={cn('bg-edge px-2 py-1 truncate text-xs rounded-xs', {
- 'max-w-[50%]': props.entities.length === 2,
- })}
+ class={cn(
+ 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',
+ {
+ 'max-w-[50%]': props.entities.length === 2,
+ }
+ )}
>
<InlineEntity entity={entity} />
</div>
diff --git a/js/app/packages/app/component/command/CommandMenu.tsx b/js/app/packages/app/component/command/CommandMenu.tsx
index a675c6a081..a91d992985 100644
--- a/js/app/packages/app/component/command/CommandMenu.tsx
+++ b/js/app/packages/app/component/command/CommandMenu.tsx
@@ -591,9 +591,12 @@ function EntityActionPreview(props: { entities: EntityData[] }) {
{(entity) => {
return (
<div
- class={cn('bg-edge px-2 py-1 truncate text-xs rounded-xs', {
- 'max-w-[50%]': props.entities.length === 2,
- })}
+ class={cn(
+ 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',
+ {
+ 'max-w-[50%]': props.entities.length === 2,
+ }
+ )}
>
<InlineEntity entity={entity} />
</div>
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index d0bbb57d10..d2d3406bc1 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -38,6 +38,8 @@ import {
SoupViewTabs,
useApplyPreset,
} from '@app/component/next-soup/soup-view/soup-view-tabs';
+import { TaskListEntity } from '@app/component/next-soup/soup-view/views/tasks/TaskListEntity';
+import { ResponsiveTaskListHeader } from '@app/component/next-soup/soup-view/views/tasks/TaskListHeader';
import {
openEntityInNewTab,
openEntityInSplitFromUnifiedList,
@@ -107,6 +109,7 @@ import {
untrack,
} from 'solid-js';
import { createStore, reconcile } from 'solid-js/store';
+import { Dynamic } from 'solid-js/web';
import { type VirtualizerHandle, VList } from 'virtua/solid';
import type { CacheSnapshot } from 'virtua/unstable_core';
import { SoupEntitySelectionToolbar } from './soup-entity-selection-toolbar';
@@ -903,6 +906,9 @@ export const SoupViewList = (props: SoupViewListProps) => {
</Match>
<Match when={rows().length}>
<ListLayoutProvider ref={localEntityListRef}>
+ <Show when={currentView() === 'tasks' && !isMobile()}>
+ <ResponsiveTaskListHeader class="shrink-0" />
+ </Show>
<EntityRowProvider
container={localEntityListRef}
canSwipeLeft={(entityId) => {
@@ -978,7 +984,12 @@ export const SoupViewList = (props: SoupViewListProps) => {
</Show>
<SoupEntityContextMenu entity={row.original}>
- <ListEntity
+ <Dynamic
+ component={
+ currentView() === 'tasks'
+ ? TaskListEntity
+ : ListEntity
+ }
entity={row.original}
timestamp={timestamp()}
highlighted={
@@ -994,10 +1005,7 @@ export const SoupViewList = (props: SoupViewListProps) => {
!soup.predicates.isActive('noise')
}
checked={row.isSelected()}
- onChecked={(
- next: boolean,
- shiftKey: boolean
- ) =>
+ onChecked={(next, shiftKey) =>
handleMultiSelectChecked({
entity: row.original,
entityIndex: i(),
@@ -1005,7 +1013,7 @@ export const SoupViewList = (props: SoupViewListProps) => {
shiftKey: shiftKey ?? false,
})
}
- onClick={(event: MouseEvent) => {
+ onClick={(event) => {
onEntityClick({
type: 'entity',
entity: row.original,
@@ -1022,10 +1030,7 @@ export const SoupViewList = (props: SoupViewListProps) => {
location: undefined,
});
}}
- onContentHitClick={(
- e: PointerEvent | MouseEvent,
- location?: SearchLocation
- ) => {
+ onContentHitClick={(e, location) => {
onEntityClick({
type: 'entity',
entity: row.original,
@@ -1161,7 +1166,10 @@ const SoupList = (props: SoupListProps) => {
return (
<div
ref={props.ref}
- class={cn('unified-table-body size-full relative', props.class)}
+ class={cn(
+ 'unified-table-body w-full flex-1 min-h-0 relative',
+ props.class
+ )}
>
<VList
cache={props.cache}
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/TaskListEntity.tsx b/js/app/packages/app/component/next-soup/soup-view/views/tasks/TaskListEntity.tsx
new file mode 100644
index 0000000000..4c15ab517a
--- /dev/null
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/TaskListEntity.tsx
@@ -0,0 +1,182 @@
+import '@entity/composed/ListEntity.css';
+import { EntityRow, EntityRowContext } from '@app/component/mobile/EntityRow';
+import { useSplitPanel } from '@app/component/split-layout/layoutUtils';
+import { isMobile } from '@core/mobile/isMobile';
+import {
+ createEntityDraggable,
+ Entity,
+ filterNotDoneNotifications,
+ filterValidNotifications,
+ isWithNotification,
+ unreadFilterFn,
+ useIsShared,
+} from '@entity';
+import { NarrowLayout } from '@entity/composed/list-entity/narrow-layout';
+import {
+ type BaseListEntityProps,
+ hasSearchContentHits,
+ type LayoutProps,
+ useCharacterCount,
+ useListLayout,
+} from '@entity/composed/list-entity/shared';
+import type { EntityRowConfig } from '@entity/extractors-notification';
+import {
+ getStreamState,
+ subscribeToStreamState,
+} from '@service-connection/stream-events';
+import { mergeRefs } from '@solid-primitives/refs';
+import { cn } from '@ui/utils/classname';
+import {
+ createSignal,
+ type JSX,
+ Match,
+ Show,
+ Switch,
+ useContext,
+} from 'solid-js';
+import { TaskGridLayout } from './task-grid-layout';
+
+interface TaskListEntityProps extends BaseListEntityProps {
+ showUnrollNotifications?: boolean;
+}
+
+function MaybeEntityRow(props: {
+ entityId: string;
+ children: JSX.Element;
+ config?: EntityRowConfig;
+}) {
+ const ctx = useContext(EntityRowContext);
+ return (
+ <Show when={isMobile() && ctx} fallback={props.children}>
+ <EntityRow
+ entityId={props.entityId}
+ swipeLeftColor={props.config?.swipeLeftColor}
+ swipeLeftRevealedComponent={props.config?.swipeLeftRevealedComponent}
+ swipeRightColor={props.config?.swipeRightColor}
+ swipeRightRevealedComponent={props.config?.swipeRightRevealedComponent}
+ >
+ {props.children}
+ </EntityRow>
+ </Show>
+ );
+}
+
+/**
+ * Task-specific list entity that renders properties (Status, Priority,
+ * Assignees, Due Date) in fixed-width grid columns so they line up
+ * vertically across rows in a list.
+ */
+export function TaskListEntity(props: TaskListEntityProps) {
+ const unread = () => unreadFilterFn(props.entity);
+ const isShared = useIsShared(props.entity);
+
+ subscribeToStreamState(props.entity.id, props.entity.type);
+ const streamState = getStreamState(props.entity.id);
+
+ const hasNotifications = () => {
+ if (!isWithNotification(props.entity)) return false;
+ return (
+ filterNotDoneNotifications(
+ filterValidNotifications(props.entity.notifications?.())
+ ).length > 0
+ );
+ };
+
+ const [snippetContainerRef, setSnippetContainerRef] = createSignal<
+ HTMLElement | undefined
+ >();
+ const chars = useCharacterCount(snippetContainerRef);
+
+ const showHitSnippet = () =>
+ !props.hideContentHits && hasSearchContentHits(props.entity);
+
+ const showContentHits = () => showHitSnippet();
+
+ const layoutProps = (): LayoutProps => ({
+ entity: props.entity,
+ checked: props.checked,
+ onChecked: props.onChecked,
+ unread: unread(),
+ isShared: isShared(),
+ hasNotifications: hasNotifications(),
+ showHitSnippet: showHitSnippet(),
+ streamState: streamState(),
+ setSnippetContainerRef,
+ chars: chars(),
+ onProjectClick: props.onProjectClick,
+ });
+
+ const draggable = createEntityDraggable({
+ entity: props.entity,
+ splitId: useSplitPanel()?.handle?.id,
+ });
+
+ const isWide = useListLayout()?.isWide ?? (() => true);
+
+ return (
+ <Entity.Root
+ entity={props.entity}
+ onClick={(e) => {
+ if (e.metaKey && props.onChecked) {
+ props.onChecked(!props.checked, e.shiftKey);
+ return;
+ }
+ props.onClick?.(e);
+ }}
+ ref={mergeRefs(props.ref, draggable)}
+ class={cn(
+ 'soup-list-entity @container/entity w-full relative group/narrow flex flex-col',
+ {
+ 'min-h-10': !isMobile(),
+ 'bg-accent/5': props.checked,
+ 'hover:bg-hover group-data-expanded/cm-trigger:bg-hover':
+ !props.checked && !props.highlighted && !props.hovered,
+ 'bg-hover': props.hovered && !props.highlighted && !props.checked,
+ 'bg-accent/5 outline-1 outline-accent/20 -outline-offset-1':
+ props.highlighted && !isMobile(),
+ }
+ )}
+ onMouseMove={props.onMouseMove}
+ >
+ <div
+ data-accent-bar
+ class={cn('absolute h-full w-[3px] left-0 top-0 bg-accent opacity-0', {
+ 'opacity-100': props.highlighted && !isMobile(),
+ })}
+ />
+
+ <Switch>
+ <Match when={isWide()}>
+ <MaybeEntityRow
+ entityId={props.entity.id}
+ config={props.entityRowConfig}
+ >
+ <TaskGridLayout {...layoutProps()} />
+ </MaybeEntityRow>
+ </Match>
+ <Match when={true}>
+ <MaybeEntityRow
+ entityId={props.entity.id}
+ config={props.entityRowConfig}
+ >
+ <NarrowLayout {...layoutProps()} />
+ </MaybeEntityRow>
+ </Match>
+ </Switch>
+
+ <Show when={showContentHits()}>
+ <div class="flex gap-2 w-full h-full items-center text-sm px-2 pb-1 -mt-2 min-w-0">
+ <div
+ class={cn('min-w-0 flex-1 overflow-hidden ml-4 @lg/entity:ml-6')}
+ >
+ <Entity.Search.ContentHits
+ entity={props.entity}
+ onClick={props.onContentHitClick}
+ visibleCount={0}
+ />
+ </div>
+ </div>
+ </Show>
+ </Entity.Root>
+ );
+}
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/TaskListHeader.tsx b/js/app/packages/app/component/next-soup/soup-view/views/tasks/TaskListHeader.tsx
new file mode 100644
index 0000000000..0930245760
--- /dev/null
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/TaskListHeader.tsx
@@ -0,0 +1,84 @@
+import { Tooltip } from '@core/component/Tooltip';
+import { useListLayout } from '@entity/composed/list-entity/shared';
+import UsersIcon from '@icon/regular/users.svg';
+import StatusInProgress from '@macro-icons/square/task-in-progress-circle.svg';
+import PriorityHigh from '@macro-icons/wide/priority-high.svg';
+import { cn } from '@ui/utils/classname';
+import { For, type JSX, Show } from 'solid-js';
+import {
+ TASK_GRID_COLUMNS,
+ TASK_GRID_TEMPLATE_AREAS,
+ TASK_GRID_TEMPLATE_COLUMNS,
+} from './task-grid-template';
+import './list-property-value.css';
+
+const HEADER_ICON_CLASS = 'size-3 text-ink-muted';
+
+/** Map column IDs to their icons for narrow mode */
+const COLUMN_ICONS: Record<string, () => JSX.Element> = {
+ status: () => <StatusInProgress class={HEADER_ICON_CLASS} />,
+ priority: () => <PriorityHigh class={HEADER_ICON_CLASS} />,
+ assignees: () => <UsersIcon class={HEADER_ICON_CLASS} />,
+};
+
+/**
+ * Responsive wrapper that only shows the header when layout is wide.
+ * Must be used inside a ListLayoutProvider.
+ */
+export function ResponsiveTaskListHeader(props: { class?: string }) {
+ const layout = useListLayout();
+ const isWide = () => layout?.isWide() ?? true;
+
+ return (
+ <Show when={isWide()}>
+ <TaskListHeader class={props.class} />
+ </Show>
+ );
+}
+
+/**
+ * Sticky table header that mirrors the column template of TaskGridLayout
+ * so the column labels line up with the property values in each row.
+ */
+export function TaskListHeader(props: { class?: string }) {
+ return (
+ <div
+ class={cn(
+ 'task-grid-row z-10 w-full grid items-center gap-2 px-2 h-10',
+ 'text-xs font-medium text-ink-extra-muted',
+ 'bg-panel border-b border-edge-muted',
+ props.class
+ )}
+ style={{
+ 'grid-template-columns': TASK_GRID_TEMPLATE_COLUMNS,
+ 'grid-template-areas': TASK_GRID_TEMPLATE_AREAS,
+ }}
+ >
+ <div style={{ 'grid-area': 'indicator' }} />
+ <div style={{ 'grid-area': 'content' }} class="truncate">
+ Task
+ </div>
+ <For each={TASK_GRID_COLUMNS}>
+ {(col) => (
+ <div
+ style={{ 'grid-area': col.id }}
+ class="truncate flex items-center min-w-0"
+ >
+ {/* Wide: show label, Narrow: hide */}
+ <span class="truncate @max-[840px]/uList:hidden">{col.label}</span>
+ {/* Narrow: show icon with tooltip */}
+ <Tooltip
+ tooltip={col.label}
+ class="hidden @max-[840px]/uList:flex @max-[840px]/uList:px-1.5"
+ >
+ {COLUMN_ICONS[col.id]?.()}
+ </Tooltip>
+ </div>
+ )}
+ </For>
+ <div style={{ 'grid-area': 'timestamp' }} class="text-right">
+ Updated
+ </div>
+ </div>
+ );
+}
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.css b/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.css
new file mode 100644
index 0000000000..31f4aef6a8
--- /dev/null
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.css
@@ -0,0 +1,15 @@
+.task-grid-row {
+ --task-col-status: 7rem;
+ --task-col-priority: 7rem;
+ --task-col-assignees: 7rem;
+ --task-col-timestamp: 5rem;
+}
+
+@container uList (max-width: 840px) {
+ .task-grid-row {
+ --task-col-status: 2rem;
+ --task-col-priority: 2rem;
+ --task-col-assignees: 2rem;
+ --task-col-timestamp: 5rem;
+ }
+}
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.tsx b/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.tsx
new file mode 100644
index 0000000000..4771f459f0
--- /dev/null
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/list-property-value.tsx
@@ -0,0 +1,213 @@
+import { CondensedPropertyValue } from '@core/component/Properties/component/propertyValue/CondensedPropertyValue';
+import { PropertyTooltip } from '@core/component/Properties/component/propertyValue/PropertyTooltip';
+import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
+import { usePropertiesContext } from '@core/component/Properties/context/PropertiesContext';
+import type { Property } from '@core/component/Properties/types';
+import {
+ formatPropertyValue,
+ getEntityValues,
+ getSelectValues,
+} from '@core/component/Properties/utils';
+import { Tooltip } from '@core/component/Tooltip';
+import { UserGroup } from '@core/component/UserGroup';
+import CaretDownIcon from '@icon/regular/caret-down.svg';
+import CircleDashedEmpty from '@icon/regular/circle-dashed.svg';
+import { cn } from '@ui/utils/classname';
+import { type Component, Show } from 'solid-js';
+import './list-property-value.css';
+
+type ListPropertyValueProps = {
+ property: Property;
+};
+
+/**
+ * Borderless property value for list views. Routes by valueType:
+ *
+ * - SELECT_*: icon + label + caret-down. Empty: dashed-circle + "Set <name>".
+ * - ENTITY (USER): avatar group + caret-down. Empty: dashed-circle +
+ * "Add <name>".
+ * - everything else: falls back to CondensedPropertyValue.
+ *
+ * All branches intercept clicks (stopPropagation) and open the property editor
+ * anchored to the cell.
+ */
+export const ListPropertyValue: Component<ListPropertyValueProps> = (props) => {
+ const isSelect = () =>
+ props.property.valueType === 'SELECT_STRING' ||
+ props.property.valueType === 'SELECT_NUMBER';
+
+ const isEntity = () => props.property.valueType === 'ENTITY';
+
+ const context = usePropertiesContext();
+
+ return (
+ <Show
+ when={isSelect()}
+ fallback={
+ <Show
+ when={isEntity()}
+ fallback={
+ <CondensedPropertyValue
+ property={props.property}
+ canEdit={context.canEdit}
+ onEdit={context.openPropertyEditor}
+ />
+ }
+ >
+ <ListEntityValue property={props.property} />
+ </Show>
+ }
+ >
+ <ListSelectValue property={props.property} />
+ </Show>
+ );
+};
+
+const buttonClass = (isReadOnly: boolean) =>
+ cn(
+ 'inline-flex items-center gap-1 min-w-0',
+ 'px-1.5 py-1 leading-tight text-left rounded-sm',
+ 'cursor-default',
+ {
+ 'hover:bg-hover': !isReadOnly,
+ }
+ );
+
+const ListSelectValue: Component<{ property: Property }> = (props) => {
+ const context = usePropertiesContext();
+
+ const isReadOnly = () => props.property.isMetadata || !context.canEdit;
+
+ const handleClick = (e: MouseEvent) => {
+ e.stopPropagation();
+ if (isReadOnly()) return;
+ context.openPropertyEditor(props.property, e.currentTarget as HTMLElement);
+ };
+
+ const firstValue = () => getSelectValues(props.property)[0];
+
+ const displayText = () => {
+ const value = firstValue();
+ if (value !== undefined) {
+ return formatPropertyValue(props.property, value);
+ }
+ return `None`;
+ };
+
+ return (
+ <Tooltip
+ unstyled
+ tooltip={<PropertyTooltip property={props.property} />}
+ class="list-property-cell flex items-center min-w-0"
+ >
+ <button
+ type="button"
+ onClick={handleClick}
+ class={cn(buttonClass(isReadOnly()), {
+ 'text-ink-extra-muted/50': !firstValue(),
+ })}
+ >
+ <Show
+ when={firstValue()}
+ fallback={<CircleDashedEmpty class="size-3 shrink-0" />}
+ >
+ {(value) => <PropertyValueIcon optionId={value()} />}
+ </Show>
+ {/* Label hidden when container is narrow via CSS */}
+ <span
+ class={cn(
+ 'list-property-label truncate flex-1 @max-[840px]/uList:hidden',
+ {
+ 'text-ink-extra-muted opacity-50': firstValue() === undefined,
+ }
+ )}
+ >
+ {displayText()}
+ </span>
+ {/* Caret hidden when container is narrow */}
+ <Show when={!isReadOnly()}>
+ <CaretDownIcon class="size-3 shrink-0 @max-[840px]/uList:hidden" />
+ </Show>
+ </button>
+ </Tooltip>
+ );
+};
+
+const ListEntityValue: Component<{ property: Property }> = (props) => {
+ const context = usePropertiesContext();
+
+ const isReadOnly = () => props.property.isMetadata || !context.canEdit;
+
+ const handleClick = (e: MouseEvent) => {
+ e.stopPropagation();
+ if (isReadOnly()) return;
+ context.openPropertyEditor(props.property, e.currentTarget as HTMLElement);
+ };
+
+ const entities = () => getEntityValues(props.property);
+ const isUser = () => props.property.specificEntityType === 'USER';
+ const hasValues = () => entities().length > 0;
+
+ return (
+ <Tooltip
+ unstyled
+ tooltip={<PropertyTooltip property={props.property} />}
+ class="list-property-cell flex items-center min-w-0"
+ >
+ <button
+ type="button"
+ onClick={handleClick}
+ class={cn(buttonClass(isReadOnly()), {
+ 'text-ink-extra-muted/50': !hasValues(),
+ })}
+ >
+ <Show
+ when={hasValues()}
+ fallback={
+ <>
+ <CircleDashedEmpty class="size-3 shrink-0" />
+ <span class="truncate flex-1 @max-[840px]/uList:hidden">
+ None
+ </span>
+ </>
+ }
+ >
+ <Show
+ when={isUser()}
+ fallback={
+ <span class="truncate flex-1 @max-[840px]/uList:hidden">
+ {entities().length === 1
+ ? '1 item'
+ : `${entities().length} items`}
+ </span>
+ }
+ >
+ {/* Wide mode: show up to 2 users. Narrow mode: show 1 user */}
+ <div class="flex @max-[840px]/uList:hidden">
+ <UserGroup
+ userIds={entities().map((e) => e.entity_id)}
+ size="sm"
+ suppressClick
+ showTooltip
+ maxUsers={2}
+ />
+ </div>
+ <div class="hidden @max-[840px]/uList:flex">
+ <UserGroup
+ userIds={entities().map((e) => e.entity_id)}
+ size="sm"
+ suppressClick
+ showTooltip
+ maxUsers={1}
+ />
+ </div>
+ </Show>
+ </Show>
+ {/* Caret hidden when container is narrow */}
+ <Show when={!isReadOnly()}>
+ <CaretDownIcon class="size-3 shrink-0 @max-[840px]/uList:hidden" />
+ </Show>
+ </button>
+ </Tooltip>
+ );
+};
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-layout.tsx b/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-layout.tsx
new file mode 100644
index 0000000000..5450aa349f
--- /dev/null
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-layout.tsx
@@ -0,0 +1,191 @@
+import { Modals } from '@core/component/Properties/component/modal';
+import {
+ PropertiesProvider,
+ type PropertySaveHandler,
+} from '@core/component/Properties/context/PropertiesContext';
+import type {
+ Property,
+ PropertyApiValues,
+} from '@core/component/Properties/types';
+import {
+ Entity,
+ type EntityData,
+ type EntityWithProperties,
+ isProjectContainedEntity,
+ MultiSelectCheckbox,
+ ProjectBreadCrumb,
+ UnreadIndicator,
+} from '@entity';
+import { SharedBadgeSmall } from '@entity/components/Badges';
+import type { LayoutProps } from '@entity/composed/list-entity/shared';
+import { soupPropertyToProperty } from '@entity/extractors-property';
+import { useUserId } from '@queries/auth';
+import { useBulkSaveEntityPropertiesMutation } from '@queries/properties/entity';
+import { EntityType } from '@service-properties/generated/schemas/entityType';
+import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';
+import { cn } from '@ui/utils/classname';
+import { createMemo, For, Show, Suspense } from 'solid-js';
+import { ListPropertyValue } from './list-property-value';
+import {
+ TASK_GRID_COLUMNS,
+ TASK_GRID_TEMPLATE_AREAS,
+ TASK_GRID_TEMPLATE_COLUMNS,
+ type TaskGridColumn,
+} from './task-grid-template';
+
+const EPOCH = new Date(0).toISOString();
+
+/**
+ * Build a placeholder Property for a column when the entity doesn't yet have
+ * the property attached. Lets the editor open and create the property on save.
+ */
+function buildStubProperty(col: TaskGridColumn): Property {
+ const stubSoup: SoupProperty = {
+ definition: {
+ id: col.defId,
+ display_name: col.label,
+ data_type: col.dataType,
+ is_metadata: false,
+ is_multi_select: col.isMultiSelect,
+ is_system: true,
+ owner: { scope: 'system' },
+ specific_entity_type: col.specificEntityType,
+ created_at: EPOCH,
+ updated_at: EPOCH,
+ },
+ };
+ return soupPropertyToProperty(stubSoup);
+}
+
+export function TaskGridLayout(props: LayoutProps) {
+ const currentId = useUserId();
+ const entity = () => props.entity as EntityWithProperties<EntityData>;
+
+ const propertyMap = createMemo(() => {
+ const map = new Map<string, Property>();
+ for (const sp of entity().properties ?? []) {
+ const property = soupPropertyToProperty(sp);
+ map.set(property.propertyDefinitionId, property);
+ }
+ return map;
+ });
+
+ const properties = createMemo(() => Array.from(propertyMap().values()));
+
+ const saveMutation = useBulkSaveEntityPropertiesMutation();
+
+ const saveOne = (property: Property, apiValues: PropertyApiValues) =>
+ saveMutation.mutateAsync({
+ properties: [
+ {
+ entityId: props.entity.id,
+ entityType: EntityType.TASK,
+ property,
+ apiValues,
+ },
+ ],
+ });
+
+ const saveHandler: PropertySaveHandler = {
+ saveProperty: (property, value) => saveOne(property, value),
+ saveDate: (property, date) =>
+ saveOne(property, { valueType: 'DATE', value: date }),
+ };
+
+ return (
+ <PropertiesProvider
+ entityType={EntityType.TASK}
+ canEdit={true}
+ properties={properties}
+ onRefresh={() => {}}
+ onPropertyAdded={() => {}}
+ onPropertyDeleted={() => {}}
+ saveHandler={saveHandler}
+ >
+ <Entity.Layout
+ class={cn(
+ 'task-grid-row w-full min-h-[inherit] items-center text-sm px-2',
+ 'gap-2 grid grid-rows-[1fr]'
+ )}
+ style={{
+ 'grid-template-columns': TASK_GRID_TEMPLATE_COLUMNS,
+ 'grid-template-areas': TASK_GRID_TEMPLATE_AREAS,
+ }}
+ >
+ <Entity.Slot placement="indicator" class="relative size-full group">
+ <div class="absolute inset-0 grid place-items-center group-hover:opacity-0">
+ <UnreadIndicator active={props.unread} />
+ </div>
+ <div
+ class={cn(
+ 'absolute inset-0 grid place-items-center opacity-0 group-hover:opacity-100',
+ {
+ 'opacity-100': props.checked,
+ }
+ )}
+ >
+ <MultiSelectCheckbox
+ checked={props.checked}
+ onChecked={props.onChecked}
+ />
+ </div>
+ </Entity.Slot>
+
+ <Entity.Slot
+ placement="content"
+ class="ph-no-capture font-semibold truncate items-center gap-2 flex min-w-0"
+ >
+ <div class="size-4 shrink-0">
+ <Entity.Icon
+ entity={props.entity}
+ streamState={props.streamState}
+ />
+ </div>
+ <span class="truncate min-w-0">
+ <Entity.Title entity={props.entity} />
+ </span>
+ <Show when={isProjectContainedEntity(props.entity) && props.entity}>
+ {(entity) => (
+ <span class="ph-no-capture text-ink text-xs shrink-0 truncate border border-edge-muted px-2 rounded-sm py-0.5">
+ <ProjectBreadCrumb
+ entity={entity()}
+ onClick={props.onProjectClick}
+ />
+ </span>
+ )}
+ </Show>
+ <Show when={props.entity.ownerId !== currentId()}>
+ <SharedBadgeSmall ownerId={props.entity.ownerId} />
+ </Show>
+ </Entity.Slot>
+
+ <For each={TASK_GRID_COLUMNS}>
+ {(col) => (
+ <Entity.Slot
+ placement={col.id}
+ class="flex items-center min-w-0 overflow-hidden text-xs ph-no-capture @container/slot"
+ >
+ <ListPropertyValue
+ property={
+ propertyMap().get(col.defId) ?? buildStubProperty(col)
+ }
+ />
+ </Entity.Slot>
+ )}
+ </For>
+
+ <Entity.Slot
+ placement="timestamp"
+ class="text-xs font-mono text-right text-ink-extra-muted uppercase font-light"
+ >
+ <Show when={!props.hasNotifications}>
+ <Entity.Timestamp entity={props.entity} />
+ </Show>
+ </Entity.Slot>
+ </Entity.Layout>
+ <Suspense>
+ <Modals />
+ </Suspense>
+ </PropertiesProvider>
+ );
+}
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-template.ts b/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-template.ts
new file mode 100644
index 0000000000..f10bd88b33
--- /dev/null
+++ b/js/app/packages/app/component/next-soup/soup-view/views/tasks/task-grid-template.ts
@@ -0,0 +1,44 @@
+import { SYSTEM_PROPERTY_IDS } from '@core/component/Properties/constants';
+import { DataType } from '@service-storage/generated/schemas/dataType';
+import { EntityType } from '@service-storage/generated/schemas/entityType';
+
+export const TASK_GRID_COLUMNS = [
+ {
+ id: 'status',
+ label: 'Status',
+ defId: SYSTEM_PROPERTY_IDS.STATUS,
+ dataType: DataType.SELECT_STRING,
+ isMultiSelect: false,
+ specificEntityType: null,
+ // CSS variable with fallback - updated by container queries in task-grid.css
+ width: 'var(--task-col-status, 7rem)',
+ },
+ {
+ id: 'priority',
+ label: 'Priority',
+ defId: SYSTEM_PROPERTY_IDS.PRIORITY,
+ dataType: DataType.SELECT_STRING,
+ isMultiSelect: false,
+ specificEntityType: null,
+ width: 'var(--task-col-priority, 7rem)',
+ },
+ {
+ id: 'assignees',
+ label: 'Assignees',
+ defId: SYSTEM_PROPERTY_IDS.ASSIGNEES,
+ dataType: DataType.ENTITY,
+ isMultiSelect: true,
+ specificEntityType: EntityType.USER,
+ width: 'var(--task-col-assignees, 7rem)',
+ },
+] as const;
+
+export type TaskGridColumn = (typeof TASK_GRID_COLUMNS)[number];
+
+export const TASK_GRID_TEMPLATE_COLUMNS = `1rem minmax(0, 100%) ${TASK_GRID_COLUMNS.map(
+ (c) => c.width
+).join(' ')} var(--task-col-timestamp, 5rem)`;
+
+export const TASK_GRID_TEMPLATE_AREAS = `"indicator content ${TASK_GRID_COLUMNS.map(
+ (c) => c.id
+).join(' ')} timestamp"`;
diff --git a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
index b4850d11b9..f2d51e0032 100644
--- a/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
+++ b/js/app/packages/app/component/property-edit-modal/PropertyEditorModal.tsx
@@ -75,7 +75,7 @@ function ListItem(props: {
class={cn(
'flex flex-row w-full justify-between items-center gap-2 py-1.5 px-2 scroll-my-1',
{
- 'bg-active': props.isSelected && !props.disabled,
+ 'bg-hover': props.isSelected && !props.disabled,
'opacity-50 cursor-not-allowed': props.disabled,
}
)}
@@ -330,9 +330,12 @@ function EditingEntityPreview(props: { entities: EntityData[] }) {
{(entity) => {
return (
<div
- class={cn('bg-edge px-2 py-1 truncate text-xs rounded-xs', {
- 'max-w-[50%]': props.entities.length === 2,
- })}
+ class={cn(
+ 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',
+ {
+ 'max-w-[50%]': props.entities.length === 2,
+ }
+ )}
>
<InlineEntity entity={entity} />
</div>
diff --git a/js/app/packages/app/component/split-layout/components/SplitToolbar.tsx b/js/app/packages/app/component/split-layout/components/SplitToolbar.tsx
index 3a2718b628..9d38cb39a2 100644
--- a/js/app/packages/app/component/split-layout/components/SplitToolbar.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitToolbar.tsx
@@ -53,13 +53,13 @@ export function SplitToolbar(props: { ref: Setter<HTMLDivElement | null> }) {
ref={props.ref}
>
<div
- class="flex-1 h-full flex items-center gap-0.5 px-2"
+ class="flex-1 h-full flex items-center gap-0.5 px-1"
ref={(ref) => {
panel.layoutRefs.toolbarLeft = ref;
}}
/>
<div
- class="flex h-full items-center gap-0.5 px-2"
+ class="flex h-full items-center gap-0.5 px-1.25"
ref={(ref) => {
panel.layoutRefs.toolbarRight = ref;
}}
diff --git a/js/app/packages/block-md/component/templates.ts b/js/app/packages/block-md/component/templates.ts
index 3ab33c37be..ac19b65841 100644
--- a/js/app/packages/block-md/component/templates.ts
+++ b/js/app/packages/block-md/component/templates.ts
@@ -72,7 +72,7 @@ A compelling introduction to your topic that hooks the reader and gives a brief
This article will help you understand [main benefit] by exploring [topic overview].
\n\n \n
## [Section 1 Heading]
-Main content for section 1. Include relevant information, examples, and insights.
+Main content for section 1. Include relevant information, examples, and insights.
\n\n \n
### [Subsection 1.1]
More detailed exploration of a specific aspect of section 1.
@@ -113,9 +113,9 @@ What will you try first? Share your experience in the comments below!
title: 'Meeting Notes: [DATE]',
content: `**Date:** [DATE]
**Time:** [HH:MM] - [HH:MM] [Timezone]
-**Location:** [Physical Location/Virtual Platform]
+**Location:** [Physical Location/Virtual Platform]
**Meeting Link:** [URL for recording/virtual meeting]
-**Attendees:**
+**Attendees:**
- [USER], [Role/Department]
- @attendee2, [Role/Department]
- @attendee3, [Role/Department]
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 a9472c7416..25357f5854 100644
--- a/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx
@@ -75,6 +75,7 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
hasChanges,
initializeSelectedOptions,
toggleOption,
+ clearOptions,
addOption,
} = usePropertyEditor(
props.property,
@@ -219,7 +220,7 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
}));
})}
class={cn(
- 'absolute border border-edge rounded sm z-action-menu max-h-96 overflow-hidden flex flex-col w-full max-w-sm'
+ 'absolute border border-edge rounded-md z-action-menu max-h-96 overflow-hidden flex flex-col w-full max-w-60 shadow-md shadow-drop-shadow'
)}
tabIndex={-1}
onClick={(e) => e.stopPropagation()}
@@ -308,6 +309,15 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
onAddOption={
props.property.isSystemProperty ? undefined : addOption
}
+ clearOption={
+ !props.property.isMultiSelect &&
+ !props.property.isRequired
+ ? {
+ label: `No ${props.property.displayName.toLowerCase()}`,
+ onClear: clearOptions,
+ }
+ : undefined
+ }
onClose={handleClose}
/>
</Show>
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 a88b73b3cd..5f7ac5e1d2 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,8 +1,10 @@
import { useKeyPressed } from '@core/util/useKeyPressed';
+import CircleDashedEmpty from '@icon/regular/circle-dashed.svg';
import SearchIcon from '@icon/regular/magnifying-glass.svg';
import PlusIcon from '@icon/regular/plus.svg';
import LoadingSpinner from '@icon/regular/spinner.svg';
-import { cn, Hotkey } from '@ui';
+import { Hotkey } from '@ui';
+import { cn } from '@ui/utils/classname';
import type { JSX, ParentComponent } from 'solid-js';
import {
type Accessor,
@@ -10,9 +12,11 @@ import {
createMemo,
createSignal,
For,
+ Match,
onCleanup,
onMount,
Show,
+ Switch,
} from 'solid-js';
import { useSearchInputFocus } from '../../../utils';
import { ERROR_MESSAGES } from '../../../utils/errorHandling';
@@ -95,7 +99,7 @@ type DropdownSearchInputProps = {
const DropdownSearchInput = (props: DropdownSearchInputProps) => {
return (
<div class="flex w-full items-center py-1 gap-2 px-2 border-b border-edge-muted">
- <SearchIcon class="size-4 text-ink-muted" />
+ <SearchIcon class="h-4 w-4 text-ink-muted" />
<input
class="w-full caret-accent"
ref={props.inputRef}
@@ -150,9 +154,16 @@ type SelectOptionsProps = {
selectedOptions: () => Set<string>;
onToggleOption: (value: string) => void;
onAddOption?: (value: string) => Promise<void>;
+ /** When provided, renders a "no value" item at the top of the list. */
+ clearOption?: { label: string; onClear: () => void };
onClose?: () => void;
};
+type SelectableItem =
+ | { type: 'option'; option: SelectableOption }
+ | { type: 'add' }
+ | { type: 'clear' };
+
export const PropertyOptionSelector = (props: SelectOptionsProps) => {
const [isAddingOption, setIsAddingOption] = createSignal(false);
@@ -183,7 +194,12 @@ export const PropertyOptionSelector = (props: SelectOptionsProps) => {
const item = selectableItems()[idx];
if (item?.type === 'add') {
handleAddOption();
- } else if (item?.type === 'option' && item.option) {
+ } else if (item?.type === 'clear') {
+ props.clearOption?.onClear();
+ if (!props.config.isMultiSelect && props.onClose) {
+ props.onClose();
+ }
+ } else if (item?.type === 'option') {
props.onToggleOption(item.option.id);
if (!props.config.isMultiSelect && props.onClose) {
props.onClose();
@@ -250,15 +266,22 @@ export const PropertyOptionSelector = (props: SelectOptionsProps) => {
return allOptions;
});
- // Get selectable items (filtered options + add option if available)
+ // Only show the clear item when the user isn't searching — searching by name
+ // matches the option list, not the synthetic "no value" entry.
+ const showClearItem = () =>
+ !!props.clearOption && !dropdown.searchQuery().trim();
+
+ // Get selectable items: optional clear + filtered options + optional add.
const selectableItems = createMemo(() => {
- const options = filteredOptions();
- const items: Array<{ type: 'option' | 'add'; option?: SelectableOption }> =
- [];
+ const items: SelectableItem[] = [];
- options.forEach((option) => {
+ if (showClearItem()) {
+ items.push({ type: 'clear' });
+ }
+
+ for (const option of filteredOptions()) {
items.push({ type: 'option', option });
- });
+ }
if (isValidNewOption() && props.onAddOption) {
items.push({ type: 'add' });
@@ -311,7 +334,7 @@ export const PropertyOptionSelector = (props: SelectOptionsProps) => {
when={!props.isLoading}
fallback={
<div class="flex items-center justify-center py-8">
- <div class="size-5 animate-spin">
+ <div class="w-5 h-5 animate-spin">
<LoadingSpinner />
</div>
<span class="ml-2 text-ink-muted">Loading options...</span>
@@ -356,7 +379,7 @@ export const PropertyOptionSelector = (props: SelectOptionsProps) => {
}
>
<div class="p-1">
- <div class="max-h-50 overflow-y-auto overflow-x-hidden scrollbar-hidden">
+ <div class="max-h-[200px] overflow-y-auto overflow-x-hidden scrollbar-hidden">
<Show
when={selectableItems().length > 0}
fallback={
@@ -366,63 +389,90 @@ export const PropertyOptionSelector = (props: SelectOptionsProps) => {
}
>
<For each={selectableItems()}>
- {(item, index) => (
- <Show
- when={item.type === 'add'}
- fallback={
- <DropdownSelectableRow
- isSelected={index() === dropdown.selectedIndex()}
- onClick={() => {
- if (item.option) {
- props.onToggleOption(item.option.id);
- if (
- !props.config.isMultiSelect &&
- props.onClose
- ) {
- props.onClose();
+ {(item, index) => {
+ const isSelected = () =>
+ index() === dropdown.selectedIndex();
+ const onMouseEnter = () => {
+ if (!dropdown.keyboardMode()) {
+ dropdown.setSelectedIndex(index());
+ }
+ };
+ return (
+ <Switch>
+ <Match when={item.type === 'option' ? item : false}>
+ {(optionItem) => (
+ <DropdownSelectableRow
+ isSelected={isSelected()}
+ onClick={() => {
+ props.onToggleOption(optionItem().option.id);
+ if (
+ !props.config.isMultiSelect &&
+ props.onClose
+ ) {
+ props.onClose();
+ }
+ }}
+ onMouseEnter={onMouseEnter}
+ showHotkey={
+ dropdown.shouldShowHotkeys() && index() < 9
}
- }
- }}
- onMouseEnter={() => {
- if (!dropdown.keyboardMode()) {
- dropdown.setSelectedIndex(index());
- }
- }}
- showHotkey={
- dropdown.shouldShowHotkeys() && index() < 9
- }
- hotkeyShortcut={`${index() + 1}`}
- rightContent={
- <Show when={props.config.isMultiSelect}>
- <OptionCheckBox
- checked={isOptionSelected(item.option!.id)}
- multiselect={props.config.isMultiSelect}
+ hotkeyShortcut={`${index() + 1}`}
+ rightContent={
+ <Show when={props.config.isMultiSelect}>
+ <OptionCheckBox
+ checked={isOptionSelected(
+ optionItem().option.id
+ )}
+ multiselect={props.config.isMultiSelect}
+ />
+ </Show>
+ }
+ >
+ <PropertyValueIcon
+ optionId={optionItem().option.id}
/>
- </Show>
- }
+ <div class="flex-1 min-w-0 text-left">
+ <p class="text-sm font-medium truncate">
+ {optionItem().option.label}
+ </p>
+ </div>
+ </DropdownSelectableRow>
+ )}
+ </Match>
+ <Match
+ when={item.type === 'clear' && props.clearOption}
>
- <PropertyValueIcon optionId={item.option!.id} />
- <div class="flex-1 min-w-0 text-left">
- <p class="text-sm font-medium truncate">
- {item.option!.label}
- </p>
+ {(clear) => (
+ <DropdownSelectableRow
+ isSelected={isSelected()}
+ onClick={() => {
+ clear().onClear();
+ if (
+ !props.config.isMultiSelect &&
+ props.onClose
+ ) {
+ props.onClose();
+ }
+ }}
+ onMouseEnter={onMouseEnter}
+ >
+ <CircleDashedEmpty class="size-3 shrink-0 text-ink-extra-muted" />
+ <div class="flex-1 min-w-0 text-left">
+ <p class="text-sm font-medium text-ink-muted truncate">
+ {clear().label}
+ </p>
+ </div>
+ </DropdownSelectableRow>
+ )}
+ </Match>
+ <Match when={item.type === 'add'}>
+ <div onMouseEnter={onMouseEnter}>
+ <AddOptionButton isSelected={isSelected()} />
</div>
- </DropdownSelectableRow>
- }
- >
- <div
- onMouseEnter={() => {
- if (!dropdown.keyboardMode()) {
- dropdown.setSelectedIndex(index());
- }
- }}
- >
- <AddOptionButton
- isSelected={index() === dropdown.selectedIndex()}
- />
- </div>
- </Show>
- )}
+ </Match>
+ </Switch>
+ );
+ }}
</For>
</Show>
</div>
diff --git a/js/app/packages/core/component/Properties/component/propertyValue/PropertyTooltip.tsx b/js/app/packages/core/component/Properties/component/propertyValue/PropertyTooltip.tsx
index 59d9b7d615..5652de7763 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/PropertyTooltip.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/PropertyTooltip.tsx
@@ -19,6 +19,7 @@ import LinkIcon from '@icon/regular/link.svg';
import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import { proxyResource } from '@service-unfurl/client';
+import { Layer } from '@ui';
import {
createSignal,
For,
@@ -76,41 +77,43 @@ const TooltipWrapper = (props: {
const singleSelect = () => !props.property.isMultiSelect;
const hasValue = () => propertyHasValue(props.property);
return (
- <Show
- when={hasValue()}
- fallback={
- <div class="p-2 border border-edge-muted bg-panel text-xs">
- No {props.property.displayName} set
- </div>
- }
- >
- <div
- 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(),
- }}
+ <Layer depth={2}>
+ <Show
+ when={hasValue()}
+ fallback={
+ <div class="p-2 border border-edge bg-panel text-xs rounded-sm shadow-md shadow-[#0001]">
+ No {props.property.displayName} set
+ </div>
+ }
>
<div
- class="flex items-center gap-2 text-ink-muted"
+ class="p-2 border border-edge bg-panel rounded-sm shadow-md shadow-[#0001]"
classList={{
- 'border-b border-edge-muted pb-1.5 mb-1.5': !singleSelect(),
+ 'flex flex-row gap-2 items-center': singleSelect(),
+ 'min-w-48 max-w-72': !singleSelect(),
}}
>
- <PropertyDataTypeIcon
- property={props.property}
- class="size-3.5 text-ink-muted"
- />
- <span class="text-xs">{props.property.displayName}</span>
+ <div
+ class="flex items-center gap-2 text-ink-muted"
+ classList={{
+ 'border-b border-edge pb-1.5 mb-1.5': !singleSelect(),
+ }}
+ >
+ <PropertyDataTypeIcon
+ property={props.property}
+ class="size-3.5 text-ink-muted"
+ />
+ <span class="text-xs">{props.property.displayName}</span>
+ </div>
+ {props.children}
</div>
- {props.children}
- </div>
- </Show>
+ </Show>
+ </Layer>
);
};
const ValueContainer = (props: { children: JSX.Element }) => (
- <div class="inline-flex items-center gap-1.5 px-2 py-1 text-xs leading-none text-ink-muted border border-edge-muted size-fit">
+ <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">
{props.children}
</div>
);
@@ -122,7 +125,7 @@ const StringTooltipContent = (props: {
<TooltipWrapper property={props.property}>
<div class="flex items-center gap-1.5 flex-wrap">
<ValueContainer>
- <span class="truncate max-w-37.5">{props.property.value}</span>
+ <span class="truncate max-w-[150px]">{props.property.value}</span>
</ValueContainer>
</div>
</TooltipWrapper>
@@ -139,7 +142,7 @@ const NumberTooltipContent = (props: {
<TooltipWrapper property={props.property}>
<div class="flex items-center gap-1.5 flex-wrap">
<ValueContainer>
- <span class="truncate max-w-37.5">{displayValue()}</span>
+ <span class="truncate max-w-[150px]">{displayValue()}</span>
</ValueContainer>
</div>
</TooltipWrapper>
@@ -173,7 +176,7 @@ const DateTooltipContent = (props: {
<TooltipWrapper property={props.property}>
<div class="flex items-center gap-1.5 flex-wrap">
<ValueContainer>
- <span class="truncate max-w-37.5">{displayValue()}</span>
+ <span class="truncate max-w-[150px]">{displayValue()}</span>
</ValueContainer>
</div>
</TooltipWrapper>
@@ -191,7 +194,7 @@ const SelectTooltipContent = (props: {
{(optionId, index) => (
<ValueContainer>
<SelectValueIcon property={props.property} valueIndex={index()} />
- <span class="truncate max-w-37.5">
+ <span class="truncate max-w-[150px]">
{formatPropertyValue(props.property, optionId)}
</span>
</ValueContainer>
@@ -252,7 +255,7 @@ const EntityValuePill = (props: { entity: EntityReference }) => {
return (
<ValueContainer>
<Show when={icon()}>{icon()}</Show>
- <span class="truncate max-w-37.5">{name()}</span>
+ <span class="truncate max-w-[150px]">{name()}</span>
</ValueContainer>
);
};
@@ -269,7 +272,7 @@ const UserEntityItem = (props: { entity: EntityReference }) => {
<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-37.5">{name()}</span>
+ <span class="truncate max-w-[150px]">{name()}</span>
</ValueContainer>
);
};
@@ -313,7 +316,7 @@ const LinkValuePill = (props: { url: string }) => {
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 size-fit"
+ 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}
>
<Show
@@ -328,7 +331,7 @@ const LinkValuePill = (props: { url: string }) => {
onError={() => setImageError(true)}
/>
</Show>
- <span class="truncate max-w-37.5">{title()}</span>
+ <span class="truncate max-w-[150px]">{title()}</span>
</a>
);
};
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 18e8a3ffd2..b42d5867a6 100644
--- a/js/app/packages/core/component/Properties/component/propertyValue/SelectValue.tsx
+++ b/js/app/packages/core/component/Properties/component/propertyValue/SelectValue.tsx
@@ -22,6 +22,7 @@ export const SelectValue: Component<PropertyValueProps> = (props) => {
const handleClick = (e: MouseEvent) => {
if (props.canEdit && !props.property.isMetadata) {
+ e.stopPropagation();
props.onEdit?.(props.property, e.currentTarget as HTMLElement);
}
};
diff --git a/js/app/packages/core/component/Properties/hooks/usePropertyEditor.ts b/js/app/packages/core/component/Properties/hooks/usePropertyEditor.ts
index 265ba4b593..6f87a2aa37 100644
--- a/js/app/packages/core/component/Properties/hooks/usePropertyEditor.ts
+++ b/js/app/packages/core/component/Properties/hooks/usePropertyEditor.ts
@@ -13,6 +13,7 @@ export interface PropertyEditorReturn {
hasChanges: Accessor<boolean>;
initializeSelectedOptions: () => void;
toggleOption: (optionValue: string) => void;
+ clearOptions: () => void;
addOption: (value: string) => Promise<void>;
}
@@ -80,6 +81,14 @@ export function usePropertyEditor(
});
};
+ const clearOptions = () => {
+ setLocalState((prev) => ({
+ ...prev,
+ selectedOptions: new Set(),
+ hasChanges: true,
+ }));
+ };
+
const addOption = async (value: string) => {
const currentOptions = propertyOptions();
const nextDisplayOrder =
@@ -151,6 +160,7 @@ export function usePropertyEditor(
hasChanges: () => localState().hasChanges,
initializeSelectedOptions,
toggleOption,
+ clearOptions,
addOption,
};
}
diff --git a/js/app/packages/core/component/Properties/types.ts b/js/app/packages/core/component/Properties/types.ts
index be3f58233b..c28046c055 100644
--- a/js/app/packages/core/component/Properties/types.ts
+++ b/js/app/packages/core/component/Properties/types.ts
@@ -50,6 +50,9 @@ export type Property = {
isMultiSelect: boolean;
isMetadata?: boolean;
isSystemProperty?: boolean;
+ /** Property must always have a value — disables the "No <name>" clear
+ * affordance in single-select editors. */
+ isRequired?: boolean;
options?: PropertyOption[];
owner: PropertyOwner;
specificEntityType?: EntityType | null;
diff --git a/js/app/packages/entity/src/components/Badges.tsx b/js/app/packages/entity/src/components/Badges.tsx
index ef0131721e..140d9f4ccb 100644
--- a/js/app/packages/entity/src/components/Badges.tsx
+++ b/js/app/packages/entity/src/components/Badges.tsx
@@ -1,4 +1,7 @@
+import { Tooltip } from '@core/component/Tooltip';
import { UserIcon } from '@core/component/UserIcon';
+import { tryMacroId, useDisplayName } from '@core/user';
+import UserPlus from '@icon/fill/user-plus-fill.svg';
import { cn } from '@ui';
import type { ParentProps } from 'solid-js';
@@ -25,6 +28,38 @@ export function SharedBadge(props: { ownerId: string }) {
);
}
+export function SharedBadgeSmall(props: { ownerId: string }) {
+ const id = () => tryMacroId(props.ownerId);
+ const name = () => {
+ const currentId = id();
+ if (currentId) {
+ let [name] = useDisplayName(currentId);
+ return name;
+ }
+ return () => undefined;
+ };
+
+ return (
+ <Tooltip
+ tooltip={
+ <div class="flex items-center gap-1.5 text-xs">
+ <UserIcon
+ id={props.ownerId}
+ size="sm"
+ suppressClick
+ showTooltip={false}
+ />
+ <span>{name()()} shared this with you</span>
+ </div>
+ }
+ >
+ <div class="text-ink-extra-muted/50 p-1">
+ <UserPlus class="size-4" />
+ </div>
+ </Tooltip>
+ );
+}
+
export function DraftBadge() {
return <Badge class="text-accent-30 border-edge-muted px-2">draft</Badge>;
}
diff --git a/js/app/packages/entity/src/composed/ListEntity.tsx b/js/app/packages/entity/src/composed/ListEntity.tsx
index 76fdbb857d..ee62f64556 100644
--- a/js/app/packages/entity/src/composed/ListEntity.tsx
+++ b/js/app/packages/entity/src/composed/ListEntity.tsx
@@ -3,7 +3,6 @@ import { EntityRow, EntityRowContext } from '@app/component/mobile/EntityRow';
import { useSplitPanel } from '@app/component/split-layout/layoutUtils';
import { useFeatureFlag } from '@app/lib/analytics/posthog';
import { isMobile } from '@core/mobile/isMobile';
-import type { DateValue } from '@core/util/date';
import { stackNotifications } from '@notifications';
import {
BULK_DOCUMENT_WAKEUP_FEATURE_FLAG,
@@ -22,7 +21,6 @@ import {
createSignal,
type JSX,
Match,
- type Ref,
Show,
Switch,
useContext,
@@ -33,17 +31,9 @@ import {
isHitSnippetComplete,
isSnippetEntity,
} from '../extractors-search/snippet-entity';
-import {
- type EntityData,
- isChannelEntity,
- isEmailEntity,
- type ProjectEntity,
-} from '../types/entity';
-import {
- isWithNotification,
- type WithNotification,
-} from '../types/notification';
-import { isSearchEntity, type SearchLocation } from '../types/search';
+import { isChannelEntity, isEmailEntity } from '../types/entity';
+import { isWithNotification } from '../types/notification';
+import { isSearchEntity } from '../types/search';
import { createEntityDraggable } from '../utils/draggable';
import { unreadFilterFn } from '../utils/filter';
import {
@@ -54,6 +44,7 @@ import { useIsShared } from '../utils/shared';
import { NarrowInboxLayout } from './list-entity/narrow-inbox-layout';
import { NarrowLayout } from './list-entity/narrow-layout';
import {
+ type BaseListEntityProps,
hasSearchContentHits,
InboxDivider,
type LayoutProps,
@@ -64,27 +55,8 @@ import { WideLayout } from './list-entity/wide-layout';
export { ListLayoutProvider } from './list-entity/shared';
-interface ListEntityProps {
- entity: WithNotification<EntityData>;
- onClick?: (event: MouseEvent) => void;
- timestamp?: DateValue | null;
- ref?: Ref<HTMLDivElement>;
- checked?: boolean;
- highlighted?: boolean;
- hovered?: boolean;
- hideContentHits?: boolean;
- onChecked?: (checked: boolean, shiftKey: boolean) => void;
- onMouseMove?: () => void;
+interface ListEntityProps extends BaseListEntityProps {
showUnrollNotifications?: boolean;
- onProjectClick?: (
- entity: ProjectEntity,
- e: PointerEvent | MouseEvent
- ) => void;
- onContentHitClick?: (
- e: PointerEvent | MouseEvent,
- location?: SearchLocation
- ) => void;
- entityRowConfig?: EntityRowConfig;
}
function MaybeEntityRow(props: {
@@ -214,11 +186,11 @@ export function ListEntity(props: ListEntityProps) {
'soup-list-entity @container/entity w-full relative group/narrow flex flex-col',
{
'min-h-10': !isMobile(),
- 'bg-accent/5': props.checked,
+ 'bg-accent/8': props.checked,
'hover:bg-hover group-data-expanded/cm-trigger:bg-hover':
!props.checked && !props.highlighted && !props.hovered,
'bg-hover': props.hovered && !props.highlighted && !props.checked,
- 'bg-accent/5 outline-1 outline-accent/20 -outline-offset-1':
+ 'bg-accent/8 outline-1 outline-accent/20 -outline-offset-1':
props.highlighted && !isMobile(),
}
)}
diff --git a/js/app/packages/entity/src/composed/list-entity/shared.tsx b/js/app/packages/entity/src/composed/list-entity/shared.tsx
index 88a412770f..704e95000e 100644
--- a/js/app/packages/entity/src/composed/list-entity/shared.tsx
+++ b/js/app/packages/entity/src/composed/list-entity/shared.tsx
@@ -1,3 +1,4 @@
+import type { DateValue } from '@core/util/date';
import type { StreamEvent } from '@service-connection/generated/schemas';
import { createElementSize } from '@solid-primitives/resize-observer';
import {
@@ -7,13 +8,37 @@ import {
createSignal,
type JSX,
onCleanup,
+ type Ref,
useContext,
} from 'solid-js';
+import type { EntityRowConfig } from '../../extractors-notification';
import type { EntityData, ProjectEntity } from '../../types/entity';
import type { WithNotification } from '../../types/notification';
-import type { ContentHitData } from '../../types/search';
+import type { ContentHitData, SearchLocation } from '../../types/search';
import { isSearchEntity } from '../../types/search';
+export interface BaseListEntityProps<E extends EntityData = EntityData> {
+ entity: WithNotification<E>;
+ onClick?: (event: MouseEvent) => void;
+ timestamp?: DateValue | null;
+ ref?: Ref<HTMLDivElement>;
+ checked?: boolean;
+ highlighted?: boolean;
+ hovered?: boolean;
+ hideContentHits?: boolean;
+ onChecked?: (checked: boolean, shiftKey: boolean) => void;
+ onMouseMove?: () => void;
+ onProjectClick?: (
+ entity: ProjectEntity,
+ e: PointerEvent | MouseEvent
+ ) => void;
+ onContentHitClick?: (
+ e: PointerEvent | MouseEvent,
+ location?: SearchLocation
+ ) => void;
+ entityRowConfig?: EntityRowConfig;
+}
+
export const WIDE_BREAKPOINT = 512; // @lg container query = 32rem
export interface LayoutProps {
diff --git a/js/app/packages/entity/src/extractors-property/property-helpers.ts b/js/app/packages/entity/src/extractors-property/property-helpers.ts
index c14fb8af2e..7ba85c73fd 100644
--- a/js/app/packages/entity/src/extractors-property/property-helpers.ts
+++ b/js/app/packages/entity/src/extractors-property/property-helpers.ts
@@ -149,6 +149,7 @@ export function soupPropertyToProperty(soupProperty: SoupProperty): Property {
isMultiSelect: definition.is_multi_select,
isMetadata: definition.is_metadata,
isSystemProperty: definition.is_system,
+ isRequired: definition.id === SYSTEM_PROPERTY_IDS.STATUS,
options,
owner: definition.owner,
specificEntityType: definition.specific_entity_type,
diff --git a/js/app/packages/ui/components/Avatar.tsx b/js/app/packages/ui/components/Avatar.tsx
index cb20183281..42af6fff7f 100644
--- a/js/app/packages/ui/components/Avatar.tsx
+++ b/js/app/packages/ui/components/Avatar.tsx
@@ -130,9 +130,9 @@ const GROUP_OVERLAP_CLASSES: Record<AvatarGroupSize, string> = {
* Ring classes applied to child avatars for separation.
*/
const GROUP_RING_CLASSES: Record<AvatarGroupSize, string> = {
- sm: '*:data-[slot=avatar]:ring-1',
- md: '*:data-[slot=avatar]:ring-2',
- lg: '*:data-[slot=avatar]:ring-2',
+ sm: '**:data-[slot=avatar]:ring-1',
+ md: '**:data-[slot=avatar]:ring-2',
+ lg: '**:data-[slot=avatar]:ring-2',
};
/**
@@ -165,7 +165,7 @@ export function AvatarGroup(props: AvatarGroupProps) {
'isolate flex w-fit shrink-0 items-center',
GROUP_OVERLAP_CLASSES[size()],
GROUP_RING_CLASSES[size()],
- '*:data-[slot=avatar]:ring-(--avatar-group-separator,var(--color-panel))',
+ '**:data-[slot=avatar]:ring-(--avatar-group-separator,var(--color-panel))',
local.class
)}
{...others}