Skip to content

Commit 9b54df8

Browse files
committed
fix(webapp): improve preview branch auto-archive settings UI
1 parent 7e92a02 commit 9b54df8

3 files changed

Lines changed: 264 additions & 176 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Simplify preview branch auto-archive settings with clearer descriptions, individual fields for branches to keep, and an option to disable auto-archiving in the settings dialog.

‎apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx‎

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -287,57 +287,67 @@ export default function Page() {
287287
Branches docs
288288
</LinkButton>
289289
</WhenAgentUnavailable>
290-
291-
{limits.isAtLimit ? (
292-
<UpgradePanel
293-
limits={limits}
294-
canUpgrade={canUpgrade ?? false}
295-
canPurchaseBranches={canPurchaseBranches}
296-
branchPricing={branchPricing}
297-
extraBranches={extraBranches}
298-
maxBranchQuota={maxBranchQuota}
299-
planBranchLimit={planBranchLimit}
300-
/>
301-
) : (
302-
<NewBranchPanel
303-
button={
304-
<Button
305-
variant="primary/small"
306-
shortcut={{ key: "n" }}
307-
LeadingIcon={PlusIcon}
308-
leadingIconClassName="text-white"
309-
fullWidth
310-
textAlignLeft
311-
disabled={!canManageBranches}
312-
tooltip={
313-
canManageBranches ? undefined : "You don't have permission to create branches."
314-
}
315-
>
316-
New branch…
317-
</Button>
318-
}
319-
env="preview"
320-
/>
321-
)}
322290
</PageAccessories>
323291
</NavBar>
324292
<PageBody scrollable={false}>
325-
<div className="grid max-h-full min-h-full grid-rows-[auto_1fr_auto]">
326-
<div className="flex items-center justify-between gap-x-1.5 p-2">
327-
<BranchFilters>
328-
{autoArchiveAvailable && (
329-
<AutoArchiveSettings
330-
environment={branchableEnvironment}
331-
canManage={canManageBranches}
293+
<div
294+
className={cn(
295+
"grid max-h-full min-h-full",
296+
hasBranches ? "grid-rows-[auto_1fr_auto]" : "grid-rows-[1fr]"
297+
)}
298+
>
299+
{hasBranches && (
300+
<div className="flex items-center justify-between gap-x-1.5 p-2">
301+
<BranchFilters>
302+
{autoArchiveAvailable && (
303+
<AutoArchiveSettings
304+
environment={branchableEnvironment}
305+
canManage={canManageBranches}
306+
/>
307+
)}
308+
</BranchFilters>
309+
<div className="flex shrink-0 items-center gap-2">
310+
<PaginationControls
311+
currentPage={currentPage}
312+
totalPages={totalPages}
313+
showPageNumbers={false}
332314
/>
333-
)}
334-
</BranchFilters>
335-
<PaginationControls
336-
currentPage={currentPage}
337-
totalPages={totalPages}
338-
showPageNumbers={false}
339-
/>
340-
</div>
315+
{limits.isAtLimit ? (
316+
<UpgradePanel
317+
limits={limits}
318+
canUpgrade={canUpgrade ?? false}
319+
canPurchaseBranches={canPurchaseBranches}
320+
branchPricing={branchPricing}
321+
extraBranches={extraBranches}
322+
maxBranchQuota={maxBranchQuota}
323+
planBranchLimit={planBranchLimit}
324+
/>
325+
) : (
326+
<NewBranchPanel
327+
button={
328+
<Button
329+
variant="primary/small"
330+
shortcut={{ key: "n" }}
331+
LeadingIcon={PlusIcon}
332+
leadingIconClassName="text-white"
333+
fullWidth
334+
textAlignLeft
335+
disabled={!canManageBranches}
336+
tooltip={
337+
canManageBranches
338+
? undefined
339+
: "You don't have permission to create branches."
340+
}
341+
>
342+
New branch…
343+
</Button>
344+
}
345+
env="preview"
346+
/>
347+
)}
348+
</div>
349+
</div>
350+
)}
341351
{!hasBranches ? (
342352
<MainCenteredContainer className="max-w-md">
343353
<BranchesNoBranches

0 commit comments

Comments
 (0)