feat(connectors): show and select personal AI account defaults (#19845)

Show a crown on each saved personal AI provider default. Add a provider-specific menu action to other eligible accounts. Share saved-state queries, block duplicate writes, and keep the saved crown until a write succeeds.

Keep account details available for accessible grants. Show session lookup errors with Retry. Resolve list permissions once per request and index account lookups. Add UI and API regression coverage and account documentation.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-11-07 10:26:08 -06:00
1 parent 824b25654c
commit 377bc87df1
18 files changed
+742 -59

No files matched your search

+6 -1
View File
@@ -57,6 +57,11 @@ const sessionQueryOptions = {
queryFn: () => authApi.getSession(),
} as const;
/** Observe the shared session read when a surface needs error and retry state. */
export function useAccountSessionQuery() {
return useQuery(sessionQueryOptions);
}
/**
* The signed-in account, as the cache currently understands it.
*
@@ -79,7 +84,7 @@ export function useAccountIdentity(): {
bootstrap: BoardBootstrap | undefined;
updatedAt: number;
} {
const { data: session, isSuccess, isError, dataUpdatedAt } = useQuery(sessionQueryOptions);
const { data: session, isSuccess, isError, dataUpdatedAt } = useAccountSessionQuery();
const userId = session?.user.id ?? null;
return {
userId, settled: isSuccess, failed: isError, updatedAt: dataUpdatedAt,