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.

fix(calendar): simplify settings when no calendar is connected (#8621)

gbirmanbd1f04dbee31
diff --git a/apps/web/src/features/calendar-team/components/team-sharing-settings.tsx b/apps/web/src/features/calendar-team/components/team-sharing-settings.tsx
index ad599e5e4a..6269ad5c9e 100644
--- a/apps/web/src/features/calendar-team/components/team-sharing-settings.tsx
+++ b/apps/web/src/features/calendar-team/components/team-sharing-settings.tsx
@@ -114,7 +114,14 @@ export function TeamSharingSettings(props: {
</Show>
</SettingsCard>
</SettingsSection>
- <Show when={props.hasTeam}>
+ <Show
+ when={
+ props.hasTeam &&
+ (props.calendarsLoading ||
+ props.calendarsError ||
+ props.calendars.length > 0)
+ }
+ >
<SettingsSection
title="Calendars that count as busy"
description="Checked calendars block your time when teammates or agents check your availability."
diff --git a/apps/web/src/features/calendar/components/connected-calendars.tsx b/apps/web/src/features/calendar/components/connected-calendars.tsx
index 355571b06c..372255b7c8 100644
--- a/apps/web/src/features/calendar/components/connected-calendars.tsx
+++ b/apps/web/src/features/calendar/components/connected-calendars.tsx
@@ -36,6 +36,11 @@ export function ConnectedCalendars(props: {
onAccountColor: (id: string, color: string | undefined) => void;
onSourceColor: (id: string, color: string | undefined) => void;
}) {
+ const accountNeedingPermission = () =>
+ props.accounts.length === 1 && props.accounts[0].needsPermission
+ ? props.accounts[0]
+ : undefined;
+ const accountList = () => (accountNeedingPermission() ? [] : props.accounts);
return (
<SettingsSection
title="Connected calendars"
@@ -44,17 +49,38 @@ export function ConnectedCalendars(props: {
<SettingsCard>
<SettingsRow
label="Google Calendar"
- description="Keep work and personal calendars together."
+ description={
+ <Show
+ when={accountNeedingPermission()}
+ fallback="Keep work and personal calendars together."
+ >
+ {(account) => `Give Macro access to ${account().email}.`}
+ </Show>
+ }
>
- <Show when={props.canConnect}>
+ <Show
+ when={accountNeedingPermission()}
+ fallback={
+ <Show when={props.canConnect}>
+ <Button
+ size="sm"
+ variant="outline"
+ disabled={props.connecting}
+ onClick={props.onConnect}
+ >
+ <PlusIcon class="size-4" />
+ {props.connecting ? 'Connecting…' : 'Connect account'}
+ </Button>
+ </Show>
+ }
+ >
<Button
size="sm"
- variant="outline"
+ variant="cta"
disabled={props.connecting}
- onClick={props.onConnect}
+ onClick={props.onEnable}
>
- <PlusIcon class="size-4" />
- {props.connecting ? 'Connecting…' : 'Connect account'}
+ {props.connecting ? 'Connecting…' : 'Connect'}
</Button>
</Show>
</SettingsRow>
@@ -74,7 +100,7 @@ export function ConnectedCalendars(props: {
</Button>
</div>
</Show>
- <Index each={props.accounts}>
+ <Index each={accountList()}>
{(account) => {
const visibleCount = () =>
account().calendars.filter((c) => props.isVisible(c.id)).length;
@@ -189,10 +215,12 @@ export function ConnectedCalendars(props: {
}}
</Index>
</SettingsCard>
- <p class="px-6 text-xs text-ink-extra-muted">
- Visibility and colors are saved in this browser. Hiding a calendar does
- not disconnect it or change your booking availability.
- </p>
+ <Show when={props.accounts.some((account) => account.calendars.length)}>
+ <p class="px-6 text-xs text-ink-extra-muted">
+ Visibility and colors are saved in this browser. Hiding a calendar
+ does not disconnect it or change your booking availability.
+ </p>
+ </Show>
</SettingsSection>
);
}
diff --git a/docs/agent-guide/calendar.md b/docs/agent-guide/calendar.md
index 7a72772d5a..613501314c 100644
--- a/docs/agent-guide/calendar.md
+++ b/docs/agent-guide/calendar.md
@@ -140,7 +140,9 @@ the flag request gets no answer, for example when a browser blocks it.
Calendar connections live in **Settings → Calendar** (`/app/settings/calendar`).
Connected calendars offers Connect account (the existing Google consent flow),
Connect calendar for accounts missing calendar permission, and Disconnect with
-confirmation. Disconnect removes calendar access/data, not the Gmail connection.
+confirmation. When the only linked account lacks calendar permission, the Google
+Calendar row shows just a filled Connect button for it, with no account list or
+visibility note. Disconnect removes calendar access/data, not the Gmail connection.
Account checkboxes show/hide all child calendars; partial selection is shown as
mixed. Individual calendars can also be shown/hidden. The account color is the
default for its calendars; a child color overrides it. Click a color dot to open
@@ -238,7 +240,8 @@ all of its calendars at once. These choices decide which calendars represent the
user's personal schedule. Primary calendars count by default; other calendars
require explicit inclusion. Meetings the user attends also contribute, except
declined meetings. Following a coworker's calendar does not automatically make
-that coworker's events occupy the user's time.
+that coworker's events occupy the user's time. The section is hidden when the
+user has no calendars to list.
Teammates' shared events do not render on the grid; `Team out of office` is the
only teammate overlay. Replacing a login session clears team data and open