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(tasks): stabilize live tags and improve light-theme contrast (#9400)
dev-rbade72a29143a
diff --git a/apps/web/src/components/icon/system/README.md b/apps/web/src/components/icon/system/README.mdindex c4991e6d4a..712f9f16cb 100644--- a/apps/web/src/components/icon/system/README.md+++ b/apps/web/src/components/icon/system/README.md@@ -87,7 +87,7 @@ Task statuses use independent `task-status-not-started`, `task-status-in-progres`task-status-in-review`, `task-status-completed`, and `task-status-canceled` themetokens for icons and group-header tints. Their defaults are muted gray, blendedamber, violet, accent, and muted gray respectively. In Progress mixes amber with-`content-0` in sRGB: 80% amber in dark mode and 50% in light mode, improving contrast+`content-0` in sRGB: 80% amber in dark mode and 85% in light mode, improving contrastwithout rotating amber toward a tinted foreground's hue. Authored overrides stayunchanged.Status and Priority option glyphs share a 12 px default, including title propertydiff --git a/apps/web/src/components/priority-collapse/PriorityCollapseOverflowSensor.tsx b/apps/web/src/components/priority-collapse/PriorityCollapseOverflowSensor.tsxindex adf8234cf7..9b9a8315b4 100644--- a/apps/web/src/components/priority-collapse/PriorityCollapseOverflowSensor.tsx+++ b/apps/web/src/components/priority-collapse/PriorityCollapseOverflowSensor.tsx@@ -128,6 +128,7 @@ export function PriorityCollapseOverflowSensor(props.controller.collapser.register({id: `truncate-last-resort-${createUniqueId()}`,priority: TRUNCATE_LAST_RESORT_PRIORITY,+ reclaimSpaceOnExpand: true,collapsed: capped,setCollapsed: (value) => setCapped(value),})diff --git a/apps/web/src/components/priority-collapse/README.md b/apps/web/src/components/priority-collapse/README.mdindex d29ecc417b..0ee3dbd19d 100644--- a/apps/web/src/components/priority-collapse/README.md+++ b/apps/web/src/components/priority-collapse/README.md@@ -5,3 +5,8 @@row, viewport, and content measurements to that policy. Each row owns itscontroller and connects its row element with `setRow`; callers register itemswith its collapser. Split-layout registration wrappers remain in split-layout.++The sensor's last-resort title cap sets `reclaimSpaceOnExpand` so new or resumed+items give up space before the title stays truncated. Ordinary controls never+collapse other controls during a failed expansion trial. Keep failed trials+silent and retry them only after measurements or registrations change.diff --git a/apps/web/src/components/priority-collapse/createPriorityCollapser.test.ts b/apps/web/src/components/priority-collapse/createPriorityCollapser.test.tsindex 379eeb374b..10fdbd7fb8 100644--- a/apps/web/src/components/priority-collapse/createPriorityCollapser.test.ts+++ b/apps/web/src/components/priority-collapse/createPriorityCollapser.test.ts@@ -175,15 +175,18 @@ describe('createPriorityCollapser', () => {set(value);};- collapser.register({- id: 'tabs',- priority: 1,- collapsed: tabsCollapsed,- setCollapsed: track('tabs', setTabsCollapsed),- });+ const registerTabs = () =>+ collapser.register({+ id: 'tabs',+ priority: 1,+ collapsed: tabsCollapsed,+ setCollapsed: track('tabs', setTabsCollapsed),+ });+ const unregisterTabs = registerTabs();collapser.register({id: 'cap',priority: Number.MAX_SAFE_INTEGER,+ reclaimSpaceOnExpand: true,collapsed: capped,setCollapsed: track('cap', setCapped),});@@ -201,6 +204,8 @@ describe('createPriorityCollapser', () => {retryWidth = width;},tabsCollapsed,+ registerTabs,+ unregisterTabs,capped,transitions,};@@ -234,6 +239,45 @@ describe('createPriorityCollapser', () => {harness.dispose();});+ it('collapses re-registered items before keeping the title capped', () => {+ const harness = createLastResortCapHarness();++ // An active picker freezes its chips while a new tag consumes title space.+ harness.unregisterTabs();+ harness.setAvailableWidth(75);+ harness.invalidate();+ expect(harness.tabsCollapsed()).toBe(false);+ expect(harness.capped()).toBe(true);++ // Closing the picker restores tag registrations without resizing the row.+ harness.registerTabs();+ harness.invalidate();+ expect(harness.tabsCollapsed()).toBe(true);+ expect(harness.capped()).toBe(false);++ harness.dispose();+ });++ it('collapses re-registered items even when the title still needs truncation', () => {+ const harness = createLastResortCapHarness();++ harness.unregisterTabs();+ harness.setAvailableWidth(50);+ harness.invalidate();+ expect(harness.capped()).toBe(true);++ harness.transitions.length = 0;+ harness.registerTabs();+ harness.invalidate();+ expect(harness.tabsCollapsed()).toBe(true);+ expect(harness.capped()).toBe(true);+ expect(+ harness.transitions.filter(({ id, silent }) => id === 'cap' && !silent)+ ).toEqual([]);++ harness.dispose();+ });+it('holds a capped row steady instead of thrashing the cap', () => {const harness = createLastResortCapHarness();@@ -276,6 +320,25 @@ describe('createPriorityCollapser', () => {harness.dispose();});+ it('preserves fitting controls when another control cannot expand', () => {+ const harness = createHarness();+ const selector = harness.register('selector', 2, 100, 10);+ harness.invalidate();+ expect(selector()).toBe(true);++ const tabs = harness.register('tabs', 1, 50, 20);+ harness.transitions.length = 0;+ harness.invalidate();++ expect(selector()).toBe(true);+ expect(tabs()).toBe(false);+ expect(+ harness.transitions.filter(({ id, silent }) => id === 'tabs' && !silent)+ ).toEqual([]);++ harness.dispose();+ });+it('expands in reverse priority order as space returns', () => {const harness = createHarness();const first = harness.register('first', 1, 50, 20);diff --git a/apps/web/src/components/priority-collapse/createPriorityCollapser.ts b/apps/web/src/components/priority-collapse/createPriorityCollapser.tsindex b94d9353c6..80d3f2f6bb 100644--- a/apps/web/src/components/priority-collapse/createPriorityCollapser.ts+++ b/apps/web/src/components/priority-collapse/createPriorityCollapser.ts@@ -7,6 +7,8 @@ export type CollapsibleRegistration = {id: string;/** Lower numbers collapse first. */priority: number;+ /** Reclaim lower-priority items when lifting a last-resort width cap. */+ reclaimSpaceOnExpand?: boolean;collapsed: Accessor<boolean>;/** `silent` suppresses callbacks during pre-paint trial measurements. */setCollapsed: (value: boolean, options?: { silent?: boolean }) => void;@@ -71,6 +73,16 @@ export function createPriorityCollapser();};+ const collapseUntilFits = (beforePriority = Infinity) => {+ const byCollapseOrder = items()+ .filter((item) => !item.collapsed() && item.priority < beforePriority)+ .sort((a, b) => a.priority - b.priority);+ for (const item of byCollapseOrder) {+ item.setCollapsed(true);+ if (!overflows()) break;+ }+ };+const evaluate = () => {const measurement = probe.measure();if (!measurement || items().length === 0) return;@@ -79,13 +91,7 @@ export function createPriorityCollapser(measurement.requiredWidth - measurement.availableWidth >OVERFLOW_EPSILON_PX) {- const byCollapseOrder = items()- .filter((item) => !item.collapsed())- .sort((a, b) => a.priority - b.priority);- for (const item of byCollapseOrder) {- item.setCollapsed(true);- if (!overflows()) break;- }+ collapseUntilFits();const collapsedMeasurement = probe.measure();if (collapsedMeasurement) {@@ -115,6 +121,10 @@ export function createPriorityCollapser(// never visible; silent keeps onCollapsedChange from firing for it.for (const item of byExpandOrder) {item.setCollapsed(false, { silent: true });+ // A width cap can conceal space needed by newly registered items.+ if (item.reclaimSpaceOnExpand && overflows()) {+ collapseUntilFits(item.priority);+ }if (overflows()) {item.setCollapsed(true, { silent: true });const collapsedMeasurement = probe.measure();diff --git a/apps/web/src/features/property/README.md b/apps/web/src/features/property/README.mdindex 1cf72dc39b..55fe3aaa53 100644--- a/apps/web/src/features/property/README.md+++ b/apps/web/src/features/property/README.md@@ -60,8 +60,17 @@ tags. For multiple tags, label the overflow chip “N tags” when every tag iscollapsed; use “+N tags” only when individual tag chips remain visible.Hidden tags keep the existing overflow picker and hover actions. Keep the visiblechip count stable while a picker or its nested editor is active so resizing-cannot discard the editing session. Hosts without a controller retain their-explicit or default chip limit.+cannot discard the editing session. Key visible chips by option ID so refreshed+tag objects do not remount a picker or leave overflow collapsing paused.+Release active-picker state when a live update removes its chip or overflow trigger.+When editing ends, immediately re-evaluate new tags against the title's full+width, even if the title is already truncated.+Hosts without a controller retain their explicit or default chip limit.+After confirmed GraphQL tag writes, refresh only lists the normalized cache cannot+maintain so stale reads do not replace the committed selection. Match option-filtered+lists by property definition as well as sorted/grouped lists; leave unrelated lists+alone. Use the write's actual transport for refresh scope, even if the feature flag+changes while saving. REST writes retain refreshes for cache-maintained readers.Tag chips, overflow chips, and inline tag pills retain their compact desktopheight on touch instead of adopting the shared button touch minimum. Onlythe task-detail title-row tags selector uses the 36px touch target; documentdiff --git a/apps/web/src/features/property/tags/EntityRowTags.tsx b/apps/web/src/features/property/tags/EntityRowTags.tsxindex 0a704cda85..d564f336eb 100644--- a/apps/web/src/features/property/tags/EntityRowTags.tsx+++ b/apps/web/src/features/property/tags/EntityRowTags.tsx@@ -7,6 +7,7 @@ import PlusIcon from '@icon/system/regular/plus.svg';import { useInFlightEntityPropertyOptions } from '@queries/properties/in-flight-options';import { EntityType } from '@service-properties/generated/schemas/entityType';import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';+import { Key } from '@solid-primitives/keyed';import {type BadgeSize,type BadgeVariant,@@ -199,12 +200,19 @@ function TagChip(props: {withClickBlock: boolean;onActiveChange: (active: boolean) => void;}) {- const [pickerOpen, setPickerOpen] = createSignal(false);+ const [pickerActive, setPickerActive] = createSignal(false);+ const onActiveChange = (active: boolean) => {+ setPickerActive(active);+ props.onActiveChange(active);+ };+ onCleanup(() => {+ if (pickerActive()) props.onActiveChange(false);+ });return (<Layer depth={2}><HoverCardplacement="bottom-start"- disabled={pickerOpen()}+ disabled={pickerActive()}content={<TagHoverContenttag={props.tag}@@ -218,8 +226,7 @@ function TagChip(props: {createDocTags={props.createDocTags}class="max-w-[14ch]"dotClass="size-2"- onOpenChange={setPickerOpen}- onActiveChange={props.onActiveChange}+ onActiveChange={onActiveChange}withClickBlock={props.withClickBlock}/></HoverCard>@@ -236,7 +243,14 @@ function TagOverflow(props: {withClickBlock: boolean;onActiveChange: (active: boolean) => void;}) {- const [pickerOpen, setPickerOpen] = createSignal(false);+ const [pickerActive, setPickerActive] = createSignal(false);+ const onActiveChange = (active: boolean) => {+ setPickerActive(active);+ props.onActiveChange(active);+ };+ onCleanup(() => {+ if (pickerActive()) props.onActiveChange(false);+ });const dots = () => props.tags.slice(0, MAX_OVERFLOW_DOTS);const count = () =>`${props.visibleCount > 0 ? '+' : ''}${props.tags.length} ${props.tags.length === 1 ? 'tag' : 'tags'}`;@@ -245,7 +259,7 @@ function TagOverflow(props: {<Layer depth={2}><HoverCardplacement="bottom-end"- disabled={pickerOpen()}+ disabled={pickerActive()}content={<div class="flex flex-col gap-0.5"><For each={props.tags}>@@ -268,8 +282,7 @@ function TagOverflow(props: {class: 'max-w-[14ch] gap-1.5 touch:min-h-0',})}triggerLabel="Edit tags"- onOpenChange={setPickerOpen}- onActiveChange={props.onActiveChange}+ onActiveChange={onActiveChange}withClickBlock={props.withClickBlock}><span class="flex items-center">@@ -359,10 +372,10 @@ export function EntityRowTags(props: {)}onClick={(event) => event.stopPropagation()}>- <For each={visible()}>+ <Key each={visible()} by="optionId">{(tag) => (<TagChip- tag={tag}+ tag={tag()}createDocTags={createDocTags}onFilterByTag={props.onFilterByTag}onEdit={setEditingTag}@@ -370,7 +383,7 @@ export function EntityRowTags(props: {withClickBlock/>)}- </For>+ </Key><Show when={hidden().length > 0}><TagOverflowtags={hidden()}diff --git a/apps/web/src/features/property/tags/tag-sets-context.test.tsx b/apps/web/src/features/property/tags/tag-sets-context.test.tsxindex 454dc2f5b1..e6954b61f8 100644--- a/apps/web/src/features/property/tags/tag-sets-context.test.tsx+++ b/apps/web/src/features/property/tags/tag-sets-context.test.tsx@@ -153,7 +153,6 @@ describe('TagSetsContext', () => {'first-tag','second-tag','third-tag',- 'fourth-tag',]);const properties = () => [{@@ -180,13 +179,17 @@ describe('TagSetsContext', () => {expect(view.getByRole('button', { name: 'Third' })).toBeTruthy();expect(view.queryByRole('button', { name: 'Fourth' })).toBeNull();- expect(view.getByRole('button', { name: '+1 tag' })).toBeTruthy();+ expect(view.queryByRole('button', { name: '+1 tag' })).toBeNull();const first = view.getByRole('button', { name: 'First' });await fireEvent.click(first);expect(registrations.size).toBe(0);expect(view.getByRole('button', { name: 'First' })).toBe(first);expect(mocks.useSoupDocTags).toHaveBeenCalledOnce();+ setTagIds(['first-tag', 'second-tag', 'third-tag', 'fourth-tag']);+ expect(view.getByRole('button', { name: 'First' })).toBe(first);+ expect(registrations.size).toBe(0);+await fireEvent.click(first);for (const registration of registrations.values()) {registration.setCollapsed(true);@@ -217,5 +220,28 @@ describe('TagSetsContext', () => {setTagIds(['first-tag', 'second-tag', 'third-tag', 'fourth-tag']);expect(registrations.size).toBe(3);expect(view.getByRole('button', { name: '4 tags' })).toBeTruthy();++ for (const registration of registrations.values()) {+ registration.setCollapsed(false);+ }+ const removedChip = view.getByRole('button', { name: 'First' });+ await fireEvent.click(removedChip);+ setTagIds(['second-tag', 'third-tag']);+ expect(removedChip.isConnected).toBe(false);+ expect(registrations.size).toBe(2);++ setTagIds(['first-tag', 'second-tag', 'third-tag', 'fourth-tag']);+ const removedOverflow = view.getByRole('button', { name: '+1 tag' });+ await fireEvent.click(removedOverflow);+ setTagIds(['first-tag', 'second-tag', 'third-tag']);+ expect(removedOverflow.isConnected).toBe(false);+ expect(registrations.size).toBe(3);++ setTagIds(['first-tag', 'second-tag', 'third-tag', 'fourth-tag']);+ expect(registrations.size).toBe(3);+ for (const registration of registrations.values()) {+ registration.setCollapsed(true);+ }+ expect(view.getByRole('button', { name: '4 tags' })).toBeTruthy();});});diff --git a/apps/web/src/features/tasks-view/AGENTS.md b/apps/web/src/features/tasks-view/AGENTS.mdindex ded09368d0..827e98266e 100644--- a/apps/web/src/features/tasks-view/AGENTS.md+++ b/apps/web/src/features/tasks-view/AGENTS.md@@ -26,6 +26,7 @@ Main Tasks and reusable task-list hosts. Projects and CRM embed `TasksViewProvid- Render phone task rows with the narrow layout, an 8px unread-only rail, no checkbox column, 4px outer list padding, and 44px row height; preserve row selection handlers and 36px property-editor touch targets.- Keep leading task status icons at 18px and priority icons at 16px desktop/20px phone without flex shrinking; use 16px Status/Priority selector icons, the shared 12px property default elsewhere unless a surface overrides it, and preserve 16px group-header carets and existing hit targets.- Give list Due date glyphs the shared 12px base size and the existing 16px compact-column override; never leave calendar SVG dimensions implicit.+- Mix light-theme due-date warnings with 40% foreground in list and board values for contrast; keep dark-theme warnings, global warning tokens, and status colors unchanged.- Use the matching `task-status-*` theme token for each status icon and group-header tint; default Completed to accent while preserving explicit theme overrides and independent global colors.- Edit priority then status through leading `TaskPropertyControl` icons on desktop and mobile; place status directly beside the title, and keep separate Status/Priority columns and duplicate trailing mobile pills removed.- Order trailing task properties as Due date, Project, then Assignees in wide and narrow rows and title pills; show both avatars for exactly two compact assignees, otherwise one avatar plus the remaining count, anchored left in a fixed-width slot so overflow grows right.@@ -38,7 +39,7 @@ Main Tasks and reusable task-list hosts. Projects and CRM embed `TasksViewProvid- Reuse `PropertyEmptyIcon` for absent values in list rows, board cards, and group or board-column headers: 30%-opacity wide priority bars, a dashed user circle, a corner-dashed project cube, and a slashed calendar for no due date; use the regular cube for set projects.- Use shared ghost-button interaction styling for editable list properties; dim empty icons and labels without applying opacity twice to No priority.- Register task-row collapse items with the shared `src/components/priority-collapse/` controller and sensor, not split-layout wrappers.-- Show at most three individual tag chips; keep a sole tag as its named chip even in collapsed layouts, otherwise collapse the folder path first, then more tags on measured overflow, and truncate the title last while preserving open tag editors.+- Show at most three individual tag chips; keep a sole tag as its named chip even in collapsed layouts, otherwise collapse the folder path first, then more tags on measured overflow, and truncate the title last while preserving open tag editors; re-evaluate new tags when editing ends without requiring a resize.- Keep the tag chip or collapsed multi-tag overflow after the title on phone rows instead of dropping tags with the desktop columns.- Tab and Shift+Tab cycle sidebar tabs only over a list. Keep `TasksSidebar`'s key-time check for an open project or task: the sidebar remounts whenever the view crosses its layout breakpoint, so it registers after an open pane and eclipses any override the pane holds.diff --git a/apps/web/src/features/tasks-view/components/task-board-property.tsx b/apps/web/src/features/tasks-view/components/task-board-property.tsxindex 7963dea564..de05c718f1 100644--- a/apps/web/src/features/tasks-view/components/task-board-property.tsx+++ b/apps/web/src/features/tasks-view/components/task-board-property.tsx@@ -137,7 +137,8 @@ export function TaskBoardProperty(props: {class="size-3.5 shrink-0"classList={{'text-failure': props.dueDateUrgency === 'danger',- 'text-warning': props.dueDateUrgency === 'warning',+ 'text-warning light-mode:text-[color-mix(in_srgb,var(--color-warning)_60%,var(--color-ink))]':+ props.dueDateUrgency === 'warning',}}/></Match>@@ -152,7 +153,7 @@ export function TaskBoardProperty(props: {<Property.Textproperty={shown()}resolveSingleEntity={isProject()}- class={`min-w-0 truncate ${isDate() && props.dueDateUrgency === 'danger' ? 'text-failure' : ''} ${isDate() && props.dueDateUrgency === 'warning' ? 'text-warning' : ''}`}+ class={`min-w-0 truncate ${isDate() && props.dueDateUrgency === 'danger' ? 'text-failure' : ''} ${isDate() && props.dueDateUrgency === 'warning' ? 'text-warning light-mode:text-[color-mix(in_srgb,var(--color-warning)_60%,var(--color-ink))]' : ''}`}fallback={<span>{shown().displayName}</span>}/></Show>diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskGridLayout.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskGridLayout.tsxindex 2b53919f6c..12005814a0 100644--- a/apps/web/src/features/tasks-view/components/task-list/TaskGridLayout.tsx+++ b/apps/web/src/features/tasks-view/components/task-list/TaskGridLayout.tsx@@ -145,7 +145,8 @@ export function TaskGridLayout(props: TaskGridLayoutProps) {);return cn({'text-failure': urgency === 'danger',- 'text-warning': urgency === 'warning',+ 'text-warning light-mode:text-[color-mix(in_srgb,var(--color-warning)_60%,var(--color-ink))]':+ urgency === 'warning','text-ink-muted': !urgency,});};diff --git a/apps/web/src/features/theme/utils/themeColorTokens.ts b/apps/web/src/features/theme/utils/themeColorTokens.tsindex f42ffad691..9558e4c492 100644--- a/apps/web/src/features/theme/utils/themeColorTokens.ts+++ b/apps/web/src/features/theme/utils/themeColorTokens.ts@@ -113,7 +113,7 @@ export function getDefaultSemanticColorTokens('task-status-in-progress': mixTokens('amber','content-0',- mode === 'dark' ? 0.8 : 0.5,+ mode === 'dark' ? 0.8 : 0.85,'srgb'),'task-status-in-review': tokenReference('violet'),diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex b339e1107f..c37391a9ec 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -742,7 +742,7 @@ body.tauri-ios {}[data-theme-light='true'] {- --color-task-status-in-progress: color-mix(in srgb, var(--color-amber) 50%, var(--color-content-0));+ --color-task-status-in-progress: color-mix(in srgb, var(--color-amber) 85%, var(--color-content-0));/* Neutral borders. */--border-primary: oklch(0 0 0 / 16%);--border-secondary: oklch(0 0 0 / 12%);diff --git a/apps/web/src/lib/queries/properties/entity.test.tsx b/apps/web/src/lib/queries/properties/entity.test.tsxindex 438b7c80af..65054fb404 100644--- a/apps/web/src/lib/queries/properties/entity.test.tsx+++ b/apps/web/src/lib/queries/properties/entity.test.tsx@@ -938,22 +938,34 @@ describe('useBulkSaveEntityPropertiesMutation dispositions', () => {],};- it('commits option selections through GraphQL when Soup is GraphQL-backed', async () => {- updateGraphqlEntityPropertyOptionsMock.mockResolvedValue([- { propertyDefinitionId: 'status-def', optionIds: ['doing'] },- ]);-- await expect(- bulkOptionsMutation.mutateAsync(optionSelection)- ).resolves.toEqual([- { propertyDefinitionId: 'status-def', optionIds: ['doing'] },- ]);-- expect(updateGraphqlEntityPropertyOptionsMock).toHaveBeenCalledWith(- optionSelection- );- expect(bulkUpdateEntityPropertyOptionsMock).not.toHaveBeenCalled();- });+ it.each([true, false])(+ 'keeps GraphQL refresh scope when the flag settles to %s',+ async (enabled) => {+ updateGraphqlEntityPropertyOptionsMock.mockImplementation(async () => {+ graphqlSoupEnabledMock.mockReturnValue(enabled);+ return [{ propertyDefinitionId: 'status-def', optionIds: ['doing'] }];+ });++ await expect(+ bulkOptionsMutation.mutateAsync(optionSelection)+ ).resolves.toEqual({+ selections: [+ { propertyDefinitionId: 'status-def', optionIds: ['doing'] },+ ],+ transport: 'graphql',+ });++ expect(updateGraphqlEntityPropertyOptionsMock).toHaveBeenCalledWith(+ optionSelection+ );+ expect(bulkUpdateEntityPropertyOptionsMock).not.toHaveBeenCalled();+ expect(refreshPropertyQueriesMock).toHaveBeenCalledWith('status-def', {+ includeOptionFilters: true,+ unmaintainedOnly: true,+ });+ expect(testQueryClient.invalidateQueries).toHaveBeenCalled();+ }+ );it('rolls back and reports a failed GraphQL option selection', async () => {updateGraphqlEntityPropertyOptionsMock.mockRejectedValue(@@ -965,19 +977,39 @@ describe('useBulkSaveEntityPropertiesMutation dispositions', () => {).rejects.toThrow('options failed');expect(bulkUpdateEntityPropertyOptionsMock).not.toHaveBeenCalled();+ expect(rollbackMock).toHaveBeenCalledOnce();+ expect(refreshPropertyQueriesMock).not.toHaveBeenCalled();+ expect(testQueryClient.invalidateQueries).toHaveBeenCalled();expect(toastFailureMock).toHaveBeenCalledOnce();});- it('keeps option selections on REST when GraphQL Soup is disabled', async () => {- graphqlSoupEnabledMock.mockReturnValue(false);-- await expect(- bulkOptionsMutation.mutateAsync(optionSelection)- ).resolves.toEqual([- { propertyDefinitionId: 'status-def', optionIds: ['doing'] },- ]);+ it.each([false, true])(+ 'keeps REST refresh scope when the flag settles to %s',+ async (enabled) => {+ graphqlSoupEnabledMock.mockReturnValue(false);+ bulkUpdateEntityPropertyOptionsMock.mockImplementationOnce(async () => {+ graphqlSoupEnabledMock.mockReturnValue(enabled);+ return ok({+ properties: [{ property_id: 'status-def', option_ids: ['doing'] }],+ });+ });- expect(bulkUpdateEntityPropertyOptionsMock).toHaveBeenCalledOnce();- expect(updateGraphqlEntityPropertyOptionsMock).not.toHaveBeenCalled();- });+ await expect(+ bulkOptionsMutation.mutateAsync(optionSelection)+ ).resolves.toEqual({+ selections: [+ { propertyDefinitionId: 'status-def', optionIds: ['doing'] },+ ],+ transport: 'rest',+ });++ expect(bulkUpdateEntityPropertyOptionsMock).toHaveBeenCalledOnce();+ expect(updateGraphqlEntityPropertyOptionsMock).not.toHaveBeenCalled();+ expect(refreshPropertyQueriesMock).toHaveBeenCalledWith('status-def', {+ includeOptionFilters: true,+ unmaintainedOnly: false,+ });+ expect(testQueryClient.invalidateQueries).toHaveBeenCalled();+ }+ );});diff --git a/apps/web/src/lib/queries/properties/entity.ts b/apps/web/src/lib/queries/properties/entity.tsindex a539800d4a..25616d8014 100644--- a/apps/web/src/lib/queries/properties/entity.ts+++ b/apps/web/src/lib/queries/properties/entity.ts@@ -737,6 +737,11 @@ type BulkUpdateEntityPropertyOptionsContext = {soupTxn?: SoupTransaction;};+type BulkUpdateEntityPropertyOptionsResult = {+ selections: EntityPropertyOptionSelection[];+ transport: 'graphql' | 'rest';+};+/*** Persists a complete multi-select selection across one or more properties in a* single transactional request, then reconciles the soup cache from the final@@ -749,7 +754,7 @@ type BulkUpdateEntityPropertyOptionsContext = {export function useBulkUpdateEntityPropertyOptionsMutation(entityId: string,callbacks?: MutationCallbacks<- EntityPropertyOptionSelection[],+ BulkUpdateEntityPropertyOptionsResult,Error,BulkUpdateEntityPropertyOptionsParams,BulkUpdateEntityPropertyOptionsContext@@ -760,7 +765,7 @@ export function useBulkUpdateEntityPropertyOptionsMutation(scope: { id: `entity-property-options:${entityId}` },mutationFn: async (variables: BulkUpdateEntityPropertyOptionsParams- ): Promise<EntityPropertyOptionSelection[]> => {+ ): Promise<BulkUpdateEntityPropertyOptionsResult> => {// The transport swaps, the mutation shell does not: the per-entity scope// that serializes commits and the in-flight overlay both read this// mutation's state, whichever cache the selection lands in.@@ -768,7 +773,10 @@ export function useBulkUpdateEntityPropertyOptionsMutation(variables.entityType === 'INITIATIVE' ||isFeatureEnabled(enableGraphqlSoup)) {- return updateGraphqlEntityPropertyOptions(variables);+ return {+ selections: await updateGraphqlEntityPropertyOptions(variables),+ transport: 'graphql',+ };}const response = await throwOnErr(async () =>propertiesServiceClient.bulkUpdateEntityPropertyOptions({@@ -789,13 +797,16 @@ export function useBulkUpdateEntityPropertyOptionsMutation(},}));- return response.properties.map((property) => ({- propertyDefinitionId: property.property_id,- optionIds: property.option_ids,- }));+ return {+ selections: response.properties.map((property) => ({+ propertyDefinitionId: property.property_id,+ optionIds: property.option_ids,+ })),+ transport: 'rest',+ };},...withCallbacks<- EntityPropertyOptionSelection[],+ BulkUpdateEntityPropertyOptionsResult,Error,BulkUpdateEntityPropertyOptionsParams,BulkUpdateEntityPropertyOptionsContext@@ -814,7 +825,7 @@ export function useBulkUpdateEntityPropertyOptionsMutation();return { soupTxn };},- onSuccess: (selections, variables) => {+ onSuccess: ({ selections, transport }, variables) => {const propertyByDefinitionId = new Map(variables.properties.map((update) => [getPropertyDefinitionId(update.property),@@ -845,7 +856,10 @@ export function useBulkUpdateEntityPropertyOptionsMutation(invalidateSoupEntity(variables.entityId);for (const selection of selections) {fireAndForget(- refreshPropertyQueries(selection.propertyDefinitionId),+ refreshPropertyQueries(selection.propertyDefinitionId, {+ includeOptionFilters: true,+ unmaintainedOnly: transport === 'graphql',+ }),'entity-properties');}diff --git a/apps/web/src/lib/queries/soup/property-queries.test.ts b/apps/web/src/lib/queries/soup/property-queries.test.tsnew file mode 100644index 0000000000..b68c80adba--- /dev/null+++ b/apps/web/src/lib/queries/soup/property-queries.test.ts@@ -0,0 +1,128 @@+import { queryClient } from '@queries/client';+import { describe, expect, it, onTestFinished, vi } from 'vitest';+import { registerActiveGraphqlSoupQuery } from './graphql/active-queries';+import { soupKeys } from './keys';+import { refreshPropertyQueries } from './property-queries';++vi.mock('@queries/client', async () => {+ const { QueryClient } = await import('@tanstack/solid-query');+ return { queryClient: new QueryClient() };+});++describe('refreshPropertyQueries', () => {+ it('invalidates REST lists but refreshes only unmaintained GraphQL lists after a confirmed option write', async () => {+ onTestFinished(() => queryClient.clear());+ const key = soupKeys.astItems({+ params: {+ sort_method: 'property',+ sort_property_definition_id: 'tag-definition',+ },+ body: {},+ }).queryKey;+ queryClient.setQueryData(key, []);++ const maintained = vi.fn(async () => {});+ const unmaintained = vi.fn(async () => {});+ const unrelated = vi.fn(async () => {});+ onTestFinished(+ registerActiveGraphqlSoupQuery({+ isEnabled: () => true,+ refresh: maintained,+ cacheMaintained: () => true,+ body: () => ({+ sortMethod: 'PROPERTY',+ sortPropertyDefinitionId: 'tag-definition',+ }),+ })+ );+ onTestFinished(+ registerActiveGraphqlSoupQuery({+ isEnabled: () => true,+ refresh: unmaintained,+ cacheMaintained: () => false,+ body: () => ({+ sortMethod: 'PROPERTY',+ sortPropertyDefinitionId: 'tag-definition',+ }),+ })+ );+ onTestFinished(+ registerActiveGraphqlSoupQuery({+ isEnabled: () => true,+ refresh: unrelated,+ body: () => ({+ sortMethod: 'PROPERTY',+ sortPropertyDefinitionId: 'other-definition',+ }),+ })+ );++ await refreshPropertyQueries('tag-definition', { unmaintainedOnly: true });++ expect(queryClient.getQueryState(key)?.isInvalidated).toBe(true);+ expect(maintained).not.toHaveBeenCalled();+ expect(unmaintained).toHaveBeenCalledOnce();+ expect(unrelated).not.toHaveBeenCalled();++ await refreshPropertyQueries('tag-definition');++ expect(maintained).toHaveBeenCalledOnce();+ expect(unmaintained).toHaveBeenCalledTimes(2);+ expect(unrelated).not.toHaveBeenCalled();+ });++ it.each([false, true])(+ 'refreshes option-filtered readers with unmaintainedOnly=%s without refreshing unrelated lists',+ async (unmaintainedOnly) => {+ onTestFinished(() => queryClient.clear());+ const filtered = {+ propf: { l: { pd: 'tag-definition', v: { so: 'tag-option' } } },+ };+ const unrelated = {+ propf: { l: { pd: 'other-definition', v: { so: 'tag-definition' } } },+ };+ const ordinary = { df: { l: { dst: 'task' } } };+ const bodies = [filtered, unrelated, ordinary];+ const keys = bodies.map(+ (body) =>+ soupKeys.astItems({ params: { sort_method: 'updated_at' }, body })+ .queryKey+ );+ const readers = bodies.map((body) => {+ const refresh = vi.fn(async () => {});+ onTestFinished(+ registerActiveGraphqlSoupQuery({+ isEnabled: () => true,+ refresh,+ cacheMaintained: () => false,+ body: () => body,+ })+ );+ return refresh;+ });+ const maintained = vi.fn(async () => {});+ onTestFinished(+ registerActiveGraphqlSoupQuery({+ isEnabled: () => true,+ refresh: maintained,+ cacheMaintained: () => true,+ body: () => filtered,+ })+ );+ for (const key of keys) queryClient.setQueryData(key, []);++ await refreshPropertyQueries('tag-definition', {+ includeOptionFilters: true,+ unmaintainedOnly,+ });++ expect(+ keys.map((key) => queryClient.getQueryState(key)?.isInvalidated)+ ).toEqual([true, false, false]);+ expect(readers[0]).toHaveBeenCalledOnce();+ expect(readers[1]).not.toHaveBeenCalled();+ expect(readers[2]).not.toHaveBeenCalled();+ expect(maintained).toHaveBeenCalledTimes(unmaintainedOnly ? 0 : 1);+ }+ );+});diff --git a/apps/web/src/lib/queries/soup/property-queries.ts b/apps/web/src/lib/queries/soup/property-queries.tsindex c3b61cb3d3..7cd475b221 100644--- a/apps/web/src/lib/queries/soup/property-queries.ts+++ b/apps/web/src/lib/queries/soup/property-queries.ts@@ -7,20 +7,30 @@ function isRecord(value: unknown): value is Record<string, unknown> {return typeof value === 'object' && value !== null && !Array.isArray(value);}-function isDateFilter(input: Record<string, unknown>): boolean {+function isPropertyValueFilter(+ input: Record<string, unknown>,+ includeOptionFilters: boolean+): boolean {const value = input.v ?? input.value ?? input;return (isRecord(value) &&(value.dr !== undefined ||value.dateRange !== undefined ||value.date_range !== undefined ||- typeof value.has_date === 'boolean')+ typeof value.has_date === 'boolean' ||+ (includeOptionFilters && typeof value.so === 'string')));}-/** Match request fields, not property IDs occurring in unrelated option filters. */-function dependsOnProperty(input: unknown, definitionId?: string): boolean {+/** Match request fields, not unrelated identifiers occurring in filter values. */+function dependsOnProperty(+ input: unknown,+ definitionId: string | undefined,+ includeOptionFilters: boolean+): boolean {if (Array.isArray(input))- return input.some((value) => dependsOnProperty(value, definitionId));+ return input.some((value) =>+ dependsOnProperty(value, definitionId, includeOptionFilters)+ );if (!isRecord(input)) return false;const matches = (id: unknown) =>@@ -48,16 +58,23 @@ function dependsOnProperty(input: unknown, definitionId?: string): boolean {const propertyId =input.pd ?? input.propertyDefinitionId ?? input.property_definition_id;- if (matches(propertyId) && isDateFilter(input)) return true;+ if (matches(propertyId) && isPropertyValueFilter(input, includeOptionFilters))+ return true;return Object.values(input).some((value) =>- dependsOnProperty(value, definitionId)+ dependsOnProperty(value, definitionId, includeOptionFilters));}/** Property edits can reorder pages, admit filtered items, and change group counts. */export async function refreshPropertyQueries(- propertyDefinitionId?: string+ propertyDefinitionId?: string,+ options: {+ /** Option writes also affect membership in select-option-filtered lists. */+ includeOptionFilters?: boolean;+ /** Skip GraphQL readers maintained by a confirmed cache write; REST still refreshes. */+ unmaintainedOnly?: boolean;+ } = {}): Promise<void> {const prefixes = [soupKeys.items._def,@@ -66,12 +83,16 @@ export async function refreshPropertyQueries(soupKeys.search._def,];const where = (input: unknown) =>- dependsOnProperty(input, propertyDefinitionId);+ dependsOnProperty(+ input,+ propertyDefinitionId,+ options.includeOptionFilters ?? false+ );const predicate = (query: Query) =>prefixes.some((prefix) => partialMatchKey(query.queryKey, prefix)) &&where(query.queryKey);await Promise.all([queryClient.invalidateQueries({ predicate }),- refreshActiveGraphqlSoupQueries({ where }),+ refreshActiveGraphqlSoupQueries({ where, ...options }),]);}diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.mdindex 599c756682..ddf3652634 100644--- a/docs/agent-guide/tasks.md+++ b/docs/agent-guide/tasks.md@@ -109,7 +109,9 @@ keeps that named chip, including on phones, rather than showing “1 tag”.Open the overflow to edit all tags; hover it for hidden-tag names and filter/edit actions.The overflow chip reads “N tags” when it represents all tags, or “+N tags” whenindividual tag chips remain visible.-An open picker or nested tag editor stays mounted while resizing. The share+An open picker or nested tag editor stays mounted while resizing. Add tags in a+constrained row and close the picker: excess tags must enter overflow without+resizing or reloading, restoring title space before truncating it. The shareindicator remains immediately beside the title whenever it is shown.Compact desktop rows keep tags after the title and before the trailing properties;phone rows retain the single tag or collapsed multi-tag chip instead of dropping tags.@@ -203,7 +205,7 @@ remain available. In the theme editor's **Task statuses** section, change a statcolor and verify its icons and group-header tints update together in List and Gantt,while Board column icons match and global warning/success colors stay unchanged.In Progress defaults to amber blended with the theme's foreground: 20% foreground-in dark mode and 50% in light mode. Check the icon's legibility against the list,+in dark mode and 15% in light mode. Check the icon's legibility against the list,menu, and board surfaces in both modes; custom status-color overrides stay intact.Click a task row or favorite to replace the list with the editable task document. Its top@@ -275,8 +277,10 @@ dropdown shows the current date, or **No due date** when unset, above the datechoices. Due dates stay outside the title.Board cards show due dates in property pills. Overdue dateson open tasks use the danger color; only dates due today or tomorrow use the-warning color. Later dates, completed tasks, and canceled tasks have neutral due-dates. Urgency refreshes at local midnight, on timezone changes, and app resume.+warning color. On light themes, list and board warning icons and text mix 60%+warning with 40% foreground for contrast; dark themes keep the warning color.+Later dates, completed tasks, and canceled tasks have neutral due dates. Urgency+refreshes at local midnight, on timezone changes, and app resume.Date selections persist with the navigation entry and round-trip through`tasks.dueDate`, `tasks.dueStart`, and `tasks.dueEnd` URL parameters.