App domain addition
Recreate the custom domain flow inside apps/app and understand its data flow.
This doc captures how the custom domain flow was wired in the app UI, so it can be restored later.
Where the UI lives
apps/app/src/components/settings/team-inbox-settings.tsx- Previously contained a "Domains" card and action buttons.
- Uses
useInboxSettingsParams()to open a sheet via query params.
apps/app/src/components/settings/inbox-domain-sheet.tsx- The sheet UI for adding/editing the domain.
- Uses
trpc.inbox.settings.get(read) +trpc.inbox.settings.update(write).
apps/app/src/hooks/use-inbox-settings-params.tsdomainSheetquery param ("create"or"edit") controls the sheet.
Data flow
- Owner check:
trpc.team.currentprovides role and gates actions. - Current domain:
trpc.inbox.settings.getsuppliessettings.domain. - Save:
trpc.inbox.settings.updatepersists a domain string ornull. - Refresh: invalidate
inbox.settings.get+inbox.mailboxes.list.
Validation rules
- Domain must match
/^[a-z0-9.-]+$/i. - Empty input maps to
null(shared domain). - Only team owners can save.
How to re-enable in the app
-
Restore the Domains card in
apps/app/src/components/settings/team-inbox-settings.tsx:- Add a "Domains"
Cardbefore the mailboxes section. - Include the "Add/Edit domain" button that calls:
setParams({ domainSheet: "create" | "edit", mailboxSheet: null, mailboxId: null }). - Display the current domain + status and updated date.
- Add a "Domains"
-
Render the sheet:
- Re-add
<InboxDomainSheet />inTeamInboxSettings.
- Re-add
-
Keep query params:
useInboxSettingsParams()already exposesdomainSheet.
Notes
- This doc only covers the
apps/appUI. The API/worker flows (apps/api,apps/inbox) were left intact.