Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(properties): align unpin action with hover-card values (#8845)
dev-rb998a529d0957
diff --git a/apps/web/src/features/block-md/component/InlinePropertyValue.test.tsx b/apps/web/src/features/block-md/component/InlinePropertyValue.test.tsxindex 3fbb45f86b..b3949a894d 100644--- a/apps/web/src/features/block-md/component/InlinePropertyValue.test.tsx+++ b/apps/web/src/features/block-md/component/InlinePropertyValue.test.tsx@@ -12,8 +12,14 @@ import { afterEach, expect, it, vi } from 'vitest';import { InlinePropertyValue } from './InlinePropertyValue';vi.mock('@property/component/PropertyValuePill', () => ({- PropertyValuePill: (props: { hoverActions?: JSX.Element }) => (- <div>{props.hoverActions}</div>+ PropertyValuePill: (props: {+ hoverActions?: JSX.Element;+ hoverTrailingAction?: JSX.Element;+ }) => (+ <div>+ {props.hoverTrailingAction}+ {props.hoverActions}+ </div>),}));vi.mock('@property/editor/state/propertyEditor', () => ({diff --git a/apps/web/src/features/block-md/component/InlinePropertyValue.tsx b/apps/web/src/features/block-md/component/InlinePropertyValue.tsxindex fe2ee93c98..74c0ac7f29 100644--- a/apps/web/src/features/block-md/component/InlinePropertyValue.tsx+++ b/apps/web/src/features/block-md/component/InlinePropertyValue.tsx@@ -1,10 +1,11 @@-import PushPinSlashIcon from '@phosphor/push-pin-slash.svg';import TrashIcon from '@phosphor/trash.svg';+import PushPinSlashIcon from '@phosphor-fill/push-pin-slash-fill.svg';import { PropertyValuePill } from '@property/component/PropertyValuePill';import { SYSTEM_PROPERTY_IDS } from '@property/constants';import { usePropertiesContext } from '@property/context/PropertiesContext';import { openPropertyEditor } from '@property/editor/state/propertyEditor';import type { Property as PropertyT } from '@property/types';+import { Button } from '@ui';import { type Component, createSignal, type JSX, Show } from 'solid-js';type InlinePropertyValueProps = {@@ -30,6 +31,25 @@ export const InlinePropertyValue: Component<InlinePropertyValueProps> = (const ctx = usePropertiesContext();const usesInlineEditor = () =>['STRING', 'NUMBER', 'BOOLEAN', 'LINK'].includes(props.property.valueType);+ const canManage = () =>+ props.canManage && ctx.canEdit && !props.property.isMetadata;+ const [removing, setRemoving] = createSignal(false);+ const remove = async () => {+ if (!ctx.removeProperty || removing()) return;+ setRemoving(true);+ try {+ await ctx.removeProperty(props.property.propertyId);+ ctx.onPropertyUnpinned?.(+ props.property.propertyId,+ props.property.propertyDefinitionId+ );+ ctx.onPropertyDeleted();+ } catch {+ // The shared removal mutation reports the failure and keeps the property.+ } finally {+ setRemoving(false);+ }+ };return (<PropertyValuePill@@ -66,70 +86,37 @@ export const InlinePropertyValue: Component<InlinePropertyValueProps> = (}class={props.class}emptyLabel={props.emptyLabel}+ hoverTrailingAction={+ <Show when={canManage()}>+ <Button+ size="icon-sm"+ label="Unpin"+ disabled={removing()}+ onClick={() =>+ ctx.onPropertyUnpinned?.(+ props.property.propertyId,+ props.property.propertyDefinitionId+ )+ }+ >+ <PushPinSlashIcon />+ </Button>+ </Show>+ }hoverActions={- <Show- when={props.canManage && ctx.canEdit && !props.property.isMetadata}- >- <InlinePropertyActions- property={props.property}- canRemove={props.canRemove}- />+ <Show when={canManage() && props.canRemove !== false}>+ <button+ type="button"+ class="flex w-full min-w-0 items-center gap-2 whitespace-nowrap rounded-md px-2 py-1.5 text-left text-failure-ink hover:bg-hover disabled:opacity-50"+ disabled={removing()}+ onClick={remove}+ >+ <TrashIcon class="size-3.5 shrink-0" />+ {removing() ? 'Deleting…' : 'Delete from item'}+ </button></Show>}entitySelfFilter={{ entityType: ctx.entityType, blockId: props.entityId }}/>);};--function InlinePropertyActions(props: {- property: PropertyT;- canRemove?: boolean;-}) {- const ctx = usePropertiesContext();- const [removing, setRemoving] = createSignal(false);- const remove = async () => {- if (!ctx.removeProperty || removing()) return;- setRemoving(true);- try {- await ctx.removeProperty(props.property.propertyId);- ctx.onPropertyUnpinned?.(- props.property.propertyId,- props.property.propertyDefinitionId- );- ctx.onPropertyDeleted();- } catch {- // The shared removal mutation reports the failure and keeps the property.- } finally {- setRemoving(false);- }- };- return (- <div class="flex min-w-40 flex-col gap-0.5 text-ink">- <button- type="button"- class="flex w-full min-w-0 items-center gap-2 whitespace-nowrap rounded-md px-2 py-1.5 text-left hover:bg-hover disabled:opacity-50"- disabled={removing()}- onClick={() =>- ctx.onPropertyUnpinned?.(- props.property.propertyId,- props.property.propertyDefinitionId- )- }- >- <PushPinSlashIcon class="size-3.5 shrink-0 text-ink-muted" />- Unpin- </button>- <Show when={props.canRemove !== false}>- <button- type="button"- class="flex w-full min-w-0 items-center gap-2 whitespace-nowrap rounded-md px-2 py-1.5 text-left text-failure-ink hover:bg-hover disabled:opacity-50"- disabled={removing()}- onClick={remove}- >- <TrashIcon class="size-3.5 shrink-0" />- {removing() ? 'Deleting…' : 'Delete from item'}- </button>- </Show>- </div>- );-}diff --git a/apps/web/src/features/property/component/PropertyValuePill.tsx b/apps/web/src/features/property/component/PropertyValuePill.tsxindex 0aa5cba536..82446f5053 100644--- a/apps/web/src/features/property/component/PropertyValuePill.tsx+++ b/apps/web/src/features/property/component/PropertyValuePill.tsx@@ -10,6 +10,7 @@ type PropertyValuePillProps = Pick<showLabel?: boolean;class?: string;hoverActions?: JSX.Element;+ hoverTrailingAction?: JSX.Element;entitySelfFilter?: ComponentProps<typeof Property.PopoverEditor>['entitySelfFilter'];@@ -31,7 +32,11 @@ export function PropertyValuePill(props: PropertyValuePillProps) {onRefresh={props.onRefresh}onEdit={props.onEdit}>- <Property.Tooltip property={props.property} actions={props.hoverActions}>+ <Property.Tooltip+ property={props.property}+ actions={props.hoverActions}+ trailingAction={props.hoverTrailingAction}+ ><Property.Pill class={props.class} variant="outline"><Show when={props.showLabel && hasValue(props.property)}><span class="shrink-0 text-ink-muted">diff --git a/apps/web/src/features/property/component/propertyValue/PropertyTooltip.tsx b/apps/web/src/features/property/component/propertyValue/PropertyTooltip.tsxindex c8c100a4bf..fe4f58b417 100644--- a/apps/web/src/features/property/component/propertyValue/PropertyTooltip.tsx+++ b/apps/web/src/features/property/component/propertyValue/PropertyTooltip.tsx@@ -19,6 +19,7 @@ import {import type { EntityReference } from '@service-properties/generated/schemas/entityReference';import { proxyResource } from '@service-unfurl/client';import {+ children,createSignal,For,type JSX,@@ -31,6 +32,7 @@ import { PropertyValueIcon } from './PropertyValueIcon';type PropertyTooltipProps = ParentProps<{property: Property;+ trailingAction?: JSX.Element;}>;/**@@ -39,45 +41,53 @@ type PropertyTooltipProps = ParentProps<{*/export const PropertyTooltip = (props: PropertyTooltipProps): JSX.Element => {return (- <Switch>- <Match when={isStringProperty(props.property) && props.property}>- {(property) => <StringTooltipContent property={property()} />}- </Match>- <Match when={isNumberProperty(props.property) && props.property}>- {(property) => <NumberTooltipContent property={property()} />}- </Match>- <Match when={isBooleanProperty(props.property) && props.property}>- {(property) => <BooleanTooltipContent property={property()} />}- </Match>- <Match when={isDateProperty(props.property) && props.property}>- {(property) => <DateTooltipContent property={property()} />}- </Match>- <Match when={isSelectProperty(props.property) && props.property}>- {(property) => <SelectTooltipContent property={property()} />}- </Match>- <Match when={isEntityProperty(props.property) && props.property}>- {(property) => <EntityTooltipContent property={property()} />}- </Match>- <Match when={isLinkProperty(props.property) && props.property}>- {(property) => <LinkTooltipContent property={property()} />}- </Match>- </Switch>+ <TooltipWrapper+ property={props.property}+ trailingAction={props.trailingAction}+ >+ <Switch>+ <Match when={isStringProperty(props.property) && props.property}>+ {(property) => <StringTooltipContent property={property()} />}+ </Match>+ <Match when={isNumberProperty(props.property) && props.property}>+ {(property) => <NumberTooltipContent property={property()} />}+ </Match>+ <Match when={isBooleanProperty(props.property) && props.property}>+ {(property) => <BooleanTooltipContent property={property()} />}+ </Match>+ <Match when={isDateProperty(props.property) && props.property}>+ {(property) => <DateTooltipContent property={property()} />}+ </Match>+ <Match when={isSelectProperty(props.property) && props.property}>+ {(property) => <SelectTooltipContent property={property()} />}+ </Match>+ <Match when={isEntityProperty(props.property) && props.property}>+ {(property) => <EntityTooltipContent property={property()} />}+ </Match>+ <Match when={isLinkProperty(props.property) && props.property}>+ {(property) => <LinkTooltipContent property={property()} />}+ </Match>+ </Switch>+ </TooltipWrapper>);};/*** Shared tooltip wrapper with consistent header styling*/-const TooltipWrapper = (props: {- property: Property;- children: JSX.Element;-}) => {+const TooltipWrapper = (props: PropertyTooltipProps) => {const singleSelect = () => !props.property.isMultiSelect;const hasValue = () => propertyHasValue(props.property);+ const trailingAction = children(() => props.trailingAction);return (<Showwhen={hasValue()}- fallback={<div class="text-xs">No {props.property.displayName} set</div>}+ fallback={+ <div class="flex min-w-0 items-center gap-4">+ <div class="text-xs">No {props.property.displayName} set</div>+ {trailingAction()}+ </div>+ }><divclassList={{@@ -86,18 +96,26 @@ const TooltipWrapper = (props: {}}><div- class="flex items-center gap-2 text-ink-muted"+ class="flex min-w-0 items-center gap-4"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 class="flex min-w-0 items-center gap-2 text-ink-muted">+ <PropertyDataTypeIcon+ property={props.property}+ class="size-3.5 shrink-0 text-ink-muted"+ />+ <span class="min-w-0 text-xs">{props.property.displayName}</span>+ </div>+ <Show when={!singleSelect() && trailingAction.toArray().length > 0}>+ <div class="ml-auto shrink-0">{trailingAction()}</div>+ </Show></div>{props.children}+ <Show when={singleSelect() && trailingAction.toArray().length > 0}>+ <div class="ml-2 shrink-0">{trailingAction()}</div>+ </Show></div></Show>);@@ -113,13 +131,11 @@ const StringTooltipContent = (props: {property: Property & { valueType: 'STRING' };}) => {return (- <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>- </ValueContainer>- </div>- </TooltipWrapper>+ <div class="flex items-center gap-1.5 flex-wrap">+ <ValueContainer>+ <span class="truncate max-w-37.5">{props.property.value}</span>+ </ValueContainer>+ </div>);};@@ -130,13 +146,11 @@ const NumberTooltipContent = (props: {formatPropertyValue(props.property, props.property.value);return (- <TooltipWrapper property={props.property}>- <div class="flex items-center gap-1.5 flex-wrap">- <ValueContainer>- <span class="truncate max-w-37.5">{displayValue()}</span>- </ValueContainer>- </div>- </TooltipWrapper>+ <div class="flex items-center gap-1.5 flex-wrap">+ <ValueContainer>+ <span class="truncate max-w-37.5">{displayValue()}</span>+ </ValueContainer>+ </div>);};@@ -147,13 +161,11 @@ const BooleanTooltipContent = (props: {formatPropertyValue(props.property, props.property.value);return (- <TooltipWrapper property={props.property}>- <div class="flex items-center gap-1.5 flex-wrap">- <ValueContainer>- <span>{displayValue()}</span>- </ValueContainer>- </div>- </TooltipWrapper>+ <div class="flex items-center gap-1.5 flex-wrap">+ <ValueContainer>+ <span>{displayValue()}</span>+ </ValueContainer>+ </div>);};@@ -164,13 +176,11 @@ const DateTooltipContent = (props: {formatPropertyValue(props.property, props.property.value);return (- <TooltipWrapper property={props.property}>- <div class="flex items-center gap-1.5 flex-wrap">- <ValueContainer>- <span class="truncate max-w-37.5">{displayValue()}</span>- </ValueContainer>- </div>- </TooltipWrapper>+ <div class="flex items-center gap-1.5 flex-wrap">+ <ValueContainer>+ <span class="truncate max-w-37.5">{displayValue()}</span>+ </ValueContainer>+ </div>);};@@ -179,20 +189,18 @@ const SelectTooltipContent = (props: {}) => {const values = () => props.property.value ?? [];return (- <TooltipWrapper property={props.property}>- <div class="flex items-center gap-1.5 flex-wrap">- <For each={values()}>- {(optionId, index) => (- <ValueContainer>- <SelectValueIcon property={props.property} valueIndex={index()} />- <span class="truncate max-w-37.5">- {formatPropertyValue(props.property, optionId)}- </span>- </ValueContainer>- )}- </For>- </div>- </TooltipWrapper>+ <div class="flex items-center gap-1.5 flex-wrap">+ <For each={values()}>+ {(optionId, index) => (+ <ValueContainer>+ <SelectValueIcon property={props.property} valueIndex={index()} />+ <span class="truncate max-w-37.5">+ {formatPropertyValue(props.property, optionId)}+ </span>+ </ValueContainer>+ )}+ </For>+ </div>);};@@ -215,24 +223,22 @@ const EntityTooltipContent = (props: {const isUserType = () => props.property.specificEntityType === 'USER';return (- <TooltipWrapper property={props.property}>- <div class="flex items-center gap-1.5 flex-wrap">- <Switch>- <Match when={isUserType()}>- <div class="flex flex-col gap-1.5">- <For each={entities()}>- {(entity) => <UserEntityItem entity={entity} />}- </For>- </div>- </Match>- <Match when={!isUserType()}>+ <div class="flex items-center gap-1.5 flex-wrap">+ <Switch>+ <Match when={isUserType()}>+ <div class="flex flex-col gap-1.5"><For each={entities()}>- {(entity) => <EntityValuePill entity={entity} />}+ {(entity) => <UserEntityItem entity={entity} />}</For>- </Match>- </Switch>- </div>- </TooltipWrapper>+ </div>+ </Match>+ <Match when={!isUserType()}>+ <For each={entities()}>+ {(entity) => <EntityValuePill entity={entity} />}+ </For>+ </Match>+ </Switch>+ </div>);};@@ -274,11 +280,9 @@ const LinkTooltipContent = (props: {const links = () => props.property.value ?? [];return (- <TooltipWrapper property={props.property}>- <div class="flex items-center gap-1.5 flex-wrap">- <For each={links()}>{(url) => <LinkValuePill url={url} />}</For>- </div>- </TooltipWrapper>+ <div class="flex items-center gap-1.5 flex-wrap">+ <For each={links()}>{(url) => <LinkValuePill url={url} />}</For>+ </div>);};diff --git a/apps/web/src/features/property/extractors/PropertyTooltip.tsx b/apps/web/src/features/property/extractors/PropertyTooltip.tsxindex 640940242d..a6568cb349 100644--- a/apps/web/src/features/property/extractors/PropertyTooltip.tsx+++ b/apps/web/src/features/property/extractors/PropertyTooltip.tsx@@ -7,6 +7,7 @@ import type { Property } from '../types';type Props = {property: Property;children: JSX.Element;+ trailingAction?: JSX.Element;actions?: JSX.Element;};@@ -23,14 +24,19 @@ type Props = {export function PropertyTooltip(props: Props) {const ctx = useContext(PropertyRootContext);const actions = children(() => props.actions);- const hasActions = () => actions.toArray().length > 0;+ const trailingAction = children(() => props.trailingAction);+ const hasActions = () =>+ actions.toArray().length > 0 || trailingAction.toArray().length > 0;return (<HoverCardtriggerClass="min-w-0 max-w-full"content={<div class="min-w-0">- <CorePropertyTooltip property={props.property} />- <Show when={hasActions()}>+ <CorePropertyTooltip+ property={props.property}+ trailingAction={trailingAction()}+ />+ <Show when={actions.toArray().length > 0}><div class="mt-2 border-t border-edge-muted pt-1.5">{actions()}</div>diff --git a/docs/agent-guide/documents.md b/docs/agent-guide/documents.mdindex 9e01c3d7a5..f3f8df1934 100644--- a/docs/agent-guide/documents.md+++ b/docs/agent-guide/documents.md@@ -99,12 +99,17 @@ being assigned, except the task's default Project placeholder. Long values truncor wrap within the value column withoutcovering the pin or remove controls.Escape cancels an inline text or number draft without saving it.-Hover or focus an inline property pill to find **Unpin** (keeps its saved-value) and **Delete from item** where removal is allowed (removes the assignment,-without deleting the shared property definition). Task builtins cannot be deleted-from these pills. Pins are saved with the document, including an explicitly empty-pin list. Tasks initially show Status, Priority, Assignees, and Project when enabled;-changing pins keeps the other defaults unless they are explicitly unpinned.+Hover or focus an inline property pill to find a filled, icon-only **Unpin**+button separated by a gap (keeps its saved value). In a single-row hover card,+it sits to the right of the value. In a column hover card, it sits to the right+of the key, above a full-width divider; values keep the full width below.+Long keys wrap without displacing the Unpin button.+**Delete from item** stays below, where removal is allowed (removes the+assignment without deleting the shared property definition). Task builtins cannot+be deleted from these pills. Pins are saved with the document, including an+explicitly empty pin list. Tasks initially show Status, Priority, Assignees, and+Project when enabled; changing pins keeps the other defaults unless they are+explicitly unpinned.Markdown code blocks have a **Copy Code** button in both editable and read-onlyviews. Successful copies briefly animate the icon to a solid green check-circle;diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.mdindex e5afe8c201..a944dacc40 100644--- a/docs/agent-guide/tasks.md+++ b/docs/agent-guide/tasks.md@@ -104,8 +104,10 @@ instead. Keyboard list navigation only moves focus; press Enter to open the focuIn the task's Properties side panel, hover or focus a row for **Pin below title**or **Unpin from title**. Pinning adds the property to the title row; unpinning keeps-its saved value and the side-panel row. The title pill's hover menu also offers-**Unpin**. Status, Priority, and Assignees are pinned by default, with Project when+its saved value and the side-panel row. The title pill's hover card also offers+**Unpin** as a filled icon-only button with a gap: beside the value in a row,+or beside the key above a full-width divider in a column.+Status, Priority, and Assignees are pinned by default, with Project whenenabled. Unpinning a default preserves the other pins, and clearing all pins stayscleared after reopening. The empty Project placeholder can also be pinned orunpinned without creating an assignment; its pin follows the real assignment when