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.

feat(teams): prompt inviters to send a heads-up with the invite link (#9921)

Jacob Beckerman452a36fd80c6
diff --git a/apps/web/src/features/onboarding/components/team-panels.tsx b/apps/web/src/features/onboarding/components/team-panels.tsx
index 3807af4b6b..792abc50d1 100644
--- a/apps/web/src/features/onboarding/components/team-panels.tsx
+++ b/apps/web/src/features/onboarding/components/team-panels.tsx
@@ -1,13 +1,15 @@
import CheckIcon from '@icon/system/regular/check.svg';
import LinkIcon from '@icon/system/regular/link.svg';
import { Button } from '@ui';
-import { For } from 'solid-js';
+import { For, Show } from 'solid-js';
import type { TeamInvite } from '../context/onboarding-context';
import { ContinueButton, SecondaryButton, SkipButton } from './controls';
/** Already on a team — auto-joined by domain, or just created/joined here. */
export function OnTeamPanel(props: {
name: string;
+ /** Teammates just emailed from this step; asks for a heads-up when > 0. */
+ invited?: number;
finishing: boolean;
copyingLink: boolean;
onCopyLink: () => void;
@@ -22,10 +24,21 @@ export function OnTeamPanel(props: {
<p class="text-sm font-medium text-ink">You're on {props.name}</p>
{/* Copy must stay true for auto-join, invite-accept, and the
optimistic mid-create flash alike. */}
- <p class="max-w-xs text-xs text-ink-muted leading-snug">
- Your team is set up — everything your teammates bring into Macro is
- shared with you.
- </p>
+ <Show
+ when={(props.invited ?? 0) > 0}
+ fallback={
+ <p class="max-w-xs text-xs text-ink-muted leading-snug">
+ Your team is set up — everything your teammates bring into Macro
+ is shared with you.
+ </p>
+ }
+ >
+ <p class="max-w-xs text-xs text-ink-muted leading-snug">
+ {props.invited === 1
+ ? 'Invite sent. Give your teammate a heads-up: send them the invite link in Slack or a text so they know to look for the email.'
+ : `Invites sent to ${props.invited} teammates. Give them a heads-up: send the invite link in Slack or a text so they know to look for the email.`}
+ </p>
+ </Show>
</div>
<ContinueButton
label={props.finishing ? 'Opening your workspace…' : 'Continue'}
diff --git a/apps/web/src/features/onboarding/primitives/team-step.ts b/apps/web/src/features/onboarding/primitives/team-step.ts
index 8cf696a2d9..f58ff223fb 100644
--- a/apps/web/src/features/onboarding/primitives/team-step.ts
+++ b/apps/web/src/features/onboarding/primitives/team-step.ts
@@ -121,7 +121,11 @@ function createInviteSlots(initial: string[]) {
export function createTeamForm(
context: Pick<OnboardingContext, 'createTeam' | 'track'>,
seed: TeamFormSeed,
- options: { ownEmail: string | undefined }
+ options: {
+ ownEmail: string | undefined;
+ /** Called once the team exists, with the addresses it emailed. */
+ onCreated?: (sent: readonly string[]) => void;
+ }
) {
const [name, setName] = createSignal(
seed.domain ? deriveTeamName(seed.domain) : ''
@@ -163,6 +167,7 @@ export function createTeamForm(
used_domain_suggestion: seed.domain !== undefined,
allow_domain_join: domainJoin(),
});
+ options.onCreated?.(sent);
};
return {
diff --git a/apps/web/src/features/onboarding/views/team-step.tsx b/apps/web/src/features/onboarding/views/team-step.tsx
index 2e093374bd..b870cae351 100644
--- a/apps/web/src/features/onboarding/views/team-step.tsx
+++ b/apps/web/src/features/onboarding/views/team-step.tsx
@@ -1,7 +1,7 @@
import { fireAndForget } from '@core/util/fireAndForget';
import LinkIcon from '@icon/system/regular/link.svg';
import { ToggleSwitch } from '@ui';
-import { createMemo, Match, Show, Switch } from 'solid-js';
+import { createMemo, createSignal, Match, Show, Switch } from 'solid-js';
import {
ContinueButton,
SecondaryButton,
@@ -59,6 +59,9 @@ export function TeamStep(props: {
);
const inviteLink = createTeamInviteLinkCopy(context);
+ // How many teammates this step just emailed, so the confirmation can ask
+ // the creator to give them a heads-up.
+ const [invited, setInvited] = createSignal(0);
// A personal address has no team to create; it refers friends instead.
const referring = () => {
const ready = seed();
@@ -86,6 +89,7 @@ export function TeamStep(props: {
<OnTeamPanel
name={name}
finishing={props.finishing}
+ invited={invited()}
copyingLink={inviteLink.copying()}
onCopyLink={() => fireAndForget(inviteLink.copy(), 'onboarding')}
onContinue={props.onContinue}
@@ -123,6 +127,7 @@ export function TeamStep(props: {
finishing={props.finishing}
seed={ready()}
ownEmail={ownEmail()}
+ onInvited={setInvited}
/>
</Show>
)}
@@ -147,10 +152,12 @@ function TeamForm(props: {
finishing: boolean;
seed: TeamFormSeed;
ownEmail: string | undefined;
+ onInvited: (count: number) => void;
}) {
const context = useOnboardingContext();
const form = createTeamForm(context, props.seed, {
ownEmail: props.ownEmail,
+ onCreated: (sent) => props.onInvited(sent.length),
});
return (
<div class="flex flex-col gap-3">
diff --git a/apps/web/src/features/settings/Settings.tsx b/apps/web/src/features/settings/Settings.tsx
index 2d484a4dea..8e1e55c381 100644
--- a/apps/web/src/features/settings/Settings.tsx
+++ b/apps/web/src/features/settings/Settings.tsx
@@ -265,7 +265,7 @@ export function SettingsPanel(props: SettingsPanelProps) {
onSearchQueryChange={setSearchQuery}
isItemActive={isItemActive}
onSelect={selectRoutedTab}
- footer={<TeamSidebarAction />}
+ action={<TeamSidebarAction />}
/>
</ViewShell.Aside>
<ViewShell.Main>
diff --git a/apps/web/src/features/settings/Team.tsx b/apps/web/src/features/settings/Team.tsx
index 3d34200901..42c8b5744e 100644
--- a/apps/web/src/features/settings/Team.tsx
+++ b/apps/web/src/features/settings/Team.tsx
@@ -34,7 +34,10 @@ import {
} from 'solid-js';
import { z } from 'zod';
import { SettingsCard, SettingsPage, SettingsSection } from './primitives';
-import { TeamInviteLinkSection } from './TeamInviteLinkSection';
+import {
+ CopyTeamInviteLinkButton,
+ TeamInviteLinkSection,
+} from './TeamInviteLinkSection';
import { isTeamAdminOrOwner } from './teamMemberPermissions';
const emailSchema = z.string().email();
@@ -451,7 +454,11 @@ export function CreateTeamDialog(props: {
);
}
-/** Invite people to an existing team by email. */
+/**
+ * Invite people to an existing team by email. After sending, a second step
+ * asks the inviter to give the invitees a heads-up with the team's invite
+ * link: an email from someone they expect is far more likely to be opened.
+ */
export function InviteToTeamDialog(props: {
teamId: string;
/** Team admins and owners may reset or turn off the invite link. */
@@ -460,6 +467,12 @@ export function InviteToTeamDialog(props: {
onClose: () => void;
}) {
const inviteToTeamMutation = useInviteToTeamMutation();
+ // The addresses just invited; set once sending succeeds to show the
+ // heads-up step.
+ const [sent, setSent] = createSignal<string[]>();
+ // Bumped when the dialog closes, so a send that finishes after the inviter
+ // dismissed it cannot reopen on the heads-up step.
+ let submission = 0;
const [invites, setInvites] = createSignal<InviteEntry[]>([EMPTY_INVITE]);
const [inviteAsAgent, setInviteAsAgent] = createSignal(false);
const [inviteErrors, setInviteErrors] = createSignal<(string | undefined)[]>(
@@ -483,6 +496,8 @@ export function InviteToTeamDialog(props: {
setInvites([EMPTY_INVITE]);
setInviteAsAgent(false);
setInviteErrors([]);
+ setSent(undefined);
+ submission += 1;
props.onClose();
};
@@ -494,12 +509,25 @@ export function InviteToTeamDialog(props: {
.map((i) => ({ email: i.email.trim() }));
if (inviteEntries.length === 0) return;
+ // Agent invites are redeemed by the agent's own signup, so a heads-up
+ // to a person doesn't apply.
+ const asAgent = inviteAsAgent();
+ const current = submission;
inviteToTeamMutation.mutate(
{
teamId: props.teamId,
- request: { invites: inviteEntries, is_agent: inviteAsAgent() },
+ request: { invites: inviteEntries, is_agent: asAgent },
},
- { onSuccess: close }
+ {
+ onSuccess: () => {
+ if (current !== submission) return;
+ if (asAgent) {
+ close();
+ return;
+ }
+ setSent(inviteEntries.map((entry) => entry.email));
+ },
+ }
);
};
@@ -511,60 +539,116 @@ export function InviteToTeamDialog(props: {
<XIcon class="size-3.5 touch:size-6 shrink-0 pointer-events-none" />
</Dialog.CloseButton>
<Dialog.Title as="span" class="text-sm font-medium p-0 m-0">
- Invite to Team
+ <Show when={sent()} fallback="Invite to Team">
+ Let them know it's coming
+ </Show>
</Dialog.Title>
</Panel.Header>
- <Panel.Body class="p-3 flex flex-col gap-3">
- <TeamInviteLinkSection
- teamId={props.teamId}
- canManage={props.canManageLink}
- />
- <div class="h-px bg-edge-muted" />
- <div class="text-sm text-ink">Invite by email</div>
- <InviteEmailsInput
- invites={invites()}
- onChange={setInvites}
- errors={inviteErrors()}
- onErrorsChange={setInviteErrors}
- />
- <Checkbox checked={inviteAsAgent()} onChange={setInviteAsAgent}>
- <Checkbox.Control />
- <Checkbox.Label class="text-sm text-ink">
- Invite as agent
- </Checkbox.Label>
- </Checkbox>
- <div class="flex justify-end gap-1 pt-2">
- <Button
- variant="ghost"
- disabled={inviteToTeamMutation.isPending}
- onClick={close}
- >
- Cancel
- </Button>
- <Button
- variant="secondary"
- disabled={!hasValidInvites() || inviteToTeamMutation.isPending}
- onClick={handleInvite}
- >
- <Show
- when={inviteToTeamMutation.isPending}
- fallback={
- invites().length > 1
- ? `Send ${invites().length} Invites`
- : 'Send Invite'
- }
+ <Show when={sent()}>
+ {(emails) => (
+ <InviteHeadsUpStep
+ teamId={props.teamId}
+ emails={emails()}
+ onDone={close}
+ />
+ )}
+ </Show>
+ <Show when={!sent()}>
+ <Panel.Body class="p-3 flex flex-col gap-3">
+ <TeamInviteLinkSection
+ teamId={props.teamId}
+ canManage={props.canManageLink}
+ />
+ <div class="h-px bg-edge-muted" />
+ <div class="text-sm text-ink">Invite by email</div>
+ <InviteEmailsInput
+ invites={invites()}
+ onChange={setInvites}
+ errors={inviteErrors()}
+ onErrorsChange={setInviteErrors}
+ />
+ <Checkbox checked={inviteAsAgent()} onChange={setInviteAsAgent}>
+ <Checkbox.Control />
+ <Checkbox.Label class="text-sm text-ink">
+ Invite as agent
+ </Checkbox.Label>
+ </Checkbox>
+ <div class="flex justify-end gap-1 pt-2">
+ <Button
+ variant="ghost"
+ disabled={inviteToTeamMutation.isPending}
+ onClick={close}
>
- <SpinnerIcon class="size-4 animate-spin" />
- </Show>
- </Button>
- </div>
- </Panel.Body>
+ Cancel
+ </Button>
+ <Button
+ variant="secondary"
+ disabled={!hasValidInvites() || inviteToTeamMutation.isPending}
+ onClick={handleInvite}
+ >
+ <Show
+ when={inviteToTeamMutation.isPending}
+ fallback={
+ invites().length > 1
+ ? `Send ${invites().length} Invites`
+ : 'Send Invite'
+ }
+ >
+ <SpinnerIcon class="size-4 animate-spin" />
+ </Show>
+ </Button>
+ </div>
+ </Panel.Body>
+ </Show>
</Panel>
</Dialog>
);
}
+/**
+ * The invite dialog's second step: the email is on its way, now nudge the
+ * inviter to send the team's invite link through a channel the invitees
+ * already read.
+ */
+function InviteHeadsUpStep(props: {
+ teamId: string;
+ emails: string[];
+ onDone: () => void;
+}) {
+ return (
+ <Panel.Body class="p-3 flex flex-col gap-3">
+ <div class="flex flex-col gap-1">
+ <div class="text-sm text-ink">
+ <Show
+ when={props.emails.length === 1}
+ fallback={`Invites sent to ${props.emails.length} people`}
+ >
+ Invite sent to <span class="font-medium">{props.emails[0]}</span>
+ </Show>
+ </div>
+ <div class="text-xs text-ink-muted">
+ Invite emails from Macro are easy to miss. Send the invite link in
+ Slack, a text, or your own email so they know to look for it.
+ </div>
+ </div>
+ <Show when={props.emails.length > 1}>
+ <ul class="flex max-h-40 flex-col gap-0.5 overflow-y-auto text-xs text-ink-muted">
+ <For each={props.emails}>
+ {(email) => <li class="truncate">{email}</li>}
+ </For>
+ </ul>
+ </Show>
+ <div class="flex items-center justify-end gap-1 pt-2">
+ <CopyTeamInviteLinkButton teamId={props.teamId} />
+ <Button variant="primary" onClick={() => props.onDone()}>
+ Done
+ </Button>
+ </div>
+ </Panel.Body>
+ );
+}
+
function EmptyTeamState() {
const [showCreateModal, setShowCreateModal] = createSignal(false);
diff --git a/apps/web/src/features/settings/TeamInviteLinkSection.tsx b/apps/web/src/features/settings/TeamInviteLinkSection.tsx
index 2325ca13f3..1c602c05b4 100644
--- a/apps/web/src/features/settings/TeamInviteLinkSection.tsx
+++ b/apps/web/src/features/settings/TeamInviteLinkSection.tsx
@@ -24,6 +24,46 @@ async function copyTeamInviteLink(token: string) {
}
}
+/**
+ * Copies the team's invite link, creating the first one when the team has
+ * none. While the link is unknown (it never loaded) the button stays disabled:
+ * creating one would replace a link people already share.
+ */
+export function CopyTeamInviteLinkButton(props: {
+ teamId: string;
+ class?: string;
+}) {
+ const linkQuery = useTeamInviteLinkQuery(
+ () => props.teamId,
+ () => true
+ );
+ const createLink = useCreateTeamInviteLinkMutation({
+ onSuccess: (token) => copyTeamInviteLink(token),
+ });
+ const token = () =>
+ linkQuery.isPending ? undefined : (linkQuery.data?.token ?? null);
+ const unknown = () => !linkQuery.isPending && linkQuery.data === undefined;
+ const handleCopy = () => {
+ const current = token();
+ if (current) {
+ fireAndForget(copyTeamInviteLink(current), 'team-invite-link');
+ } else if (current === null && !unknown()) {
+ createLink.mutate({ teamId: props.teamId });
+ }
+ };
+ return (
+ <Button
+ variant="secondary"
+ class={props.class}
+ disabled={linkQuery.isPending || createLink.isPending || unknown()}
+ onClick={handleCopy}
+ >
+ <LinkIcon class="size-4" />
+ Copy invite link
+ </Button>
+ );
+}
+
/**
* The team's shareable invite link: anyone who opens it can join the team.
* Anyone who may invite can copy it or create the first one; admins can
diff --git a/apps/web/src/features/settings/TeamMembers.tsx b/apps/web/src/features/settings/TeamMembers.tsx
index f0d8e51c01..db7d3b5812 100644
--- a/apps/web/src/features/settings/TeamMembers.tsx
+++ b/apps/web/src/features/settings/TeamMembers.tsx
@@ -50,6 +50,7 @@ import {
SettingsSection,
} from './primitives';
import { InviteToTeamDialog, useTeamViewer } from './Team';
+import { CopyTeamInviteLinkButton } from './TeamInviteLinkSection';
import {
canInviteToTeam,
canRemoveTeamMember,
@@ -391,16 +392,24 @@ export function TeamMembers(props: { team: TeamSummary }) {
<Show
when={canInviteToTeam(currentUserRole(), allowNonAdminInvites())}
>
- {/* Inverted (black on light, white on dark) so inviting is the
- page's primary action. */}
- <Button
- variant="primary"
- class="text-[15px]"
- onClick={() => setShowInviteModal(true)}
- >
- <PlusIcon class="size-4" />
- Invite
- </Button>
+ <div class="flex items-center gap-2">
+ {/* A link someone sends themselves gets opened; keep it one
+ click from the page alongside the email invite. */}
+ <CopyTeamInviteLinkButton
+ teamId={props.team.id}
+ class="text-[15px]"
+ />
+ {/* Inverted (black on light, white on dark) so inviting is the
+ page's primary action. */}
+ <Button
+ variant="primary"
+ class="text-[15px]"
+ onClick={() => setShowInviteModal(true)}
+ >
+ <PlusIcon class="size-4" />
+ Invite
+ </Button>
+ </div>
</Show>
}
>
diff --git a/apps/web/src/features/settings/TeamSidebarAction.tsx b/apps/web/src/features/settings/TeamSidebarAction.tsx
index 1379911876..50cb7ab533 100644
--- a/apps/web/src/features/settings/TeamSidebarAction.tsx
+++ b/apps/web/src/features/settings/TeamSidebarAction.tsx
@@ -10,8 +10,8 @@ import { CreateTeamDialog, InviteToTeamDialog } from './Team';
import { canInviteToTeam, isTeamAdminOrOwner } from './teamMemberPermissions';
/**
- * The settings sidebar's footer action: invite people to your team, or create
- * a team when you don't have one yet.
+ * The settings sidebar's top action: invite people to your team, or create a
+ * team when you don't have one yet.
*/
export function TeamSidebarAction() {
const userTeamsQuery = useUserTeamsQuery();
@@ -34,7 +34,7 @@ function CreateTeamAction() {
const [open, setOpen] = createSignal(false);
return (
<>
- <FooterItem
+ <ActionItem
icon={<UsersThreeIcon class="size-4" />}
label={t('settingsNav.createTeam')}
onPress={() => setOpen(true)}
@@ -62,9 +62,10 @@ function InviteToTeamAction(props: { teamId: string }) {
return (
<Show when={canInvite()}>
- <FooterItem
+ <ActionItem
icon={<UserPlusIcon class="size-4" />}
label={t('settingsNav.inviteTeam')}
+ rainbow
onPress={() => setOpen(true)}
/>
<InviteToTeamDialog
@@ -77,15 +78,43 @@ function InviteToTeamAction(props: { teamId: string }) {
);
}
-function FooterItem(props: {
+function ActionItem(props: {
icon: JSX.Element;
label: string;
+ /** Paint the label in a rainbow gradient to draw the eye. */
+ rainbow?: boolean;
onPress: () => void;
}) {
return (
<ViewSidebar.Item {...pressHandlers(() => props.onPress())}>
<ViewSidebar.Icon>{props.icon}</ViewSidebar.Icon>
- <span class="truncate">{props.label}</span>
+ <span
+ class="truncate font-medium"
+ style={props.rainbow ? RAINBOW_TEXT_STYLE : undefined}
+ >
+ {props.label}
+ </span>
</ViewSidebar.Item>
);
}
+
+/**
+ * Rainbow stops pulled toward the ink color: darker on the light sidebar and
+ * lighter on the dark one, so every stop keeps the small label at 4.5:1 or
+ * better on both sidebars.
+ */
+const RAINBOW_TEXT_STYLE: JSX.CSSProperties = {
+ 'background-image': `linear-gradient(90deg, ${[
+ '#e5484d',
+ '#d97706',
+ '#30a46c',
+ '#0091ff',
+ '#8e4ec6',
+ '#d6409f',
+ ]
+ .map((hue) => `color-mix(in oklch, ${hue} 70%, var(--color-ink))`)
+ .join(', ')})`,
+ 'background-clip': 'text',
+ '-webkit-background-clip': 'text',
+ color: 'transparent',
+};
diff --git a/apps/web/src/features/settings/components/settings-sidebar.tsx b/apps/web/src/features/settings/components/settings-sidebar.tsx
index 9fe56c96f2..1069aca0de 100644
--- a/apps/web/src/features/settings/components/settings-sidebar.tsx
+++ b/apps/web/src/features/settings/components/settings-sidebar.tsx
@@ -10,8 +10,8 @@ import { SettingsSearchResults } from './settings-search-results';
/**
* Settings' inner navigation, laid out like every other view's sidebar: a
- * title bar, a search field, the grouped section pills, and an optional
- * footer action pinned to the bottom.
+ * title bar, a search field, an optional action (inviting your team) above
+ * the grouped section pills, and the pills themselves.
*/
export function SettingsSidebar(props: {
groups: SettingsTabGroup[];
@@ -22,9 +22,9 @@ export function SettingsSidebar(props: {
onSearchQueryChange: (query: string) => void;
isItemActive: (tab: SettingsTab) => boolean;
onSelect: (tab: SettingsTab) => void;
- footer?: JSX.Element;
+ action?: JSX.Element;
}) {
- const footer = children(() => props.footer);
+ const action = children(() => props.action);
let root: HTMLDivElement | undefined;
return (
<ViewSidebar.Root
@@ -61,6 +61,12 @@ export function SettingsSidebar(props: {
</ViewSidebar.Primary>
<ViewSidebar.Content>
+ {/* Search results replace the pills, so they replace the action too. */}
+ <Show when={action() && !props.searchQuery.trim()}>
+ <ViewSidebar.Nav aria-label={t('settingsNav.teamActions')}>
+ {action()}
+ </ViewSidebar.Nav>
+ </Show>
<Show
when={!props.searchQuery.trim()}
fallback={
@@ -107,12 +113,6 @@ export function SettingsSidebar(props: {
</Show>
</Show>
</ViewSidebar.Content>
-
- <Show when={footer()}>
- <ViewSidebar.Footer class="py-(--sidebar-gutter)">
- {footer()}
- </ViewSidebar.Footer>
- </Show>
</ViewSidebar.Root>
);
}
diff --git a/apps/web/src/features/settings/invite-to-team-dialog.test.tsx b/apps/web/src/features/settings/invite-to-team-dialog.test.tsx
index 32865c485d..0958b15774 100644
--- a/apps/web/src/features/settings/invite-to-team-dialog.test.tsx
+++ b/apps/web/src/features/settings/invite-to-team-dialog.test.tsx
@@ -11,6 +11,9 @@ vi.mock('@queries/team/invites', () => ({
}));
vi.mock('./TeamInviteLinkSection', () => ({
TeamInviteLinkSection: () => null,
+ CopyTeamInviteLinkButton: () => (
+ <button type="button">Copy invite link</button>
+ ),
}));
import { InviteToTeamDialog } from './Team';
@@ -20,13 +23,13 @@ afterEach(() => {
mocks.mutate.mockReset();
});
-function sendInvite(asAgent: boolean) {
+function sendInvite(asAgent: boolean, onClose: () => void = () => {}) {
render(() => (
<InviteToTeamDialog
teamId="team-1"
canManageLink={false}
open
- onClose={() => {}}
+ onClose={onClose}
/>
));
@@ -54,4 +57,37 @@ describe('InviteToTeamDialog', () => {
request: { invites: [{ email: '[email protected]' }], is_agent: true },
});
});
+
+ it('asks the inviter to give a heads-up with the invite link after sending', () => {
+ const onClose = vi.fn();
+ sendInvite(false, onClose);
+ mocks.mutate.mock.calls[0]?.[1]?.onSuccess?.();
+
+ expect(screen.getByText("Let them know it's coming")).toBeTruthy();
+ expect(screen.getByText('[email protected]')).toBeTruthy();
+ expect(
+ screen.getByRole('button', { name: 'Copy invite link' })
+ ).toBeTruthy();
+ expect(onClose).not.toHaveBeenCalled();
+
+ fireEvent.click(screen.getByRole('button', { name: 'Done' }));
+ expect(onClose).toHaveBeenCalledTimes(1);
+ });
+
+ it('closes right away after inviting an agent', () => {
+ const onClose = vi.fn();
+ sendInvite(true, onClose);
+ mocks.mutate.mock.calls[0]?.[1]?.onSuccess?.();
+
+ expect(onClose).toHaveBeenCalledTimes(1);
+ expect(screen.queryByText("Let them know it's coming")).toBeNull();
+ });
+
+ it('stays on the invite form when a send finishes after the dialog closed', () => {
+ sendInvite(false);
+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }));
+ mocks.mutate.mock.calls[0]?.[1]?.onSuccess?.();
+
+ expect(screen.queryByText("Let them know it's coming")).toBeNull();
+ });
});
diff --git a/apps/web/src/lib/i18n/locales/en/settings-nav.ts b/apps/web/src/lib/i18n/locales/en/settings-nav.ts
index 7254caf9a2..8d68a9a22a 100644
--- a/apps/web/src/lib/i18n/locales/en/settings-nav.ts
+++ b/apps/web/src/lib/i18n/locales/en/settings-nav.ts
@@ -56,4 +56,5 @@ export default {
sectionUnavailable: 'This settings section is unavailable.',
createTeam: 'Create a team',
inviteTeam: 'Invite your team',
+ teamActions: 'Team actions',
};
diff --git a/docs/agent-guide/settings.md b/docs/agent-guide/settings.md
index 85f9a3b281..c7d2484714 100644
--- a/docs/agent-guide/settings.md
+++ b/docs/agent-guide/settings.md
@@ -205,6 +205,12 @@ and its email and **Copy link** go to `/app/signup/agent?team_invite=<id>` (see
grants a Pro seat (an enterprise team, or one with a subscription), otherwise
**Free to join**. Examples: [desktop](media/team-invite-email/desktop.png) and
[mobile](media/team-invite-email/mobile.png).
+After a person invite sends, the dialog's second step, **Let them know it's
+coming**, lists the addresses and offers **Copy invite link** (creating the
+first link when there is none) and **Done**; agent invites close the dialog
+instead. **Team → Members** also shows **Copy invite link** beside **Invite**,
+and onboarding's team confirmation asks a creator who just invited teammates
+to send them the link too.
A signed-out invitee who opens an emailed or link invite is sent to
`/app/login?redirect=/team-invite?…`; once signed in or signed up (including
desktop Google sign-in, whose `macro:///login` callback carries the redirect)
@@ -250,10 +256,11 @@ like any other rail item, and Shift-click opens it in a new split.
`/app/settings/<tab>` opens it as the only split with the app rail still
visible, and `/app/home/~/settings/<tab>` places it beside Home. Its inner
sidebar matches Email and Tasks: a **Settings** title bar, a rounded
-**Search settings** field, the grouped section pills, and a team action pinned
-to the bottom: **Invite your team** (opens the invite dialog; hidden for members
-when the team limits invites to admins) or, with no team, **Create a team**
-(opens the create-team dialog). Unlike other views, it cannot be hidden at
+**Search settings** field, a team action at the top of the list (hidden while
+searching): **Invite your team** in rainbow text (opens the invite dialog;
+hidden for members when the team limits invites to admins) or, with no team,
+**Create a team** (opens the create-team dialog), then the grouped section
+pills. Unlike other views, it cannot be hidden at
desktop widths: there is no **Hide navigation** toggle and `Cmd .` does
nothing, even if it was hidden before. Below 720px the sidebar becomes an overlay opened from **Show
navigation** (or `Cmd .`), which starts closed. Escape closes a