forge
Explore
Log in

Don't you dare go Hollow

Every line starts on its sheet's text edge: server settings rows share the forms' label column and sit on the topic's edge instead of 18px in, the README text, a secret's row and a word action leading a line or an attach row line up with the rest, and a wrapped filter on a phone starts at the edge

Browse files at this commit

27b4555b194b8214ba13930d5a6f158281ed4343Ahmet Kaan GümüşParent: 656d478
Some checks failed
Show checks
  • ✗ci/buildjob was cancelledDetails
  • style
    • every line starts on its sheet's text edge: server settings rows share the forms' label column and sit on the topic's edge instead of 18px in, the README text, a secret's row and a word action leading a line or an attach row line up with the rest, and a wrapped filter on a phone starts at the edge
    • Exact and Aa sit inside the search field so they never wrap under it
    • the repository head drops the latest commit's message, keeping its sha, author and age
    • Convert to draft joins the merge line
    • the mail password says not set in its field instead of a line under it
    • org settings say Default role and Members can create repositories
    • replication off says only that 🔧 chore: the audit's measure flags lines a few pixels off their sheet's text edge
Show full message
💄 style: every line starts on its sheet's text edge: server settings rows share the forms' label column and sit on the topic's edge instead of 18px in, the README text, a secret's row and a word action leading a line or an attach row line up with the rest, and a wrapped filter on a phone starts at the edge; Exact and Aa sit inside the search field so they never wrap under it; the repository head drops the latest commit's message, keeping its sha, author and age; Convert to draft joins the merge line; the mail password says not set in its field instead of a line under it; org settings say Default role and Members can create repositories; replication off says only that 🔧 chore: the audit's measure flags lines a few pixels off their sheet's text edge
crates/forge-e2e/tests/e2e/browse_e2e.rsmodified+4 -4
@@ -124,8 +124,8 @@ fn element_texts(body: &str, selector: &str) -> Vec<String> {
124124 .collect()
125125 }
126126
127-/// Checks the latest commit in a repo page's head line: its short sha and subject, both linking to
128-/// the commit, and the commit count label.
127+/// Checks the latest commit in a repo page's head line: its short sha linking to the commit, no
128+/// subject, and the commit count label.
129129 fn assert_latest_bar(body: &str, what: &str, subject: &str, oid: &str, count: &str) {
130130 assert_eq!(element_texts(body, ".head-sub").len(), 1, "{what}: one head line");
131131 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
133133 assert_eq!(shas[0].trim(), &oid[..7], "{what}: short sha");
134134 let links = element_texts(body, ".head-sub a[href*=\"/commit/\"]");
135135 assert!(
136- links.iter().any(|l| l.trim() == subject),
137- "{what}: the head line must show {subject:?}, got {links:?}"
136+ !links.iter().any(|l| l.trim() == subject),
137+ "{what}: the head line must not show the subject {subject:?}, got {links:?}"
138138 );
139139 let parts = element_texts(body, ".head-sub span");
140140 assert!(
crates/forge-web-base/src/i18n/admin.rsmodified+2 -10
@@ -86,7 +86,6 @@ pub enum K {
8686 MailSettingsSaved,
8787 MovedToGhost,
8888 NoEntries,
89- NoPasswordStored,
9089 NoReposYet,
9190 NoRunnersYet,
9291 NoRunnerWithId,
@@ -319,8 +318,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
319318 (MovedToGhost, Tr) => "Hayalet kullanıcıya taşınanlar:",
320319 (NoEntries, En) => "No entries.",
321320 (NoEntries, Tr) => "Kayıt yok.",
322- (NoPasswordStored, En) => "No password is stored.",
323- (NoPasswordStored, Tr) => "Kayıtlı parola yok.",
324321 (NoReposYet, En) => "No repos yet.",
325322 (NoReposYet, Tr) => "Henüz depo yok.",
326323 (NoRunnersYet, En) => "No runners registered yet.",
@@ -345,12 +342,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
345342 (RemovedWithAccount, Tr) => "Hesapla birlikte silinenler:",
346343 (Replication, En) => "Replication",
347344 (Replication, Tr) => "Çoğaltma",
348- (ReplicationOff, En) => {
349- "Replication is off. Set target, identity_file and known_hosts_file in the [replication] section to turn it on."
350- }
351- (ReplicationOff, Tr) => {
352- "Çoğaltma kapalı. Açmak için [replication] bölümünde target, identity_file ve known_hosts_file ayarlarını yapın."
353- }
345+ (ReplicationOff, En) => "Replication is off.",
346+ (ReplicationOff, Tr) => "Çoğaltma kapalı.",
354347 (Repos, En) => "Repos",
355348 (Repos, Tr) => "Depolar",
356349 (Retention, En) => "Retention",
@@ -637,7 +630,6 @@ mod tests {
637630 K::MailSettingsSaved,
638631 K::MovedToGhost,
639632 K::NoEntries,
640- K::NoPasswordStored,
641633 K::NoReposYet,
642634 K::NoRunnersYet,
643635 K::NoRunnerWithId,
crates/forge-web-base/src/i18n/orgs.rsmodified+4 -4
@@ -218,10 +218,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
218218 (Description, Tr) => "Açıklama",
219219 (DisplayNameLabel, En) => "Display name",
220220 (DisplayNameLabel, Tr) => "Görünen ad",
221- (DefaultRoleLabel, En) => "Default role on the organization's repositories",
222- (DefaultRoleLabel, Tr) => "Kuruluş depolarında varsayılan rol",
223- (MembersCanCreate, En) => "Members can create repositories for this organization",
224- (MembersCanCreate, Tr) => "Üyeler bu kuruluş için depo oluşturabilir",
221+ (DefaultRoleLabel, En) => "Default role",
222+ (DefaultRoleLabel, Tr) => "Varsayılan rol",
223+ (MembersCanCreate, En) => "Members can create repositories",
224+ (MembersCanCreate, Tr) => "Üyeler depo oluşturabilir",
225225 (SaveSettings, En) => "Save settings",
226226 (SaveSettings, Tr) => "Ayarları kaydet",
227227 (DeleteOrg, En) => "Delete organization",
crates/forge-web/src/pages/admin_mail.rsmodified+1 -4
@@ -257,11 +257,8 @@ async fn mail_view(
257257 </div>
258258 <div class="field">
259259 <label for="mail-password">(i18n::t(lang, Key::Password))</label>
260- <input id="mail-password" type="password" name="password" autocomplete="new-password" maxlength="1024">
260+ <input id="mail-password" type="password" name="password" autocomplete="new-password" maxlength="1024" placeholder=(g::t(lang, if data.has_password { K::SrvSecretSet } else { K::SrvSecretNotSet }))>
261261 </div>
262- if !data.has_password {
263- <p class="state">(g::t(lang, K::NoPasswordStored))</p>
264- }
265262 </div>
266263 </section>
267264 <section class="sec">
crates/forge-web/src/pages/pull_view.rsmodified+3 -5
@@ -364,6 +364,9 @@ async fn merge_box(
364364 if let Some(summary) = checks {
365365 checks_summary(summary: summary, lang: StatusLang(lang))
366366 }
367+ if let Some((action, label)) = draft_toggle {
368+ post_act(label: label, action: action.as_str(), csrf: flow_csrf.as_str())
369+ }
367370 </div>
368371 if !required.is_empty() {
369372 <div>
@@ -448,11 +451,6 @@ async fn merge_box(
448451 <button type="submit" class="primary">(enable_auto)</button>
449452 </form>
450453 }
451- if let Some((action, label)) = draft_toggle {
452- <div class="line">
453- post_act(label: label, action: action.as_str(), csrf: flow_csrf.as_str())
454- </div>
455- }
456454 </section>
457455 })
458456 }
crates/forge-web/src/pages/repo_side.rsmodified+0 -1
@@ -265,7 +265,6 @@ pub fn code_sub(
265265 let mut sha = SubPart::link(bar.short.as_str(), bar.last.href.as_str());
266266 sha.class = "mono";
267267 parts.push(sha);
268- parts.push(SubPart::link(bar.last.summary.as_str(), bar.last.href.as_str()));
269268 parts.push(SubPart::text(bar.author.as_str()));
270269 parts.push(SubPart::text(bar.last.age.as_str()));
271270 }
crates/forge-web/src/views/find.rsmodified+8 -8
@@ -172,15 +172,15 @@ pub async fn finder_field(
172172 <svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
173173 <label class="sr-only" for=(id)>(placeholder)</label>
174174 <input id=(id) type="search" name="q" value=(finder.q.as_str()) placeholder=(placeholder) data-live-search="" autocomplete="off">
175+ <label class="find-opt" title=(s(lang, "Exact", "Tam"))>
176+ <input type="checkbox" name="exact" value="1" checked=(finder.exact) data-autosubmit="true">
177+ <span>(s(lang, "Exact", "Tam"))</span>
178+ </label>
179+ <label class="find-opt" title=(s(lang, "Match case", "Büyük/küçük harf"))>
180+ <input type="checkbox" name="case" value="1" checked=(finder.case) data-autosubmit="true">
181+ <span>"Aa"</span>
182+ </label>
175183 </div>
176- <label class="find-opt" title=(s(lang, "Only the text as typed, as one piece", "Yalnızca yazılan metin, tek parça olarak"))>
177- <input type="checkbox" name="exact" value="1" checked=(finder.exact) data-autosubmit="true">
178- <span>(s(lang, "Exact", "Tam"))</span>
179- </label>
180- <label class="find-opt" title=(s(lang, "Keep upper and lower case apart", "Büyük ve küçük harfi ayırt et"))>
181- <input type="checkbox" name="case" value="1" checked=(finder.case) data-autosubmit="true">
182- <span>"Aa"</span>
183- </label>
184184 <button type="submit" class="sr-only">(s(lang, "Search", "Ara"))</button>
185185 </div>
186186 })
scripts/audit/measure.tsmodified+29 -0
@@ -224,6 +224,35 @@ const ALIGN = `((root) => {
224224 const t = line(e), b = e.getBoundingClientRect();
225225 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));
226226 }
227+ // 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.
228+ for (const sheet of root.querySelectorAll('.sheet')) {
229+ if (!seen(sheet) || sheet.parentElement.closest('.sheet')) continue;
230+ const sc = getComputedStyle(sheet), sr = sheet.getBoundingClientRect();
231+ const edge = sr.left + parseFloat(sc.borderLeftWidth) + parseFloat(sc.paddingLeft);
232+ const items = [];
233+ const walk = document.createTreeWalker(sheet, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
234+ for (let n = walk.nextNode(); n && items.length < 2000; n = walk.nextNode()) {
235+ const host = n.nodeType === 3 ? n.parentElement : n;
236+ if (host.closest('pre, .markdown-body, .sr-only, table, .diff, .log, .tree, svg, [hidden], details:not([open]) > :not(summary)')) continue;
237+ let r;
238+ const pill = host.closest('button, summary, a, label, .tag, .pill');
239+ if (pill && sheet.contains(pill) && getComputedStyle(pill).backgroundColor !== 'rgba(0, 0, 0, 0)') { if (n !== pill) continue; r = pill.getBoundingClientRect(); }
240+ else if (n.nodeType === 3) { if (!n.textContent.trim()) continue; const g = document.createRange(); g.selectNodeContents(n); r = g.getClientRects()[0]; }
241+ else if (n.matches('img, input:not([type=hidden]), select, textarea, button, svg')) r = n.getBoundingClientRect();
242+ if (!r || !r.width || !r.height || getComputedStyle(host).visibility === 'hidden') continue;
243+ items.push({ r, host });
244+ }
245+ 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));
246+ const count = new Map();
247+ for (const a of starts) { const k = Math.round(a.r.left - edge); count.set(k, (count.get(k) || 0) + 1); }
248+ if (!count.size) continue;
249+ const main = [...count].sort((x, y) => y[1] - x[1])[0][0];
250+ for (const a of starts) {
251+ const off = Math.round(a.r.left - edge) - main;
252+ if (Math.abs(off) < 3 || Math.abs(off) > 40) continue;
253+ bad.push('line starts ' + off + 'px off the sheet text edge: ' + name(a.host));
254+ }
255+ }
227256 for (const form of root.querySelectorAll('.fields')) {
228257 if (!seen(form) || form.getBoundingClientRect().width < 500) continue;
229258 const fields = [...form.querySelectorAll('.field')].filter((f) => seen(f) && f.closest('.fields') === form && getComputedStyle(f).display === 'grid');
style/_authoring.scssmodified+4 -0
@@ -7,6 +7,10 @@
77 gap: 0.6rem;
88 min-height: 1.6rem;
99 margin-top: 0.25rem;
10+
11+ > :is(.link-button, .act):first-child {
12+ margin-left: -10px;
13+ }
1014 }
1115
1216 .md-status {
style/_one.scssmodified+35 -3
@@ -1328,7 +1328,7 @@ main > .tabs {
13281328 // A readme in a sheet: its text starts on the tools row's inset, the canvas's 22px under the row.
13291329 .sheet .readme {
13301330 margin: 0;
1331- padding: 22px 28px 28px;
1331+ padding: 22px 18px 28px;
13321332
13331333 .markdown-body,
13341334 .readme-text {
@@ -1432,7 +1432,14 @@ a.line:hover .name,
14321432 color: var(--text);
14331433 }
14341434
1435+.line > :is(a.act, button.act, summary.act):first-child,
1436+.line > .act-form:first-child > .act,
1437+.line > details.reveal:first-child > summary.act {
1438+ margin-left: -10px;
1439+}
1440+
14351441 .sheet > .sec > .line,
1442+.sheet > .sec > div:not([class]) > .line,
14361443 .sheet > .sec > .commits-list > .line,
14371444 .sheet > .sec > .commits-list > .row-open > .line,
14381445 .sheet > .sec > .row-open > .line {
@@ -3440,6 +3447,10 @@ nav.pager.pager-numbered {
34403447 font-size: 14px;
34413448 font-weight: 500;
34423449
3450+ @media (max-width: 700px) {
3451+ margin-left: 0;
3452+ }
3453+
34433454 select {
34443455 width: auto;
34453456 max-width: 220px;
@@ -3642,14 +3653,35 @@ details.log-group {
36423653 }
36433654 }
36443655
3645-// In a rail the search takes the rail's width, its options on the line under it.
3656+// Exact and Aa sit inside the field at its end, so they never wrap under it.
3657+.list-find.list-find .plain-search:has(> .find-opt) {
3658+ width: 320px;
3659+ padding-right: 4px;
3660+ gap: 6px;
3661+
3662+ > .find-opt {
3663+ flex: none;
3664+ height: 24px;
3665+ padding: 0 8px;
3666+ border-radius: 12px;
3667+ font-size: 12px;
3668+ }
3669+
3670+ > .find-opt:has(> input:checked) {
3671+ background: var(--surface);
3672+ }
3673+}
3674+
3675+// In a rail the search takes the rail's width.
36463676 .rail .list-find {
36473677 display: flex;
36483678 width: 100%;
36493679
3650- &.list-find .plain-search {
3680+ &.list-find .plain-search,
3681+ &.list-find .plain-search:has(> .find-opt) {
36513682 flex: 1 1 100%;
36523683 width: auto;
3684+ min-width: 0;
36533685 }
36543686 }
36553687
style/_one_admin.scssmodified+27 -2
@@ -87,9 +87,17 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])';
8787
8888 // Server settings: one setting a line. Its name, then its control on one fixed width, then its notes,
8989 // so every control and every note starts on the same edge. A page is short enough to need no scroll.
90+#{$admin} .sheet:has(.srv-row) {
91+ --label-w: 210px;
92+
93+ .fields {
94+ --label-w: 210px;
95+ }
96+}
97+
9098 #{$admin} .srv-row {
9199 display: grid;
92- grid-template-columns: 210px 280px minmax(0, 1fr);
100+ grid-template-columns: var(--label-w) 280px minmax(0, 1fr);
93101 column-gap: 16px;
94102 align-items: center;
95103 min-height: 52px;
@@ -142,10 +150,22 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])';
142150 }
143151 }
144152
153+#{$admin} .srv-row:not(:has(+ .srv-row)):not(:has(+ .srv-save)) {
154+ border-bottom: 0;
155+}
156+
145157 // Save sits under the controls, on their edge.
146158 #{$admin} .srv-save {
147159 margin: 0;
148- padding: 14px 18px 16px calc(18px + 210px + 16px);
160+ padding: 14px 18px 16px calc(18px + var(--label-w) + 16px);
161+}
162+
163+#{$admin} .sec .srv-row {
164+ padding-inline: 0;
165+}
166+
167+#{$admin} .sec .srv-save {
168+ padding-inline: calc(var(--label-w) + 16px) 0;
149169 }
150170
151171 @media (max-width: 700px) {
@@ -158,6 +178,11 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])';
158178 #{$admin} .srv-save {
159179 padding-left: 14px;
160180 }
181+
182+ #{$admin} .sec .srv-row,
183+ #{$admin} .sec .srv-save {
184+ padding-inline: 0;
185+ }
161186 }
162187
163188 // The server form takes the sheet's width, so its rows reach the same edge as the topic rules.