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 {
271 border-color: var(--fb-danger);271 border-color: var(--fb-danger);
272}272}
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
274/* Repo settings danger zone. */285/* Repo settings danger zone. */
275.danger-zone {286.danger-zone {
276 border-color: var(--fb-danger);287 border-color: var(--fb-danger);
crates/web/src/repo.rs +9 −19
@@ -741,7 +741,7 @@ async fn repo_settings_view(
741 section class="listing" {741 section class="listing" {
742 h2 { "General" }742 h2 { "General" }
743 div class="card" {743 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")) {
745 input type="hidden" name="_csrf" value=(chrome.csrf);745 input type="hidden" name="_csrf" value=(chrome.csrf);
746 label for="name" { "Repository name" }746 label for="name" { "Repository name" }
747 input type="text" id="name" name="name" value=(ctx.repo.name) required;747 input type="text" id="name" name="name" value=(ctx.repo.name) required;
@@ -751,31 +751,21 @@ async fn repo_settings_view(
751 (vis_option(Visibility::Internal, "Internal — any signed-in user"))751 (vis_option(Visibility::Internal, "Internal — any signed-in user"))
752 (vis_option(Visibility::Private, "Private — only you and collaborators"))752 (vis_option(Visibility::Private, "Private — only you and collaborators"))
753 }753 }
754 button class="btn btn-primary" type="submit" { "Save changes" }
755 }754 }
756 }755 div class="settings-actions" {
757 }756 button class="btn btn-primary" type="submit" form="repo-general" { "Save changes" }
758 (collaborators_section(id, &chrome.csrf, &collaborators))757 @let archived = ctx.repo.archived_at.is_some();
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." }
764 form method="post" action=(format!("/repo-settings/{id}/archive")) {758 form method="post" action=(format!("/repo-settings/{id}/archive")) {
765 input type="hidden" name="_csrf" value=(chrome.csrf);759 input type="hidden" name="_csrf" value=(chrome.csrf);
766 input type="hidden" name="archived" value="false";760 input type="hidden" name="archived" value=(if archived { "false" } else { "true" });
767 button class="btn btn-primary" type="submit" { "Unarchive repository" }761 button class="btn inline-btn" type="submit" {
768 }762 (if archived { "Unarchive" } else { "Archive" })
769 } @else {763 }
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" }
775 }764 }
776 }765 }
777 }766 }
778 }767 }
768 (collaborators_section(id, &chrome.csrf, &collaborators))
779 section class="listing" {769 section class="listing" {
780 h2 { "Danger zone" }770 h2 { "Danger zone" }
781 div class="card danger-zone" {771 div class="card danger-zone" {