[codex] Restore T3 Connect account controls#3492
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
Bugbot Autofix prepared fixes for all 3 issues found in the latest run.
- ✅ Fixed: Error shows empty clients state
- Added a
hasErrorWithoutDataguard that renders nothing in place of EmptyMobileClients when an error is present but no cached data exists, so only the error banner is shown.
- Added a
- ✅ Fixed: Preference switch stale after update
- Added optimistic local state (
optimisticPublishActivity) that is set immediately on successful update and used as the switch's checked value until the async refresh catches up, preventing the stale display.
- Added optimistic local state (
- ✅ Fixed: False empty before relay session
- Extended the
isInitialLoadcondition to also be true whendevicesState.accountIdis falsy (relay session not yet established), showing the loading skeleton instead of the false empty state.
- Extended the
Or push these changes by commenting:
@cursor push 85a49a0654
Preview (85a49a0654)
diff --git a/apps/web/src/components/clerk/MobileClientsUserProfilePage.tsx b/apps/web/src/components/clerk/MobileClientsUserProfilePage.tsx
--- a/apps/web/src/components/clerk/MobileClientsUserProfilePage.tsx
+++ b/apps/web/src/components/clerk/MobileClientsUserProfilePage.tsx
@@ -107,7 +107,9 @@
export function MobileClientsUserProfilePage() {
const devicesState = useManagedRelayDevices();
const devices = devicesState.data ?? [];
- const isInitialLoad = devicesState.data === null && !devicesState.error;
+ const isInitialLoad =
+ !devicesState.accountId || (devicesState.data === null && !devicesState.error);
+ const hasErrorWithoutData = devicesState.error !== null && devicesState.data === null;
return (
<div className="flex min-h-[30rem] w-full flex-col bg-background text-foreground">
@@ -149,7 +151,7 @@
{isInitialLoad ? (
<MobileClientsSkeleton />
- ) : devices.length > 0 ? (
+ ) : hasErrorWithoutData ? null : devices.length > 0 ? (
<ul className="space-y-3">
{devices.map((device) => (
<MobileClientRow key={device.deviceId} device={device} />
diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsx
--- a/apps/web/src/components/settings/ConnectionsSettings.tsx
+++ b/apps/web/src/components/settings/ConnectionsSettings.tsx
@@ -1586,7 +1586,15 @@
const [operationError, setOperationError] = useState<string | null>(null);
const [isUpdating, setIsUpdating] = useState(false);
const [isUpdatingPreference, setIsUpdatingPreference] = useState(false);
+ const [optimisticPublishActivity, setOptimisticPublishActivity] = useState<boolean | null>(null);
+ const serverPublishActivity = primaryCloudLinkState.data?.publishAgentActivity ?? null;
+ useEffect(() => {
+ if (optimisticPublishActivity !== null && serverPublishActivity === optimisticPublishActivity) {
+ setOptimisticPublishActivity(null);
+ }
+ }, [serverPublishActivity, optimisticPublishActivity]);
+
const reportUpdateFailure = (cause: unknown) => {
const message = cause instanceof Error ? cause.message : "Could not update T3 Connect access.";
const traceId = findErrorTraceId(cause);
@@ -1689,6 +1697,7 @@
}
primaryCloudLinkState.refresh();
+ setOptimisticPublishActivity(enabled);
toastManager.add({
type: "success",
title: enabled ? "Agent activity enabled" : "Agent activity disabled",
@@ -1734,7 +1743,11 @@
control={
<Switch
aria-label="Publish agent activity to mobile clients"
- checked={primaryCloudLinkState.data?.publishAgentActivity ?? false}
+ checked={
+ optimisticPublishActivity ??
+ primaryCloudLinkState.data?.publishAgentActivity ??
+ false
+ }
disabled={
!canManageRelay ||
!isSignedIn ||You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 5c536c8. Configure here.
| ? "This environment can publish agent activity to your mobile clients." | ||
| : "This environment will stop publishing agent activity.", | ||
| }); | ||
| setIsUpdatingPreference(false); |
There was a problem hiding this comment.
Preference switch stale after update
Medium Severity
The "Publish agent activity" switch can display an incorrect state immediately after a successful update. The UI relies on primaryCloudLinkState which updates asynchronously, discarding the updatePrimaryEnvironmentPreferences command's immediate return value. This causes a brief mismatch between the UI and the actual state, even after a success toast.
Reviewed by Cursor Bugbot for commit 5c536c8. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces new user-facing features including a mobile clients management page and an agent activity publishing toggle. New feature introductions with user-facing behavior changes warrant human review, and there's an unresolved comment about potential UI state issues. You can customize Macroscope's approvability policy. Learn more. |
- Treat missing account IDs as initial load state - Suppress empty list when device fetch errors with no data
Co-authored-by: Julius Marminge <julius@mac.lan>



Summary
UserButton.UserProfilePagefor account-level mobile clientsPublish agent activityas a nested setting under the local environment's T3 Connect exposure switchRoot cause
The dedicated cloud settings page originally owned both notification-device status and the activity publication preference. The T3 Connect rebrand removed that page without moving the device view into Clerk. A later connection architecture rewrite also replaced the T3 Connect exposure row and dropped its nested publication toggle, while leaving the relay device APIs and server preference endpoint intact.
Impact
Signed-in users can inspect registered mobile clients from the Clerk account component again. Linked server environments can explicitly opt into publishing agent activity so mobile push notifications and Live Activities receive updates.
Validation
vp test run apps/web/src/components/clerk/MobileClientsUserProfilePage.logic.test.ts apps/web/src/cloud/linkEnvironment.test.tsvp checkvp run typecheckvp run --filter @t3tools/web buildNote
Restore T3 Connect account controls with mobile client management and agent activity toggle
updatePrimaryEnvironmentPreferencesatom command.Macroscope summarized fddeca8.
Note
Medium Risk
Touches cloud link preferences and what activity is published to mobile clients, but reuses existing connect APIs and serializes preference updates with link/unlink operations.
Overview
Restores T3 Connect account and connection settings that were dropped during the rebrand and connection UI rewrite.
User-facing copy in Connections is updated from “T3 Cloud” to T3 Connect. When a local environment is linked, a nested Publish agent activity switch calls
updatePrimaryEnvironmentPreferences(serialized with link/unlink) so the primary environment can opt in or out of sending activity to mobile push and Live Activities.A Mobile clients tab is added to the Clerk
UserButtonprofile. It lists relay-registered iOS devices (push/Live Activity badges, notification detail, refresh and error retry) viauseManagedRelayDevices, with small presentation helpers and unit tests.Reviewed by Cursor Bugbot for commit fddeca8. Bugbot is set up for automated code reviews on this repo. Configure here.