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(saved-views): restore distinct creation controls (#9047)
dev-rbe61fd733890e
diff --git a/apps/web/src/features/saved-views/AGENTS.md b/apps/web/src/features/saved-views/AGENTS.mdindex 413801ac14..91bfee97a4 100644--- a/apps/web/src/features/saved-views/AGENTS.md+++ b/apps/web/src/features/saved-views/AGENTS.md@@ -26,7 +26,7 @@ Reusable named view definitions. The first consumer is main Tasks; the generic f- Mount picker menus inside the drawer portal scope, close menus before opening dialogs, then close the drawer and restore focus before opening another dialog.- Render the mobile picker trigger with the shared pill button and preserve the selected state supplied by its consumer.- Compose unsaved list entries with the draft row; keep draft lifecycle and confirmed-record reconciliation in the consumer.-- Let consumers omit the header create action when an expanded empty state already offers creation.+- Keep header creation consumer-owned and forward its control ref so the host can isolate its keyboard scope.- Bind deferred picker actions to the opening account and discard them after an account change.- Validate the response viewer before exposing cached reads after an account change.- Keep list and detail hooks independent; pass mutation dialogs a refresh callback, not an aggregate read source.diff --git a/apps/web/src/features/saved-views/components/saved-view-list.tsx b/apps/web/src/features/saved-views/components/saved-view-list.tsxindex 885fc641dc..401c0f51b8 100644--- a/apps/web/src/features/saved-views/components/saved-view-list.tsx+++ b/apps/web/src/features/saved-views/components/saved-view-list.tsx@@ -28,7 +28,10 @@ function Root(props: {);}-function Header(props: { onCreate?: () => void }) {+function Header(props: {+ onCreate?: () => void;+ createButtonRef?: (element: HTMLButtonElement) => void;+}) {return (<CollapsibleSection.Header><CollapsibleSection.Trigger>@@ -38,6 +41,7 @@ function Header(props: { onCreate?: () => void }) {<Show when={props.onCreate}>{(onCreate) => (<CollapsibleSection.Action+ ref={props.createButtonRef}label={t('viewMenus.newSavedView')}onClick={onCreate()}>diff --git a/apps/web/src/features/tasks-view/AGENTS.md b/apps/web/src/features/tasks-view/AGENTS.mdindex e00a334523..e2bc64d16e 100644--- a/apps/web/src/features/tasks-view/AGENTS.md+++ b/apps/web/src/features/tasks-view/AGENTS.md@@ -25,7 +25,7 @@ Main Tasks and reusable task-list hosts. Projects and CRM embed `TasksViewProvid- Keep sidebar actions targeted to their own record; Edit combines naming and sharing without saving temporary settings, and Duplicate starts with a prefilled private copy and warns before omitting unsupported settings.- Keep saved-view names and menus in the mobile picker; overlay creation above the filter drawer footer on a drawer-colored backing without blocking the last scrollable controls, and put Save changes at the footer's right edge, opposite Clear all.- Place the saved-view picker after Filters and before built-in mobile tabs; omit duplicate headers and general create controls, but offer Create view in the empty state.-- Group the shared sidebar and picker empty state in a subtly bordered, rounded container with 12px padding, the inherited background, and no shadow: “Your go-to views”, “Save your setup for next time.” and a neutral icon-only plus action labeled Create view, without a separate illustration; hide the header plus while this action is visible, and isolate its keyboard scope from task-list selection shortcuts.+- Group the shared sidebar and picker empty state in a subtly bordered, rounded container with 12px padding, the inherited background, and no shadow: “Your go-to views”, “Save your setup for next time.” and a neutral Create view button with a leading plus icon, without a separate illustration; keep the sidebar header's icon-only plus available in every section state, and isolate both creation buttons' keyboard scopes from task-list selection shortcuts.- Keep mobile pills in a flex wrapper inside the header so their shadow margins cannot collapse the header and overlap task content.- Show one local New view draft row after creation starts; prefill its save dialog with New view, replace the row on confirmed save, and remove it on cancellation or navigation without adding fake cached records.- Close the selected-view menu before opening a dialog, discard deferred actions after account or selection changes, and close dialogs after account, saved-view, or built-in-tab navigation.diff --git a/apps/web/src/features/tasks-view/views/task-saved-views.tsx b/apps/web/src/features/tasks-view/views/task-saved-views.tsxindex bb7feffaf6..c9885a2c3c 100644--- a/apps/web/src/features/tasks-view/views/task-saved-views.tsx+++ b/apps/web/src/features/tasks-view/views/task-saved-views.tsx@@ -321,7 +321,7 @@ export function TaskSavedViewsList() {isSidebarSectionOpen,setSidebarSectionOpen,} = useTasksView();- const list = useTaskSavedViewListState();+ const [attachCreateHotkeys] = useHotkeyDOMScope('create-saved-view', true);const create = () => {setSidebarSectionOpen('saved-views', true);startSavedView();@@ -333,11 +333,8 @@ export function TaskSavedViewsList() {onOpenChange={(open) => setSidebarSectionOpen('saved-views', open)}><SavedViewList.Header- onCreate={- !isSidebarSectionOpen('saved-views') || !list.empty()- ? create- : undefined- }+ onCreate={create}+ createButtonRef={attachCreateHotkeys}/><SavedViewList.Content><TaskSavedViewRows />@@ -411,12 +408,12 @@ function TaskSavedViewRows(props: {</div><Buttonref={attachCreateHotkeys}- size="icon-sm"- label={t('viewMenus.createSavedView')}+ size="sm"variant="outline"onClick={() => run(startSavedView)}><PlusIcon class="size-3.5" />+ {t('viewMenus.createSavedView')}</Button></div></Show>diff --git a/docs/agent-guide/images/saved-view-create-controls.png b/docs/agent-guide/images/saved-view-create-controls.pngnew file mode 100644index 0000000000..f3a4efd836Binary files /dev/null and b/docs/agent-guide/images/saved-view-create-controls.png differdiff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.mdindex b3d1cb32fe..caa4bc9715 100644--- a/docs/agent-guide/tasks.md+++ b/docs/agent-guide/tasks.md@@ -129,9 +129,9 @@ the optimistic tag. Repeat with an existing assignment and with removal.Saved views are available on main Tasks, not inside Project or CRM task lists.-- Desktop: use the **Saved views** sidebar section. Its icon-only **+** remains available while collapsed or populated, but hides while the expanded empty state's **+** button is visible.+- Desktop: use the **Saved views** sidebar section. Its icon-only **+** remains available when the section is empty, populated, collapsed, loading, or in an error state. Enter on the focused **+** starts a draft instead of opening the selected task.- Mobile: the **Saved views** pill sits after **Filters** and before the built-in task tabs, using the same mobile pill component. It shows the selected view's name and active styling, and opens a drawer of saved-view rows with selection and management menus, without a duplicate section heading or a header create button. Create views from changed filters, layout, grouping, or sort in the filter drawer.-- The empty sidebar and mobile picker show **Your go-to views**, the muted description **Save your setup for next time.**, and a neutral icon-only **+** button labeled **Create view** in a rounded container with a subtle border, 12px padding, the surrounding background, and no shadow or illustration. It starts the same unsaved draft as desktop **+**; on mobile, the picker closes first. Configure the draft in Filters, then choose **Save view**.+- The empty sidebar and mobile picker show **Your go-to views**, the muted description **Save your setup for next time.**, and a neutral **Create view** button with a leading plus icon in a rounded container with a subtle border, 12px padding, the surrounding background, and no shadow or illustration. It starts the same unsaved draft as desktop **+**; on mobile, the picker closes first. Configure the draft in Filters, then choose **Save view**.- Desktop **+** starts an unsaved view without person restrictions and with explicit open-status filters. It expands the section and adds a selected, italic **New view** row labeled **Draft** in the sidebar and mobile picker. Configure filters, then choose **Save view**; the name defaults to **New view** and can be edited before saving. A confirmed save replaces the draft with the named view; **Cancel** in the desktop toolbar or mobile filter drawer, another selection, or leaving Tasks removes the unsaved row. Canceling only the name dialog keeps the draft for later.- When filters, layout, grouping, or sort differ from the built-in tab defaults, the filled **Save view** button appears immediately left of Filters on desktop and in an edge-to-edge mobile banner above the filter drawer footer. The borderless banner overlays content on a drawer-colored backing and has a leading bookmark icon on its button. Base settings and search alone do not show the banner. It captures current filters, layout, grouping, and ordered sort directions, but excludes text search and scroll state. My Tasks adds **Me** to Assignee; Created by me adds it to Created by. Additional people in the same filter use OR matching.- Saved views use the normal Assignee and Created by filters, not a separate Scope control. **Me** stays relative; its tooltip says “Matches whoever opens this saved view.” A named person stays fixed. Removing Me removes that restriction.@@ -144,6 +144,8 @@ Saved views are available on main Tasks, not inside Project or CRM task lists.- A conflicting save retains the draft and offers **Reload saved view** or **Duplicate**. A network failure also retains the name and sharing inputs.- Copy links use the existing split search codec, for example `/app/component/tasks?s0.tasks.savedView=<uuid>`.++Verify creation without early persistence, explicit save/reset, copy versus owner-only editing, desktop/mobile metadata dialogs, and returning from task detail. Repeat with another teammate, a removed/rejoined owner, an unavailable tag, and a stale revision.Exercise these flows at desktop, phone, and tablet widths. Verify the mobile pill strip reserves its full height without overlapping task content, including after scrolling and returning from a drawer. Check that the mobile creation banner stays above the footer while filters scroll behind it and that the final filter controls can scroll clear of the banner. Verify it appears for changes to filters, layout, grouping, or sort and disappears when all four match the built-in tab defaults. Check keyboard navigation inside the mobile picker and focus after opening and closing Edit, Duplicate, or Delete. These focused dialogs use the shared imperative dialog host and must close when their owning account or view changes; the picker closes before a management dialog opens. Saving from the filter drawer closes it before opening the name dialog; Cancel or Escape reopens the unchanged filter draft, while a confirmed creation selects the new view without reopening the drawer. Delay a save while navigating or editing filters, and delay a deletion while selecting its target: stale saves must not change the new selection, later filter edits must survive, and confirmed deletion must clear its selected target.diff --git a/docs/design/saved-views.md b/docs/design/saved-views.mdindex 5e41a9da5a..9b6d597793 100644--- a/docs/design/saved-views.md+++ b/docs/design/saved-views.md@@ -100,11 +100,12 @@ Compose the list through compound components and reuse styled menu items acrossits context and overflow menus. The mobile picker shows rows without a duplicatesection heading or general create button. The compact sidebar and picker emptystate show the heading “Your go-to views”, the muted description “Save your setup-for next time.” and a neutral icon-only plus button labeled Create view, without a-separate illustration. A subtly bordered, rounded container uses 12px padding,-inherits the surrounding background, and has no shadow. Hide the sidebar header's-plus while that action is visible; retain it while collapsed or populated. The-action starts the existing draft flow after closing the picker. Changes from the+for next time.” and a neutral Create view button with a leading plus icon, without+a separate illustration. A subtly bordered, rounded container uses 12px padding,+inherits the surrounding background, and has no shadow. The sidebar header's+icon-only plus remains available in every section state, including when the+empty-state button is visible. The empty-state button starts the existing draft+flow after closing the picker. Changes from thebuilt-in settings expose creation in the filter drawer's overlay banner above thefooter and existing-view save/reset actions at its footer's right.Starting a new view from the desktop sidebar expands the section and shows one