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.

chore(agents): add skeleton loaders to Agents and Home lists (#7146)

Wolf Mermelsteind388619a914c
diff --git a/apps/web/src/components/view-shell/ListSkeleton.tsx b/apps/web/src/components/view-shell/ListSkeleton.tsx
new file mode 100644
index 0000000000..b62b08fa05
--- /dev/null
+++ b/apps/web/src/components/view-shell/ListSkeleton.tsx
@@ -0,0 +1,43 @@
+import { cn } from '@ui';
+import { createSignal, onCleanup, onMount, type ParentProps } from 'solid-js';
+
+function Root(props: ParentProps<{ label: string; class?: string }>) {
+ const [visible, setVisible] = createSignal(false);
+ onMount(() => {
+ const timeout = window.setTimeout(() => setVisible(true), 150);
+ onCleanup(() => window.clearTimeout(timeout));
+ });
+
+ return (
+ <div role="status" aria-label={props.label} class={props.class}>
+ <span class="sr-only">{props.label}</span>
+ <div aria-hidden="true" classList={{ invisible: !visible() }}>
+ {props.children}
+ </div>
+ </div>
+ );
+}
+
+function Row(props: ParentProps<{ class?: string }>) {
+ return (
+ <div
+ class={cn(
+ 'flex h-(--sidebar-row-height) min-w-0 items-center gap-(--sidebar-label-gap) px-(--sidebar-item-inset) touch:h-11',
+ props.class
+ )}
+ >
+ {props.children}
+ </div>
+ );
+}
+
+function Bar(props: { class?: string }) {
+ return (
+ <div
+ class={cn('skeleton-shimmer h-2.5 rounded-full bg-skeleton', props.class)}
+ />
+ );
+}
+
+/** Decorative list geometry; the caller owns loading and pagination state. */
+export const ListSkeleton = { Root, Row, Bar };
diff --git a/apps/web/src/features/agents-view/components/AgentSessionListSkeleton.tsx b/apps/web/src/features/agents-view/components/AgentSessionListSkeleton.tsx
new file mode 100644
index 0000000000..8928dbaab1
--- /dev/null
+++ b/apps/web/src/features/agents-view/components/AgentSessionListSkeleton.tsx
@@ -0,0 +1,43 @@
+import { ListSkeleton } from '@app/components/view-shell/ListSkeleton';
+import { cn } from '@ui';
+import { For, Show } from 'solid-js';
+
+const TITLE_WIDTHS = ['w-3/5', 'w-4/5', 'w-1/2', 'w-2/3', 'w-3/4', 'w-1/2'];
+
+export function AgentSessionListSkeleton(props: { loadingMore?: boolean }) {
+ return (
+ <ListSkeleton.Root
+ label={
+ props.loadingMore
+ ? 'Loading more conversations'
+ : 'Loading conversations'
+ }
+ class="shrink-0"
+ >
+ <div class="flex flex-col gap-(--sidebar-row-gap)">
+ <For each={props.loadingMore ? TITLE_WIDTHS.slice(0, 3) : TITLE_WIDTHS}>
+ {(width, index) => (
+ <ListSkeleton.Row
+ class={cn(index() % 3 === 1 && 'h-12 touch:h-12')}
+ >
+ <div class="flex size-(--sidebar-icon-slot) shrink-0 items-center justify-center">
+ <ListSkeleton.Bar class="size-1.5" />
+ </div>
+ <div class="flex min-w-0 flex-1 flex-col gap-2">
+ <div class="flex items-center gap-3">
+ <div class="min-w-0 flex-1">
+ <ListSkeleton.Bar class={width} />
+ </div>
+ <ListSkeleton.Bar class="h-2 w-5 shrink-0" />
+ </div>
+ <Show when={index() % 3 === 1}>
+ <ListSkeleton.Bar class="h-2 w-2/3 opacity-60" />
+ </Show>
+ </div>
+ </ListSkeleton.Row>
+ )}
+ </For>
+ </div>
+ </ListSkeleton.Root>
+ );
+}
diff --git a/apps/web/src/features/agents-view/components/AgentsSidebar.tsx b/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
index 0d705be4d0..42881b1a9a 100644
--- a/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
+++ b/apps/web/src/features/agents-view/components/AgentsSidebar.tsx
@@ -33,6 +33,7 @@ import {
conversationTimestamp,
} from '../core/recent-conversations';
import { AgentSessionListItem } from '../views/AgentSessionListItem';
+import { AgentSessionListSkeleton } from './AgentSessionListSkeleton';
const AGENTS_ACTION_VIEW_CONTEXT: EntityActionViewContext = {
supportsMarkDone: false,
@@ -244,6 +245,7 @@ export function AgentsSidebar(props: AgentsSidebarProps) {
<ViewSidebar.Nav
class="min-h-0 flex-1 shrink overflow-auto"
aria-label="Recent conversations"
+ aria-busy={props.loading || props.loadingNextPage}
onScroll={(event) => {
const list = event.currentTarget;
if (!props.hasNextPage || props.loadingNextPage) return;
@@ -292,10 +294,8 @@ export function AgentsSidebar(props: AgentsSidebarProps) {
</>
)}
</Key>
- <Show when={props.loading}>
- <p class="px-(--sidebar-item-inset) py-2 text-xs text-ink-muted">
- Loading conversations…
- </p>
+ <Show when={props.loading && total() === 0}>
+ <AgentSessionListSkeleton />
</Show>
<Show when={props.error}>
<ViewSidebar.Item onClick={props.onRetry}>
@@ -311,9 +311,7 @@ export function AgentsSidebar(props: AgentsSidebarProps) {
</p>
</Show>
<Show when={props.loadingNextPage}>
- <p class="px-(--sidebar-item-inset) py-2 text-xs text-ink-muted">
- Loading more…
- </p>
+ <AgentSessionListSkeleton loadingMore />
</Show>
</ViewSidebar.Nav>
</CollapsibleSection.Content>
diff --git a/apps/web/src/features/home/components/HomeList.tsx b/apps/web/src/features/home/components/HomeList.tsx
index 38e1b6a48b..2c3fe97258 100644
--- a/apps/web/src/features/home/components/HomeList.tsx
+++ b/apps/web/src/features/home/components/HomeList.tsx
@@ -39,7 +39,6 @@ import {
} from '@entity';
import { getChannelThreadName } from '@entity/utils/channel-thread-name';
import CheckIcon from '@phosphor/check.svg';
-import SpinnerIcon from '@phosphor/spinner.svg';
import { createElementSize } from '@solid-primitives/resize-observer';
import { debounce } from '@solid-primitives/scheduled';
import { Button } from '@ui';
@@ -77,6 +76,7 @@ import {
import { HomeDateGroupHeader } from './HomeDateGroupHeader';
import { HomeEmptyState } from './HomeEmptyState';
import { HomeListEntity } from './HomeListEntity';
+import { HomeListSkeleton } from './HomeListSkeleton';
type HomeActionRow = {
entity: WithNotification<EntityData>;
@@ -493,6 +493,7 @@ export function HomeList(props: HomeListProps) {
ref={setListRoot}
role="grid"
aria-label="Home"
+ aria-busy={source.isLoading() || source.isLoadingMore()}
aria-multiselectable="true"
aria-activedescendant={list.focus.key()}
tabIndex={0}
@@ -547,10 +548,9 @@ export function HomeList(props: HomeListProps) {
!isPullRefreshing()
}
>
- <div class="grid min-h-0 flex-1 place-items-center text-ink-muted touch:pt-(--mobile-content-inset-top)">
- <SpinnerIcon
- aria-label="Loading Home"
- class="size-5 animate-spin"
+ <div class="min-h-0 flex-1 overflow-hidden touch:pt-(--mobile-content-inset-top)">
+ <HomeListSkeleton
+ grouped={state.groupBy === 'date' && !state.search.trim()}
/>
</div>
</Match>
@@ -716,6 +716,9 @@ export function HomeList(props: HomeListProps) {
</Switch>
)}
</Virtualizer>
+ <Show when={source.isLoadingMore()}>
+ <HomeListSkeleton loadingMore />
+ </Show>
</div>
</Match>
</Switch>
diff --git a/apps/web/src/features/home/components/HomeListSkeleton.tsx b/apps/web/src/features/home/components/HomeListSkeleton.tsx
new file mode 100644
index 0000000000..6d314aa739
--- /dev/null
+++ b/apps/web/src/features/home/components/HomeListSkeleton.tsx
@@ -0,0 +1,45 @@
+import '@entity/composed/ListEntity.css';
+import { ListSkeleton } from '@app/components/view-shell/ListSkeleton';
+import { For, Show } from 'solid-js';
+
+const TITLE_WIDTHS = [
+ 'w-3/5',
+ 'w-4/5',
+ 'w-1/2',
+ 'w-2/3',
+ 'w-3/4',
+ 'w-1/2',
+ 'w-4/5',
+ 'w-3/5',
+];
+
+export function HomeListSkeleton(props: {
+ grouped?: boolean;
+ loadingMore?: boolean;
+}) {
+ return (
+ <ListSkeleton.Root
+ label={props.loadingMore ? 'Loading more Home items' : 'Loading Home'}
+ class="soup-list min-w-0 shrink-0"
+ >
+ <Show when={props.grouped && !props.loadingMore}>
+ <div class="soup-row-card flex h-7 items-center px-4 touch:pl-(--soup-row-content-inset)">
+ <ListSkeleton.Bar class="h-2 w-16" />
+ </div>
+ </Show>
+ <For each={props.loadingMore ? TITLE_WIDTHS.slice(0, 3) : TITLE_WIDTHS}>
+ {(width) => (
+ <ListSkeleton.Row class="soup-row-card mx-(--sidebar-gutter) my-(--sidebar-row-gap) touch:mx-(--soup-row-gutter) touch:h-16 touch:gap-3 touch:pl-(--soup-row-padding-l) touch:pr-3">
+ <div class="flex size-(--sidebar-icon-slot) shrink-0 items-center justify-center touch:size-8 mobile:size-(--soup-inbox-icon-diameter)">
+ <ListSkeleton.Bar class="size-4 rounded touch:size-full touch:rounded-full" />
+ </div>
+ <div class="flex min-w-0 flex-1 flex-col gap-2">
+ <ListSkeleton.Bar class={width} />
+ <ListSkeleton.Bar class="hidden h-2 w-4/5 opacity-60 touch:block" />
+ </div>
+ </ListSkeleton.Row>
+ )}
+ </For>
+ </ListSkeleton.Root>
+ );
+}
diff --git a/apps/web/src/features/home/home-view.tsx b/apps/web/src/features/home/home-view.tsx
index 99a3ee82a9..fe58a01763 100644
--- a/apps/web/src/features/home/home-view.tsx
+++ b/apps/web/src/features/home/home-view.tsx
@@ -11,11 +11,11 @@ import { SplitPanel } from '@components/app/split-panel';
import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { ListEntityMetadataQueryProvider } from '@entity';
-import SpinnerIcon from '@phosphor/spinner.svg';
import { createEffect, onMount, Show } from 'solid-js';
import { HomeChatStart } from './components/HomeChatStart';
import { HomeList } from './components/HomeList';
import { HomeListLayout } from './components/HomeListLayout';
+import { HomeListSkeleton } from './components/HomeListSkeleton';
import { HomeReturnBreadcrumb } from './components/HomeReturnBreadcrumb';
import { HomeTabs } from './components/HomeTabs';
import { HomeViewProvider, useHomeView } from './home-view-context';
@@ -28,9 +28,12 @@ export type HomeViewProps = {
};
function HomeFallback() {
+ const { state } = useHomeView();
return (
- <div class="grid min-h-0 min-w-0 flex-1 place-items-center text-ink-muted">
- <SpinnerIcon aria-label="Loading Home" class="size-5 animate-spin" />
+ <div class="mt-3 min-h-0 min-w-0 flex-1 overflow-hidden touch:mt-0 touch:pt-(--mobile-content-inset-top)">
+ <HomeListSkeleton
+ grouped={state.groupBy === 'date' && !state.search.trim()}
+ />
</div>
);
}
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 83bf5940b9..b6302c980e 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -1292,6 +1292,12 @@ html[data-touch-device='true'] :is(
animation: skeleton-shimmer 1.4s infinite;
}
+@media (prefers-reduced-motion: reduce) {
+ .skeleton-shimmer::after {
+ animation: none;
+ }
+}
+
@keyframes slideIn {
from { transform: translateX(calc(100% + 16px)); }
to { transform: translateX(0 ); }
diff --git a/docs/AGENT_GUIDE/ai-chat.md b/docs/AGENT_GUIDE/ai-chat.md
index 36a9f8c684..81f30975d1 100644
--- a/docs/AGENT_GUIDE/ai-chat.md
+++ b/docs/AGENT_GUIDE/ai-chat.md
@@ -35,6 +35,12 @@ permission failures should display a failed tool call without a successful resul
## Where chats live
+The Agents conversation list shows row skeletons after a short delay on first
+load. Fetching another page appends three placeholders while existing sessions
+remain usable. Wait for named conversation buttons before selecting a session;
+the placeholders are decorative and cannot be focused. Reduced motion disables
+the shimmer.
+
- If session creation fails, the session view shows **Unable to start this agent**
with the service's reason. Repository access requires a GitHub connection to
Macro that covers that repository; connecting only Cursor does not grant Macro
diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.md
index ef335e26ea..397093549e 100644
--- a/docs/AGENT_GUIDE/surfaces.md
+++ b/docs/AGENT_GUIDE/surfaces.md
@@ -1,5 +1,12 @@
# Other Surfaces
+## Home list loading
+
+Home shows compact row skeletons during initial loading, with taller notification
+placeholders on touch devices. Date grouping includes a placeholder heading.
+Pagination appends three placeholders without replacing existing items; refresh
+keeps loaded items visible. Wait for real rows before navigating or selecting.
+
## Top bars
Right-aligned split-header actions (including Calendar's touch/preview New event