Skip to content

Commit b325660

Browse files
committed
fix(webapp): align preview and protected branch summaries
1 parent e9f476c commit b325660

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

apps/webapp/app/routes/resources.branches.auto-archive.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ function AutoArchiveForm({
394394
{!valid ? (
395395
<Paragraph>Enter 1–365 days and valid branch names to see the preview.</Paragraph>
396396
) : reviewed && preview.data?.ok ? (
397-
<div className="space-y-2 text-sm text-text-dimmed">
397+
<div className="space-y-2 text-sm tabular-nums text-text-dimmed">
398398
<ul className="list-disc space-y-1 pl-4">
399399
<li className={preview.data.count > 0 ? "text-amber-400" : undefined}>
400400
{preview.data.partial ? "At least " : ""}
@@ -424,11 +424,6 @@ function AutoArchiveForm({
424424
</li>
425425
)}
426426
</ul>
427-
{preview.data.protectedBranches.length > 0 && (
428-
<p className="break-words">
429-
Protected: {preview.data.protectedBranches.join(", ")}
430-
</p>
431-
)}
432427
{preview.data.partial && (
433428
<p>Preview limited to the first 1,000 branches. Cleanup checks all branches.</p>
434429
)}
@@ -439,6 +434,20 @@ function AutoArchiveForm({
439434
<Paragraph>Checking branches…</Paragraph>
440435
)}
441436
</section>
437+
{reviewed && preview.data?.ok && preview.data.protectedBranches.length > 0 && (
438+
<section className="max-h-48 overflow-y-auto" aria-labelledby="protected-branches-title">
439+
<h3 id="protected-branches-title" className={`${labelVariants.medium.text} mb-2`}>
440+
Protected branches
441+
</h3>
442+
<ul className="list-disc space-y-1 pl-4 text-sm text-text-dimmed">
443+
{preview.data.protectedBranches.map((branch) => (
444+
<li key={branch} className="break-words">
445+
{branch}
446+
</li>
447+
))}
448+
</ul>
449+
</section>
450+
)}
442451
</Fieldset>
443452
{fetcher.data && !fetcher.data.ok && <FormError>{fetcher.data.error}</FormError>}
444453
<DialogFooter>

0 commit comments

Comments
 (0)