fabrica

hanna/fabrica

refactor(web): move Archive next to Save in repo General settings

415a57b · hanna committed on 2026-07-25

Drop the separate Archive section; the Archive/Unarchive button now sits
beside Save changes in the General card (Save uses a form= reference so it
can live outside the general form in the shared actions row).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed by hannaSSH key fingerprint: SHA256:4g9cWhkAAw8gwqhJUcVbSnGEvdGwklW+1Aa/fMUu59k
2 files changed · +20 −19UnifiedSplit
assets/base.css +11 −0
@@ -271,6 +271,17 @@ body.drawer-open .drawer-backdrop {
271271 border-color: var(--fb-danger);
272272 }
273273
274+/* Repo settings: Save changes + Archive on one row. */
275+.settings-actions {
276+ display: flex;
277+ align-items: center;
278+ gap: 0.6rem;
279+ margin-top: 1.25rem;
280+}
281+.settings-actions form {
282+ display: inline;
283+}
284+
274285 /* Repo settings danger zone. */
275286 .danger-zone {
276287 border-color: var(--fb-danger);
crates/web/src/repo.rs +9 −19
@@ -741,7 +741,7 @@ async fn repo_settings_view(
741741 section class="listing" {
742742 h2 { "General" }
743743 div class="card" {
744- form method="post" action=(format!("/repo-settings/{id}/general")) {
744+ form id="repo-general" method="post" action=(format!("/repo-settings/{id}/general")) {
745745 input type="hidden" name="_csrf" value=(chrome.csrf);
746746 label for="name" { "Repository name" }
747747 input type="text" id="name" name="name" value=(ctx.repo.name) required;
@@ -751,31 +751,21 @@ async fn repo_settings_view(
751751 (vis_option(Visibility::Internal, "Internal — any signed-in user"))
752752 (vis_option(Visibility::Private, "Private — only you and collaborators"))
753753 }
754- button class="btn btn-primary" type="submit" { "Save changes" }
755754 }
756- }
757- }
758- (collaborators_section(id, &chrome.csrf, &collaborators))
759- section class="listing" {
760- h2 { "Archive" }
761- div class="card" {
762- @if ctx.repo.archived_at.is_some() {
763- p class="muted" { "This repository is archived (read-only). Unarchiving restores pushing." }
755+ div class="settings-actions" {
756+ button class="btn btn-primary" type="submit" form="repo-general" { "Save changes" }
757+ @let archived = ctx.repo.archived_at.is_some();
764758 form method="post" action=(format!("/repo-settings/{id}/archive")) {
765759 input type="hidden" name="_csrf" value=(chrome.csrf);
766- input type="hidden" name="archived" value="false";
767- button class="btn btn-primary" type="submit" { "Unarchive repository" }
768- }
769- } @else {
770- p class="muted" { "Archiving makes the repository read-only; pushes are refused until it is unarchived." }
771- form method="post" action=(format!("/repo-settings/{id}/archive")) {
772- input type="hidden" name="_csrf" value=(chrome.csrf);
773- input type="hidden" name="archived" value="true";
774- button class="btn" type="submit" { "Archive repository" }
760+ input type="hidden" name="archived" value=(if archived { "false" } else { "true" });
761+ button class="btn inline-btn" type="submit" {
762+ (if archived { "Unarchive" } else { "Archive" })
763+ }
775764 }
776765 }
777766 }
778767 }
768+ (collaborators_section(id, &chrome.csrf, &collaborators))
779769 section class="listing" {
780770 h2 { "Danger zone" }
781771 div class="card danger-zone" {