From dfd0dbdceab33d971e64398356c456ae4d867fa7 Mon Sep 17 00:00:00 2001
From: Gildas Garcia <1122076+djhi@users.noreply.github.com>
Date: Fri, 31 Jul 2026 16:34:35 +0200
Subject: [PATCH] Scoped PAT: apply `flex-row-reverse` form layout
---
.../Scoped/Form/ResourceAccessStep.tsx | 225 ++++++++++--------
.../AccessTokens/Scoped/Form/TokenDetails.tsx | 6 +-
2 files changed, 127 insertions(+), 104 deletions(-)
diff --git a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/ResourceAccessStep.tsx b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/ResourceAccessStep.tsx
index 958b80d3db9..6a355b31415 100644
--- a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/ResourceAccessStep.tsx
+++ b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/ResourceAccessStep.tsx
@@ -9,6 +9,8 @@ import {
Label,
RadioGroupCard,
RadioGroupCardItem,
+ RadioGroupStacked,
+ RadioGroupStackedItem,
Select,
SelectContent,
SelectItem,
@@ -109,57 +111,123 @@ export const ResourceAccessStep = ({ control, setValue, error }: ResourceAccessS
return (
-
-
Resource access
-
Choose what this token can reach.
-
-
- (
- {
- field.onChange(value)
- // Reset dependent selections when switching modes.
- setValue('projectRefs', [])
- if (value !== 'account') setValue('accountConfirmed', false)
- }}
- disabled={isAccount}
- >
- {CARD_OPTIONS.map((option) => (
-
-
- {option.name}
- {option.recommended && Recommended }
-
- {option.description}
-
- }
- />
- ))}
-
- )}
- />
+ {isAccount ? (
+ <>
+ Resource access
+
+
+ This token can reach every organization and project you have access to. Prefer a
+ single project or organization unless you specifically need account-wide access.
+
+
+ (
+ <>
+ field.onChange(checked)}
+ />
+
+ I understand this token is not limited to one project or organization.
+
+ >
+ )}
+ />
+
+
+ Switch back
+
+
+ }
+ />
+ >
+ ) : (
+ (
+
+ Need access to every organization and project?{' '}
+
+ Advanced options
+
+
+ ) : null
+ }
+ id="resourceAccess"
+ >
+
+ {
+ field.onChange(value)
+ // Reset dependent selections when switching modes.
+ setValue('projectRefs', [])
+ if (value !== 'account') setValue('accountConfirmed', false)
+ }}
+ disabled={isAccount}
+ >
+ {CARD_OPTIONS.map((option) => (
+
+
+ {option.name}
+ {option.recommended && Recommended }
+
+ {option.description}
+
+ }
+ />
+ ))}
+
+
+
+ )}
+ />
+ )}
{!isAccount && resourceAccess === 'project' ? (
-
+ <>
(
-
+ Organization}
+ id="organizationSlugs"
+ >
0 ? field.value[0] : ''}
@@ -189,7 +257,11 @@ export const ResourceAccessStep = ({ control, setValue, error }: ResourceAccessS
control={control}
name="projectRefs"
render={({ field }) => (
-
+ Projects}
+ id="projectRefs"
+ >
)}
/>
-
+ >
) : null}
{!isAccount && resourceAccess === 'organization' ? (
(
-
+ Organization}
+ id="organizationSlugs"
+ >
{error}}
-
- {!isAccount ? (
-
- Need access to every organization and project?{' '}
-
- Advanced options
-
-
- ) : (
-
-
- This token can reach every organization and project you have access to. Prefer a
- single project or organization unless you specifically need account-wide access.
-
-
- (
- <>
- field.onChange(checked)}
- />
-
- I understand this token is not limited to one project or organization.
-
- >
- )}
- />
-
-
- Switch back
-
-
- }
- />
- )}
)
}
diff --git a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/TokenDetails.tsx b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/TokenDetails.tsx
index 8a76815cd42..edd1f8c94bc 100644
--- a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/TokenDetails.tsx
+++ b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/TokenDetails.tsx
@@ -50,14 +50,14 @@ export const TokenDetails = ({ control, setValue }: TokenDetailsProps) => {
return (