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): clarify the sidebar empty state (#8920)
dev-rb0991ca793955
diff --git a/apps/web/src/features/saved-views/AGENTS.md b/apps/web/src/features/saved-views/AGENTS.mdindex befa145242..413801ac14 100644--- a/apps/web/src/features/saved-views/AGENTS.md+++ b/apps/web/src/features/saved-views/AGENTS.md@@ -26,6 +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.- 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 a02a6f04df..885fc641dc 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,19 +28,23 @@ function Root(props: {);}-function Header(props: { onCreate: () => void }) {+function Header(props: { onCreate?: () => void }) {return (<CollapsibleSection.Header><CollapsibleSection.Trigger><span class="min-w-0 truncate">{t('viewMenus.savedViews')}</span><CollapsibleSection.Indicator /></CollapsibleSection.Trigger>- <CollapsibleSection.Action- label={t('viewMenus.newSavedView')}- onClick={props.onCreate}- >- <PlusIcon class="size-3.5" />- </CollapsibleSection.Action>+ <Show when={props.onCreate}>+ {(onCreate) => (+ <CollapsibleSection.Action+ label={t('viewMenus.newSavedView')}+ onClick={onCreate()}+ >+ <PlusIcon class="size-3.5" />+ </CollapsibleSection.Action>+ )}+ </Show></CollapsibleSection.Header>);}diff --git a/apps/web/src/features/saved-views/components/saved-view-picker.tsx b/apps/web/src/features/saved-views/components/saved-view-picker.tsxindex 5e6c91b58b..983d8dbb40 100644--- a/apps/web/src/features/saved-views/components/saved-view-picker.tsx+++ b/apps/web/src/features/saved-views/components/saved-view-picker.tsx@@ -1,3 +1,4 @@+import { t } from '@app/lib/i18n';import { MobileDrawer } from '@components/app/mobile/MobileDrawer';import { PillButton } from '@components/app/mobile/PillTabs';import CaretDownIcon from '@phosphor/caret-down.svg';@@ -60,7 +61,7 @@ export function SavedViewPicker(props: {<MobileDrawer.Content><MobileDrawer.Handle /><MobileDrawer.Title class="px-6 pb-3 text-base font-medium">- Saved views+ {t('viewMenus.savedViews')}</MobileDrawer.Title><MobileDrawer.ScrollBody class="px-3">{props.children((action) => {diff --git a/apps/web/src/features/tasks-view/AGENTS.md b/apps/web/src/features/tasks-view/AGENTS.mdindex 2d7f384de0..e00a334523 100644--- a/apps/web/src/features/tasks-view/AGENTS.md+++ b/apps/web/src/features/tasks-view/AGENTS.md@@ -24,7 +24,8 @@ Main Tasks and reusable task-list hosts. Projects and CRM embed `TasksViewProvid- Show filled Save view and Save changes actions; place mobile creation in a borderless, edge-to-edge info banner overlaying filter content immediately above the footer with unpunctuated copy and a leading bookmark icon on its button only when filters, layout, grouping, or sort differ from the built-in tab defaults, excluding search.- 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; show rows without a duplicate section header or create button inside its drawer.+- 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.- 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 b37f90def9..bb7feffaf6 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@@ -1,9 +1,12 @@+import { t } from '@app/lib/i18n';import { replacePaneSearchParams } from '@app/lib/split-router';import { HeaderActionGroup } from '@components/app/HeaderActionGroup';import { toast } from '@core/component/Toast/Toast';import { useUserId } from '@core/context/user';+import { useHotkeyDOMScope } from '@core/hotkey/hotkeys';import { writeClipboardData } from '@core/util/dataTransfer';import { fireAndForget } from '@core/util/fireAndForget';+import PlusIcon from '@icon/system/regular/plus.svg';import BookmarkIcon from '@phosphor/bookmark-simple.svg';import DotsIcon from '@phosphor/dots-three.svg';import InfoIcon from '@phosphor/info.svg';@@ -286,6 +289,30 @@ function TaskSavedViewMenuItems(props: {);}+function useTaskSavedViewListState() {+ const { savedViews, savedViewsList } = useTasksView();+ const viewerId = useUserId();+ const creating = () => savedViews?.view().kind === 'new';+ const items = () => {+ const records = savedViewsList?.items();+ const selection = savedViews?.view();+ // Keep confirmed creations visible without restoring a revoked shared view.+ if (+ selection?.kind === 'saved' &&+ selection.record.ownerId === viewerId() &&+ !records?.some((record) => record.id === selection.record.id)+ )+ return [selection.record, ...(records ?? [])];+ return records;+ };+ return {+ creating,+ items,+ empty: () =>+ !creating() && !savedViewsList?.loading() && items()?.length === 0,+ };+}+export function TaskSavedViewsList() {const {savedViews,@@ -294,6 +321,11 @@ export function TaskSavedViewsList() {isSidebarSectionOpen,setSidebarSectionOpen,} = useTasksView();+ const list = useTaskSavedViewListState();+ const create = () => {+ setSidebarSectionOpen('saved-views', true);+ startSavedView();+ };return (<Show when={savedViews && savedViewsList}><SavedViewList.Root@@ -301,10 +333,11 @@ export function TaskSavedViewsList() {onOpenChange={(open) => setSidebarSectionOpen('saved-views', open)}><SavedViewList.Header- onCreate={() => {- setSidebarSectionOpen('saved-views', true);- startSavedView();- }}+ onCreate={+ !isSidebarSectionOpen('saved-views') || !list.empty()+ ? create+ : undefined+ }/><SavedViewList.Content><TaskSavedViewRows />@@ -318,27 +351,21 @@ function TaskSavedViewRows(props: {onAction?: (action: () => void) => void;dialogOwner?: Owner | null;}) {- const { savedViews, savedViewsList, selectSavedView, closeTask } =- useTasksView();+ const {+ savedViews,+ savedViewsList,+ selectSavedView,+ startSavedView,+ closeTask,+ } = useTasksView();+ const [attachCreateHotkeys] = useHotkeyDOMScope('create-saved-view', true);const viewerId = useUserId();const owner = props.dialogOwner ?? getOwner();const selectedId = () => {const view = savedViews?.view();return view?.kind === 'saved' ? view.record.id : undefined;};- const creating = () => savedViews?.view().kind === 'new';- const items = () => {- const records = savedViewsList?.items();- const selection = savedViews?.view();- // Keep confirmed creations visible without restoring a revoked shared view.- if (- selection?.kind === 'saved' &&- selection.record.ownerId === viewerId() &&- !records?.some((record) => record.id === selection.record.id)- )- return [selection.record, ...(records ?? [])];- return records;- };+ const { creating, items, empty } = useTaskSavedViewListState();const run = (action: () => void) =>props.onAction ? props.onAction(action) : action();return (@@ -372,12 +399,26 @@ function TaskSavedViewRows(props: {Loading views…</p></Show>- <Show- when={!creating() && !views().loading() && items()?.length === 0}- >- <p class="px-3 py-2 text-xs text-ink-muted">- Save a set of filters to return to it.- </p>+ <Show when={empty()}>+ <div class="mx-2 my-1 flex flex-col items-start gap-2 rounded-lg border border-edge-muted p-3 group-data-closed/sidebar-section:invisible">+ <div class="space-y-1">+ <p class="text-xs font-medium text-ink">+ {t('viewMenus.savedViewsEmptyTitle')}+ </p>+ <p class="text-xs text-ink-muted">+ {t('viewMenus.savedViewsEmptyDescription')}+ </p>+ </div>+ <Button+ ref={attachCreateHotkeys}+ size="icon-sm"+ label={t('viewMenus.createSavedView')}+ variant="outline"+ onClick={() => run(startSavedView)}+ >+ <PlusIcon class="size-3.5" />+ </Button>+ </div></Show><Show when={views().error()}><Button@@ -417,7 +458,7 @@ export function TaskSavedViewsPicker() {scopeKey={viewerId()}label={views().view().kind === 'default'- ? 'Saved views'+ ? t('viewMenus.savedViews'): taskSavedViewTitle(views().view())}>diff --git a/apps/web/src/lib/i18n/locales/en/view-menus.ts b/apps/web/src/lib/i18n/locales/en/view-menus.tsindex d568f1c4d6..fdc98a579b 100644--- a/apps/web/src/lib/i18n/locales/en/view-menus.ts+++ b/apps/web/src/lib/i18n/locales/en/view-menus.ts@@ -116,6 +116,9 @@ export default {personal: 'Personal',savedViews: 'Saved views',newSavedView: 'New saved view',+ savedViewsEmptyTitle: 'Your go-to views',+ savedViewsEmptyDescription: 'Save your setup for next time.',+ createSavedView: 'Create view',savedTaskViews: 'Saved task views',newViewDraft: 'New view, draft',newView: 'New view',diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.mdindex a5f3d9b4b8..28445fe4b9 100644--- a/docs/agent-guide/tasks.md+++ b/docs/agent-guide/tasks.md@@ -129,8 +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 empty.-- 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 **+** button. Create views from changed filters, layout, grouping, or sort in the filter drawer.+- 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.+- 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**.- 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.diff --git a/docs/design/saved-views.md b/docs/design/saved-views.mdindex 0c2284ec0b..5e41a9da5a 100644--- a/docs/design/saved-views.md+++ b/docs/design/saved-views.md@@ -23,7 +23,7 @@ main Tasks screen.| Contents | Filters, selected layout, grouping, and ordered sorting, including implicit person conditions. No search text or scroll state. || Editing | Explicit Save changes, Reset, and Duplicate. || Navigation | Leaving discards temporary edits without a confirmation prompt. |-| Creation | Desktop sidebar `+` starts an unsaved view; mobile creates from changed filters, layout, grouping, or sort in the filter drawer. |+| Creation | Desktop sidebar `+` or the shared empty-state Create view action starts an unsaved view; mobile also captures changed filters, layout, grouping, or sort in the filter drawer. || Capture | Save view appears left of Filters on desktop and in the mobile overlay banner when filters, layout, grouping, or sort differ from built-in tab defaults. || Mobile | Shared picker pill after Filters and before built-in tabs; its drawer browses/manages views, while the filter drawer owns save/create/reset actions. || Initial surfaces | Main Tasks only; not project or CRM embedded task lists. |@@ -98,9 +98,15 @@ writing or reloading, reject stale completions, and explicitly select createdviews. Mutation dialogs receive a refresh callback, not both query sources.Compose the list through compound components and reuse styled menu items acrossits context and overflow menus. The mobile picker shows rows without a duplicate-section heading or create button; changes from the built-in settings expose creation in-the filter drawer's overlay banner above the footer and existing-view save/reset-actions at its footer's right.+section heading or general create button. The compact sidebar and picker empty+state 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+built-in settings expose creation in the filter drawer's overlay banner above the+footer and existing-view save/reset actions at its footer's right.Starting a new view from the desktop sidebar expands the section and shows onelocal, selected New view row labeled Draft in the sidebar and mobile picker.Confirmed creation replaces the draft with the named record, including while the