diff --git a/crates/forge-e2e/tests/e2e/browse_e2e.rs b/crates/forge-e2e/tests/e2e/browse_e2e.rs index f9d6160..71091f5 100644 --- a/crates/forge-e2e/tests/e2e/browse_e2e.rs +++ b/crates/forge-e2e/tests/e2e/browse_e2e.rs @@ -124,8 +124,8 @@ fn element_texts(body: &str, selector: &str) -> Vec { .collect() } -/// Checks the latest commit in a repo page's head line: its short sha and subject, both linking to -/// the commit, and the commit count label. +/// Checks the latest commit in a repo page's head line: its short sha linking to the commit, no +/// subject, and the commit count label. fn assert_latest_bar(body: &str, what: &str, subject: &str, oid: &str, count: &str) { assert_eq!(element_texts(body, ".head-sub").len(), 1, "{what}: one head line"); let shas = element_texts(body, ".head-sub a.mono"); @@ -133,8 +133,8 @@ fn assert_latest_bar(body: &str, what: &str, subject: &str, oid: &str, count: &s assert_eq!(shas[0].trim(), &oid[..7], "{what}: short sha"); let links = element_texts(body, ".head-sub a[href*=\"/commit/\"]"); assert!( - links.iter().any(|l| l.trim() == subject), - "{what}: the head line must show {subject:?}, got {links:?}" + !links.iter().any(|l| l.trim() == subject), + "{what}: the head line must not show the subject {subject:?}, got {links:?}" ); let parts = element_texts(body, ".head-sub span"); assert!( diff --git a/crates/forge-web-base/src/i18n/admin.rs b/crates/forge-web-base/src/i18n/admin.rs index e829ad4..e0bfcc7 100644 --- a/crates/forge-web-base/src/i18n/admin.rs +++ b/crates/forge-web-base/src/i18n/admin.rs @@ -86,7 +86,6 @@ pub enum K { MailSettingsSaved, MovedToGhost, NoEntries, - NoPasswordStored, NoReposYet, NoRunnersYet, NoRunnerWithId, @@ -319,8 +318,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { (MovedToGhost, Tr) => "Hayalet kullanıcıya taşınanlar:", (NoEntries, En) => "No entries.", (NoEntries, Tr) => "Kayıt yok.", - (NoPasswordStored, En) => "No password is stored.", - (NoPasswordStored, Tr) => "Kayıtlı parola yok.", (NoReposYet, En) => "No repos yet.", (NoReposYet, Tr) => "Henüz depo yok.", (NoRunnersYet, En) => "No runners registered yet.", @@ -345,12 +342,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { (RemovedWithAccount, Tr) => "Hesapla birlikte silinenler:", (Replication, En) => "Replication", (Replication, Tr) => "Çoğaltma", - (ReplicationOff, En) => { - "Replication is off. Set target, identity_file and known_hosts_file in the [replication] section to turn it on." - } - (ReplicationOff, Tr) => { - "Çoğaltma kapalı. Açmak için [replication] bölümünde target, identity_file ve known_hosts_file ayarlarını yapın." - } + (ReplicationOff, En) => "Replication is off.", + (ReplicationOff, Tr) => "Çoğaltma kapalı.", (Repos, En) => "Repos", (Repos, Tr) => "Depolar", (Retention, En) => "Retention", @@ -637,7 +630,6 @@ mod tests { K::MailSettingsSaved, K::MovedToGhost, K::NoEntries, - K::NoPasswordStored, K::NoReposYet, K::NoRunnersYet, K::NoRunnerWithId, diff --git a/crates/forge-web-base/src/i18n/orgs.rs b/crates/forge-web-base/src/i18n/orgs.rs index f809e8f..9f0330e 100644 --- a/crates/forge-web-base/src/i18n/orgs.rs +++ b/crates/forge-web-base/src/i18n/orgs.rs @@ -218,10 +218,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { (Description, Tr) => "Açıklama", (DisplayNameLabel, En) => "Display name", (DisplayNameLabel, Tr) => "Görünen ad", - (DefaultRoleLabel, En) => "Default role on the organization's repositories", - (DefaultRoleLabel, Tr) => "Kuruluş depolarında varsayılan rol", - (MembersCanCreate, En) => "Members can create repositories for this organization", - (MembersCanCreate, Tr) => "Üyeler bu kuruluş için depo oluşturabilir", + (DefaultRoleLabel, En) => "Default role", + (DefaultRoleLabel, Tr) => "Varsayılan rol", + (MembersCanCreate, En) => "Members can create repositories", + (MembersCanCreate, Tr) => "Üyeler depo oluşturabilir", (SaveSettings, En) => "Save settings", (SaveSettings, Tr) => "Ayarları kaydet", (DeleteOrg, En) => "Delete organization", diff --git a/crates/forge-web/src/pages/admin_mail.rs b/crates/forge-web/src/pages/admin_mail.rs index f87bdf0..a1d93ce 100644 --- a/crates/forge-web/src/pages/admin_mail.rs +++ b/crates/forge-web/src/pages/admin_mail.rs @@ -257,11 +257,8 @@ async fn mail_view(
- +
- if !data.has_password { -

(g::t(lang, K::NoPasswordStored))

- }
diff --git a/crates/forge-web/src/pages/pull_view.rs b/crates/forge-web/src/pages/pull_view.rs index e112ead..61d85bc 100644 --- a/crates/forge-web/src/pages/pull_view.rs +++ b/crates/forge-web/src/pages/pull_view.rs @@ -364,6 +364,9 @@ async fn merge_box( if let Some(summary) = checks { checks_summary(summary: summary, lang: StatusLang(lang)) } + if let Some((action, label)) = draft_toggle { + post_act(label: label, action: action.as_str(), csrf: flow_csrf.as_str()) + } if !required.is_empty() {
@@ -448,11 +451,6 @@ async fn merge_box( } - if let Some((action, label)) = draft_toggle { -
- post_act(label: label, action: action.as_str(), csrf: flow_csrf.as_str()) -
- }
}) } diff --git a/crates/forge-web/src/pages/repo_side.rs b/crates/forge-web/src/pages/repo_side.rs index 41f620a..3ee0c70 100644 --- a/crates/forge-web/src/pages/repo_side.rs +++ b/crates/forge-web/src/pages/repo_side.rs @@ -265,7 +265,6 @@ pub fn code_sub( let mut sha = SubPart::link(bar.short.as_str(), bar.last.href.as_str()); sha.class = "mono"; parts.push(sha); - parts.push(SubPart::link(bar.last.summary.as_str(), bar.last.href.as_str())); parts.push(SubPart::text(bar.author.as_str())); parts.push(SubPart::text(bar.last.age.as_str())); } diff --git a/crates/forge-web/src/views/find.rs b/crates/forge-web/src/views/find.rs index 15ec068..f0adc5c 100644 --- a/crates/forge-web/src/views/find.rs +++ b/crates/forge-web/src/views/find.rs @@ -172,15 +172,15 @@ pub async fn finder_field( + + - - }) diff --git a/scripts/audit/measure.ts b/scripts/audit/measure.ts index 6996d63..df8dc62 100644 --- a/scripts/audit/measure.ts +++ b/scripts/audit/measure.ts @@ -224,6 +224,35 @@ const ALIGN = `((root) => { const t = line(e), b = e.getBoundingClientRect(); if (t !== b && b.width - t.width > 120 && b.width > 2 * t.width) bad.push('stretched action ' + Math.round(b.width) + 'px for ' + Math.round(t.width) + 'px of words: ' + name(e)); } + // Every line of a sheet starts on the sheet's text edge, or clearly away from it: a few pixels in reads as a slip. + for (const sheet of root.querySelectorAll('.sheet')) { + if (!seen(sheet) || sheet.parentElement.closest('.sheet')) continue; + const sc = getComputedStyle(sheet), sr = sheet.getBoundingClientRect(); + const edge = sr.left + parseFloat(sc.borderLeftWidth) + parseFloat(sc.paddingLeft); + const items = []; + const walk = document.createTreeWalker(sheet, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT); + for (let n = walk.nextNode(); n && items.length < 2000; n = walk.nextNode()) { + const host = n.nodeType === 3 ? n.parentElement : n; + if (host.closest('pre, .markdown-body, .sr-only, table, .diff, .log, .tree, svg, [hidden], details:not([open]) > :not(summary)')) continue; + let r; + const pill = host.closest('button, summary, a, label, .tag, .pill'); + if (pill && sheet.contains(pill) && getComputedStyle(pill).backgroundColor !== 'rgba(0, 0, 0, 0)') { if (n !== pill) continue; r = pill.getBoundingClientRect(); } + else if (n.nodeType === 3) { if (!n.textContent.trim()) continue; const g = document.createRange(); g.selectNodeContents(n); r = g.getClientRects()[0]; } + else if (n.matches('img, input:not([type=hidden]), select, textarea, button, svg')) r = n.getBoundingClientRect(); + if (!r || !r.width || !r.height || getComputedStyle(host).visibility === 'hidden') continue; + items.push({ r, host }); + } + const starts = items.filter((a) => !items.some((b) => b !== a && b.r.left < a.r.left - 1 && b.r.top < a.r.bottom - 2 && b.r.bottom > a.r.top + 2)); + const count = new Map(); + for (const a of starts) { const k = Math.round(a.r.left - edge); count.set(k, (count.get(k) || 0) + 1); } + if (!count.size) continue; + const main = [...count].sort((x, y) => y[1] - x[1])[0][0]; + for (const a of starts) { + const off = Math.round(a.r.left - edge) - main; + if (Math.abs(off) < 3 || Math.abs(off) > 40) continue; + bad.push('line starts ' + off + 'px off the sheet text edge: ' + name(a.host)); + } + } for (const form of root.querySelectorAll('.fields')) { if (!seen(form) || form.getBoundingClientRect().width < 500) continue; const fields = [...form.querySelectorAll('.field')].filter((f) => seen(f) && f.closest('.fields') === form && getComputedStyle(f).display === 'grid'); diff --git a/style/_authoring.scss b/style/_authoring.scss index 708dcca..7cdc4ce 100644 --- a/style/_authoring.scss +++ b/style/_authoring.scss @@ -7,6 +7,10 @@ gap: 0.6rem; min-height: 1.6rem; margin-top: 0.25rem; + + > :is(.link-button, .act):first-child { + margin-left: -10px; + } } .md-status { diff --git a/style/_one.scss b/style/_one.scss index 9d1f766..cd38542 100644 --- a/style/_one.scss +++ b/style/_one.scss @@ -1328,7 +1328,7 @@ main > .tabs { // A readme in a sheet: its text starts on the tools row's inset, the canvas's 22px under the row. .sheet .readme { margin: 0; - padding: 22px 28px 28px; + padding: 22px 18px 28px; .markdown-body, .readme-text { @@ -1432,7 +1432,14 @@ a.line:hover .name, color: var(--text); } +.line > :is(a.act, button.act, summary.act):first-child, +.line > .act-form:first-child > .act, +.line > details.reveal:first-child > summary.act { + margin-left: -10px; +} + .sheet > .sec > .line, +.sheet > .sec > div:not([class]) > .line, .sheet > .sec > .commits-list > .line, .sheet > .sec > .commits-list > .row-open > .line, .sheet > .sec > .row-open > .line { @@ -3440,6 +3447,10 @@ nav.pager.pager-numbered { font-size: 14px; font-weight: 500; + @media (max-width: 700px) { + margin-left: 0; + } + select { width: auto; max-width: 220px; @@ -3642,14 +3653,35 @@ details.log-group { } } -// In a rail the search takes the rail's width, its options on the line under it. +// Exact and Aa sit inside the field at its end, so they never wrap under it. +.list-find.list-find .plain-search:has(> .find-opt) { + width: 320px; + padding-right: 4px; + gap: 6px; + + > .find-opt { + flex: none; + height: 24px; + padding: 0 8px; + border-radius: 12px; + font-size: 12px; + } + + > .find-opt:has(> input:checked) { + background: var(--surface); + } +} + +// In a rail the search takes the rail's width. .rail .list-find { display: flex; width: 100%; - &.list-find .plain-search { + &.list-find .plain-search, + &.list-find .plain-search:has(> .find-opt) { flex: 1 1 100%; width: auto; + min-width: 0; } } diff --git a/style/_one_admin.scss b/style/_one_admin.scss index 126e932..9ee156b 100644 --- a/style/_one_admin.scss +++ b/style/_one_admin.scss @@ -87,9 +87,17 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])'; // Server settings: one setting a line. Its name, then its control on one fixed width, then its notes, // so every control and every note starts on the same edge. A page is short enough to need no scroll. +#{$admin} .sheet:has(.srv-row) { + --label-w: 210px; + + .fields { + --label-w: 210px; + } +} + #{$admin} .srv-row { display: grid; - grid-template-columns: 210px 280px minmax(0, 1fr); + grid-template-columns: var(--label-w) 280px minmax(0, 1fr); column-gap: 16px; align-items: center; min-height: 52px; @@ -142,10 +150,22 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])'; } } +#{$admin} .srv-row:not(:has(+ .srv-row)):not(:has(+ .srv-save)) { + border-bottom: 0; +} + // Save sits under the controls, on their edge. #{$admin} .srv-save { margin: 0; - padding: 14px 18px 16px calc(18px + 210px + 16px); + padding: 14px 18px 16px calc(18px + var(--label-w) + 16px); +} + +#{$admin} .sec .srv-row { + padding-inline: 0; +} + +#{$admin} .sec .srv-save { + padding-inline: calc(var(--label-w) + 16px) 0; } @media (max-width: 700px) { @@ -158,6 +178,11 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])'; #{$admin} .srv-save { padding-left: 14px; } + + #{$admin} .sec .srv-row, + #{$admin} .sec .srv-save { + padding-inline: 0; + } } // The server form takes the sheet's width, so its rows reach the same edge as the topic rules.