From 620fcdab4e8f0568c40d045c9f02fe99f00b81b6 Mon Sep 17 00:00:00 2001 From: Saxon Fletcher Date: Fri, 6 Jun 2025 12:35:10 +1000 Subject: [PATCH] refinements to gitless branching --- .../Preferences/AccountConnections.tsx | 19 +++---- .../BranchManagement/BranchPanels.tsx | 56 ++++++++++--------- .../BranchManagement/CreateBranchModal.tsx | 4 +- .../BranchManagement/EditBranchModal.tsx | 4 +- .../BranchManagement/EmptyStates.tsx | 3 +- .../EnableBranchingModal.tsx | 14 ++++- 6 files changed, 53 insertions(+), 47 deletions(-) diff --git a/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx b/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx index d0314ca218e..3e586cf972d 100644 --- a/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx @@ -50,20 +50,17 @@ const AccountConnections = () => { {isSuccess && (
-
- - {`GitHub -
+ {`GitHub

GitHub

- Sync GitHub repos to Supabase projects + Sync GitHub repos to Supabase projects for automatic branch creation and merging

diff --git a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx index 19067c729dc..258abac83f3 100644 --- a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx +++ b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx @@ -185,7 +185,7 @@ export const BranchRow = ({ text: branch.persistent ? `${branch.name} is a persistent branch and will remain active even after the underlying PR is closed` - : undefined, + : 'Switch to branch', }, }} > @@ -294,32 +294,34 @@ export const BranchRow = ({ )} - - - setShowBranchModeSwitch(true)} - onClick={() => setShowBranchModeSwitch(true)} - disabled={!isBranchActiveHealthy} - > - {branch.persistent ? ( - <> - Switch to ephemeral - - ) : ( - <> - Switch to persistent - - )} - - - {!isBranchActiveHealthy && ( - - Branch is still initializing. Please wait for the branch to become healthy - before switching modes - - )} - + {branch.git_branch && ( + + + setShowBranchModeSwitch(true)} + onClick={() => setShowBranchModeSwitch(true)} + disabled={!isBranchActiveHealthy} + > + {branch.persistent ? ( + <> + Switch to ephemeral + + ) : ( + <> + Switch to persistent + + )} + + + {!isBranchActiveHealthy && ( + + Branch is still initializing. Please wait for the branch to become healthy + before switching modes + + )} + + )} {gitlessBranching && ( diff --git a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx index 7b1d46225b9..fd981309aa0 100644 --- a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx +++ b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx @@ -95,7 +95,7 @@ export const CreateBranchModal = ({ visible, onClose }: CreateBranchModalProps) .string() .min(1, 'Branch name cannot be empty') .refine( - (val) => /^[a-zA-Z0-9\-\_]+$/.test(val), + (val) => /^[a-zA-Z0-9\-_]+$/.test(val), 'Branch name can only contain alphanumeric characters, hyphens, and underscores.' ) .refine( @@ -170,7 +170,7 @@ export const CreateBranchModal = ({ visible, onClose }: CreateBranchModalProps) return ( !open && onClose()}> - + Create a new preview branch diff --git a/apps/studio/components/interfaces/BranchManagement/EditBranchModal.tsx b/apps/studio/components/interfaces/BranchManagement/EditBranchModal.tsx index ce301431270..1f058c0ee99 100644 --- a/apps/studio/components/interfaces/BranchManagement/EditBranchModal.tsx +++ b/apps/studio/components/interfaces/BranchManagement/EditBranchModal.tsx @@ -91,7 +91,7 @@ export const EditBranchModal = ({ branch, visible, onClose }: EditBranchModalPro .string() .min(1, 'Branch name cannot be empty') .refine( - (val) => /^[a-zA-Z0-9\\-\\_]+$/.test(val), + (val) => /^[a-zA-Z0-9\-_]+$/.test(val), 'Branch name can only contain alphanumeric characters, hyphens, and underscores.' ) .refine( @@ -188,7 +188,7 @@ export const EditBranchModal = ({ branch, visible, onClose }: EditBranchModalPro return ( !open && onClose()}> - + Edit branch "{branch?.name}" {/* Update title */} diff --git a/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx b/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx index f9de9511af1..329ebaeeb70 100644 --- a/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx +++ b/apps/studio/components/interfaces/BranchManagement/EmptyStates.tsx @@ -71,8 +71,7 @@ export const PullRequestsEmptyState = ({

Connect to GitHub for seamless branching

- Connect your GitHub repository to create preview branches that automatically track pull - requests. + Sync GitHub repos to Supabase projects for automatic branch creation and merging