forge
Explore
Log in

Don't you dare go Hollow

The repo head drops its … menu: the watch level is a pill beside Star and Fork (its eye alone on a phone), and watching and forks are counted in the line under the title

Browse files at this commit

c71bf40008db7a1ca220e6d565cd5922ec6e8502Ahmet Kaan GümüşParent: 409776f
All checks have passed
Show checks
  • style
    • the repo head drops its … menu: the watch level is a pill beside Star and Fork (its eye alone on a phone), and watching and forks are counted in the line under the title
    • a topic's own action standing under its heading (Rename repository, Transfer repository) is a small soft pill like Star, red-worded when dangerous, while tools on a line of facts stay words
    • branch protection is two groups of toggles, Pushes and Pull requests, with short labels and no hints beside them, the Pull requests group showing while Only through pull requests is on or a pull request setting is saved
    • each rule is one line with Edit beside its summary, the default branch reads protected by default · Add rule, and Save changes, Cancel and Remove rule share one row ✅ test: the audit seeds a branch rule so its form is shot
Show full message
💄 style: the repo head drops its … menu: the watch level is a pill beside Star and Fork (its eye alone on a phone), and watching and forks are counted in the line under the title; a topic's own action standing under its heading (Rename repository, Transfer repository) is a small soft pill like Star, red-worded when dangerous, while tools on a line of facts stay words; branch protection is two groups of toggles, Pushes and Pull requests, with short labels and no hints beside them, the Pull requests group showing while Only through pull requests is on or a pull request setting is saved; each rule is one line with Edit beside its summary, the default branch reads protected by default · Add rule, and Save changes, Cancel and Remove rule share one row ✅ test: the audit seeds a branch rule so its form is shot
crates/forge-e2e/tests/e2e/repo_settings_e2e.rsmodified+5 -5
@@ -379,7 +379,7 @@ async fn repo_settings_deletes_rows_when_repo_dir_is_missing() {
379379 /// of its summary pills. The built-in default-branch row has no rule behind it, so it is skipped.
380380 fn branch_rows(body: &str) -> Vec<Vec<String>> {
381381 let doc = scraper::Html::parse_document(body);
382- // Every rule row is a `details` with the pattern in its summary's name; the "+ New rule" row
382+ // Every rule row is a `details` with the pattern in its summary's name; the "Add rule" row
383383 // has no pattern there, so it drops out.
384384 let cards = scraper::Selector::parse("details.row-open").expect("selector");
385385 let pattern = scraper::Selector::parse("summary .name code").expect("selector");
@@ -464,7 +464,7 @@ async fn branch_protection_end_to_end() {
464464 assert_eq!(page.status, 200, "owner settings page");
465465 assert!(page.body.contains("Branch protection"), "section missing");
466466 assert!(
467- page.body.contains("(default branch): protected by default"),
467+ page.body.contains("protected by default"),
468468 "built-in row missing"
469469 );
470470 let danger_page = http
@@ -515,7 +515,7 @@ async fn branch_protection_end_to_end() {
515515 "main card after add"
516516 );
517517 assert!(
518- !page.body.contains("(default branch): protected by default"),
518+ !page.body.contains("protected by default"),
519519 "built-in row must disappear once a rule matches"
520520 );
521521
@@ -626,7 +626,7 @@ async fn branch_protection_end_to_end() {
626626 .await;
627627 assert!(rule_row(&page.body, "main").is_none(), "main removed");
628628 assert!(
629- page.body.contains("(default branch): protected by default"),
629+ page.body.contains("protected by default"),
630630 "built-in row back after remove"
631631 );
632632
@@ -648,7 +648,7 @@ async fn branch_protection_end_to_end() {
648648 http.get("/bob/app/settings?section=branches", Some(&bob))
649649 .await
650650 .body
651- .contains("(default branch): protected by default"),
651+ .contains("protected by default"),
652652 "write collaborator must not change rules"
653653 );
654654
crates/forge-web-base/src/i18n/merge_queue.rsmodified+2 -2
@@ -92,8 +92,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
9292 use K::*;
9393 use Lang::{En, Tr};
9494 match (key, lang) {
95- (RequireMergeQueue, En) => "Require merge queue",
96- (RequireMergeQueue, Tr) => "Birleştirme sırası iste",
95+ (RequireMergeQueue, En) => "Merge queue",
96+ (RequireMergeQueue, Tr) => "Birleştirme sırası",
9797 (RequireMergeQueueHint, En) => {
9898 "Merges go through the merge queue. Each pull request is tested on top of the current branch tip, and the branch moves only to a tested commit."
9999 }
crates/forge-web-base/src/i18n/repo_admin.rsmodified+30 -78
@@ -13,7 +13,6 @@ pub enum K {
1313 AllowDeletion,
1414 AllowForcePush,
1515 AlreadyOwner,
16- ApprovalsHelp,
1716 ApprovalsRange,
1817 ArchiveHeading,
1918 ArchiveHelp,
@@ -49,7 +48,6 @@ pub enum K {
4948 DeleteRepoHelp,
5049 DeleteTrashHelp,
5150 DeletionAllowed,
52- DeletionDesc,
5351 Description,
5452 DescriptionHelp,
5553 DescriptionLong,
@@ -57,7 +55,6 @@ pub enum K {
5755 EnterUsername,
5856 EnterValue,
5957 ForcePushAllowed,
60- ForcePushDesc,
6158 General,
6259 GeneralSaved,
6360 MakePublic,
@@ -69,17 +66,14 @@ pub enum K {
6966 NameRule,
7067 NewName,
7168 NewOwnerLabel,
72- NewRule,
69+ AddRule,
7370 NoBranchesYet,
7471 NoCollaborators,
7572 NoPendingTransfer,
7673 NoSecrets,
7774 NotCollaborator,
7875 OwnerIsMember,
79- PatternHelpA,
80- PatternHelpB,
81- PatternHelpC,
82- PatternHelpD,
76+ PatternHelp,
8377 PendingTransfers,
8478 PrivateOption,
8579 PublicOption,
@@ -96,7 +90,6 @@ pub enum K {
9690 RepoUnarchived,
9791 RequireUpToDate,
9892 RequiredApprovals,
99- RestrictPushDesc,
10093 RestrictPushTitle,
10194 Role,
10295 RoleAdminDesc,
@@ -107,7 +100,6 @@ pub enum K {
107100 RoleUpdated,
108101 RoleWriteDesc,
109102 RequiredChecks,
110- RequiredChecksHelp,
111103 RecentContexts,
112104 RuleChangesShort,
113105 RuleNoExtra,
@@ -124,7 +116,7 @@ pub enum K {
124116 Secrets,
125117 SecretsHelp,
126118 SectionChecks,
127- SectionMerging,
119+ SectionPullRequests,
128120 SectionPattern,
129121 SectionPushes,
130122 SettingsNavLabel,
@@ -167,18 +159,12 @@ pub fn t(lang: Lang, key: K) -> &'static str {
167159 }
168160 (AddOrUpdate, En) => "Add or update a secret",
169161 (AddOrUpdate, Tr) => "Gizli anahtar ekle veya güncelle",
170- (AllowDeletion, En) => "Allow deletion",
171- (AllowDeletion, Tr) => "Silmeye izin verilir",
172- (AllowForcePush, En) => "Allow force pushes",
173- (AllowForcePush, Tr) => "Zorla göndermeye izin verilir",
162+ (AllowDeletion, En) => "Deleting the branch",
163+ (AllowDeletion, Tr) => "Dalın silinmesi",
164+ (AllowForcePush, En) => "Force pushes",
165+ (AllowForcePush, Tr) => "Zorla gönderim",
174166 (AlreadyOwner, En) => "The repository already belongs to that user.",
175167 (AlreadyOwner, Tr) => "Depo zaten bu kullanıcıya ait.",
176- (ApprovalsHelp, En) => {
177- "How many a pull needs, 0 to 20. They count only from reviewers with Write access or higher, using each reviewer's latest review."
178- }
179- (ApprovalsHelp, Tr) => {
180- "Bir çekme isteğinin gereken onay sayısı, 0 ile 20 arası. Onaylar yalnızca yazma veya daha yüksek erişimi olan inceleyicilerden, her inceleyicinin en son incelemesine göre sayılır."
181- }
182168 (ApprovalsRange, En) => "required approvals must be a whole number from 0 to 20",
183169 (ApprovalsRange, Tr) => "Gerekli onay sayısı 0 ile 20 arasında bir tam sayı olmalıdır.",
184170 (ArchiveHeading, En) => "Archive",
@@ -205,30 +191,26 @@ pub fn t(lang: Lang, key: K) -> &'static str {
205191 (ArchivedSecrets, Tr) => "Bu depo arşivlenmiş. Gizli anahtarlar salt okunurdur.",
206192 (BadForm, En) => "The form was not understood. Nothing was changed.",
207193 (BadForm, Tr) => "Form anlaşılamadı. Hiçbir şey değiştirilmedi.",
208- (BlockWhileChanges, En) => "Block merges while changes are requested",
209- (BlockWhileChanges, Tr) => "Değişiklik istenirken birleştirmeler engellenir",
194+ (BlockWhileChanges, En) => "Block while changes are requested",
195+ (BlockWhileChanges, Tr) => "Değişiklik istenirken engelle",
210196 (BranchMissing, En) => "That branch does not exist. Nothing was saved.",
211197 (BranchMissing, Tr) => "Bu dal mevcut değil. Hiçbir şey kaydedilmedi.",
212- (BranchPattern, En) => "Branch pattern",
213- (BranchPattern, Tr) => "Dal deseni",
198+ (BranchPattern, En) => "Branch",
199+ (BranchPattern, Tr) => "Dal",
214200 (BranchProtection, En) => "Branch protection",
215201 (BranchProtection, Tr) => "Dal koruması",
216202 (BranchProtectionHelp, En) => {
217- "Pushes to a protected branch are checked before they are accepted. Force pushes and deletions are blocked on the default branch unless a rule allows them. Tags are not covered."
203+ "A push to a protected branch is checked against its rule before it is accepted."
218204 }
219205 (BranchProtectionHelp, Tr) => {
220- "Korumalı bir dala yapılan gönderimler kabul edilmeden önce denetlenir. Bir kural izin vermedikçe varsayılan dalda zorla gönderimler ve silmeler engellenir. Etiketler kapsam dışındadır."
206+ "Korumalı bir dala yapılan gönderim, kabul edilmeden önce kuralına göre denetlenir."
221207 }
222208 (BranchRuleRemoved, En) => "Branch rule removed.",
223209 (BranchRuleRemoved, Tr) => "Dal kuralı kaldırıldı.",
224210 (BranchRuleSaved, En) => "Branch rule saved.",
225211 (BranchRuleSaved, Tr) => "Dal kuralı kaydedildi.",
226- (BuiltinRowText, En) => {
227- " (default branch): protected by default; add a rule for it to change this."
228- }
229- (BuiltinRowText, Tr) => {
230- " (varsayılan dal): varsayılan olarak korunur; bunu değiştirmek için bir kural ekleyin."
231- }
212+ (BuiltinRowText, En) => "protected by default",
213+ (BuiltinRowText, Tr) => "varsayılan olarak korunur",
232214 (CancelRule, En) => "Cancel",
233215 (CancelRule, Tr) => "Vazgeç",
234216 (CancelTransfer, En) => "Cancel transfer",
@@ -277,9 +259,7 @@ pub fn t(lang: Lang, key: K) -> &'static str {
277259 }
278260 (DeletionAllowed, En) => "Deletion allowed",
279261 (DeletionAllowed, Tr) => "Silmeye izin var",
280- (DeletionDesc, En) => "The branch can be deleted.",
281262 (Description, En) => "Description",
282- (DeletionDesc, Tr) => "Dal silinebilir.",
283263 (Description, Tr) => "Açıklama",
284264 (DescriptionHelp, En) => {
285265 "Up to 350 characters, on one line. It is shown under the repository name."
@@ -301,9 +281,7 @@ pub fn t(lang: Lang, key: K) -> &'static str {
301281 (EnterValue, Tr) => "Bir değer girin.",
302282 (ForcePushAllowed, En) => "Force push allowed",
303283 (ForcePushAllowed, Tr) => "Zorla gönderime izin var",
304- (ForcePushDesc, En) => "Rewriting history with git push --force is allowed.",
305284 (General, En) => "General",
306- (ForcePushDesc, Tr) => "git push --force ile geçmişin yeniden yazılmasına izin verilir.",
307285 (General, Tr) => "Genel",
308286 (GeneralSaved, En) => "General settings saved.",
309287 (GeneralSaved, Tr) => "Genel ayarlar kaydedildi.",
@@ -333,11 +311,11 @@ pub fn t(lang: Lang, key: K) -> &'static str {
333311 (NewName, Tr) => "Yeni ad",
334312 (NewOwnerLabel, En) => "New owner (username)",
335313 (NewOwnerLabel, Tr) => "Yeni sahip (kullanıcı adı)",
336- (NewRule, En) => "New rule",
314+ (AddRule, En) => "Add rule",
315+ (AddRule, Tr) => "Kural ekle",
337316 (NoBranchesYet, En) => {
338317 "No branches yet. The default branch can be chosen after the first push."
339318 }
340- (NewRule, Tr) => "Yeni kural",
341319 (NoBranchesYet, Tr) => "Henüz dal yok. Varsayılan dal, ilk gönderimden sonra seçilebilir.",
342320 (NoCollaborators, En) => "No collaborators yet.",
343321 (NoCollaborators, Tr) => "Henüz ortak çalışan yok.",
@@ -353,16 +331,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
353331 (OwnerIsMember, Tr) => {
354332 "Depo sahibi zaten tam erişimli bir üyedir ve ortak çalışan olarak eklenemez."
355333 }
356- (PatternHelpA, En) => "A branch name, or a pattern: ",
357- (PatternHelpA, Tr) => "Bir dal adı veya desen: ",
358- (PatternHelpB, En) => " matches within one path segment and ",
359- (PatternHelpB, Tr) => " tek yol parçası içinde eşleşir, ",
360- (PatternHelpC, En) => " matches across ",
361- (PatternHelpC, Tr) => " ise ",
362- (PatternHelpD, En) => ".",
363- (PatternHelpD, Tr) => {
364- " işaretini de aşarak eşleşir."
365- }
334+ (PatternHelp, En) => "A name, or * and ** patterns.",
335+ (PatternHelp, Tr) => "Bir ad veya * ve ** desenleri.",
366336 (PendingTransfers, En) => "Pending transfers",
367337 (PendingTransfers, Tr) => "Bekleyen devirler",
368338 (PrivateOption, En) => {
@@ -399,17 +369,13 @@ pub fn t(lang: Lang, key: K) -> &'static str {
399369 (RepoTransfers, Tr) => "Depo devirleri",
400370 (RepoUnarchived, En) => "Repository unarchived.",
401371 (RepoUnarchived, Tr) => "Depo arşivden çıkarıldı.",
402- (RequireUpToDate, En) => "Require the pull request head to contain the latest base branch",
403- (RequireUpToDate, Tr) => {
404- "Çekme isteğinin kaynak dalı, hedef dalın en son hâlini içermelidir"
405- }
372+ (RequireUpToDate, En) => "Up to date with the base branch",
373+ (RequireUpToDate, Tr) => "Hedef dalla güncel",
406374 (RequiredApprovals, En) => "Approvals",
407375 (RequiredApprovals, Tr) => "Onaylar",
408- (RestrictPushDesc, En) => "Direct pushes are limited to repo admins.",
409- (RestrictPushTitle, En) => "Only accept changes through pull requests",
376+ (RestrictPushTitle, En) => "Only through pull requests",
410377 (Role, En) => "Role",
411- (RestrictPushDesc, Tr) => "Doğrudan gönderimler depo yöneticileriyle sınırlıdır.",
412- (RestrictPushTitle, Tr) => "Değişiklikler yalnızca çekme istekleri üzerinden kabul edilir",
378+ (RestrictPushTitle, Tr) => "Yalnızca çekme istekleri üzerinden",
413379 (Role, Tr) => "Rol",
414380 (RoleAdminDesc, En) => "full repo settings except delete and transfer",
415381 (RoleAdminDesc, Tr) => "silme ve devir dışında tüm depo ayarları",
@@ -427,12 +393,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
427393 (RoleWriteDesc, Tr) => "gönderme (push)",
428394 (RequiredChecks, En) => "Required status checks",
429395 (RequiredChecks, Tr) => "Gerekli durum denetimleri",
430- (RequiredChecksHelp, En) => {
431- "Contexts that must be successful on the pull request head before it can merge, separated by commas. CI jobs report as ci/<job name>."
432- }
433- (RequiredChecksHelp, Tr) => {
434- "Birleştirmeden önce çekme isteğinin son commit'inde başarılı olması gereken bağlamlar, virgülle ayrılır. CI işleri ci/<iş adı> olarak bildirilir."
435- }
436396 (RecentContexts, En) => "Recently seen:",
437397 (RecentContexts, Tr) => "Son görülenler:",
438398 (RuleChangesShort, En) => "Blocks on changes requested",
@@ -467,13 +427,13 @@ pub fn t(lang: Lang, key: K) -> &'static str {
467427 (SecretsHelp, Tr) => {
468428 "Gizli anahtarlar, bu deponun CI işlerine ortam değişkeni olarak aktarılır. Değerler yalnızca yazılabilir: kaydedildikten sonra geri okunamazlar ve bir gizli anahtarı güncellemek değerini değiştirir."
469429 }
470- (SectionChecks, En) => "Status checks",
471- (SectionMerging, En) => "Merging",
430+ (SectionChecks, En) => "Checks",
431+ (SectionPullRequests, En) => "Pull requests",
472432 (SectionPattern, En) => "Pattern",
473433 (SectionPushes, En) => "Pushes",
474434 (SettingsNavLabel, En) => "Settings",
475- (SectionChecks, Tr) => "Durum denetimleri",
476- (SectionMerging, Tr) => "Birleştirme",
435+ (SectionChecks, Tr) => "Denetimler",
436+ (SectionPullRequests, Tr) => "Çekme istekleri",
477437 (SectionPattern, Tr) => "Desen",
478438 (SectionPushes, Tr) => "Gönderimler",
479439 (SettingsNavLabel, Tr) => "Ayarlar",
@@ -679,7 +639,6 @@ mod tests {
679639 K::AllowDeletion,
680640 K::AllowForcePush,
681641 K::AlreadyOwner,
682- K::ApprovalsHelp,
683642 K::ApprovalsRange,
684643 K::ArchiveHeading,
685644 K::ArchiveHelp,
@@ -715,7 +674,6 @@ mod tests {
715674 K::DeleteRepoHelp,
716675 K::DeleteTrashHelp,
717676 K::DeletionAllowed,
718- K::DeletionDesc,
719677 K::Description,
720678 K::DescriptionHelp,
721679 K::DescriptionLong,
@@ -723,7 +681,6 @@ mod tests {
723681 K::EnterUsername,
724682 K::EnterValue,
725683 K::ForcePushAllowed,
726- K::ForcePushDesc,
727684 K::General,
728685 K::GeneralSaved,
729686 K::MakePublic,
@@ -735,17 +692,14 @@ mod tests {
735692 K::NameRule,
736693 K::NewName,
737694 K::NewOwnerLabel,
738- K::NewRule,
695+ K::AddRule,
739696 K::NoBranchesYet,
740697 K::NoCollaborators,
741698 K::NoPendingTransfer,
742699 K::NoSecrets,
743700 K::NotCollaborator,
744701 K::OwnerIsMember,
745- K::PatternHelpA,
746- K::PatternHelpB,
747- K::PatternHelpC,
748- K::PatternHelpD,
702+ K::PatternHelp,
749703 K::PendingTransfers,
750704 K::PrivateOption,
751705 K::PublicOption,
@@ -762,7 +716,6 @@ mod tests {
762716 K::RepoUnarchived,
763717 K::RequireUpToDate,
764718 K::RequiredApprovals,
765- K::RestrictPushDesc,
766719 K::RestrictPushTitle,
767720 K::Role,
768721 K::RoleAdminDesc,
@@ -773,7 +726,6 @@ mod tests {
773726 K::RoleUpdated,
774727 K::RoleWriteDesc,
775728 K::RequiredChecks,
776- K::RequiredChecksHelp,
777729 K::RecentContexts,
778730 K::RuleChangesShort,
779731 K::RuleNoExtra,
@@ -790,7 +742,7 @@ mod tests {
790742 K::Secrets,
791743 K::SecretsHelp,
792744 K::SectionChecks,
793- K::SectionMerging,
745+ K::SectionPullRequests,
794746 K::SectionPattern,
795747 K::SectionPushes,
796748 K::SettingsNavLabel,
crates/forge-web/src/pages/repo.rsmodified+5 -13
@@ -160,6 +160,8 @@ pub async fn repo_head(
160160 parts.push(SubPart::text(description.as_str()));
161161 }
162162 parts.push(SubPart::text(vis));
163+ parts.push(SubPart::text(watch_count));
164+ parts.push(SubPart::text(fork_count));
163165 if let Some((source_owner, source_name)) = forked_from {
164166 parts.push(SubPart::link(
165167 format!("{} {source_owner}/{source_name}", g::t(lang, K::ForkedFrom)),
@@ -202,19 +204,9 @@ pub async fn repo_head(
202204 <button type="submit">(g::t(lang, K::ForkButton))</button>
203205 </form>
204206 }
205- <details class="menu head-more">
206- <summary class="button" aria-label=(s(lang, "Repository actions", "Depo işlemleri"))>
207- <span aria-hidden="true">"…"</span>
208- </summary>
209- <div class="menu-list head-more-list">
210- if let Some((action, csrf, level)) = watch_control {
211- watch_form(lang: lang, action: action, csrf: csrf, level: level, watchers: watchers)
212- } else {
213- <span class="hint">(watch_count.as_str())</span>
214- }
215- <span class="hint">(fork_count.as_str())</span>
216- </div>
217- </details>
207+ if let Some((action, csrf, level)) = watch_control {
208+ watch_form(lang: lang, action: action, csrf: csrf, level: level, watchers: watchers)
209+ }
218210 } else if private {
219211 <span class=(badge)>(vis)</span>
220212 }
crates/forge-web/src/pages/repo_settings.rsmodified+99 -107
@@ -532,10 +532,11 @@ struct RuleCard {
532532 draft: RuleDraft,
533533 }
534534
535-/// The rule list: a line per rule, then a muted line for the default branch when no rule covers it,
536-/// then the New rule line last. A rule opens in place with its rule's values, and the rule whose
537-/// draft has an error opens with the draft instead. The New rule line opens with the draft when no
538-/// rule takes it. The rows share one `name`, so opening one closes the rest.
535+/// The rule list: a line per rule with its summary and an Edit word. The last line is the add line:
536+/// when no rule covers the default branch it also names that branch as protected by default, and
537+/// the add line opens the add form, prefilled with the default branch. A rule opens in place with its
538+/// rule's values, and the rule whose draft has an error opens with the draft instead. The add line
539+/// opens with the draft when no rule takes it. The rows share one `name`, so opening one closes the rest.
539540 #[component]
540541 async fn branch_rule_cards(
541542 lang: Lang,
@@ -560,6 +561,7 @@ async fn branch_rule_cards(
560561 <span class=(pill.class)>(pill.text.as_str())</span>
561562 }
562563 </span>
564+ <span class="act">(g::t(lang, K::EditRule))</span>
563565 </summary>
564566 <div class="opened">
565567 branch_rule_form(lang: lang, csrf: csrf.clone(), save_action: save_action.clone(),
@@ -568,15 +570,13 @@ async fn branch_rule_cards(
568570 </div>
569571 </details>
570572 }
571- if builtin_row {
572- <div class="line">
573- <span class="name"><code>(default_branch.as_str())</code></span>
574- <span class="val">(g::t(lang, K::BuiltinRowText))</span>
575- </div>
576- }
577573 <details class="row-open" name="branch-rule" open=(new_open)>
578574 <summary class="line">
579- <span class="name">"+ "(g::t(lang, K::NewRule))</span>
575+ if builtin_row {
576+ <span class="val"><code>(default_branch.as_str())</code>" "(g::t(lang, K::BuiltinRowText))" · "<span class="act">(g::t(lang, K::AddRule))</span></span>
577+ } else {
578+ <span class="val"><span class="act">(g::t(lang, K::AddRule))</span></span>
579+ }
580580 </summary>
581581 <div class="opened">
582582 branch_rule_form(lang: lang, csrf: csrf.clone(), save_action: save_action.clone(),
@@ -584,14 +584,15 @@ async fn branch_rule_cards(
584584 draft: new_draft, contexts: contexts.clone())
585585 </div>
586586 </details>
587- <p class="hint">(passkeys::s(lang, "Pick a rule to edit it.", "Düzenlemek için bir kural seç."))</p>
588587 </div>
589588 })
590589 }
591590
592-/// The rule form: the pattern, the pushes and merging switches, and the checks, with the save action
593-/// under them. Saving an existing pattern updates its rule. An existing rule also gets a Remove
594-/// action, a confirm_act sibling of the rule form, because forms cannot nest.
591+/// The rule form: the pattern (a new rule only), two groups of toggles, and the approvals and checks,
592+/// with the actions in one row under the form. The Pull requests group hides while Only through
593+/// pull requests is off, unless the rule already keeps a pull request setting, so a saved setting is
594+/// never hidden. The actions sit outside the form and submit it by its id, because forms cannot nest;
595+/// an existing rule's Remove action is a confirm_act beside them, on the same row.
595596 #[component]
596597 async fn branch_rule_form(
597598 lang: Lang,
@@ -615,118 +616,109 @@ async fn branch_rule_form(
615616 error,
616617 is_new: _,
617618 } = draft;
619+ // A pull request setting that is not the default keeps its group in view while the switch is off.
620+ let pr_saved = !matches!(required_approvals.trim(), "" | "0")
621+ || block_on_changes_requested
622+ || require_up_to_date
623+ || require_merge_queue
624+ || !required_checks.trim().is_empty();
625+ let pr_class = if pr_saved { "rule-pr rule-pr-set" } else { "rule-pr" };
618626 // Field ids are per rule, so two open rule forms never share an id.
619627 let prefix = match &rule_id {
620628 Some(id) => format!("rule-{id}"),
621629 None => "rule-new".to_owned(),
622630 };
631+ let form_id = format!("{prefix}-form");
623632 let pattern_id = format!("{prefix}-pattern");
624633 let approvals_id = format!("{prefix}-approvals");
625634 let checks_id = format!("{prefix}-checks");
626635 Ok(view! {
627- <form method="post" action=(save_action.as_str()) class="fields">
628- if let Some(message) = error {
629- alert(message: message.as_str())
630- }
631- <input type="hidden" name="csrf" value=(csrf.as_str())>
632- // An existing rule's pattern is fixed: this form only changes what the rule does. A
633- // different pattern is a new rule, added from the New rule line.
634- if rule_id.is_some() {
635- <input type="hidden" name="pattern" value=(pattern.as_str())>
636- <input type="hidden" name="existing" value="1">
637- <div class="field">
638- <span class="field-label">(g::t(lang, K::BranchPattern))</span>
639- <span class="field-value"><code>(pattern.as_str())</code></span>
640- <p class="hint">(passkeys::s(lang, "For another branch, add a new rule.", "Başka bir dal için yeni bir kural ekle."))</p>
641- </div>
642- } else {
643- <div class="field">
644- <label for=(pattern_id.as_str())>(g::t(lang, K::BranchPattern))</label>
645- <input id=(pattern_id.as_str()) type="text" name="pattern" value=(pattern.as_str()) autocomplete="off" spellcheck="false" required=(true)>
646- <p class="hint">(g::t(lang, K::PatternHelpA))<code>"*"</code>(g::t(lang, K::PatternHelpB))<code>"**"</code>(g::t(lang, K::PatternHelpC))<code>"/"</code>(g::t(lang, K::PatternHelpD))</p>
647- </div>
648- }
649- // Each group is a field: its name in the label column, its boxes in the control column, each
650- // box with its note beside it.
651- <div class="field">
652- <span class="field-label">(g::t(lang, K::SectionPushes))</span>
653- <div class="checks">
654- <div class="check-row">
655- <label class="switch">
656- <input type="checkbox" name="allow_force_push" value="on" checked=(allow_force_push)>
657- <span>(g::t(lang, K::AllowForcePush))</span>
658- </label>
659- <span class="hint">(g::t(lang, K::ForcePushDesc))</span>
660- </div>
661- <div class="check-row">
662- <label class="switch">
663- <input type="checkbox" name="allow_deletion" value="on" checked=(allow_deletion)>
664- <span>(g::t(lang, K::AllowDeletion))</span>
665- </label>
666- <span class="hint">(g::t(lang, K::DeletionDesc))</span>
636+ <div class="rule-edit">
637+ <form id=(form_id.as_str()) method="post" action=(save_action.as_str()) class="fields branch-rule-form">
638+ if let Some(message) = error {
639+ alert(message: message.as_str())
640+ }
641+ <input type="hidden" name="csrf" value=(csrf.as_str())>
642+ // An existing rule's pattern is fixed: this form only changes what the rule does. A
643+ // different pattern is a new rule, added from the Add rule line.
644+ if rule_id.is_some() {
645+ <input type="hidden" name="pattern" value=(pattern.as_str())>
646+ <input type="hidden" name="existing" value="1">
647+ } else {
648+ <div class="field">
649+ <label for=(pattern_id.as_str())>(g::t(lang, K::BranchPattern))</label>
650+ <input id=(pattern_id.as_str()) type="text" name="pattern" value=(pattern.as_str()) autocomplete="off" spellcheck="false" required=(true)>
651+ <p class="hint">(g::t(lang, K::PatternHelp))</p>
667652 </div>
668- <div class="check-row">
669- <label class="switch">
670- <input type="checkbox" name="restrict_push" value="on" checked=(restrict_push)>
671- <span>(g::t(lang, K::RestrictPushTitle))</span>
672- </label>
673- <span class="hint">(g::t(lang, K::RestrictPushDesc))</span>
653+ }
654+ <div class="rule-section">
655+ <h3 class="rule-head">(g::t(lang, K::SectionPushes))</h3>
656+ <div class="field">
657+ <div class="checks">
658+ <label class="switch">
659+ <input type="checkbox" name="allow_force_push" value="on" checked=(allow_force_push)>
660+ <span>(g::t(lang, K::AllowForcePush))</span>
661+ </label>
662+ <label class="switch">
663+ <input type="checkbox" name="allow_deletion" value="on" checked=(allow_deletion)>
664+ <span>(g::t(lang, K::AllowDeletion))</span>
665+ </label>
666+ <label class="switch">
667+ <input type="checkbox" name="restrict_push" value="on" checked=(restrict_push)>
668+ <span>(g::t(lang, K::RestrictPushTitle))</span>
669+ </label>
670+ </div>
674671 </div>
675672 </div>
676- </div>
677- <div class="field">
678- <label for=(approvals_id.as_str())>(g::t(lang, K::RequiredApprovals))</label>
679- <input id=(approvals_id.as_str()) type="number" name="required_approvals" min="0" max="20" step="1" inputmode="numeric" value=(required_approvals.as_str())>
680- <p class="hint">(g::t(lang, K::ApprovalsHelp))</p>
681- </div>
682- <div class="field">
683- <span class="field-label">(g::t(lang, K::SectionMerging))</span>
684- <div class="checks">
685- <label class="switch">
686- <input type="checkbox" name="block_on_changes_requested" value="on" checked=(block_on_changes_requested)>
687- <span>(g::t(lang, K::BlockWhileChanges))</span>
688- </label>
689- <label class="switch">
690- <input type="checkbox" name="require_up_to_date" value="on" checked=(require_up_to_date)>
691- <span>(g::t(lang, K::RequireUpToDate))</span>
692- </label>
693- <div class="check-row">
694- <label class="switch">
695- <input type="checkbox" name="require_merge_queue" value="on" checked=(require_merge_queue)>
696- <span>(mq::t(lang, mq::K::RequireMergeQueue))</span>
697- </label>
698- <span class="hint">(mq::t(lang, mq::K::RequireMergeQueueHint))</span>
673+ <div class=(pr_class)>
674+ <h3 class="rule-head">(g::t(lang, K::SectionPullRequests))</h3>
675+ <div class="field">
676+ <label for=(approvals_id.as_str())>(g::t(lang, K::RequiredApprovals))</label>
677+ <input id=(approvals_id.as_str()) type="number" name="required_approvals" min="0" max="20" step="1" inputmode="numeric" value=(required_approvals.as_str())>
699678 </div>
700- </div>
701- </div>
702- <div class="field">
703- <label for=(checks_id.as_str())>(g::t(lang, K::SectionChecks))</label>
704- <input id=(checks_id.as_str()) type="text" name="required_checks" value=(required_checks.as_str()) autocomplete="off" spellcheck="false" placeholder="ci/test, ci/lint" aria-label=(g::t(lang, K::RequiredChecks))>
705- <p class="hint">(g::t(lang, K::RequiredChecksHelp))</p>
706- if !contexts.is_empty() {
707- <div class="acts">
708- <span class="hint">(g::t(lang, K::RecentContexts))</span>
709- for context in contexts.iter() {
710- <button type="button" class="act" data-check-add=(context.as_str())>(context.as_str())</button>
679+ <div class="field">
680+ <div class="checks">
681+ <label class="switch">
682+ <input type="checkbox" name="block_on_changes_requested" value="on" checked=(block_on_changes_requested)>
683+ <span>(g::t(lang, K::BlockWhileChanges))</span>
684+ </label>
685+ <label class="switch">
686+ <input type="checkbox" name="require_up_to_date" value="on" checked=(require_up_to_date)>
687+ <span>(g::t(lang, K::RequireUpToDate))</span>
688+ </label>
689+ <label class="switch">
690+ <input type="checkbox" name="require_merge_queue" value="on" checked=(require_merge_queue)>
691+ <span>(mq::t(lang, mq::K::RequireMergeQueue))</span>
692+ </label>
693+ </div>
694+ </div>
695+ <div class="field">
696+ <label for=(checks_id.as_str())>(g::t(lang, K::SectionChecks))</label>
697+ <input id=(checks_id.as_str()) type="text" name="required_checks" value=(required_checks.as_str()) autocomplete="off" spellcheck="false" placeholder="ci/test, ci/lint" aria-label=(g::t(lang, K::RequiredChecks))>
698+ if !contexts.is_empty() {
699+ <div class="acts recent-checks">
700+ <span class="hint">(g::t(lang, K::RecentContexts))</span>
701+ for context in contexts.iter() {
702+ <button type="button" class="act" data-check-add=(context.as_str())>(context.as_str())</button>
703+ }
704+ </div>
711705 }
712706 </div>
713- }
714- </div>
715- <div class="acts">
707+ </div>
708+ </form>
709+ <div class="acts rule-acts">
716710 if rule_id.is_some() {
717- <button type="submit" class="primary">(passkeys::s(lang, "Save changes", "Değişiklikleri kaydet"))</button>
711+ <button type="submit" form=(form_id.as_str()) class="primary">(passkeys::s(lang, "Save changes", "Değişiklikleri kaydet"))</button>
718712 } else {
719- <button type="submit" class="primary">(passkeys::s(lang, "Add rule", "Kuralı ekle"))</button>
713+ <button type="submit" form=(form_id.as_str()) class="primary">(g::t(lang, K::AddRule))</button>
720714 }
721715 <button type="button" class="act quiet" data-close-details="">(g::t(lang, K::CancelRule))</button>
716+ if let Some(id) = &rule_id {
717+ confirm_act(lang: lang, label: g::t(lang, K::RemoveRule), action: delete_action.as_str(), csrf: csrf.as_str(),
718+ fields: vec![("rule_id".to_owned(), id.clone())])
719+ }
722720 </div>
723- </form>
724- if let Some(id) = &rule_id {
725- <div class="acts">
726- confirm_act(lang: lang, label: g::t(lang, K::RemoveRule), action: delete_action.as_str(), csrf: csrf.as_str(),
727- fields: vec![("rule_id".to_owned(), id.clone())])
728- </div>
729- }
721+ </div>
730722 })
731723 }
732724
docs/ui-language.mdmodified+4 -1
@@ -80,7 +80,10 @@ no `margin-left:auto`, no `justify-content:space-between`, no second column at t
8080 - **Time range**: every log has a When filter (Any time, Last hour, Last 24 hours, Last 7 days, Last
8181 30 days, Today, Dates…). Dates… shows From and To day fields in the viewer's timezone, and the tools
8282 row starts with the count of entries that match, so "how many sign-ins last week" is one glance.
83-- **Tool**: `.act`, a word in the accent's ink (14px, 600, radius 12), never the dim colour of a hint. `.act.danger` for destructive. This is what goes in
83+- **Tool**: `.act`, a word in the accent's ink (14px, 600, radius 12), never the dim colour of a hint.
84+ A topic's own action, standing alone under its heading in `.sec > .acts` or right in the `.sec`
85+ (Rename repository, Transfer repository), takes the small soft pill (32px, like Star) instead,
86+ red-worded when dangerous. On a line of facts a tool stays a word. `.act.danger` for destructive. This is what goes in
8487 tools rows, in rows and in `.acts`.
8588 - `reveal(label, id, open)`: a tool that opens its form in place. `open` when a form came back with an error.
8689 In a `.fields` form its word starts on the controls' edge. What should not be one click away
scripts/audit/seed.pymodified+6 -0
@@ -515,6 +515,12 @@ def _():
515515 seed["hook_id"] = m.group(1) if m and m.group(1) != "new" else None
516516
517517
518+@step("branch rule")
519+def _():
520+ admin.post(f"{R}/settings/branches", {"pattern": "release/*", "restrict_push": "on",
521+ "required_approvals": "2", "required_checks": "ci/test"})
522+
523+
518524 @step("secret")
519525 def _():
520526 admin.post(f"{R}/settings/secrets", {"name": "DEPLOY_KEY", "value": "hunter2"})
style/_min_menus.scssmodified+0 -16
@@ -72,7 +72,6 @@
7272
7373 // Actions moved left, so their menus open rightward from them and stay in the window.
7474 .watch-menu > .menu-list,
75-.head-more-list,
7675 .pins-menu > .pop-panel,
7776 .pins-menu > .menu-list,
7877 .clone > .menu-list,
@@ -100,21 +99,6 @@
10099 max-width: none;
101100 }
102101
103- // The watch menu opens inside the fixed More panel: it stays in the panel's flow.
104- .head-more .watch-control,
105- .head-more .watch-menu {
106- display: block;
107- width: 100%;
108- }
109-
110- .head-more .watch-menu > .menu-list {
111- position: static !important;
112- width: 100%;
113- min-width: 0;
114- max-width: 100%;
115- box-shadow: none;
116- }
117-
118102 .line .val {
119103 flex-wrap: wrap;
120104 min-width: 0;
style/_one.scssmodified+40 -0
@@ -3645,3 +3645,43 @@ details.log-group {
36453645 font-size: 15px;
36463646 line-height: 22px;
36473647 }
3648+
3649+// A topic's own action, standing alone under its heading (Rename repository, Transfer repository,
3650+// Regenerate codes), is a small soft pill like Star, not a word: it is the thing the topic is for.
3651+// Tools on a line of facts stay words. A dangerous one keeps its red word on the pill.
3652+.sec > .acts > details.reveal > summary.act,
3653+.sec > .acts > :is(a.act, button.act),
3654+.sec > .acts > form.act-form > button.act,
3655+.sec > :is(a.act, button.act),
3656+.sec > details > summary.act,
3657+.sec > form > button.act:only-of-type {
3658+ height: var(--control-sm);
3659+ margin-left: 0;
3660+ padding: 0 14px;
3661+ border-radius: 15px;
3662+ background: var(--surface-2);
3663+ color: var(--text);
3664+ font-size: 13px;
3665+ font-weight: 600;
3666+
3667+ &:hover {
3668+ background: color-mix(in oklab, var(--surface-2) 88%, var(--text));
3669+ color: var(--text);
3670+ }
3671+
3672+ &.danger,
3673+ &.danger:hover {
3674+ background: var(--danger-bg);
3675+ color: var(--bad);
3676+ }
3677+
3678+ &.quiet {
3679+ color: var(--muted);
3680+ }
3681+}
3682+
3683+// Pills keep their own edge, so a row of them starts on the topic's text edge.
3684+.sec > .acts:has(> details.reveal > summary.act, > a.act, > button.act, > form.act-form > button.act) {
3685+ margin-left: 0;
3686+ gap: 8px;
3687+}
style/_one_admin.scssmodified+91 -0
@@ -306,3 +306,94 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])';
306306 border-bottom: 0;
307307 }
308308 }
309+
310+// Branch rules. The form has two groups, Pushes and Pull requests, each with a heading and its
311+// fields stacked. Its options are toggles: the checkbox itself is drawn as a switch, so it stays the
312+// control for the keyboard and the label, and its focus ring shows.
313+#{$repo} .rule-section,
314+#{$repo} .rule-pr {
315+ display: flex;
316+ flex-direction: column;
317+ gap: 6px;
318+ min-width: 0;
319+}
320+
321+#{$repo} .rule-head {
322+ margin: 12px 0 0;
323+ font-size: 14px;
324+ font-weight: 600;
325+ color: var(--muted);
326+}
327+
328+#{$repo} .branch-rule-form label.switch {
329+ align-items: center;
330+ gap: 12px;
331+ cursor: pointer;
332+ font-weight: 400;
333+
334+ > input[type="checkbox"] {
335+ position: relative;
336+ flex: none;
337+ appearance: none;
338+ width: 36px;
339+ height: 20px;
340+ margin: 0;
341+ border: 0;
342+ border-radius: 10px;
343+ background: var(--surface-2);
344+ box-shadow: inset 0 0 0 1.5px var(--border-strong);
345+ transition: background 0.15s;
346+
347+ &::after {
348+ content: "";
349+ position: absolute;
350+ top: 3px;
351+ left: 3px;
352+ width: 14px;
353+ height: 14px;
354+ border-radius: 50%;
355+ background: var(--muted);
356+ transition: transform 0.15s, background 0.15s;
357+ }
358+
359+ &:checked {
360+ background: var(--accent);
361+ box-shadow: none;
362+
363+ &::after {
364+ transform: translateX(16px);
365+ background: var(--surface);
366+ }
367+ }
368+
369+ &:focus-visible {
370+ outline: 2px solid var(--focus);
371+ outline-offset: 2px;
372+ }
373+ }
374+}
375+
376+// Pull requests show only while the rule is restricted to pull requests, live as its switch is ticked.
377+// A rule that already keeps a pull request setting keeps the group in view, so no saved value is hidden.
378+#{$repo} .branch-rule-form:has(input[name="restrict_push"]:not(:checked)) .rule-pr:not(.rule-pr-set) {
379+ display: none;
380+}
381+
382+// The actions sit under the form on its control column, one row: Save or Add, Cancel, and Remove rule.
383+#{$repo} .rule-edit {
384+ --label-w: 130px;
385+}
386+
387+#{$repo} .rule-acts {
388+ align-items: center;
389+ margin-left: calc(var(--label-w) + 16px);
390+
391+ @media (max-width: 700px) {
392+ margin-left: 0;
393+ }
394+}
395+
396+// The recently seen checks start on the input's edge, in one line under it.
397+#{$repo} .recent-checks {
398+ margin-left: 0;
399+}
style/_one_shell.scssmodified+25 -70
@@ -131,31 +131,6 @@ a > .ref-chip,
131131 border: 0;
132132 }
133133
134-// Repo actions panel on a phone: one fixed panel inside the window, its watch options inside it.
135-@media (max-width: 899px) {
136- .head-more-list {
137- position: fixed !important;
138- left: 16px !important;
139- right: 16px !important;
140- top: auto;
141- width: auto;
142- min-width: 0;
143- max-width: none;
144- }
145-
146- .head-more-list .watch-menu,
147- .head-more-list .watch-control {
148- width: 100%;
149- min-width: 0;
150- }
151-
152- .head-more-list .watch-menu > summary {
153- width: 100%;
154- max-width: 100%;
155- box-sizing: border-box;
156- }
157-}
158-
159134 // Watch options are menu rows: the name only. The longer description stays for screen readers.
160135 .watch-list .watch-option-desc {
161136 position: absolute;
@@ -166,8 +141,8 @@ a > .ref-chip,
166141 white-space: nowrap;
167142 }
168143
169-// The watch menu's button is a soft shape like every other, and inside the repo's "…" panel it is
170-// one of that panel's rows. Its options are menu rows too: 34px, the check before the name.
144+// The watch menu's button is a soft shape like every other action beside a title (the
145+// `.head-title` pill rule below). Its options are menu rows: 34px, the check before the name.
171146 .watch-menu > summary {
172147 height: var(--control-h);
173148 padding: 0 30px 0 14px;
@@ -177,15 +152,18 @@ a > .ref-chip,
177152 font-size: 15px;
178153 }
179154
180-.head-more-list .watch-menu > summary {
181- height: 34px;
182- padding: 0 30px 0 12px;
183- border-radius: 12px;
184- background: none;
185- font-size: 14px;
155+// Beside a repo title, the watch button is one of the head's pills: the same height, radius, fill,
156+// and 600 text as Star and Fork. The caret keeps its place at the end.
157+.head-title > .watch-control .watch-menu > summary {
158+ box-sizing: border-box;
159+ padding: 0 30px 0 18px;
160+ font-size: 15px;
161+ font-weight: 600;
162+ line-height: 1;
163+ color: var(--text);
186164
187165 &:hover {
188- background: var(--surface-2);
166+ background: color-mix(in oklab, var(--surface-2) 88%, var(--text));
189167 }
190168 }
191169
@@ -211,42 +189,6 @@ a > .ref-chip,
211189 }
212190 }
213191
214-// The counts in the repo's "…" panel sit on its rows' inset, as quiet rows of their own.
215-.head-more-list > .hint,
216-.head-more-list .watch-control > .hint {
217- display: flex;
218- align-items: center;
219- height: 30px;
220- margin: 0;
221- padding: 0 12px;
222- font-size: 13px;
223-}
224-
225-.head-more-list .watch-menu > summary {
226- justify-content: flex-start;
227-}
228-
229-// Inside the "…" panel the watch options open in place under their row, never as a second panel.
230-.head-more .watch-control,
231-.head-more .watch-menu {
232- display: block;
233- width: 100%;
234-}
235-
236-.head-more .watch-menu > .menu-list {
237- position: static !important;
238- width: 100%;
239- min-width: 0;
240- max-width: 100%;
241- padding: 0 0 4px;
242- box-shadow: none !important;
243- background: none !important;
244-}
245-
246-.head-more-list {
247- min-width: 220px;
248-}
249-
250192 .watch-list button.watch-option {
251193 justify-content: flex-start;
252194 text-align: left;
@@ -257,3 +199,16 @@ a > .ref-chip,
257199 background: var(--surface-2);
258200 font-weight: 600;
259201 }
202+
203+// In the head the watcher count is in the line under the title, so the watch pill stands alone.
204+.head-title > .watch-control > .hint {
205+ display: none;
206+}
207+
208+// On a phone the watch pill is its eye and chevron, so it shares the title's line with Star; its
209+// level stays in the summary's label.
210+@media (max-width: 700px) {
211+ .head-title > .watch-control .watch-menu > summary > span {
212+ display: none;
213+ }
214+}