@devries-cameron20 / t3code-1 / commits / 322f6544df
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

feat(web): show a newly created pairing link without expanding the client list (#30498)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 3, 2026 at 16:41 UTC 322f6544dfad0a3c8a0c8cbecf2c7f7874b14268
3 files changed +43 -15
apps/web/src/components/settings/AuthorizedClientsSettings.tsx
+6 -1
@@ -123,6 +123,7 @@ function endpointRowClassName(isAvailable: boolean) {
123 type PairingLinkListRowProps = {
124 pairingLink: ServerPairingLinkRecord;
125 credential: string | undefined;
126 + defaultShareOpen: boolean;
127 endpointUrl: string | null | undefined;
128 endpoints: ReadonlyArray<AdvertisedEndpoint>;
129 defaultEndpointKey: string | null;
@@ -134,6 +135,7 @@ type PairingLinkListRowProps = {
135 const PairingLinkListRow = memo(function PairingLinkListRow({
136 pairingLink,
137 credential,
138 + defaultShareOpen,
139 endpointUrl,
140 endpoints,
141 defaultEndpointKey,
@@ -144,7 +146,7 @@ const PairingLinkListRow = memo(function PairingLinkListRow({
146 const nowMs = useNowSecond();
147 const expiresAtMs = new Date(pairingLink.expiresAt).getTime();
148 const [isRevealDialogOpen, setIsRevealDialogOpen] = useState(false);
147 - const [isQrPanelOpen, setIsQrPanelOpen] = useState(false);
149 + const [isQrPanelOpen, setIsQrPanelOpen] = useState(defaultShareOpen);
150 const [qrEndpointId, setQrEndpointId] = useState<string | null>(null);
151 const qrPanelId = useId();
152
@@ -791,6 +793,7 @@ type PairingClientsListProps = {
793 isLoading: boolean;
794 pairingLinks: ReadonlyArray<ServerPairingLinkRecord>;
795 createdPairingCredentials: ReadonlyMap<string, string>;
796 + sharedPairingLinkId: string | null;
797 clientSessions: ReadonlyArray<ServerClientSessionRecord>;
798 revokingPairingLinkId: string | null;
799 revokingClientSessionId: string | null;
@@ -806,6 +809,7 @@ export const PairingClientsList = memo(function PairingClientsList({
809 isLoading,
810 pairingLinks,
811 createdPairingCredentials,
812 + sharedPairingLinkId,
813 clientSessions,
814 revokingPairingLinkId,
815 revokingClientSessionId,
@@ -820,6 +824,7 @@ export const PairingClientsList = memo(function PairingClientsList({
824 key={pairingLink.id}
825 pairingLink={pairingLink}
826 credential={createdPairingCredentials.get(pairingLink.id)}
827 + defaultShareOpen={pairingLink.id === sharedPairingLinkId}
828 endpointUrl={endpointUrl}
829 endpoints={endpoints}
830 defaultEndpointKey={defaultEndpointKey}
apps/web/src/components/settings/ConnectionsSettings.tsx
+31 -14
@@ -226,8 +226,10 @@ export function ConnectionsSettings({ view }: { readonly view: "environments" |
226 const [createdPairingCredentials, setCreatedPairingCredentials] = useState<
227 ReadonlyMap<string, string>
228 >(() => new Map());
229 + const [newestPairingLinkId, setNewestPairingLinkId] = useState<string | null>(null);
230 const handlePairingLinkCreated = (created: AuthPairingCredentialResult) => {
231 setCreatedPairingCredentials((current) => new Map(current).set(created.id, created.credential));
232 + setNewestPairingLinkId(created.id);
233 };
234 const [revokingDesktopPairingLinkId, setRevokingDesktopPairingLinkId] = useState<string | null>(
235 null,
@@ -928,6 +930,29 @@ export function ConnectionsSettings({ view }: { readonly view: "environments" |
930 managed={tailscaleHttpsEndpoint?.status === "available" ? undefined : remoteClientsDenial}
931 />
932 );
933 + const newestPairingLink = visibleDesktopPairingLinks.find(
934 + (pairingLink) => pairingLink.id === newestPairingLinkId,
935 + );
936 + const renderPairingClientsList = (
937 + pairingLinks: typeof visibleDesktopPairingLinks,
938 + clientSessions: typeof desktopClientSessions,
939 + ) => (
940 + <PairingClientsList
941 + endpointUrl={desktopServerExposureState?.endpointUrl}
942 + endpoints={visibleDesktopAdvertisedEndpoints}
943 + defaultEndpointKey={defaultDesktopAdvertisedEndpointKey}
944 + isLoading={isLoadingDesktopAccessManagement}
945 + pairingLinks={pairingLinks}
946 + createdPairingCredentials={createdPairingCredentials}
947 + sharedPairingLinkId={newestPairingLinkId}
948 + clientSessions={clientSessions}
949 + revokingPairingLinkId={revokingDesktopPairingLinkId}
950 + revokingClientSessionId={revokingDesktopClientSessionId}
951 + onRevokePairingLink={handleRevokeDesktopPairingLink}
952 + onRevokeClientSession={handleRevokeDesktopClientSession}
953 + canRevoke={canWriteAccess}
954 + />
955 + );
956 const renderAuthorizedClients = () => (
957 <>
958 {desktopAccessManagementError ? (
@@ -935,20 +960,7 @@ export function ConnectionsSettings({ view }: { readonly view: "environments" |
960 <p className="text-xs text-destructive">{desktopAccessManagementError}</p>
961 </div>
962 ) : null}
938 - <PairingClientsList
939 - endpointUrl={desktopServerExposureState?.endpointUrl}
940 - endpoints={visibleDesktopAdvertisedEndpoints}
941 - defaultEndpointKey={defaultDesktopAdvertisedEndpointKey}
942 - isLoading={isLoadingDesktopAccessManagement}
943 - pairingLinks={visibleDesktopPairingLinks}
944 - createdPairingCredentials={createdPairingCredentials}
945 - clientSessions={desktopClientSessions}
946 - revokingPairingLinkId={revokingDesktopPairingLinkId}
947 - revokingClientSessionId={revokingDesktopClientSessionId}
948 - onRevokePairingLink={handleRevokeDesktopPairingLink}
949 - onRevokeClientSession={handleRevokeDesktopClientSession}
950 - canRevoke={canWriteAccess}
951 - />
963 + {renderPairingClientsList(visibleDesktopPairingLinks, desktopClientSessions)}
964 </>
965 );
966 const renderNetworkAccessRow = () => (
@@ -1153,6 +1165,11 @@ export function ConnectionsSettings({ view }: { readonly view: "environments" |
1165 <FoldedSettingsSection
1166 id="authorized-clients"
1167 title="Authorized clients"
1168 + collapsedContent={
1169 + canReadAccess && newestPairingLink
1170 + ? renderPairingClientsList([newestPairingLink], [])
1171 + : undefined
1172 + }
1173 summary={summarizeAuthorizedClients(
1174 desktopClientSessions,
1175 visibleDesktopPairingLinks,
apps/web/src/components/settings/FoldedSettingsSection.tsx
+6
@@ -12,6 +12,7 @@ export function FoldedSettingsSection({
12 summary,
13 control,
14 headerPlacement = "inside",
15 + collapsedContent,
16 children,
17 }: {
18 readonly id: string;
@@ -19,6 +20,8 @@ export function FoldedSettingsSection({
20 readonly summary?: string | null;
21 readonly control?: ReactNode;
22 readonly headerPlacement?: "inside" | "outside";
23 + /** Shown under the header only while folded. */
24 + readonly collapsedContent?: ReactNode;
25 readonly children: ReactNode;
26 }) {
27 const [open, setOpen] = useState(false);
@@ -82,6 +85,9 @@ export function FoldedSettingsSection({
85 </CollapsibleTrigger>
86 {control ? <div className="flex shrink-0 items-center">{control}</div> : null}
87 </div>
88 + {!open && collapsedContent ? (
89 + <div className="border-t border-border/50 empty:hidden">{collapsedContent}</div>
90 + ) : null}
91 <CollapsiblePanel>
92 <div className="border-t border-border/50 [&>*+*]:border-t [&>*+*]:border-border/50">
93 {children}