forge
Explore
Log in

Don't you dare go Hollow

Four passes over every page in both themes and on phones: all menus, dropdowns and popovers share one panel and open at once, selects, checkboxes, scrollbars and disclosure chevrons replace the browser's, labels are tinted chips, one-pane settings and admin pages use the full width, sessions are one row each, the audit filter sits above its table, Create and Import share the page head, Compare is one row, a folder with no README gives its list the width, and new pages' empty states lose buttons that repeat the form beside them

Browse files at this commit

3aaf5efc6e6aa5d8c495134443cad39e537ccf20Ahmet Kaan GümüşParent: 046e094
All checks have passed
Show checks
  • style
    • four passes over every page in both themes and on phones: all menus, dropdowns and popovers share one panel and open at once, selects, checkboxes, scrollbars and disclosure chevrons replace the browser's, labels are tinted chips, one-pane settings and admin pages use the full width, sessions are one row each, the audit filter sits above its table, Create and Import share the page head, Compare is one row, a folder with no README gives its list the width, and new pages' empty states lose buttons that repeat the form beside them
  • perf
    • a run page embeds 24 KiB of log rather than 512, with a link to the full log, and links prefetch on press, so opening CI is as quick as Issues
  • feat
    • run tones are told apart at once, a bright rising chime for passed and a low double buzz for failed
    • 🔥 remove: the density setting, which changed nothing on the pages people use
    • the settings side switch says what it moves
  • fix
    • file tree icons are no longer black on dark, the site banner lines up with the page, the pulls page no longer scrolls sideways on a phone, phone tables keep two straight columns, blame stays readable in both themes, and syntax colours reach 4.5:1 in light
    • a run whose commit was overwritten cannot be re-run, standbys prune too, links to pruned commits no longer dangle, and a contribution or a stored run no longer shows a commit that is gone
Show full message
💄 style: four passes over every page in both themes and on phones: all menus, dropdowns and popovers share one panel and open at once, selects, checkboxes, scrollbars and disclosure chevrons replace the browser's, labels are tinted chips, one-pane settings and admin pages use the full width, sessions are one row each, the audit filter sits above its table, Create and Import share the page head, Compare is one row, a folder with no README gives its list the width, and new pages' empty states lose buttons that repeat the form beside them; ⚡ perf: a run page embeds 24 KiB of log rather than 512, with a link to the full log, and links prefetch on press, so opening CI is as quick as Issues; ✨ feat: run tones are told apart at once, a bright rising chime for passed and a low double buzz for failed; 🔥 remove: the density setting, which changed nothing on the pages people use; the settings side switch says what it moves; 🐛 fix: file tree icons are no longer black on dark, the site banner lines up with the page, the pulls page no longer scrolls sideways on a phone, phone tables keep two straight columns, blame stays readable in both themes, and syntax colours reach 4.5:1 in light; a run whose commit was overwritten cannot be re-run, standbys prune too, links to pruned commits no longer dangle, and a contribution or a stored run no longer shows a commit that is gone

50 changed files +1267 -398

crates/forge-core/src/store/contributions.rsmodified+24 -0
@@ -197,6 +197,30 @@ impl Store {
197 .map_err(db_err)?;197 .map_err(db_err)?;
198 Ok(())198 Ok(())
199 }199 }
200+
201+ /// The distinct commit ids in `repo_id` whose stored message is not blank.
202+ pub async fn coauthored_oids(&self, repo_id: &str) -> Result<Vec<String>> {
203+ let sql = "SELECT DISTINCT commit_oid FROM coauthored_commits \
204+ WHERE repo_id = ?1 AND summary <> '' ORDER BY commit_oid";
205+ let params = vec![Value::Text(repo_id.to_string())];
206+ let conn = self.read_conn().await;
207+ fetch_all(&conn, sql, params, |row| col_text(row, 0)).await
208+ }
209+
210+ /// Blanks the stored message of the commits `oids` in `repo_id`, for every user. The rows stay,
211+ /// so contribution counts do not change.
212+ pub async fn blank_coauthored(&self, repo_id: &str, oids: &[String]) -> Result<()> {
213+ let conn = self.inner.conn.lock().await;
214+ for oid in oids {
215+ conn.execute(
216+ "UPDATE coauthored_commits SET summary = '' WHERE repo_id = ?1 AND commit_oid = ?2",
217+ (repo_id.to_string(), oid.clone()),
218+ )
219+ .await
220+ .map_err(db_err)?;
221+ }
222+ Ok(())
223+ }
200 }224 }
201 225
202 #[cfg(test)]226 #[cfg(test)]
crates/forge-core/src/store/user_prefs.rsmodified+2 -14
@@ -8,10 +8,6 @@ use super::{Store, col_text, db_err, fetch_all};
8 use crate::error::Result;8 use crate::error::Result;
9 use crate::time::now_stamp;9 use crate::time::now_stamp;
10 10
11-/// Key of the row density: `comfortable` (the default, no row) or `compact`.
12-pub const DENSITY: &str = "density";
13-/// The densities a user may store.
14-pub const DENSITIES: &[&str] = &["comfortable", "compact"];
15 /// Key of the run-finished tone: `on` or `off` (the default, no row).11 /// Key of the run-finished tone: `on` or `off` (the default, no row).
16 pub const SOUND: &str = "sound";12 pub const SOUND: &str = "sound";
17 /// The sound values a user may store.13 /// The sound values a user may store.
@@ -69,7 +65,7 @@ mod tests {
69 use crate::store::Store;65 use crate::store::Store;
70 66
71 #[tokio::test]67 #[tokio::test]
72- async fn density_and_sound_round_trip_and_replace() {68+ async fn a_pref_round_trips_and_replaces() {
73 let dir = tempfile::tempdir().unwrap();69 let dir = tempfile::tempdir().unwrap();
74 let store = Store::open(&dir.path().join("forge.db")).await.unwrap();70 let store = Store::open(&dir.path().join("forge.db")).await.unwrap();
75 let user = store71 let user = store
@@ -78,18 +74,10 @@ mod tests {
78 .unwrap();74 .unwrap();
79 75
80 assert!(store.user_prefs(&user.id).await.unwrap().is_empty());76 assert!(store.user_prefs(&user.id).await.unwrap().is_empty());
81- store77+ store.set_user_pref(&user.id, SOUND, "off").await.unwrap();
82- .set_user_pref(&user.id, DENSITY, "compact")
83- .await
84- .unwrap();
85 store.set_user_pref(&user.id, SOUND, "on").await.unwrap();78 store.set_user_pref(&user.id, SOUND, "on").await.unwrap();
86- store
87- .set_user_pref(&user.id, DENSITY, "comfortable")
88- .await
89- .unwrap();
90 79
91 let prefs = store.user_prefs(&user.id).await.unwrap();80 let prefs = store.user_prefs(&user.id).await.unwrap();
92- assert_eq!(prefs.get(DENSITY).map(String::as_str), Some("comfortable"));
93 assert_eq!(prefs.get(SOUND).map(String::as_str), Some("on"));81 assert_eq!(prefs.get(SOUND).map(String::as_str), Some("on"));
94 }82 }
95 }83 }
crates/forge-git/src/browse.rsmodified+37 -7
@@ -3,6 +3,7 @@
3 //! Everything here is blocking; callers run it inside `spawn_blocking`. Repositories are opened3 //! Everything here is blocking; callers run it inside `spawn_blocking`. Repositories are opened
4 //! isolated: the environment and user/system git configuration are ignored.4 //! isolated: the environment and user/system git configuration are ignored.
5 5
6+use std::collections::HashSet;
6 use std::path::Path;7 use std::path::Path;
7 8
8 use gix::bstr::ByteSlice;9 use gix::bstr::ByteSlice;
@@ -226,26 +227,31 @@ fn resolve_hex(repo: &gix::Repository, hex: &str) -> Result<Option<String>> {
226 /// The refs whose history is public. A commit no ref here reaches was overwritten or deleted.227 /// The refs whose history is public. A commit no ref here reaches was overwritten or deleted.
227 const VISIBLE_REFS: [&str; 3] = ["refs/heads/", "refs/tags/", "refs/pull/"];228 const VISIBLE_REFS: [&str; 3] = ["refs/heads/", "refs/tags/", "refs/pull/"];
228 229
229-/// True when a branch, tag or pull request reaches `id`. Other commits stay on disk until230+/// The commits at the tips of [`VISIBLE_REFS`]. A ref that does not peel to a commit reaches nothing.
230-/// `maintenance::prune_unreachable` runs, and must not be served by hash until then.231+fn visible_tips(repo: &gix::Repository) -> Result<Vec<gix::ObjectId>> {
231-fn reachable(repo: &gix::Repository, id: gix::ObjectId) -> Result<bool> {
232 let refs = repo.references().map_err(gerr)?;232 let refs = repo.references().map_err(gerr)?;
233 let mut tips = Vec::new();233 let mut tips = Vec::new();
234 for prefix in VISIBLE_REFS {234 for prefix in VISIBLE_REFS {
235 for reference in refs.prefixed(prefix).map_err(gerr)? {235 for reference in refs.prefixed(prefix).map_err(gerr)? {
236 let mut reference = reference.map_err(gerr)?;236 let mut reference = reference.map_err(gerr)?;
237- // A ref that does not peel to a commit reaches nothing.
238 if let Ok(tip) = reference.peel_to_id() {237 if let Ok(tip) = reference.peel_to_id() {
239 let tip = tip.detach();238 let tip = tip.detach();
240- if tip == id {
241- return Ok(true);
242- }
243 if is_commit(repo, tip)? {239 if is_commit(repo, tip)? {
244 tips.push(tip);240 tips.push(tip);
245 }241 }
246 }242 }
247 }243 }
248 }244 }
245+ Ok(tips)
246+}
247+
248+/// True when a branch, tag or pull request reaches `id`. Other commits stay on disk until
249+/// `maintenance::prune_unreachable` runs, and must not be served by hash until then.
250+fn reachable(repo: &gix::Repository, id: gix::ObjectId) -> Result<bool> {
251+ let tips = visible_tips(repo)?;
252+ if tips.contains(&id) {
253+ return Ok(true);
254+ }
249 if tips.is_empty() {255 if tips.is_empty() {
250 return Ok(false);256 return Ok(false);
251 }257 }
@@ -257,6 +263,30 @@ fn reachable(repo: &gix::Repository, id: gix::ObjectId) -> Result<bool> {
257 Ok(false)263 Ok(false)
258 }264 }
259 265
266+/// Those of the full commit ids `oids` that a branch, tag or pull request reaches, in one walk.
267+/// Malformed ids are left out. For deciding which stored hashes on a page may still link.
268+pub fn reachable_commits(repo: &Path, oids: &[String]) -> Result<HashSet<String>> {
269+ let mut wanted: HashSet<gix::ObjectId> =
270+ oids.iter().filter_map(|oid| parse_oid(oid).ok()).collect();
271+ let repo = open(repo)?;
272+ let mut found = HashSet::new();
273+ wanted.retain(|id| matches!(repo.try_find_header(*id), Ok(Some(_))));
274+ let tips = visible_tips(&repo)?;
275+ if wanted.is_empty() || tips.is_empty() {
276+ return Ok(found);
277+ }
278+ for info in repo.rev_walk(tips).all().map_err(gerr)? {
279+ let id = info.map_err(gerr)?.id;
280+ if wanted.remove(&id) {
281+ found.insert(id.to_hex().to_string());
282+ if wanted.is_empty() {
283+ break;
284+ }
285+ }
286+ }
287+ Ok(found)
288+}
289+
260 /// True when `oid` is a full commit id that a branch, tag or pull request reaches.290 /// True when `oid` is a full commit id that a branch, tag or pull request reaches.
261 pub fn commit_reachable(repo: &Path, oid: &str) -> Result<bool> {291 pub fn commit_reachable(repo: &Path, oid: &str) -> Result<bool> {
262 let repo = open(repo)?;292 let repo = open(repo)?;
crates/forge-git/src/maintenance.rsmodified+15 -0
@@ -16,6 +16,9 @@ const PRUNE_TIMEOUT: Duration = Duration::from_secs(30 * 60);
16 const PRUNE_MARK: &str = "forge-prune-due";16 const PRUNE_MARK: &str = "forge-prune-due";
17 /// Touched after each prune.17 /// Touched after each prune.
18 const PRUNE_STAMP: &str = "forge-pruned";18 const PRUNE_STAMP: &str = "forge-pruned";
19+/// Written after a prune removed objects. The standby still holds them, so its next replication
20+/// prunes its copy and clears this mark.
21+const STANDBY_PRUNE_MARK: &str = "forge-standby-prune-due";
19 /// A push's objects are unreachable for a moment before its ref lands, so only objects at least22 /// A push's objects are unreachable for a moment before its ref lands, so only objects at least
20 /// this old are removed. The mark waits this long too, so everything it stands for qualifies.23 /// this old are removed. The mark waits this long too, so everything it stands for qualifies.
21 const PRUNE_GRACE: Duration = Duration::from_secs(15 * 60);24 const PRUNE_GRACE: Duration = Duration::from_secs(15 * 60);
@@ -79,6 +82,7 @@ pub async fn prune_unreachable(env: &GitEnv, repo: &Path, prune: &'static str) -
79 }82 }
80 }83 }
81 fs::write(repo.join(PRUNE_STAMP), b"")?;84 fs::write(repo.join(PRUNE_STAMP), b"")?;
85+ fs::write(repo.join(STANDBY_PRUNE_MARK), b"")?;
82 // A mark written during the prune stays for the next pass.86 // A mark written during the prune stays for the next pass.
83 if let Ok(marked) = marked87 if let Ok(marked) = marked
84 && fs::metadata(repo.join(PRUNE_MARK))88 && fs::metadata(repo.join(PRUNE_MARK))
@@ -91,6 +95,17 @@ pub async fn prune_unreachable(env: &GitEnv, repo: &Path, prune: &'static str) -
91 Ok(())95 Ok(())
92 }96 }
93 97
98+/// True when a prune removed objects that the standby copy of `repo` still holds.
99+pub fn standby_prune_due(repo: &Path) -> bool {
100+ repo.join(STANDBY_PRUNE_MARK).is_file()
101+}
102+
103+/// Clears the standby mark once the standby has been pruned. Best effort: a mark left behind only
104+/// causes one more harmless prune.
105+pub fn clear_standby_prune(repo: &Path) {
106+ let _ = fs::remove_file(repo.join(STANDBY_PRUNE_MARK));
107+}
108+
94 /// Runs `cmd` with [`STEP_TIMEOUT`]. Dropping the future on timeout drops the child,109 /// Runs `cmd` with [`STEP_TIMEOUT`]. Dropping the future on timeout drops the child,
95 /// which `GitCommand` spawns with `kill_on_drop`, so the process is killed.110 /// which `GitCommand` spawns with `kill_on_drop`, so the process is killed.
96 async fn run_bounded(cmd: GitCommand) -> Result<()> {111 async fn run_bounded(cmd: GitCommand) -> Result<()> {
crates/forge-web/assets/nav.jsmodified+62 -24
@@ -2511,28 +2511,59 @@
2511 var finishedKeys = null; // the runs the newest answer listed; null until the first one2511 var finishedKeys = null; // the runs the newest answer listed; null until the first one
2512 var toneCtx = null; // the AudioContext, made on first use2512 var toneCtx = null; // the AudioContext, made on first use
2513 2513
2514- // The two notes of an outcome: rising C5 then G5 for a pass, falling for a failure. Each note is a2514+ // The two outcomes differ in everything an ear uses, so neither is a guess. A pass is high, clean
2515- // short sine with a quick fade in and out, so nothing clicks.2515+ // and quick: a rising C major chime that rings out. A failure is low, rough and heavy: two falling
2516+ // buzzes, each a pair of notes a semitone apart that beat against each other.
2517+ var TONES = {
2518+ passed: {
2519+ wave: 'triangle', peak: 0.16, cutoff: 8000,
2520+ notes: [
2521+ { at: 0, hz: [523.25], len: 0.16 },
2522+ { at: 0.09, hz: [659.25], len: 0.16 },
2523+ { at: 0.18, hz: [783.99, 1046.5], len: 0.5 }
2524+ ]
2525+ },
2526+ failed: {
2527+ wave: 'sawtooth', peak: 0.2, cutoff: 900,
2528+ notes: [
2529+ { at: 0, hz: [196, 207.65], len: 0.24 },
2530+ { at: 0.26, hz: [146.83, 155.56], len: 0.46 }
2531+ ]
2532+ }
2533+ };
2534+
2535+ // Schedules an outcome's notes on `ctx`, fading each in and out so nothing clicks.
2536+ function scheduleTones(ctx, outcome) {
2537+ var tone = TONES[outcome] || TONES.failed;
2538+ var filter = ctx.createBiquadFilter();
2539+ filter.type = 'lowpass';
2540+ filter.frequency.value = tone.cutoff;
2541+ filter.connect(ctx.destination);
2542+ var start = ctx.currentTime + 0.02;
2543+ tone.notes.forEach(function (note) {
2544+ var at = start + note.at;
2545+ var gain = ctx.createGain();
2546+ gain.gain.setValueAtTime(0.0001, at);
2547+ gain.gain.exponentialRampToValueAtTime(tone.peak, at + 0.012);
2548+ gain.gain.exponentialRampToValueAtTime(0.0001, at + note.len);
2549+ gain.connect(filter);
2550+ note.hz.forEach(function (hz) {
2551+ var osc = ctx.createOscillator();
2552+ osc.type = tone.wave;
2553+ osc.frequency.value = hz;
2554+ osc.connect(gain);
2555+ osc.start(at);
2556+ osc.stop(at + note.len + 0.02);
2557+ });
2558+ });
2559+ }
2560+
2516 function playTones(outcome) {2561 function playTones(outcome) {
2517 var AC = window.AudioContext || window.webkitAudioContext;2562 var AC = window.AudioContext || window.webkitAudioContext;
2518 if (!AC) { return; }2563 if (!AC) { return; }
2519 try { toneCtx = toneCtx || new AC(); } catch (err) { return; }2564 try { toneCtx = toneCtx || new AC(); } catch (err) { return; }
2520 if (toneCtx.state === 'suspended') { toneCtx.resume().catch(function () { }); }2565 if (toneCtx.state === 'suspended') { toneCtx.resume().catch(function () { }); }
2521- var freqs = outcome === 'passed' ? [523.25, 783.99] : [783.99, 523.25];2566+ scheduleTones(toneCtx, outcome);
2522- var start = toneCtx.currentTime + 0.02;
2523- freqs.forEach(function (hz, i) {
2524- var at = start + i * 0.14;
2525- var osc = toneCtx.createOscillator(), gain = toneCtx.createGain();
2526- osc.type = 'sine';
2527- osc.frequency.value = hz;
2528- gain.gain.setValueAtTime(0.0001, at);
2529- gain.gain.exponentialRampToValueAtTime(0.15, at + 0.02);
2530- gain.gain.exponentialRampToValueAtTime(0.0001, at + 0.16);
2531- osc.connect(gain);
2532- gain.connect(toneCtx.destination);
2533- osc.start(at);
2534- osc.stop(at + 0.18);
2535- });
2536 }2567 }
2537 2568
2538 // One tab plays for a run. Each tab writes its id under the run's key when the key is free, waits2569 // One tab plays for a run. Each tab writes its id under the run's key when the key is free, waits
@@ -2585,12 +2616,6 @@
2585 if (b) { playTones(b.getAttribute('data-sound-play')); }2616 if (b) { playTones(b.getAttribute('data-sound-play')); }
2586 });2617 });
2587 2618
2588- // Signed-out visitors keep their density in localStorage. Signed in, the shell has set
2589- // `data-density` on <html> already, so nothing is read here.
2590- if (!signedIn && !root.hasAttribute('data-density')) {
2591- try { if (localStorage.getItem('forge-density') === 'compact') { root.setAttribute('data-density', 'compact'); } } catch (err) { }
2592- }
2593-
2594 // The CI log (a job page's [data-live-log]). The server sends the raw text; this turns it into2619 // The CI log (a job page's [data-live-log]). The server sends the raw text; this turns it into
2595 // numbered lines (#L12 anchors) with ANSI colours as spans, `::group::name` / `::endgroup::`2620 // numbered lines (#L12 anchors) with ANSI colours as spans, `::group::name` / `::endgroup::`
2596 // sections as <details>, and a search box with highlight and next/previous. Streamed bytes go2621 // sections as <details>, and a search box with highlight and next/previous. Streamed bytes go
@@ -3566,7 +3591,7 @@
3566 // Hover prefetch: a link the pointer rests on for a moment starts its page request early, so the3591 // Hover prefetch: a link the pointer rests on for a moment starts its page request early, so the
3567 // click that often follows finds the answer already on its way. Only what the click handler would3592 // click that often follows finds the answer already on its way. Only what the click handler would
3568 // soft-navigate is fetched, and never a path that writes when viewed or serves a file.3593 // soft-navigate is fetched, and never a path that writes when viewed or serves a file.
3569- var PREFETCH_DELAY = 80; // ms the pointer must rest on a link before its request starts3594+ var PREFETCH_DELAY = 30; // ms the pointer must rest on a link before its request starts
3570 var PREFETCH_TTL = 10000; // ms a finished or running prefetch is still used by a click3595 var PREFETCH_TTL = 10000; // ms a finished or running prefetch is still used by a click
3571 var PREFETCH_MAX = 4; // stored prefetches; the oldest is dropped first3596 var PREFETCH_MAX = 4; // stored prefetches; the oldest is dropped first
3572 var NO_PREFETCH = /\/-\/|\/(live|events|stream|open|download)$|\/(archive|raw|actions|attachments|artifacts)\/|\.zip$|\.tar\.gz$|\/releases\/download\/|^\/(logout|notifications)(\/|$)/;3597 var NO_PREFETCH = /\/-\/|\/(live|events|stream|open|download)$|\/(archive|raw|actions|attachments|artifacts)\/|\.zip$|\.tar\.gz$|\/releases\/download\/|^\/(logout|notifications)(\/|$)/;
@@ -3633,6 +3658,19 @@
3633 }, PREFETCH_DELAY);3658 }, PREFETCH_DELAY);
3634 }, true);3659 }, true);
3635 3660
3661+ // A press means the click is coming: the request leaves now, not when the button comes back up.
3662+ document.addEventListener('pointerdown', function (e) {
3663+ var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
3664+ var url = a && e.button === 0 ? prefetchUrl(a) : null;
3665+ if (!url || !prefetchAllowed()) { return; }
3666+ for (var i = 0; i < prefetches.length; i++) {
3667+ if (prefetches[i].key === url.href) { return; }
3668+ }
3669+ clearTimeout(prefetchTimer);
3670+ prefetchTimer = null;
3671+ startPrefetch(url);
3672+ }, true);
3673+
3636 // Leaving the link (not moving between its children) cancels a prefetch that has not started yet.3674 // Leaving the link (not moving between its children) cancels a prefetch that has not started yet.
3637 document.addEventListener('mouseout', function (e) {3675 document.addEventListener('mouseout', function (e) {
3638 var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;3676 var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
crates/forge-web/src/i18n/misc.rsmodified+7 -31
@@ -42,12 +42,7 @@ pub enum K {
42 SidebarLeft,42 SidebarLeft,
43 SidebarRight,43 SidebarRight,
44 ChooseSidebar,44 ChooseSidebar,
45- // Appearance: row density, and the run-finished tone.45+ // Appearance: the run-finished tone.
46- DensityLabel,
47- DensityComfortable,
48- DensityCompact,
49- DensityHelp,
50- ChooseDensity,
51 SoundLabel,46 SoundLabel,
52 SoundSwitch,47 SoundSwitch,
53 SoundOwnRuns,48 SoundOwnRuns,
@@ -57,7 +52,6 @@ pub enum K {
57 SoundFailedNote,52 SoundFailedNote,
58 SoundPlay,53 SoundPlay,
59 SoundFootOwn,54 SoundFootOwn,
60- SoundFootTones,
61 ChooseSound,55 ChooseSound,
62 // Notifications: row kinds.56 // Notifications: row kinds.
63 KindOpenIssue,57 KindOpenIssue,
@@ -228,11 +222,6 @@ const ALL: &[K] = &[
228 K::SidebarLeft,222 K::SidebarLeft,
229 K::SidebarRight,223 K::SidebarRight,
230 K::ChooseSidebar,224 K::ChooseSidebar,
231- K::DensityLabel,
232- K::DensityComfortable,
233- K::DensityCompact,
234- K::DensityHelp,
235- K::ChooseDensity,
236 K::SoundLabel,225 K::SoundLabel,
237 K::SoundSwitch,226 K::SoundSwitch,
238 K::SoundOwnRuns,227 K::SoundOwnRuns,
@@ -242,7 +231,6 @@ const ALL: &[K] = &[
242 K::SoundFailedNote,231 K::SoundFailedNote,
243 K::SoundPlay,232 K::SoundPlay,
244 K::SoundFootOwn,233 K::SoundFootOwn,
245- K::SoundFootTones,
246 K::ChooseSound,234 K::ChooseSound,
247 K::KindOpenIssue,235 K::KindOpenIssue,
248 K::KindClosedIssue,236 K::KindClosedIssue,
@@ -424,24 +412,14 @@ pub fn t(lang: Lang, key: K) -> &'static str {
424 (BackgroundLabel, Tr) => "Arka plan",412 (BackgroundLabel, Tr) => "Arka plan",
425 (ChooseBase, En) => "Choose a background from the list.",413 (ChooseBase, En) => "Choose a background from the list.",
426 (ChooseBase, Tr) => "Listeden bir arka plan seçin.",414 (ChooseBase, Tr) => "Listeden bir arka plan seçin.",
427- (SidebarLabel, En) => "Sidebar position",415+ (SidebarLabel, En) => "Settings menu side",
428- (SidebarLabel, Tr) => "Kenar çubuğu konumu",416+ (SidebarLabel, Tr) => "Ayarlar menüsünün yanı",
429 (SidebarLeft, En) => "Left",417 (SidebarLeft, En) => "Left",
430 (SidebarLeft, Tr) => "Sol",418 (SidebarLeft, Tr) => "Sol",
431 (SidebarRight, En) => "Right",419 (SidebarRight, En) => "Right",
432 (SidebarRight, Tr) => "Sağ",420 (SidebarRight, Tr) => "Sağ",
433 (ChooseSidebar, En) => "Choose a sidebar position from the list.",421 (ChooseSidebar, En) => "Choose a sidebar position from the list.",
434 (ChooseSidebar, Tr) => "Listeden bir kenar çubuğu konumu seçin.",422 (ChooseSidebar, Tr) => "Listeden bir kenar çubuğu konumu seçin.",
435- (DensityLabel, En) => "Density",
436- (DensityLabel, Tr) => "Yoğunluk",
437- (DensityComfortable, En) => "Comfortable",
438- (DensityComfortable, Tr) => "Rahat",
439- (DensityCompact, En) => "Compact",
440- (DensityCompact, Tr) => "Sıkı",
441- (DensityHelp, En) => "Saved to your account. Compact shows more rows on a screen.",
442- (DensityHelp, Tr) => "Hesabınıza kaydedilir. Sıkı görünüm ekranda daha çok satır gösterir.",
443- (ChooseDensity, En) => "Choose Comfortable or Compact.",
444- (ChooseDensity, Tr) => "Rahat ya da Sıkı seçin.",
445 (SoundLabel, En) => "Sound",423 (SoundLabel, En) => "Sound",
446 (SoundLabel, Tr) => "Ses",424 (SoundLabel, Tr) => "Ses",
447 (SoundSwitch, En) => "Play a tone when my run finishes",425 (SoundSwitch, En) => "Play a tone when my run finishes",
@@ -450,18 +428,16 @@ pub fn t(lang: Lang, key: K) -> &'static str {
450 (SoundOwnRuns, Tr) => "Yalnızca kendi çalıştırmalarınız",428 (SoundOwnRuns, Tr) => "Yalnızca kendi çalıştırmalarınız",
451 (SoundPassed, En) => "Run passed",429 (SoundPassed, En) => "Run passed",
452 (SoundPassed, Tr) => "Çalıştırma başarılı",430 (SoundPassed, Tr) => "Çalıştırma başarılı",
453- (SoundPassedNote, En) => "two rising notes",431+ (SoundPassedNote, En) => "a bright rising chime",
454- (SoundPassedNote, Tr) => "yükselen iki nota",432+ (SoundPassedNote, Tr) => "parlak, yükselen bir çan",
455 (SoundFailed, En) => "Run failed",433 (SoundFailed, En) => "Run failed",
456 (SoundFailed, Tr) => "Çalıştırma başarısız",434 (SoundFailed, Tr) => "Çalıştırma başarısız",
457- (SoundFailedNote, En) => "two falling notes",435+ (SoundFailedNote, En) => "a low, rough double buzz",
458- (SoundFailedNote, Tr) => "alçalan iki nota",436+ (SoundFailedNote, Tr) => "pes ve sert, çift vızıltı",
459 (SoundPlay, En) => "Play",437 (SoundPlay, En) => "Play",
460 (SoundPlay, Tr) => "Çal",438 (SoundPlay, Tr) => "Çal",
461 (SoundFootOwn, En) => "Never for a page you are looking at.",439 (SoundFootOwn, En) => "Never for a page you are looking at.",
462 (SoundFootOwn, Tr) => "Baktığınız sayfa için asla çalmaz.",440 (SoundFootOwn, Tr) => "Baktığınız sayfa için asla çalmaz.",
463- (SoundFootTones, En) => "Tones are made in the browser, with no audio files.",
464- (SoundFootTones, Tr) => "Sesler tarayıcıda üretilir, ses dosyası yoktur.",
465 (ChooseSound, En) => "Choose on or off.",441 (ChooseSound, En) => "Choose on or off.",
466 (ChooseSound, Tr) => "Açık ya da kapalı seçin.",442 (ChooseSound, Tr) => "Açık ya da kapalı seçin.",
467 (KindOpenIssue, En) => "Open issue",443 (KindOpenIssue, En) => "Open issue",
crates/forge-web/src/i18n/mod.rsmodified+2 -2
@@ -1054,7 +1054,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
1054 (MailReasonComment, En) => "you commented on it",1054 (MailReasonComment, En) => "you commented on it",
1055 (MailReasonSubscribed, En) => "you are subscribed to it",1055 (MailReasonSubscribed, En) => "you are subscribed to it",
1056 (MailReasonWatching, En) => "you watch this repository",1056 (MailReasonWatching, En) => "you watch this repository",
1057- (MenuNotificationEmails, En) => "Notification emails",1057+ (MenuNotificationEmails, En) => "Notifications",
1058 (EmailNotifyLabel, En) => "Email me about notifications",1058 (EmailNotifyLabel, En) => "Email me about notifications",
1059 (EmailNotifyHelp, En) => {1059 (EmailNotifyHelp, En) => {
1060 "Each notification is sent to your verified address. Notifications on the site are not affected."1060 "Each notification is sent to your verified address. Notifications on the site are not affected."
@@ -1083,7 +1083,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
1083 (MailReasonComment, Tr) => "bunda yorum yaptınız",1083 (MailReasonComment, Tr) => "bunda yorum yaptınız",
1084 (MailReasonSubscribed, Tr) => "bunu takip ediyorsunuz",1084 (MailReasonSubscribed, Tr) => "bunu takip ediyorsunuz",
1085 (MailReasonWatching, Tr) => "bu depoyu izliyorsunuz",1085 (MailReasonWatching, Tr) => "bu depoyu izliyorsunuz",
1086- (MenuNotificationEmails, Tr) => "Bildirim e-postaları",1086+ (MenuNotificationEmails, Tr) => "Bildirimler",
1087 (EmailNotifyLabel, Tr) => "Bildirimler hakkında bana e-posta gönder",1087 (EmailNotifyLabel, Tr) => "Bildirimler hakkında bana e-posta gönder",
1088 (EmailNotifyHelp, Tr) => {1088 (EmailNotifyHelp, Tr) => {
1089 "Her bildirim doğrulanmış adresinize gönderilir. Sitedeki bildirimler bundan etkilenmez."1089 "Her bildirim doğrulanmış adresinize gönderilir. Sitedeki bildirimler bundan etkilenmez."
crates/forge-web/src/i18n/releases_ci.rsmodified+10 -0
@@ -38,6 +38,8 @@ pub enum K {
38 CiNoticeNoFailed,38 CiNoticeNoFailed,
39 CiNoticeNotDone,39 CiNoticeNotDone,
40 CiNoticeTooBig,40 CiNoticeTooBig,
41+ CiNoticeOverwritten,
42+ CiCommitOverwritten,
41 LogSearch,43 LogSearch,
42 LogPrev,44 LogPrev,
43 LogNext,45 LogNext,
@@ -232,6 +234,12 @@ pub fn t(lang: Lang, key: K) -> &'static str {
232 (CiNoticeTooBig, Tr) => {234 (CiNoticeTooBig, Tr) => {
233 "Yapıtlar tek dosya olarak indirilemeyecek kadar büyük. Tek tek indirin."235 "Yapıtlar tek dosya olarak indirilemeyecek kadar büyük. Tek tek indirin."
234 }236 }
237+ (CiNoticeOverwritten, En) => "This commit was overwritten, so it can't be re-run.",
238+ (CiNoticeOverwritten, Tr) => {
239+ "Bu commit'in üzerine yazıldı, bu yüzden yeniden çalıştırılamaz."
240+ }
241+ (CiCommitOverwritten, En) => "This commit was overwritten by a force push.",
242+ (CiCommitOverwritten, Tr) => "Bu commit'in üzerine yazıldı.",
235 (LogSearch, En) => "Search the log",243 (LogSearch, En) => "Search the log",
236 (LogSearch, Tr) => "Günlükte ara",244 (LogSearch, Tr) => "Günlükte ara",
237 (LogPrev, En) => "Previous match",245 (LogPrev, En) => "Previous match",
@@ -624,6 +632,8 @@ mod tests {
624 K::CiNoticeNoFailed,632 K::CiNoticeNoFailed,
625 K::CiNoticeNotDone,633 K::CiNoticeNotDone,
626 K::CiNoticeTooBig,634 K::CiNoticeTooBig,
635+ K::CiNoticeOverwritten,
636+ K::CiCommitOverwritten,
627 K::LogSearch,637 K::LogSearch,
628 K::LogPrev,638 K::LogPrev,
629 K::LogNext,639 K::LogNext,
crates/forge-web/src/i18n/repo_admin.rsmodified+2 -2
@@ -339,8 +339,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
339 }339 }
340 (NewRule, Tr) => "Yeni kural",340 (NewRule, Tr) => "Yeni kural",
341 (NoBranchesYet, Tr) => "Henüz dal yok. Varsayılan dal, ilk gönderimden sonra seçilebilir.",341 (NoBranchesYet, Tr) => "Henüz dal yok. Varsayılan dal, ilk gönderimden sonra seçilebilir.",
342- (NoCollaborators, En) => "No collaborators yet. Add one below.",342+ (NoCollaborators, En) => "No collaborators yet.",
343- (NoCollaborators, Tr) => "Henüz ortak çalışan yok. Aşağıdan bir ortak çalışan ekleyin.",343+ (NoCollaborators, Tr) => "Henüz ortak çalışan yok.",
344 (NoPendingTransfer, En) => "No transfer is pending for this repository.",344 (NoPendingTransfer, En) => "No transfer is pending for this repository.",
345 (NoPendingTransfer, Tr) => "Bu depo için bekleyen bir devir yok.",345 (NoPendingTransfer, Tr) => "Bu depo için bekleyen bir devir yok.",
346 (NoSecrets, En) => "No secrets yet.",346 (NoSecrets, En) => "No secrets yet.",
crates/forge-web/src/pages/ci_job.rsmodified+15 -6
@@ -35,8 +35,8 @@ use crate::i18n::{
35 releases_ci::{self as g, K},35 releases_ci::{self as g, K},
36 };36 };
37 use crate::pages::ci_runs::{37 use crate::pages::ci_runs::{
38- age_text, can_write, changed_event, dock_bars, duration_text, events_response, job_href,38+ age_text, can_write, changed_event, commit_reachable_for, dock_bars, duration_text,
39- run_href, state_text, strip_ansi,39+ events_response, job_href, run_href, state_text, strip_ansi,
40 };40 };
41 use crate::pages::repo::repo_head;41 use crate::pages::repo::repo_head;
42 use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo, still_readable};42 use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo, still_readable};
@@ -145,6 +145,11 @@ async fn newlines_before(path: &Path, end: u64) -> Result<u64> {
145 145
146 /// The last `TAIL_BYTES` of a log, from a line boundary. A log that does not exist yet is empty.146 /// The last `TAIL_BYTES` of a log, from a line boundary. A log that does not exist yet is empty.
147 pub(crate) async fn log_tail(path: &Path) -> Result<Tail> {147 pub(crate) async fn log_tail(path: &Path) -> Result<Tail> {
148+ log_tail_of(path, TAIL_BYTES).await
149+}
150+
151+/// The last `max` bytes of a log, from a line boundary.
152+pub(crate) async fn log_tail_of(path: &Path, max: u64) -> Result<Tail> {
148 let mut file = match tokio::fs::File::open(path).await {153 let mut file = match tokio::fs::File::open(path).await {
149 Ok(file) => file,154 Ok(file) => file,
150 Err(e) if e.kind() == std::io::ErrorKind::NotFound => {155 Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
@@ -158,17 +163,17 @@ pub(crate) async fn log_tail(path: &Path) -> Result<Tail> {
158 Err(e) => return Err(forge_core::Error::Io(e).into()),163 Err(e) => return Err(forge_core::Error::Io(e).into()),
159 };164 };
160 let len = file.metadata().await.map_err(forge_core::Error::Io)?.len();165 let len = file.metadata().await.map_err(forge_core::Error::Io)?.len();
161- let truncated = len > TAIL_BYTES;166+ let truncated = len > max;
162 let mut start = 0;167 let mut start = 0;
163 if truncated {168 if truncated {
164- start = len - TAIL_BYTES;169+ start = len - max;
165 file.seek(SeekFrom::Start(start))170 file.seek(SeekFrom::Start(start))
166 .await171 .await
167 .map_err(forge_core::Error::Io)?;172 .map_err(forge_core::Error::Io)?;
168 }173 }
169 let mut buf = Vec::new();174 let mut buf = Vec::new();
170 (&mut file)175 (&mut file)
171- .take(TAIL_BYTES)176+ .take(max)
172 .read_to_end(&mut buf)177 .read_to_end(&mut buf)
173 .await178 .await
174 .map_err(forge_core::Error::Io)?;179 .map_err(forge_core::Error::Io)?;
@@ -515,6 +520,10 @@ async fn job_page(cx: &Cx) -> Result<impl View> {
515 };520 };
516 let title = title_of(&ctx);521 let title = title_of(&ctx);
517 let live = format!("{}/events", job_href(&title, &job.id));522 let live = format!("{}/events", job_href(&title, &job.id));
523+ // A job of a run whose commit was overwritten cannot be run again. The walk runs only for a writer.
524+ let reachable = can_write(&ctx)
525+ && job.state.is_terminal()
526+ && commit_reachable_for(&ctx.path, &run.commit_oid).await?;
518 let view = JobView {527 let view = JobView {
519 name: job.name.clone(),528 name: job.name.clone(),
520 fingerprint,529 fingerprint,
@@ -543,7 +552,7 @@ async fn job_page(cx: &Cx) -> Result<impl View> {
543 run_href: run_href(&title, run.number),552 run_href: run_href(&title, run.number),
544 run_number: run.number,553 run_number: run.number,
545 log_href: format!("{}/log.txt", job_href(&title, &job.id)),554 log_href: format!("{}/log.txt", job_href(&title, &job.id)),
546- rerun: if job.state.is_terminal() && can_write(&ctx) {555+ rerun: if reachable {
547 ctx.viewer.as_ref().map(|(_, session)| {556 ctx.viewer.as_ref().map(|(_, session)| {
548 (557 (
549 format!("{}/rerun", job_href(&title, &job.id)),558 format!("{}/rerun", job_href(&title, &job.id)),
crates/forge-web/src/pages/ci_runs.rsmodified+69 -17
@@ -8,14 +8,14 @@
8 //! `/{owner}/{repo}/ci/events`, which fires on every run created or changed in the repo, and a run or job8 //! `/{owner}/{repo}/ci/events`, which fires on every run created or changed in the repo, and a run or job
9 //! page opens its own `changed` stream (`.../events`) when it is not finished.9 //! page opens its own `changed` stream (`.../events`) when it is not finished.
10 10
11-use std::collections::HashMap;11+use std::collections::{HashMap, HashSet};
12 use std::future::Future;12 use std::future::Future;
13 use std::path::Path;13 use std::path::Path;
14 use std::time::Duration;14 use std::time::Duration;
15 15
16 use forge_core::ci::{CiJob, CiRun, JobSample, JobState, RunState};16 use forge_core::ci::{CiJob, CiRun, JobSample, JobState, RunState};
17 use forge_core::{Action, Denied, Store, User, authorize};17 use forge_core::{Action, Denied, Store, User, authorize};
18-use forge_git::browse::{RefInfo, RefKind, read_commit};18+use forge_git::browse::{RefInfo, RefKind, commit_reachable, reachable_commits, read_commit};
19 use futures_util::{Stream, StreamExt, stream};19 use futures_util::{Stream, StreamExt, stream};
20 use serde::Deserialize;20 use serde::Deserialize;
21 use time::OffsetDateTime;21 use time::OffsetDateTime;
@@ -41,7 +41,7 @@ use crate::i18n::{
41 };41 };
42 use crate::pages::ci_estimate::{self, Est, Step};42 use crate::pages::ci_estimate::{self, Est, Step};
43 use crate::pages::ci_fail::{self, FailFirst, fail_first_block};43 use crate::pages::ci_fail::{self, FailFirst, fail_first_block};
44-use crate::pages::ci_job::{Tail, log_tail};44+use crate::pages::ci_job::{Tail, log_tail_of};
45 use crate::pages::refs::load_refs;45 use crate::pages::refs::load_refs;
46 use crate::pages::repo::repo_head;46 use crate::pages::repo::repo_head;
47 use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo, still_readable};47 use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo, still_readable};
@@ -64,7 +64,8 @@ const PER_PAGE: u32 = 25;
64 const MAX_PAGE: u32 = 1000;64 const MAX_PAGE: u32 = 1000;
65 65
66 /// Notice words (the only text a `?notice=` query can show), their text and whether they are errors.66 /// Notice words (the only text a `?notice=` query can show), their text and whether they are errors.
67-const NOTICES: [(&str, K, bool); 11] = [67+const NOTICES: [(&str, K, bool); 12] = [
68+ ("overwritten", K::CiNoticeOverwritten, true),
68 ("started", K::CiNoticeStarted, false),69 ("started", K::CiNoticeStarted, false),
69 ("cancelled", K::CiNoticeCancelled, false),70 ("cancelled", K::CiNoticeCancelled, false),
70 ("approved", K::CiNoticeApproved, false),71 ("approved", K::CiNoticeApproved, false),
@@ -437,7 +438,10 @@ struct RunDetail {
437 state_class: String,438 state_class: String,
438 trigger: String,439 trigger: String,
439 branch: String,440 branch: String,
440- commit_href: String,441+ /// The commit's page. None when a force push overwrote the commit.
442+ commit_href: Option<String>,
443+ /// Whether a branch, tag or pull request still reaches the commit. Re-run is offered only then.
444+ reachable: bool,
441 commit: String,445 commit: String,
442 actor: String,446 actor: String,
443 /// The run's creation as an age, and its stamp for the `<time>` that carries it.447 /// The run's creation as an age, and its stamp for the `<time>` that carries it.
@@ -701,6 +705,9 @@ const AXIS_STEPS: [i64; 14] = [
701 ];705 ];
702 /// How far back from the end of a log the run page reads for its last lines.706 /// How far back from the end of a log the run page reads for its last lines.
703 const LOG_TAIL_BYTES: u64 = 16 * 1024;707 const LOG_TAIL_BYTES: u64 = 16 * 1024;
708+/// How much of the selected job's log the run page carries: the page has to open at once. The job
709+/// page and the raw log hold the rest.
710+const RUN_LOG_BYTES: u64 = 24 * 1024;
704 /// Lines of a log an expanded job row shows.711 /// Lines of a log an expanded job row shows.
705 const LOG_LINES: usize = 20;712 const LOG_LINES: usize = 20;
706 713
@@ -1377,13 +1384,20 @@ async fn runs_split(cx: &Cx, number: Option<&str>, job: Option<&str>) -> Result<
1377 .map(|run| run.actor_id.as_str()),1384 .map(|run| run.actor_id.as_str()),
1378 )1385 )
1379 .await?;1386 .await?;
1380- // Commit subjects are the run titles. A commit that cannot be read leaves the trigger as the title.
1381- let path = ctx.path.clone();
1382 let oids: Vec<String> = runs1387 let oids: Vec<String> = runs
1383 .iter()1388 .iter()
1384 .chain(selected.iter())1389 .chain(selected.iter())
1385 .map(|run| run.commit_oid.clone())1390 .map(|run| run.commit_oid.clone())
1386 .collect();1391 .collect();
1392+ // The commits a branch, tag or pull request still reaches. The others were overwritten: their runs
1393+ // show no link and cannot be run again. One walk covers the page.
1394+ let reachable: HashSet<String> = {
1395+ let path = ctx.path.clone();
1396+ let oids = oids.clone();
1397+ tokio::task::spawn_blocking(move || reachable_commits(&path, &oids)).await??
1398+ };
1399+ // Commit subjects are the run titles. A commit that cannot be read leaves the trigger as the title.
1400+ let path = ctx.path.clone();
1387 let subjects: HashMap<String, String> = tokio::task::spawn_blocking(move || {1401 let subjects: HashMap<String, String> = tokio::task::spawn_blocking(move || {
1388 oids.into_iter()1402 oids.into_iter()
1389 .filter_map(|oid| {1403 .filter_map(|oid| {
@@ -1483,10 +1497,12 @@ async fn runs_split(cx: &Cx, number: Option<&str>, job: Option<&str>) -> Result<
1483 String::new()1497 String::new()
1484 },1498 },
1485 est,1499 est,
1486- // The same condition as the run page's Re-run button: a writer, and a finished run.1500+ // The same condition as the run page's Re-run button: a writer, a finished run and a
1501+ // commit that is still reachable.
1487 rerun: csrf1502 rerun: csrf
1488 .as_ref()1503 .as_ref()
1489 .filter(|_| run_finished(&run.state))1504 .filter(|_| run_finished(&run.state))
1505+ .filter(|_| reachable.contains(&run.commit_oid))
1490 .map(|token| {1506 .map(|token| {
1491 (1507 (
1492 format!("{}/rerun", run_href(&title, run.number)),1508 format!("{}/rerun", run_href(&title, run.number)),
@@ -1527,6 +1543,7 @@ async fn runs_split(cx: &Cx, number: Option<&str>, job: Option<&str>) -> Result<
1527 title: subject,1543 title: subject,
1528 actor,1544 actor,
1529 writer_csrf: csrf.clone(),1545 writer_csrf: csrf.clone(),
1546+ reachable: reachable.contains(&run.commit_oid),
1530 },1547 },
1531 &runners,1548 &runners,
1532 lang,1549 lang,
@@ -1580,6 +1597,15 @@ struct RunHeader {
1580 title: String,1597 title: String,
1581 actor: String,1598 actor: String,
1582 writer_csrf: Option<String>,1599 writer_csrf: Option<String>,
1600+ /// Whether a branch, tag or pull request still reaches the run's commit.
1601+ reachable: bool,
1602+}
1603+
1604+/// Whether a branch, tag or pull request still reaches `oid`. A force push that overwrote the commit
1605+/// leaves it unreachable: its run then has no commit link and cannot be run again.
1606+pub(crate) async fn commit_reachable_for(path: &Path, oid: &str) -> Result<bool> {
1607+ let (path, oid) = (path.to_path_buf(), oid.to_owned());
1608+ Ok(tokio::task::spawn_blocking(move || commit_reachable(&path, &oid)).await??)
1583 }1609 }
1584 1610
1585 /// Whether a job row starts with its tail open: a failed job does, and so does the only job of a run.1611 /// Whether a job row starts with its tail open: a failed job does, and so does the only job of a run.
@@ -1612,6 +1638,7 @@ async fn run_detail(
1612 let gantt =1638 let gantt =
1613 (!jobs.is_empty()).then(|| gantt(&jobs, origin_of(run, now), run_end(run, now), now, lang));1639 (!jobs.is_empty()).then(|| gantt(&jobs, origin_of(run, now), run_end(run, now), now, lang));
1614 let writer = header.writer_csrf.is_some();1640 let writer = header.writer_csrf.is_some();
1641+ let rerunnable = writer && header.reachable;
1615 let mut lines = Vec::with_capacity(jobs.len());1642 let mut lines = Vec::with_capacity(jobs.len());
1616 let mut artifacts = Vec::new();1643 let mut artifacts = Vec::new();
1617 for (index, job) in jobs.iter().enumerate() {1644 for (index, job) in jobs.iter().enumerate() {
@@ -1656,7 +1683,7 @@ async fn run_detail(
1656 name: variant.unwrap_or(job.name.as_str()).to_owned(),1683 name: variant.unwrap_or(job.name.as_str()).to_owned(),
1657 dot: format!("ci-dot ci-{}", job.state.as_str()),1684 dot: format!("ci-dot ci-{}", job.state.as_str()),
1658 detail: job.image.clone(),1685 detail: job.image.clone(),
1659- rerun: (writer && job.state.is_terminal())1686+ rerun: (rerunnable && job.state.is_terminal())
1660 .then(|| format!("{}/rerun", job_href(title, &job.id))),1687 .then(|| format!("{}/rerun", job_href(title, &job.id))),
1661 runner: job.runner.clone(),1688 runner: job.runner.clone(),
1662 duration: job.duration.clone(),1689 duration: job.duration.clone(),
@@ -1675,7 +1702,7 @@ async fn run_detail(
1675 truncated,1702 truncated,
1676 offset,1703 offset,
1677 first_line,1704 first_line,
1678- } = log_tail(&log_path(&state.config.data_dir, &job.id)).await?;1705+ } = log_tail_of(&log_path(&state.config.data_dir, &job.id), RUN_LOG_BYTES).await?;
1679 let href = job_href(title, &job.id);1706 let href = job_href(title, &job.id);
1680 Some(JobLog {1707 Some(JobLog {
1681 log_href: format!("{href}/log.txt"),1708 log_href: format!("{href}/log.txt"),
@@ -1695,7 +1722,7 @@ async fn run_detail(
1695 }1722 }
1696 None => None,1723 None => None,
1697 };1724 };
1698- let can_rerun_failed = writer1725+ let can_rerun_failed = rerunnable
1699 && run_finished(&run.state)1726 && run_finished(&run.state)
1700 && jobs.iter().any(|job| {1727 && jobs.iter().any(|job| {
1701 matches!(1728 matches!(
@@ -1722,7 +1749,10 @@ async fn run_detail(
1722 state_class: format!("ci-state ci-{}", run.state.as_str()),1749 state_class: format!("ci-state ci-{}", run.state.as_str()),
1723 trigger: trigger_text(lang, &run.trigger),1750 trigger: trigger_text(lang, &run.trigger),
1724 branch: short_ref(&run.git_ref).to_owned(),1751 branch: short_ref(&run.git_ref).to_owned(),
1725- commit_href: format!("/{title}/commit/{}", run.commit_oid),1752+ commit_href: header
1753+ .reachable
1754+ .then(|| format!("/{title}/commit/{}", run.commit_oid)),
1755+ reachable: header.reachable,
1726 commit: short_oid(&run.commit_oid).to_owned(),1756 commit: short_oid(&run.commit_oid).to_owned(),
1727 actor: header.actor,1757 actor: header.actor,
1728 when: age_text(lang, &run.created_at),1758 when: age_text(lang, &run.created_at),
@@ -1844,7 +1874,7 @@ async fn runs_body(
1844 }1874 }
1845 </select>1875 </select>
1846 </label>1876 </label>
1847- <button type="submit">(g::t(lang, K::RunWorkflow))</button>1877+ <button type="submit" class="primary">(g::t(lang, K::RunWorkflow))</button>
1848 </form>1878 </form>
1849 </div>1879 </div>
1850 </details>1880 </details>
@@ -2044,7 +2074,11 @@ async fn run_head(lang: Lang, run: &RunDetail, all_href: Option<String>) -> Resu
2044 <div class="ci-tl-meta">2074 <div class="ci-tl-meta">
2045 <span class=(run.state_class.as_str())>(run.state.as_str())</span>2075 <span class=(run.state_class.as_str())>(run.state.as_str())</span>
2046 <span class="muted">(run.trigger.as_str()) " \u{b7} " (run.branch.as_str())</span>2076 <span class="muted">(run.trigger.as_str()) " \u{b7} " (run.branch.as_str())</span>
2047- <a href=(run.commit_href.as_str())><code>(run.commit.as_str())</code></a>2077+ if let Some(href) = run.commit_href.as_ref() {
2078+ <a href=(href.as_str())><code>(run.commit.as_str())</code></a>
2079+ } else {
2080+ <code class="muted" title=(g::t(lang, K::CiCommitOverwritten))>(run.commit.as_str())</code>
2081+ }
2048 if !run.actor.is_empty() {2082 if !run.actor.is_empty() {
2049 <span class="muted">(run.actor.as_str())</span>2083 <span class="muted">(run.actor.as_str())</span>
2050 }2084 }
@@ -2077,7 +2111,7 @@ async fn run_head(lang: Lang, run: &RunDetail, all_href: Option<String>) -> Resu
2077 if run.can_rerun_failed && !run.can_approve && !run.can_cancel {2111 if run.can_rerun_failed && !run.can_approve && !run.can_cancel {
2078 action_button(action: format!("{}/rerun-failed", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::RerunFailed))2112 action_button(action: format!("{}/rerun-failed", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::RerunFailed))
2079 }2113 }
2080- if !run.can_approve {2114+ if !run.can_approve && run.reachable {
2081 action_button(action: format!("{}/rerun", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Rerun))2115 action_button(action: format!("{}/rerun", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Rerun))
2082 }2116 }
2083 </div>2117 </div>
@@ -2196,9 +2230,12 @@ async fn run_log(lang: Lang, run: &RunDetail, timeline: bool) -> Result<impl Vie
2196 }2230 }
2197 if let Some(log) = run.log.as_ref() {2231 if let Some(log) = run.log.as_ref() {
2198 if log.truncated {2232 if log.truncated {
2199- <p class="muted small">(g::t(lang, K::LogTruncated))</p>2233+ <p class="muted small ci-tl-pad">
2234+ (crate::pages::passkeys::s(lang, "Showing the end of this log.", "Günlüğün sonu gösteriliyor."))
2235+ " " <a href=(log.log_href.as_str())>(crate::pages::passkeys::s(lang, "Full log", "Tam günlük"))</a>
2236+ </p>
2200 }2237 }
2201- <pre class="ci-log ci-tl-code" data-live=(log.live.as_deref()) data-live-log="true" data-offset=(log.offset.as_str()) data-first=(log.first_line.as_str())>(log.text.as_str())</pre>2238+ <pre class="ci-log ci-tl-code" data-empty=(crate::pages::passkeys::s(lang, "No output yet.", "Henüz çıktı yok.")) data-live=(log.live.as_deref()) data-live-log="true" data-offset=(log.offset.as_str()) data-first=(log.first_line.as_str())>(log.text.as_str())</pre>
2202 } else {2239 } else {
2203 <p class="muted ci-tl-pad">(g::t(lang, K::NoJobs))</p>2240 <p class="muted ci-tl-pad">(g::t(lang, K::NoJobs))</p>
2204 }2241 }
@@ -2634,6 +2671,12 @@ async fn run_rerun(cx: &Cx, Form(form): Form<CsrfForm>) -> Result<SeeOther> {
2634 require_write(&ctx)?;2671 require_write(&ctx)?;
2635 let state = app_context::<AppState>(cx);2672 let state = app_context::<AppState>(cx);
2636 let run = run_of(state, &ctx, &number).await?;2673 let run = run_of(state, &ctx, &number).await?;
2674+ if !commit_reachable_for(&ctx.path, &run.commit_oid).await? {
2675+ return Ok(notice_redirect(
2676+ &run_href(&title_of(&ctx), run.number),
2677+ "overwritten",
2678+ ));
2679+ }
2637 let new_run = state.store.rerun(&run.id, &user.id).await?;2680 let new_run = state.store.rerun(&run.id, &user.id).await?;
2638 after_change(state, &new_run.id, &[]).await?;2681 after_change(state, &new_run.id, &[]).await?;
2639 Ok(notice_redirect(2682 Ok(notice_redirect(
@@ -2655,6 +2698,9 @@ async fn run_rerun_failed(cx: &Cx, Form(form): Form<CsrfForm>) -> Result<SeeOthe
2655 let state = app_context::<AppState>(cx);2698 let state = app_context::<AppState>(cx);
2656 let run = run_of(state, &ctx, &number).await?;2699 let run = run_of(state, &ctx, &number).await?;
2657 let href = run_href(&title_of(&ctx), run.number);2700 let href = run_href(&title_of(&ctx), run.number);
2701+ if !commit_reachable_for(&ctx.path, &run.commit_oid).await? {
2702+ return Ok(notice_redirect(&href, "overwritten"));
2703+ }
2658 match state.store.rerun_failed(&run.id, &user.id).await {2704 match state.store.rerun_failed(&run.id, &user.id).await {
2659 Ok(new_run) => {2705 Ok(new_run) => {
2660 after_change(state, &new_run.id, &[]).await?;2706 after_change(state, &new_run.id, &[]).await?;
@@ -2695,6 +2741,12 @@ async fn job_rerun(cx: &Cx, Form(form): Form<CsrfForm>) -> Result<SeeOther> {
2695 if run.repo_id != ctx.repo.id {2741 if run.repo_id != ctx.repo.id {
2696 return Err(not_found().into());2742 return Err(not_found().into());
2697 }2743 }
2744+ if !commit_reachable_for(&ctx.path, &run.commit_oid).await? {
2745+ return Ok(notice_redirect(
2746+ &run_href(&title_of(&ctx), run.number),
2747+ "overwritten",
2748+ ));
2749+ }
2698 match state.store.rerun_job(&run.id, &job.id, &user.id).await {2750 match state.store.rerun_job(&run.id, &job.id, &user.id).await {
2699 Ok(new_run) => {2751 Ok(new_run) => {
2700 after_change(state, &new_run.id, &[]).await?;2752 after_change(state, &new_run.id, &[]).await?;
crates/forge-web/src/pages/ci_tests.rsmodified+45 -1
@@ -18,6 +18,7 @@ use crate::ci::{CiLive, artifact_key, log_path};
18 use crate::test_support::{app_router, create_session, test_state};18 use crate::test_support::{app_router, create_session, test_state};
19 19
20 const CSRF: &str = "ci-test-csrf";20 const CSRF: &str = "ci-test-csrf";
21+/// A hash no ref reaches, standing in for a commit that was overwritten.
21 const SHA: &str = "0123456789abcdef0123456789abcdef01234567";22 const SHA: &str = "0123456789abcdef0123456789abcdef01234567";
22 const SPEC: &str = r#"{"runs_on":[]}"#;23 const SPEC: &str = r#"{"runs_on":[]}"#;
23 const RUN_BASE: &str = "/tahinli/proj/ci";24 const RUN_BASE: &str = "/tahinli/proj/ci";
@@ -28,6 +29,8 @@ struct Fixture {
28 live: Arc<CiLive>,29 live: Arc<CiLive>,
29 repo: forge_core::Repo,30 repo: forge_core::Repo,
30 tahinli: String,31 tahinli: String,
32+ /// The commit `main` points at in `proj`.
33+ head: String,
31 data_dir: PathBuf,34 data_dir: PathBuf,
32 blobs: BlobStore,35 blobs: BlobStore,
33 }36 }
@@ -59,6 +62,7 @@ async fn fixture(dir: &Path) -> Fixture {
59 init_bare(&state.git, &bare, "main")62 init_bare(&state.git, &bare, "main")
60 .await63 .await
61 .expect("init bare");64 .expect("init bare");
65+ let head = commit_main(&bare);
62 store66 store
63 .set_collaborator(&repo.id, &bob.id, Role::Write)67 .set_collaborator(&repo.id, &bob.id, Role::Write)
64 .await68 .await
@@ -80,11 +84,31 @@ async fn fixture(dir: &Path) -> Fixture {
80 live,84 live,
81 repo,85 repo,
82 tahinli: tahinli.id,86 tahinli: tahinli.id,
87+ head,
83 data_dir,88 data_dir,
84 blobs,89 blobs,
85 }90 }
86 }91 }
87 92
93+/// Puts one empty commit on `main` and returns its hash.
94+fn commit_main(bare: &Path) -> String {
95+ let git = |args: &[&str]| {
96+ let out = std::process::Command::new("git")
97+ .args(["-c", "user.name=t", "-c", "user.email=t@example.com", "-C"])
98+ .arg(bare)
99+ .args(args)
100+ .stdin(std::process::Stdio::null())
101+ .output()
102+ .expect("git");
103+ assert!(out.status.success(), "{args:?}");
104+ String::from_utf8_lossy(&out.stdout).trim().to_owned()
105+ };
106+ let tree = git(&["hash-object", "-t", "tree", "-w", "--stdin"]);
107+ let commit = git(&["commit-tree", &tree, "-m", "first"]);
108+ git(&["update-ref", "refs/heads/main", &commit]);
109+ commit
110+}
111+
88 fn cookie_for(token: &str) -> String {112 fn cookie_for(token: &str) -> String {
89 format!("__Host-{SESSION_COOKIE}={token}")113 format!("__Host-{SESSION_COOKIE}={token}")
90 }114 }
@@ -162,7 +186,7 @@ async fn run_with(fx: &Fixture, jobs: &[&str], needs_approval: bool) -> CiRun {
162 &fx.repo.id,186 &fx.repo.id,
163 "push",187 "push",
164 "refs/heads/main",188 "refs/heads/main",
165- SHA,189+ &fx.head,
166 None,190 None,
167 &fx.tahinli,191 &fx.tahinli,
168 needs_approval,192 needs_approval,
@@ -1639,6 +1663,26 @@ async fn rerun_failed_and_rerun_job_start_partial_runs() {
1639 assert!(job_page.contains("Re-run this job"));1663 assert!(job_page.contains("Re-run this job"));
1640 }1664 }
1641 1665
1666+#[tokio::test]
1667+async fn a_run_on_an_overwritten_commit_cannot_be_rerun() {
1668+ let dir = tempfile::tempdir().expect("tempdir");
1669+ let fx = fixture(dir.path()).await;
1670+ run_at(&fx, SHA).await;
1671+ finish_job(&fx).await;
1672+ let writer = cookie_for("bob-token");
1673+ let run_url = format!("{RUN_BASE}/runs/1");
1674+ let page = get(&fx.app, &run_url, Some(&writer)).await.text();
1675+ assert!(!page.contains(">Re-run<"));
1676+ assert!(!page.contains(&format!("/commit/{SHA}")));
1677+ let refused = post(&fx.app, &format!("{run_url}/rerun"), &writer, &[]).await;
1678+ assert!(
1679+ refused
1680+ .location()
1681+ .unwrap_or_default()
1682+ .ends_with("?notice=overwritten")
1683+ );
1684+}
1685+
1642 #[tokio::test]1686 #[tokio::test]
1643 async fn a_run_with_no_failed_jobs_has_nothing_to_rerun() {1687 async fn a_run_with_no_failed_jobs_has_nothing_to_rerun() {
1644 let dir = tempfile::tempdir().expect("tempdir");1688 let dir = tempfile::tempdir().expect("tempdir");
crates/forge-web/src/pages/compare.rsmodified+5 -5
@@ -431,17 +431,17 @@ async fn picker_view(cx: &Cx, ctx: RepoCtx, base: String, head: String) -> Resul
431 Ok(view! {431 Ok(view! {
432 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),432 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
433 repo_head(head: header)433 repo_head(head: header)
434- <section class="lang-form">434+ <section class="lang-form compare-pick">
435 <h2>(g::t(lang, K::CompareBranches))</h2>435 <h2>(g::t(lang, K::CompareBranches))</h2>
436- <form method="get" action=(action.as_str())>436+ <form method="get" action=(action.as_str()) class="filter-bar">
437- <p><label>(g::t(lang, K::BasePrefix)) <input type="text" name="base" list="compare-branches" value=(base.as_str())></label></p>437+ <label>(g::t(lang, K::BasePrefix)) <input type="text" name="base" list="compare-branches" value=(base.as_str())></label>
438- <p><label>(g::t(lang, K::HeadPrefix)) <input type="text" name="head" list="compare-branches" value=(head.as_str()) placeholder=(g::t(lang, K::BranchOrOwner))></label></p>438+ <label>(g::t(lang, K::HeadPrefix)) <input type="text" name="head" list="compare-branches" value=(head.as_str()) placeholder=(g::t(lang, K::BranchOrOwner))></label>
439 <datalist id="compare-branches">439 <datalist id="compare-branches">
440 for name in branches.iter() {440 for name in branches.iter() {
441 <option value=(name.as_str())></option>441 <option value=(name.as_str())></option>
442 }442 }
443 </datalist>443 </datalist>
444- <p><button type="submit">(g::t(lang, K::Compare))</button></p>444+ <button type="submit" class="primary">(g::t(lang, K::Compare))</button>
445 </form>445 </form>
446 </section>446 </section>
447 )447 )
crates/forge-web/src/pages/discussion_view.rsmodified+2 -2
@@ -184,7 +184,7 @@ async fn comment_article(item: CommentView) -> Result<impl View> {
184 if deleted {184 if deleted {
185 <span class="muted">(g::t(lang, K::CommentDeleted))</span>185 <span class="muted">(g::t(lang, K::CommentDeleted))</span>
186 } else {186 } else {
187- <a href=(profile.as_str())><img class="avatar avatar-sm" src=(avatar.as_str()) alt="" width="24" height="24"></a>187+ <a href=(profile.as_str()) aria-label=(login.as_str())><img class="avatar avatar-sm" src=(avatar.as_str()) alt="" width="24" height="24"></a>
188 <strong>user_link(shown: author.as_str(), login: login.as_str())</strong>188 <strong>user_link(shown: author.as_str(), login: login.as_str())</strong>
189 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>189 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>
190 }190 }
@@ -424,7 +424,7 @@ async fn discussion_page(
424 <div class="issue-column fit-pane">424 <div class="issue-column fit-pane">
425 <article class="issue-item" id="discussion-body">425 <article class="issue-item" id="discussion-body">
426 <header class="issue-item-head">426 <header class="issue-item-head">
427- <a href=(author_profile.as_str())><img class="avatar avatar-sm" src=(author_avatar.as_str()) alt="" width="24" height="24"></a>427+ <a href=(author_profile.as_str()) aria-label=(author.as_str())><img class="avatar avatar-sm" src=(author_avatar.as_str()) alt="" width="24" height="24"></a>
428 <strong>user_link(shown: author.as_str(), login: author_login.as_str())</strong>428 <strong>user_link(shown: author.as_str(), login: author_login.as_str())</strong>
429 </header>429 </header>
430 <div class="issue-item-body markdown-body">(Unescaped::new_unchecked(body_html))</div>430 <div class="issue-item-body markdown-body">(Unescaped::new_unchecked(body_html))</div>
crates/forge-web/src/pages/import.rsmodified+4 -8
@@ -327,6 +327,7 @@ async fn import_form(
327 <input type="hidden" name="source" value=(source_value)>327 <input type="hidden" name="source" value=(source_value)>
328 <header class="newrepo-head page-head">328 <header class="newrepo-head page-head">
329 <h1>(g::t(lang, K::ImportTitle))</h1>329 <h1>(g::t(lang, K::ImportTitle))</h1>
330+ newrepo_tabs(lang: lang, active: "import")
330 <div class="newrepo-head-actions">331 <div class="newrepo-head-actions">
331 visibility_pick(lang: lang, private: private)332 visibility_pick(lang: lang, private: private)
332 <button type="submit" class="primary">(g::t(lang, K::StartImport))</button>333 <button type="submit" class="primary">(g::t(lang, K::StartImport))</button>
@@ -411,7 +412,6 @@ async fn import_home(
411 more: bool,412 more: bool,
412 ) -> Result<impl View> {413 ) -> Result<impl View> {
413 Ok(view! {414 Ok(view! {
414- newrepo_tabs(lang: lang, active: "import")
415 <div class="import-home">415 <div class="import-home">
416 import_form(lang: lang, csrf: csrf.as_str(), draft: draft, error: None, owners: owners)416 import_form(lang: lang, csrf: csrf.as_str(), draft: draft, error: None, owners: owners)
417 recent_imports(lang: lang, jobs: jobs, more: more)417 recent_imports(lang: lang, jobs: jobs, more: more)
@@ -419,7 +419,7 @@ async fn import_home(
419 })419 })
420 }420 }
421 421
422-/// The import form again after a rejected submit: the tabs, then the form.422+/// The import form again after a rejected submit.
423 #[component]423 #[component]
424 async fn import_error_body(424 async fn import_error_body(
425 lang: Lang,425 lang: Lang,
@@ -429,7 +429,6 @@ async fn import_error_body(
429 owners: Vec<String>,429 owners: Vec<String>,
430 ) -> Result<impl View> {430 ) -> Result<impl View> {
431 Ok(view! {431 Ok(view! {
432- newrepo_tabs(lang: lang, active: "import")
433 <div class="import-home">432 <div class="import-home">
434 import_form(lang: lang, csrf: csrf.as_str(), draft: draft, error: Some(error), owners: owners)433 import_form(lang: lang, csrf: csrf.as_str(), draft: draft, error: Some(error), owners: owners)
435 </div>434 </div>
@@ -630,7 +629,6 @@ async fn bulk_form(
630 // A Forgejo token can list its own repositories, so the owner may stay empty.629 // A Forgejo token can list its own repositories, so the owner may stay empty.
631 let owner_required = source != Source::Forgejo;630 let owner_required = source != Source::Forgejo;
632 Ok(view! {631 Ok(view! {
633- newrepo_tabs(lang: lang, active: "import")
634 if let Some(message) = error {632 if let Some(message) = error {
635 alert(message: message.as_str())633 alert(message: message.as_str())
636 }634 }
@@ -640,6 +638,7 @@ async fn bulk_form(
640 <input type="hidden" name="stage" value="list">638 <input type="hidden" name="stage" value="list">
641 <header class="newrepo-head page-head">639 <header class="newrepo-head page-head">
642 <h1>(g::t(lang, K::BulkTitle))</h1>640 <h1>(g::t(lang, K::BulkTitle))</h1>
641+ newrepo_tabs(lang: lang, active: "import")
643 <div class="newrepo-head-actions">642 <div class="newrepo-head-actions">
644 <button type="submit" class="primary">(g::t(lang, K::BulkListButton))</button>643 <button type="submit" class="primary">(g::t(lang, K::BulkListButton))</button>
645 </div>644 </div>
@@ -695,7 +694,6 @@ async fn bulk_select(
695 form.owner.clone()694 form.owner.clone()
696 };695 };
697 Ok(view! {696 Ok(view! {
698- newrepo_tabs(lang: lang, active: "import")
699 <form method="post" action="/new/import/bulk" class="newrepo-form">697 <form method="post" action="/new/import/bulk" class="newrepo-form">
700 csrf_field(token: csrf)698 csrf_field(token: csrf)
701 <input type="hidden" name="stage" value="run">699 <input type="hidden" name="stage" value="run">
@@ -705,6 +703,7 @@ async fn bulk_select(
705 <input type="hidden" name="from" value=(form.from.as_str())>703 <input type="hidden" name="from" value=(form.from.as_str())>
706 <header class="newrepo-head page-head">704 <header class="newrepo-head page-head">
707 <h1>(g::t(lang, K::BulkSelectHeading))</h1>705 <h1>(g::t(lang, K::BulkSelectHeading))</h1>
706+ newrepo_tabs(lang: lang, active: "import")
708 <div class="newrepo-head-actions">707 <div class="newrepo-head-actions">
709 visibility_pick(lang: lang, private: private)708 visibility_pick(lang: lang, private: private)
710 if !empty {709 if !empty {
@@ -1133,7 +1132,6 @@ async fn jobs_list(
1133 let empty = jobs.is_empty();1132 let empty = jobs.is_empty();
1134 let retry = jobs.iter().any(|(job, _)| job.state == ImportState::Failed);1133 let retry = jobs.iter().any(|(job, _)| job.state == ImportState::Failed);
1135 Ok(view! {1134 Ok(view! {
1136- newrepo_tabs(lang: lang, active: "import")
1137 <section class="page-head" data-live="/import/events">1135 <section class="page-head" data-live="/import/events">
1138 <h1>(g::t(lang, K::JobsTitle))</h1>1136 <h1>(g::t(lang, K::JobsTitle))</h1>
1139 if retry {1137 if retry {
@@ -1239,7 +1237,6 @@ async fn job_view(
1239 let state_word = job.state.as_str();1237 let state_word = job.state.as_str();
1240 let empty_log = log.is_empty();1238 let empty_log = log.is_empty();
1241 Ok(view! {1239 Ok(view! {
1242- newrepo_tabs(lang: lang, active: "import")
1243 <section class="import-job" data-live=(live.as_deref()) data-live-state=(state_word)>1240 <section class="import-job" data-live=(live.as_deref()) data-live-state=(state_word)>
1244 <header class="newrepo-head page-head">1241 <header class="newrepo-head page-head">
1245 <h1 class="import-job-title">(job.source_ref.as_str())</h1>1242 <h1 class="import-job-title">(job.source_ref.as_str())</h1>
@@ -1461,7 +1458,6 @@ async fn retry_list(lang: Lang, csrf: &str, rows: Vec<(ImportJob, Repo)>) -> Res
1461 let count = rows.len();1458 let count = rows.len();
1462 let empty = rows.is_empty();1459 let empty = rows.is_empty();
1463 Ok(view! {1460 Ok(view! {
1464- newrepo_tabs(lang: lang, active: "import")
1465 <form method="post" action="/import/retry" class="newrepo-form">1461 <form method="post" action="/import/retry" class="newrepo-form">
1466 csrf_field(token: csrf)1462 csrf_field(token: csrf)
1467 <header class="newrepo-head page-head">1463 <header class="newrepo-head page-head">
crates/forge-web/src/pages/issue_parts.rsmodified+36 -10
@@ -224,6 +224,17 @@ pub(crate) fn is_hex_oid(s: &str) -> bool {
224 (4..=64).contains(&s.len()) && s.bytes().all(|b| b.is_ascii_hexdigit())224 (4..=64).contains(&s.len()) && s.bytes().all(|b| b.is_ascii_hexdigit())
225 }225 }
226 226
227+/// The ids in `oids` that a branch, tag or pull request still reaches, read in one git walk. A
228+/// failed read yields none, so no stored hash links to a page that would 404.
229+pub(crate) async fn reachable_among(path: &std::path::Path, oids: Vec<String>) -> HashSet<String> {
230+ let path = path.to_owned();
231+ tokio::task::spawn_blocking(move || forge_git::browse::reachable_commits(&path, &oids))
232+ .await
233+ .ok()
234+ .and_then(|found| found.ok())
235+ .unwrap_or_default()
236+}
237+
227 // Timeline238 // Timeline
228 239
229 /// One comment, or the item body (which uses the same item shape without a delete action).240 /// One comment, or the item body (which uses the same item shape without a delete action).
@@ -328,6 +339,7 @@ fn event_line(
328 base_branch: &str,339 base_branch: &str,
329 actor: String,340 actor: String,
330 when: When,341 when: When,
342+ reachable: &HashSet<String>,
331 ) -> EventLine {343 ) -> EventLine {
332 let text = |key: &str| {344 let text = |key: &str| {
333 event345 event
@@ -375,18 +387,19 @@ fn event_line(
375 "base_changed" => g::event_base_changed(lang, &text("from"), &text("to")),387 "base_changed" => g::event_base_changed(lang, &text("from"), &text("to")),
376 other => other.to_owned(),388 other => other.to_owned(),
377 };389 };
390+ // A commit no branch, tag or pull request reaches keeps its short hash, as plain text.
378 let (link_href, link_label) = if is_hex_oid(&commit) {391 let (link_href, link_label) = if is_hex_oid(&commit) {
379- (392+ let href = reachable
380- Some(format!("{base}/commit/{commit}")),393+ .contains(&commit)
381- short_oid(&commit).to_owned(),394+ .then(|| format!("{base}/commit/{commit}"));
382- )395+ (href, short_oid(&commit).to_owned())
383 } else {396 } else {
384 (None, String::new())397 (None, String::new())
385 };398 };
386 let (from, to) = (text("from"), text("to"));399 let (from, to) = (text("from"), text("to"));
387 let (before, after) = match event.kind.as_str() {400 let (before, after) = match event.kind.as_str() {
388 kind @ ("closed" | "referenced" | "merged") => {401 kind @ ("closed" | "referenced" | "merged") => {
389- g::commit_event_sides(lang, kind, &before, base_branch, link_href.is_some())402+ g::commit_event_sides(lang, kind, &before, base_branch, !link_label.is_empty())
390 }403 }
391 "head_updated" if !from.is_empty() && !to.is_empty() => (404 "head_updated" if !from.is_empty() && !to.is_empty() => (
392 before,405 before,
@@ -424,7 +437,7 @@ pub(crate) async fn comment_item(lang: Lang, item: CommentView) -> Result<impl V
424 Ok(view! {437 Ok(view! {
425 <article class="issue-item" id=(anchor.as_str())>438 <article class="issue-item" id=(anchor.as_str())>
426 <header class="issue-item-head">439 <header class="issue-item-head">
427- <a href=(profile.as_str())><img class="avatar avatar-sm" src=(avatar.as_str()) alt="" width="24" height="24"></a>440+ <a href=(profile.as_str()) aria-label=(login.as_str())><img class="avatar avatar-sm" src=(avatar.as_str()) alt="" width="24" height="24"></a>
428 <strong>user_link(shown: author.as_str(), login: login.as_str())</strong>441 <strong>user_link(shown: author.as_str(), login: login.as_str())</strong>
429 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>442 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>
430 if let Some(href) = history_href {443 if let Some(href) = history_href {
@@ -544,9 +557,13 @@ pub(crate) async fn event_item(line: EventLine) -> Result<impl View> {
544 <strong>(actor.as_str())</strong>557 <strong>(actor.as_str())</strong>
545 " "558 " "
546 (before.as_str())559 (before.as_str())
547- if let Some(href) = link_href {560+ if !link_label.is_empty() {
548 " "561 " "
549- <a class="mono" href=(href.as_str())>(link_label.as_str())</a>562+ if let Some(href) = link_href {
563+ <a class="mono" href=(href.as_str())>(link_label.as_str())</a>
564+ } else {
565+ <span class="mono">(link_label.as_str())</span>
566+ }
550 }567 }
551 if !after.is_empty() {568 if !after.is_empty() {
552 " "569 " "
@@ -593,7 +610,7 @@ pub(crate) async fn review_item(lang: Lang, review: ReviewView) -> Result<impl V
593 Ok(view! {610 Ok(view! {
594 <article class="issue-item review-item" id=(anchor.as_str())>611 <article class="issue-item review-item" id=(anchor.as_str())>
595 <header class="issue-item-head">612 <header class="issue-item-head">
596- <a href=(profile.as_str())><img class="avatar avatar-sm" src=(avatar.as_str()) alt="" width="24" height="24"></a>613+ <a href=(profile.as_str()) aria-label=(login.as_str())><img class="avatar avatar-sm" src=(avatar.as_str()) alt="" width="24" height="24"></a>
597 <strong>user_link(shown: author.as_str(), login: login.as_str())</strong>614 <strong>user_link(shown: author.as_str(), login: login.as_str())</strong>
598 <span class=(verb_class)>(verb)</span>615 <span class=(verb_class)>(verb)</span>
599 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>616 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>
@@ -656,6 +673,15 @@ pub(crate) async fn load_discussion(
656 let comments = store.list_comments(&item.id).await?;673 let comments = store.list_comments(&item.id).await?;
657 let events = store.list_events(&item.id).await?;674 let events = store.list_events(&item.id).await?;
658 675
676+ // Every event's commit, checked against git in one walk before any row is built.
677+ let event_commits: Vec<String> = events
678+ .iter()
679+ .filter_map(|e| e.data.get("commit").and_then(Json::as_str))
680+ .filter(|c| is_hex_oid(c))
681+ .map(str::to_owned)
682+ .collect();
683+ let reachable = reachable_among(&ctx.path, event_commits).await;
684+
659 // One batched lookup for every author and event actor on the page.685 // One batched lookup for every author and event actor on the page.
660 let mut ids: Vec<String> = std::iter::once(item.author_id.clone())686 let mut ids: Vec<String> = std::iter::once(item.author_id.clone())
661 .chain(comments.iter().map(|c| c.author_id.clone()))687 .chain(comments.iter().map(|c| c.author_id.clone()))
@@ -790,7 +816,7 @@ pub(crate) async fn load_discussion(
790 None => g::t(lang, K::System).to_owned(),816 None => g::t(lang, K::System).to_owned(),
791 };817 };
792 let when = When::new(lang, &event.created_at, &tz, now);818 let when = When::new(lang, &event.created_at, &tz, now);
793- let line = event_line(lang, event, &base, base_branch, actor, when);819+ let line = event_line(lang, event, &base, base_branch, actor, when, &reachable);
794 keyed.push((event.created_at.clone(), Entry::Event(line)));820 keyed.push((event.created_at.clone(), Entry::Event(line)));
795 }821 }
796 if kind == ItemKind::Pull {822 if kind == ItemKind::Pull {
crates/forge-web/src/pages/issue_view.rsmodified+2 -2
@@ -234,7 +234,7 @@ async fn edit_item_page(
234 </label>234 </label>
235 <div class="issue-actions">235 <div class="issue-actions">
236 <button type="submit" class="primary">(g::t(lang, K::SaveChanges))</button>236 <button type="submit" class="primary">(g::t(lang, K::SaveChanges))</button>
237- <a href=(back.as_str())>(g::t(lang, K::Cancel))</a>237+ <a class="button" href=(back.as_str())>(g::t(lang, K::Cancel))</a>
238 </div>238 </div>
239 </form>239 </form>
240 </section>240 </section>
@@ -346,7 +346,7 @@ async fn edit_comment_page(
346 </label>346 </label>
347 <div class="issue-actions">347 <div class="issue-actions">
348 <button type="submit" class="primary">(g::t(lang, K::SaveComment))</button>348 <button type="submit" class="primary">(g::t(lang, K::SaveComment))</button>
349- <a href=(back.as_str())>(g::t(lang, K::Cancel))</a>349+ <a class="button" href=(back.as_str())>(g::t(lang, K::Cancel))</a>
350 </div>350 </div>
351 </form>351 </form>
352 </section>352 </section>
crates/forge-web/src/pages/issues_list.rsmodified+2 -2
@@ -730,7 +730,7 @@ async fn new_issue_body(
730 </ul>730 </ul>
731 <div class="issue-actions">731 <div class="issue-actions">
732 <a href=(blank.as_str())>(g::t(lang, K::BlankIssue))</a>732 <a href=(blank.as_str())>(g::t(lang, K::BlankIssue))</a>
733- <a href=(cancel.as_str())>(g::t(lang, K::Cancel))</a>733+ <a class="button" href=(cancel.as_str())>(g::t(lang, K::Cancel))</a>
734 </div>734 </div>
735 } else {735 } else {
736 if let Some(message) = draft.error {736 if let Some(message) = draft.error {
@@ -760,7 +760,7 @@ async fn new_issue_body(
760 }760 }
761 <div class="issue-actions">761 <div class="issue-actions">
762 <button type="submit" class="primary">(g::t(lang, K::SubmitNewIssue))</button>762 <button type="submit" class="primary">(g::t(lang, K::SubmitNewIssue))</button>
763- <a href=(cancel.as_str())>(g::t(lang, K::Cancel))</a>763+ <a class="button" href=(cancel.as_str())>(g::t(lang, K::Cancel))</a>
764 </div>764 </div>
765 </form>765 </form>
766 }766 }
crates/forge-web/src/pages/labels_css.rsmodified+6 -49
@@ -26,29 +26,6 @@ path_param!(repo);
26 /// Revalidate on every use: the ETag makes an unchanged stylesheet a cheap 304.26 /// Revalidate on every use: the ETag makes an unchanged stylesheet a cheap 304.
27 const CACHE_REVALIDATE: &str = "no-cache";27 const CACHE_REVALIDATE: &str = "no-cache";
28 28
29-/// Relative luminance of an sRGB color, as defined by WCAG 2.x.
30-fn luminance(r: u8, g: u8, b: u8) -> f64 {
31- let linear = |c: u8| {
32- let c = f64::from(c) / 255.0;
33- if c <= 0.03928 {
34- c / 12.92
35- } else {
36- ((c + 0.055) / 1.055).powf(2.4)
37- }
38- };
39- 0.2126 * linear(r) + 0.7152 * linear(g) + 0.0722 * linear(b)
40-}
41-
42-/// Black or white text, whichever gives the higher contrast ratio against the background. The
43-/// two ratios are equal at a luminance of about 0.179, so black wins above that.
44-pub fn text_color(r: u8, g: u8, b: u8) -> &'static str {
45- if luminance(r, g, b) > 0.179 {
46- "#000"
47- } else {
48- "#fff"
49- }
50-}
51-
52 /// `#rrggbb` to its channels. Only six hex digits with a leading `#` are accepted.29 /// `#rrggbb` to its channels. Only six hex digits with a leading `#` are accepted.
53 fn parse_hex(color: &str) -> Option<(u8, u8, u8)> {30 fn parse_hex(color: &str) -> Option<(u8, u8, u8)> {
54 let hex = color.strip_prefix('#')?;31 let hex = color.strip_prefix('#')?;
@@ -84,9 +61,8 @@ pub fn label_css(labels: &[Label]) -> String {
84 // Writing to a String cannot fail.61 // Writing to a String cannot fail.
85 let _ = writeln!(62 let _ = writeln!(
86 css,63 css,
87- ".label-{} {{ background-color: #{r:02x}{g:02x}{b:02x}; color: {}; }}",64+ ".label-{} {{ --label: #{r:02x}{g:02x}{b:02x}; }}",
88- label.id,65+ label.id
89- text_color(r, g, b)
90 );66 );
91 }67 }
92 css68 css
@@ -138,7 +114,7 @@ mod tests {
138 use forge_core::{Label, Visibility};114 use forge_core::{Label, Visibility};
139 use http::header::{CACHE_CONTROL, CONTENT_TYPE, ETAG, IF_NONE_MATCH};115 use http::header::{CACHE_CONTROL, CONTENT_TYPE, ETAG, IF_NONE_MATCH};
140 116
141- use super::{label_css, text_color};117+ use super::label_css;
142 use crate::pages::issues_list::test_util::{OWNER, REPO, fixture, send};118 use crate::pages::issues_list::test_util::{OWNER, REPO, fixture, send};
143 119
144 fn label(id: &str, color: &str) -> Label {120 fn label(id: &str, color: &str) -> Label {
@@ -151,15 +127,6 @@ mod tests {
151 }127 }
152 }128 }
153 129
154- #[test]
155- fn contrast_picks_black_or_white() {
156- assert_eq!(text_color(255, 255, 255), "#000");
157- assert_eq!(text_color(255, 255, 0), "#000");
158- assert_eq!(text_color(0, 0, 0), "#fff");
159- assert_eq!(text_color(0, 0, 128), "#fff");
160- assert_eq!(text_color(136, 136, 136), "#000");
161- }
162-
163 #[test]130 #[test]
164 fn css_has_colors_and_contrast() {131 fn css_has_colors_and_contrast() {
165 let css = label_css(&[132 let css = label_css(&[
@@ -168,14 +135,8 @@ mod tests {
168 label("bad", "red"),135 label("bad", "red"),
169 label("x y", "#123456"),136 label("x y", "#123456"),
170 ]);137 ]);
171- assert!(138+ assert!(css.contains(".label-red1 { --label: #ff0000; }"), "{css}");
172- css.contains(".label-red1 { background-color: #ff0000; color: #000; }"),139+ assert!(css.contains(".label-navy { --label: #000080; }"), "{css}");
173- "{css}"
174- );
175- assert!(
176- css.contains(".label-navy { background-color: #000080; color: #fff; }"),
177- "{css}"
178- );
179 assert!(!css.contains(".label-bad"), "{css}");140 assert!(!css.contains(".label-bad"), "{css}");
180 assert!(!css.contains("x y"), "{css}");141 assert!(!css.contains("x y"), "{css}");
181 }142 }
@@ -206,11 +167,7 @@ mod tests {
206 Some("no-cache")167 Some("no-cache")
207 );168 );
208 let etag = reply.header(ETAG.as_str()).expect("etag");169 let etag = reply.header(ETAG.as_str()).expect("etag");
209- assert!(170+ assert!(reply.text().contains("--label: #b60205;"));
210- reply
211- .text()
212- .contains("background-color: #b60205; color: #fff;")
213- );
214 171
215 let reply = send(172 let reply = send(
216 &fx.router,173 &fx.router,
crates/forge-web/src/pages/new_repo.rsmodified+1 -1
@@ -234,7 +234,6 @@ async fn new_repo_form(
234 let draft_mirror_username = draft.mirror_username;234 let draft_mirror_username = draft.mirror_username;
235 let draft_mirror_interval = draft.mirror_interval;235 let draft_mirror_interval = draft.mirror_interval;
236 Ok(view! {236 Ok(view! {
237- crate::pages::import::newrepo_tabs(lang: lang, active: "create")
238 if let Some(message) = error {237 if let Some(message) = error {
239 alert(message: message.as_str())238 alert(message: message.as_str())
240 }239 }
@@ -242,6 +241,7 @@ async fn new_repo_form(
242 csrf_field(token: csrf)241 csrf_field(token: csrf)
243 <header class="newrepo-head page-head">242 <header class="newrepo-head page-head">
244 <h1>(i18n::t(lang, Key::NewRepository))</h1>243 <h1>(i18n::t(lang, Key::NewRepository))</h1>
244+ crate::pages::import::newrepo_tabs(lang: lang, active: "create")
245 <div class="newrepo-head-actions">245 <div class="newrepo-head-actions">
246 <fieldset class="newrepo-visibility">246 <fieldset class="newrepo-visibility">
247 <legend class="sr-only">(g::t(lang, K::VisibilityLegend))</legend>247 <legend class="sr-only">(g::t(lang, K::VisibilityLegend))</legend>
crates/forge-web/src/pages/notifications.rsmodified+1 -1
@@ -1240,7 +1240,7 @@ pub(crate) async fn watch_form(
1240 Ok(view! {1240 Ok(view! {
1241 <div class="watch-control">1241 <div class="watch-control">
1242 <details class="menu watch-menu">1242 <details class="menu watch-menu">
1243- <summary>1243+ <summary aria-label=(current)>
1244 <svg class="watch-eye" viewBox="0 0 24 24" aria-hidden="true"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg>1244 <svg class="watch-eye" viewBox="0 0 24 24" aria-hidden="true"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg>
1245 <span>(current)</span>1245 <span>(current)</span>
1246 </summary>1246 </summary>
crates/forge-web/src/pages/pull_view.rsmodified+15 -4
@@ -28,7 +28,7 @@ use crate::pages::issue_meta::item_href;
28 use crate::pages::issue_parts::{28 use crate::pages::issue_parts::{
29 CommentForm, ItemKind, Posted, When, check_write, comment_form, csrf_of, discussion_timeline,29 CommentForm, ItemKind, Posted, When, check_write, comment_form, csrf_of, discussion_timeline,
30 item_sidebar, load_discussion, load_sidebar, lock_message, may_change, may_converse,30 item_sidebar, load_discussion, load_sidebar, lock_message, may_change, may_converse,
31- parse_number, post_comment, triage, viewer,31+ parse_number, post_comment, reachable_among, triage, viewer,
32 };32 };
33 use crate::pages::notifications::notify_box_for;33 use crate::pages::notifications::notify_box_for;
34 use crate::pages::pull_branch::{self, branch_box, branch_error_from};34 use crate::pages::pull_branch::{self, branch_box, branch_error_from};
@@ -487,7 +487,7 @@ async fn merged_notice(
487 who: String,487 who: String,
488 when: When,488 when: When,
489 commit: String,489 commit: String,
490- commit_href: String,490+ commit_href: Option<String>,
491 lang: Lang,491 lang: Lang,
492 ) -> Result<impl View> {492 ) -> Result<impl View> {
493 let short = short_oid(&commit).to_owned();493 let short = short_oid(&commit).to_owned();
@@ -501,7 +501,11 @@ async fn merged_notice(
501 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>501 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>
502 if !commit.is_empty() {502 if !commit.is_empty() {
503 (as_sep)503 (as_sep)
504- <a class="mono" href=(commit_href.as_str())>(short.as_str())</a>504+ if let Some(href) = commit_href {
505+ <a class="mono" href=(href.as_str())>(short.as_str())</a>
506+ } else {
507+ <span class="mono">(short.as_str())</span>
508+ }
505 }509 }
506 </p>510 </p>
507 </section>511 </section>
@@ -868,7 +872,14 @@ async fn pull_conversation(
868 .as_deref()872 .as_deref()
869 .map(|stamp| When::new(lang, stamp, ctx.viewer_tz(), now_unix()));873 .map(|stamp| When::new(lang, stamp, ctx.viewer_tz(), now_unix()));
870 let merge_commit = pr.merge_commit.clone().unwrap_or_default();874 let merge_commit = pr.merge_commit.clone().unwrap_or_default();
871- let merge_commit_href = format!("/{owner}/{name}/commit/{merge_commit}");875+ // Linked only while a branch, tag or pull request still reaches the merge commit.
876+ let merge_commit_href = match merge_commit.as_str() {
877+ "" => None,
878+ oid => reachable_among(&ctx.path, vec![oid.to_owned()])
879+ .await
880+ .contains(oid)
881+ .then(|| format!("/{owner}/{name}/commit/{oid}")),
882+ };
872 883
873 let review_error = review_error_from(lang, cx);884 let review_error = review_error_from(lang, cx);
874 let summary = state.store.review_summary(&pr.issue.id).await?;885 let summary = state.store.review_summary(&pr.issue.id).await?;
crates/forge-web/src/pages/repo_webhooks.rsmodified+1 -4
@@ -582,10 +582,7 @@ async fn hooks_list_body(
582 <p><a href=(new_href.as_str()) class="button">(g::t(lang, K::AddWebhook))</a></p>582 <p><a href=(new_href.as_str()) class="button">(g::t(lang, K::AddWebhook))</a></p>
583 }583 }
584 if rows.is_empty() {584 if rows.is_empty() {
585- empty_state(title: g::t(lang, K::NoWebhooks),585+ empty_state(title: g::t(lang, K::NoWebhooks))
586- if !archived {
587- <a class="button" href=(new_href.as_str())>(g::t(lang, K::AddWebhook))</a>
588- })
589 } else {586 } else {
590 <ul class="runner-list hook-list">587 <ul class="runner-list hook-list">
591 for row in rows.iter() {588 for row in rows.iter() {
crates/forge-web/src/pages/review_requests.rsmodified+3 -1
@@ -289,7 +289,9 @@ async fn review_requests(cx: &Cx) -> Result<impl View> {
289 <h1>(heading)</h1>289 <h1>(heading)</h1>
290 </section>290 </section>
291 if empty {291 if empty {
292- empty_state(title: ga::t(lang, AK::NoReviewRequests))292+ <section class="card list-pane fit-pane">
293+ empty_state(title: ga::t(lang, AK::NoReviewRequests))
294+ </section>
293 }295 }
294 if !empty {296 if !empty {
295 <section class="card list-pane fit-pane">297 <section class="card list-pane fit-pane">
crates/forge-web/src/pages/settings_appearance.rsmodified+10 -49
@@ -8,7 +8,7 @@ use std::collections::HashMap;
8 8
9 use forge_core::AuditAction;9 use forge_core::AuditAction;
10 use forge_core::store::ui_prefs::{SIDEBAR_SIDES, THEMES};10 use forge_core::store::ui_prefs::{SIDEBAR_SIDES, THEMES};
11-use forge_core::store::user_prefs::{DENSITIES, DENSITY, SOUND, SOUND_VALUES};11+use forge_core::store::user_prefs::{SOUND, SOUND_VALUES};
12 use forge_core::{Error as CoreError, Session, Store, User};12 use forge_core::{Error as CoreError, Session, Store, User};
13 use serde::{Deserialize, Deserializer};13 use serde::{Deserialize, Deserializer};
14 use topcoat::Result;14 use topcoat::Result;
@@ -70,9 +70,10 @@ struct AppearanceForm {
70 base_dark: Option<String>,70 base_dark: Option<String>,
71 #[serde(default, deserialize_with = "present_string")]71 #[serde(default, deserialize_with = "present_string")]
72 sidebar_side: Option<String>,72 sidebar_side: Option<String>,
73- /// Sent by the density buttons and the sound switch only. Absent keeps the stored value.73+ /// Present when the form that holds the sound switch was posted: an unchecked switch posts
74+ /// nothing, so this tells off from a post that never showed the switch.
74 #[serde(default, deserialize_with = "present_string")]75 #[serde(default, deserialize_with = "present_string")]
75- density: Option<String>,76+ sound_shown: Option<String>,
76 #[serde(default, deserialize_with = "present_string")]77 #[serde(default, deserialize_with = "present_string")]
77 sound: Option<String>,78 sound: Option<String>,
78 }79 }
@@ -169,18 +170,10 @@ struct AppearancePage {
169 light: ColourGroup,170 light: ColourGroup,
170 dark: ColourGroup,171 dark: ColourGroup,
171 sidebar: Vec<Choice>,172 sidebar: Vec<Choice>,
172- density: Vec<Choice>,
173 /// Whether the run-finished tone is on: the sound switch's checked state.173 /// Whether the run-finished tone is on: the sound switch's checked state.
174 sound_on: bool,174 sound_on: bool,
175 }175 }
176 176
177-/// The `data-density` value the shell puts on `<html>`: `compact` only. Comfortable is the
178-/// default, so it has no attribute. `None` for a signed-out visitor, who gets browser storage.
179-pub fn density_attr(prefs: Option<&HashMap<String, String>>) -> Option<&'static str> {
180- let stored = prefs.and_then(|p| p.get(DENSITY))?;
181- (stored == "compact").then_some("compact")
182-}
183-
184 /// The `data-sound` value the shell puts on `<html>`: `on` when the viewer wants the tone.177 /// The `data-sound` value the shell puts on `<html>`: `on` when the viewer wants the tone.
185 pub fn sound_attr(prefs: Option<&HashMap<String, String>>) -> Option<&'static str> {178 pub fn sound_attr(prefs: Option<&HashMap<String, String>>) -> Option<&'static str> {
186 let stored = prefs.and_then(|p| p.get(SOUND))?;179 let stored = prefs.and_then(|p| p.get(SOUND))?;
@@ -445,7 +438,6 @@ async fn appearance_body(page: AppearancePage) -> Result<impl View> {
445 light,438 light,
446 dark,439 dark,
447 sidebar,440 sidebar,
448- density,
449 sound_on,441 sound_on,
450 } = page;442 } = page;
451 Ok(view! {443 Ok(view! {
@@ -484,21 +476,11 @@ async fn appearance_body(page: AppearancePage) -> Result<impl View> {
484 </label>476 </label>
485 }477 }
486 </div>478 </div>
487- </fieldset>479+ <small class="muted">(crate::pages::passkeys::s(lang, "Moves the menu on settings and admin pages.", "Ayarlar ve yönetim sayfalarındaki menüyü taşır."))</small>
488- <fieldset class="side-picker density-picker">
489- <legend>(g::t(lang, K::DensityLabel))</legend>
490- <div class="segmented snippet-segmented" role="group">
491- for choice in density.into_iter() {
492- <label class="segment">
493- <input type="radio" name="density" value=(choice.value) checked=(choice.selected) data-autosubmit="true">
494- <span>(choice.label)</span>
495- </label>
496- }
497- </div>
498- <small class="muted">(g::t(lang, K::DensityHelp))</small>
499 </fieldset>480 </fieldset>
500 <fieldset class="side-picker sound-toggle">481 <fieldset class="side-picker sound-toggle">
501 <legend>(g::t(lang, K::SoundLabel))</legend>482 <legend>(g::t(lang, K::SoundLabel))</legend>
483+ <input type="hidden" name="sound_shown" value="1">
502 <div class="sound-row">484 <div class="sound-row">
503 <span>(g::t(lang, K::SoundSwitch))</span>485 <span>(g::t(lang, K::SoundSwitch))</span>
504 <label class="sound-switch">486 <label class="sound-switch">
@@ -532,7 +514,6 @@ async fn appearance_body(page: AppearancePage) -> Result<impl View> {
532 <span class="sound-name">(g::t(lang, K::SoundFailed)) <span class="muted">(g::t(lang, K::SoundFailedNote))</span></span>514 <span class="sound-name">(g::t(lang, K::SoundFailed)) <span class="muted">(g::t(lang, K::SoundFailedNote))</span></span>
533 <button type="button" class="btn" data-sound-play="failed">(g::t(lang, K::SoundPlay))</button>515 <button type="button" class="btn" data-sound-play="failed">(g::t(lang, K::SoundPlay))</button>
534 </div>516 </div>
535- <p class="muted small">(g::t(lang, K::SoundFootTones))</p>
536 </section>517 </section>
537 </div>518 </div>
538 </div>519 </div>
@@ -594,10 +575,6 @@ fn page_for(
594 prefs: &HashMap<String, String>,575 prefs: &HashMap<String, String>,
595 ) -> AppearancePage {576 ) -> AppearancePage {
596 let user = &viewer.0;577 let user = &viewer.0;
597- let density = match prefs.get(DENSITY).map(String::as_str) {
598- Some("compact") => "compact",
599- _ => "comfortable",
600- };
601 let sound_on = prefs.get(SOUND).is_some_and(|v| v == "on");578 let sound_on = prefs.get(SOUND).is_some_and(|v| v == "on");
602 // The tab that opens first is the dark colours for a dark theme. The page script moves it to579 // The tab that opens first is the dark colours for a dark theme. The page script moves it to
603 // the one the viewer sees when the theme follows the system.580 // the one the viewer sees when the theme follows the system.
@@ -621,21 +598,11 @@ fn page_for(
621 sidebar: choices(SIDEBAR_CODES, sidebar_stored(&user.sidebar_side), |code| {598 sidebar: choices(SIDEBAR_CODES, sidebar_stored(&user.sidebar_side), |code| {
622 sidebar_label(lang, code)599 sidebar_label(lang, code)
623 }),600 }),
624- density: choices(DENSITIES, density, |code| density_label(lang, code)),
625 sound_on,601 sound_on,
626 }602 }
627 }603 }
628 604
629-/// The label of a row density: Comfortable or Compact.605+/// A sound value a save stores. Absent (`None`) stores nothing. A present value must
630-fn density_label(lang: Lang, code: &str) -> &'static str {
631- if code == "compact" {
632- g::t(lang, K::DensityCompact)
633- } else {
634- g::t(lang, K::DensityComfortable)
635- }
636-}
637-
638-/// A density or sound value a save stores. Absent (`None`) stores nothing. A present value must
639 /// be one offered, so an empty or unknown value is rejected.606 /// be one offered, so an empty or unknown value is rejected.
640 fn pref_choice(607 fn pref_choice(
641 lang: Lang,608 lang: Lang,
@@ -677,11 +644,9 @@ async fn appearance_save(cx: &Cx, Form(form): Form<AppearanceForm>) -> Result<Se
677 let base_light = base_choice(lang, form.base_light.as_deref(), &user.base_light)?;644 let base_light = base_choice(lang, form.base_light.as_deref(), &user.base_light)?;
678 let base_dark = base_choice(lang, form.base_dark.as_deref(), &user.base_dark)?;645 let base_dark = base_choice(lang, form.base_dark.as_deref(), &user.base_dark)?;
679 let sidebar_side = sidebar_choice(lang, form.sidebar_side.as_deref(), &user.sidebar_side)?;646 let sidebar_side = sidebar_choice(lang, form.sidebar_side.as_deref(), &user.sidebar_side)?;
680- let density = pref_choice(lang, form.density.as_deref(), DENSITIES, K::ChooseDensity)?;647+ // An unchecked switch posts nothing, so a form that showed it and sent no `sound` means off. A
681- // An unchecked switch posts nothing. Every post of this form carries the density radio, so648+ // post that never showed it leaves the stored sound alone.
682- // a missing `sound` with `density` present means off. A post without `density` (an older649+ let posted_sound = match (&form.sound_shown, &form.sound) {
683- // form, or the parts that save alone) leaves the stored sound alone.
684- let posted_sound = match (&form.density, &form.sound) {
685 (Some(_), None) => Some("off"),650 (Some(_), None) => Some("off"),
686 (_, Some(value)) => Some(value.as_str()),651 (_, Some(value)) => Some(value.as_str()),
687 (None, None) => None,652 (None, None) => None,
@@ -691,9 +656,6 @@ async fn appearance_save(cx: &Cx, Form(form): Form<AppearanceForm>) -> Result<Se
691 .set_ui_prefs(&user.id, &form.theme, &form.language)656 .set_ui_prefs(&user.id, &form.theme, &form.language)
692 .await?;657 .await?;
693 store.set_sidebar_side(&user.id, &sidebar_side).await?;658 store.set_sidebar_side(&user.id, &sidebar_side).await?;
694- if let Some(value) = &density {
695- store.set_user_pref(&user.id, DENSITY, value).await?;
696- }
697 if let Some(value) = &sound {659 if let Some(value) = &sound {
698 store.set_user_pref(&user.id, SOUND, value).await?;660 store.set_user_pref(&user.id, SOUND, value).await?;
699 }661 }
@@ -724,7 +686,6 @@ async fn appearance_save(cx: &Cx, Form(form): Form<AppearanceForm>) -> Result<Se
724 "base_light": base_light,686 "base_light": base_light,
725 "base_dark": base_dark,687 "base_dark": base_dark,
726 "sidebar_side": sidebar_side,688 "sidebar_side": sidebar_side,
727- "density": density,
728 "sound": sound,689 "sound": sound,
729 }),690 }),
730 )691 )
crates/forge-web/src/prune.rsmodified+50 -2
@@ -1,8 +1,10 @@
1 //! Removes overwritten and deleted history. Pages stop serving such a hash at once; this deletes1 //! Removes overwritten and deleted history. Pages stop serving such a hash at once; this deletes
2 //! the objects themselves, one repo at a time, once the grace period has passed.2 //! the objects themselves, one repo at a time, once the grace period has passed.
3 3
4+use std::path::Path;
4 use std::time::{Duration, SystemTime};5 use std::time::{Duration, SystemTime};
5 6
7+use forge_git::browse::reachable_commits;
6 use forge_git::maintenance::{PRUNE_AFTER_GRACE, prune_due, prune_unreachable};8 use forge_git::maintenance::{PRUNE_AFTER_GRACE, prune_due, prune_unreachable};
7 use tokio::time::MissedTickBehavior;9 use tokio::time::MissedTickBehavior;
8 10
@@ -40,8 +42,54 @@ async fn sweep(state: &AppState) {
40 if !dir.is_dir() || !prune_due(&dir, SystemTime::now()) {42 if !dir.is_dir() || !prune_due(&dir, SystemTime::now()) {
41 continue;43 continue;
42 }44 }
43- if let Err(e) = prune_unreachable(&state.git, &dir, PRUNE_AFTER_GRACE).await {45+ match prune_unreachable(&state.git, &dir, PRUNE_AFTER_GRACE).await {
44- tracing::error!(error = %e, repo_id = %id, "prune failed");46+ Ok(()) => {
47+ // Prunes the standby soon. Does nothing when replication is off.
48+ crate::replication::enqueue_repo(state, &id);
49+ blank_unreachable_messages(state, &id, &dir).await;
50+ }
51+ Err(e) => tracing::error!(error = %e, repo_id = %id, "prune failed"),
45 }52 }
46 }53 }
47 }54 }
55+
56+/// Blanks the stored message of each co-authored commit the prune made unreachable. The rows stay,
57+/// so contribution counts do not change. Errors are logged; the prune itself already succeeded.
58+async fn blank_unreachable_messages(state: &AppState, repo_id: &str, dir: &Path) {
59+ if let Err(e) = blank_unreachable_inner(state, repo_id, dir).await {
60+ tracing::error!(error = %e, repo_id = %repo_id, "prune: blanking commit messages failed");
61+ }
62+}
63+
64+async fn blank_unreachable_inner(
65+ state: &AppState,
66+ repo_id: &str,
67+ dir: &Path,
68+) -> Result<(), String> {
69+ let oids = state
70+ .store
71+ .coauthored_oids(repo_id)
72+ .await
73+ .map_err(|e| e.to_string())?;
74+ if oids.is_empty() {
75+ return Ok(());
76+ }
77+ let repo = dir.to_path_buf();
78+ let check = oids.clone();
79+ let reachable = tokio::task::spawn_blocking(move || reachable_commits(&repo, &check))
80+ .await
81+ .map_err(|e| e.to_string())?
82+ .map_err(|e| e.to_string())?;
83+ let gone: Vec<String> = oids
84+ .into_iter()
85+ .filter(|oid| !reachable.contains(oid))
86+ .collect();
87+ if gone.is_empty() {
88+ return Ok(());
89+ }
90+ state
91+ .store
92+ .blank_coauthored(repo_id, &gone)
93+ .await
94+ .map_err(|e| e.to_string())
95+}
crates/forge-web/src/render/highlight.rsmodified+63 -7
@@ -22,6 +22,10 @@ const MAX_LINES: usize = 20_000;
22 const CLASS_PREFIX: &str = "hl-";22 const CLASS_PREFIX: &str = "hl-";
23 const LIGHT_THEME: &str = "InspiredGitHub";23 const LIGHT_THEME: &str = "InspiredGitHub";
24 const DARK_THEME: &str = "base16-ocean.dark";24 const DARK_THEME: &str = "base16-ocean.dark";
25+/// Scope for the light rules when the page has no explicit theme.
26+const LIGHT_WHEN_AUTO: &str = ":root:not([data-theme=\"dark\"])";
27+/// Scope for the light rules when the user picked the light theme.
28+const LIGHT_WHEN_FORCED: &str = ":root[data-theme=\"light\"]";
25 /// Scope for the dark rules when the page has no explicit theme.29 /// Scope for the dark rules when the page has no explicit theme.
26 const DARK_WHEN_AUTO: &str = ":root:not([data-theme=\"light\"])";30 const DARK_WHEN_AUTO: &str = ":root:not([data-theme=\"light\"])";
27 /// Scope for the dark rules when the user picked the dark theme.31 /// Scope for the dark rules when the user picked the dark theme.
@@ -120,19 +124,72 @@ fn build_css() -> String {
120 .themes124 .themes
121 .get(DARK_THEME)125 .get(DARK_THEME)
122 .expect("syntect default theme base16-ocean.dark is present");126 .expect("syntect default theme base16-ocean.dark is present");
123- let light_css = css_for_theme_with_class_style(light, class_style())127+ let light_css = readable_on_light(
124- .expect("generating CSS for the light theme");128+ &css_for_theme_with_class_style(light, class_style())
129+ .expect("generating CSS for the light theme"),
130+ );
125 let dark_css = css_for_theme_with_class_style(dark, class_style())131 let dark_css = css_for_theme_with_class_style(dark, class_style())
126 .expect("generating CSS for the dark theme");132 .expect("generating CSS for the dark theme");
127- // The dark rules follow the page theme: the OS preference unless `data-theme="light"` is set,133+ // Each theme follows the page theme: the OS preference unless `data-theme` is set, and always
128- // and always when `data-theme="dark"` is set.134+ // when it is. The light rules are scoped too: a bare light rule with more classes would beat
135+ // a dark rule with fewer, and leave light colours on a dark page.
129 format!(136 format!(
130- "{light_css}\n@media (prefers-color-scheme: dark) {{\n{}}}\n{}",137+ "@media (prefers-color-scheme: light) {{
138+{}}}
139+{}
140+@media (prefers-color-scheme: dark) {{
141+{}}}
142+{}",
143+ scope_css(&light_css, LIGHT_WHEN_AUTO),
144+ scope_css(&light_css, LIGHT_WHEN_FORCED),
131 scope_css(&dark_css, DARK_WHEN_AUTO),145 scope_css(&dark_css, DARK_WHEN_AUTO),
132 scope_css(&dark_css, DARK_WHEN_FORCED),146 scope_css(&dark_css, DARK_WHEN_FORCED),
133 )147 )
134 }148 }
135 149
150+/// Darkens each text colour of the light theme until it reaches 4.5:1 on the light code background,
151+/// #EEF2EC. Some of InspiredGitHub's colours are too pale to read there.
152+fn readable_on_light(css: &str) -> String {
153+ const BACKGROUND_LUMINANCE: f32 = 0.875;
154+ let luminance = |rgb: [u8; 3]| {
155+ let [r, g, b] = rgb.map(|channel| {
156+ let c = f32::from(channel) / 255.0;
157+ if c <= 0.04045 {
158+ c / 12.92
159+ } else {
160+ ((c + 0.055) / 1.055).powf(2.4)
161+ }
162+ });
163+ 0.2126 * r + 0.7152 * g + 0.0722 * b
164+ };
165+ let mut out = String::with_capacity(css.len());
166+ for line in css.lines() {
167+ let hex = line
168+ .trim()
169+ .strip_prefix("color: #")
170+ .and_then(|rest| rest.strip_suffix(';'));
171+ let rgb = hex
172+ .filter(|hex| hex.len() == 6)
173+ .and_then(|hex| u32::from_str_radix(hex, 16).ok())
174+ .map(|value| value.to_be_bytes())
175+ .map(|[_, r, g, b]| [r, g, b]);
176+ match rgb {
177+ Some(mut rgb) => {
178+ while (BACKGROUND_LUMINANCE + 0.05) / (luminance(rgb) + 0.05) < 4.5 {
179+ rgb = rgb.map(|channel| (f32::from(channel) * 0.95) as u8);
180+ }
181+ let [r, g, b] = rgb;
182+ out.push_str(&format!(" color: #{r:02x}{g:02x}{b:02x};\n"));
183+ }
184+ None => {
185+ out.push_str(line);
186+ out.push('\n');
187+ }
188+ }
189+ }
190+ out
191+}
192+
136 /// Prefixes every selector in a syntect stylesheet with `scope`. syntect writes each rule as a193 /// Prefixes every selector in a syntect stylesheet with `scope`. syntect writes each rule as a
137 /// selector line ending in `{` (selectors separated by commas), then declarations, then `}`.194 /// selector line ending in `{` (selectors separated by commas), then declarations, then `}`.
138 fn scope_css(css: &str, scope: &str) -> String {195 fn scope_css(css: &str, scope: &str) -> String {
@@ -156,8 +213,7 @@ fn scope_css(css: &str, scope: &str) -> String {
156 out213 out
157 }214 }
158 215
159-/// CSS for the `hl-` classes: the light theme by default, and the dark theme216+/// CSS for the `hl-` classes: both themes, each scoped to the page theme it belongs to.
160-/// under `prefers-color-scheme: dark`.
161 pub fn highlight_css() -> String {217 pub fn highlight_css() -> String {
162 CSS.clone()218 CSS.clone()
163 }219 }
crates/forge-web/src/replication/worker.rsmodified+42 -0
@@ -14,6 +14,7 @@ use forge_core::store::replication::DB_SUBJECT;
14 use forge_core::store::snapshot::verify_snapshot;14 use forge_core::store::snapshot::verify_snapshot;
15 use forge_git::GitEnv;15 use forge_git::GitEnv;
16 use forge_git::backup::refs_checksum;16 use forge_git::backup::refs_checksum;
17+use forge_git::maintenance::{clear_standby_prune, standby_prune_due};
17 18
18 use super::{19 use super::{
19 KEEP_SNAPSHOTS, Layout, SshTransport, StandbyTransport, Target, is_snapshot_name, push_repo,20 KEEP_SNAPSHOTS, Layout, SshTransport, StandbyTransport, Target, is_snapshot_name, push_repo,
@@ -247,6 +248,17 @@ async fn replicate_dir<T: StandbyTransport>(
247 ));248 ));
248 }249 }
249 }250 }
251+ if standby_prune_due(local) {
252+ // The refs match and this worker is the only writer, so unreachable objects can go now.
253+ ctx.transport
254+ .run(&format!(
255+ "git -C {} gc --quiet --prune=now",
256+ sh_quote(remote)
257+ ))
258+ .await
259+ .map_err(|e| format!("standby prune failed: {e}"))?;
260+ clear_standby_prune(local);
261+ }
250 Ok(Some(local_sum))262 Ok(Some(local_sum))
251 }263 }
252 264
@@ -423,6 +435,7 @@ mod tests {
423 use forge_core::store::snapshot::verify_snapshot;435 use forge_core::store::snapshot::verify_snapshot;
424 use forge_git::GitEnv;436 use forge_git::GitEnv;
425 use forge_git::backup::refs_checksum;437 use forge_git::backup::refs_checksum;
438+ use forge_git::maintenance::{prune_unreachable, standby_prune_due};
426 439
427 use super::super::{Layout, LocalTransport, remote_refs_checksum};440 use super::super::{Layout, LocalTransport, remote_refs_checksum};
428 use super::{Ctx, ReconcileReport, reconcile_once, replicate_repo, ship_db};441 use super::{Ctx, ReconcileReport, reconcile_once, replicate_repo, ship_db};
@@ -544,6 +557,35 @@ mod tests {
544 );557 );
545 }558 }
546 559
560+ #[tokio::test]
561+ async fn a_force_update_removes_the_standby_copy_of_the_old_commit() {
562+ let f = fixture().await;
563+ replicate_repo(&f.ctx, &f.repo_id)
564+ .await
565+ .expect("first push");
566+ let old = plumbing(&f.local_repo, &["rev-parse", "refs/heads/main"]);
567+ commit_to(&f.local_repo, "refs/heads/main", "rewritten");
568+ prune_unreachable(&f.ctx.git, &f.local_repo, "--prune=now")
569+ .await
570+ .expect("local prune");
571+ assert!(standby_prune_due(&f.local_repo));
572+
573+ replicate_repo(&f.ctx, &f.repo_id)
574+ .await
575+ .expect("second push");
576+ let remote = f.ctx.layout.repo_dir(&f.repo_id).expect("remote dir");
577+ let found = std::process::Command::new("git")
578+ .arg(format!("--git-dir={remote}"))
579+ .args(["cat-file", "-e", &old])
580+ .status()
581+ .expect("cat-file");
582+ assert!(
583+ !found.success(),
584+ "the standby still holds the overwritten commit"
585+ );
586+ assert!(!standby_prune_due(&f.local_repo), "the mark is cleared");
587+ }
588+
547 #[tokio::test]589 #[tokio::test]
548 async fn a_failed_push_is_recorded_and_keeps_the_last_success() {590 async fn a_failed_push_is_recorded_and_keeps_the_last_success() {
549 let f = fixture().await;591 let f = fixture().await;
crates/forge-web/src/views/heatmap.rsmodified+28 -12
@@ -189,7 +189,8 @@ struct CellView {
189 /// One line of the selected day's list, with its strings ready for the view.189 /// One line of the selected day's list, with its strings ready for the view.
190 struct DayRow {190 struct DayRow {
191 before: String,191 before: String,
192- href: String,192+ /// None when the row has no page to open: a pruned commit, whose hash stays plain text.
193+ href: Option<String>,
193 link: String,194 link: String,
194 after: String,195 after: String,
195 updated: String,196 updated: String,
@@ -242,22 +243,25 @@ fn day_row(lang: Lang, item: &ContributionItem, now: i64) -> DayRow {
242 let repo = item_repo(item);243 let repo = item_repo(item);
243 let (before, after) = g::day_item_words(lang, item.kind, item_branch(item), &repo);244 let (before, after) = g::day_item_words(lang, item.kind, item_branch(item), &repo);
244 let (href, link) = match item.kind {245 let (href, link) = match item.kind {
245- ContributionKind::Push => (format!("/{repo}"), repo.clone()),246+ ContributionKind::Push => (Some(format!("/{repo}")), repo.clone()),
246 ContributionKind::Issue | ContributionKind::Comment => (247 ContributionKind::Issue | ContributionKind::Comment => (
247- format!("/{repo}/issues/{}", item.number),248+ Some(format!("/{repo}/issues/{}", item.number)),
248 format!("#{} {}", item.number, item.title),249 format!("#{} {}", item.number, item.title),
249 ),250 ),
250 ContributionKind::Pull => (251 ContributionKind::Pull => (
251- format!("/{repo}/pulls/{}", item.number),252+ Some(format!("/{repo}/pulls/{}", item.number)),
252 format!("#{} {}", item.number, item.title),253 format!("#{} {}", item.number, item.title),
253 ),254 ),
254 ContributionKind::CoAuthored => {255 ContributionKind::CoAuthored => {
255- let summary = if item.title.is_empty() {256+ // A pruned commit has its title blanked by the job that prunes it: keep the hash, unlinked.
256- item.commit.chars().take(7).collect()257+ if item.title.is_empty() {
258+ (None, item.commit.chars().take(7).collect())
257 } else {259 } else {
258- item.title.clone()260+ (
259- };261+ Some(format!("/{repo}/commit/{}", item.commit)),
260- (format!("/{repo}/commit/{}", item.commit), summary)262+ item.title.clone(),
263+ )
264+ }
261 }265 }
262 };266 };
263 DayRow {267 DayRow {
@@ -507,7 +511,11 @@ pub async fn contribution_calendar(
507 if entry.pushes.is_empty() {511 if entry.pushes.is_empty() {
508 <li>512 <li>
509 <span>(entry.row.before.as_str())</span>513 <span>(entry.row.before.as_str())</span>
510- <a href=(entry.row.href.as_str())>(entry.row.link.as_str())</a>514+ if let Some(href) = entry.row.href {
515+ <a href=(href.as_str())>(entry.row.link.as_str())</a>
516+ } else {
517+ <span>(entry.row.link.as_str())</span>
518+ }
511 <span>(entry.row.after.as_str())</span>519 <span>(entry.row.after.as_str())</span>
512 <time data-rel="true" datetime=(entry.row.updated.as_str())>(entry.row.relative.as_str())</time>520 <time data-rel="true" datetime=(entry.row.updated.as_str())>(entry.row.relative.as_str())</time>
513 </li>521 </li>
@@ -516,7 +524,11 @@ pub async fn contribution_calendar(
516 <details>524 <details>
517 <summary>525 <summary>
518 <span>(entry.row.before.as_str())</span>526 <span>(entry.row.before.as_str())</span>
519- <a href=(entry.row.href.as_str())>(entry.row.link.as_str())</a>527+ if let Some(href) = entry.row.href {
528+ <a href=(href.as_str())>(entry.row.link.as_str())</a>
529+ } else {
530+ <span>(entry.row.link.as_str())</span>
531+ }
520 <span>(entry.row.after.as_str())</span>532 <span>(entry.row.after.as_str())</span>
521 <time data-rel="true" datetime=(entry.row.updated.as_str())>(entry.row.relative.as_str())</time>533 <time data-rel="true" datetime=(entry.row.updated.as_str())>(entry.row.relative.as_str())</time>
522 </summary>534 </summary>
@@ -524,7 +536,11 @@ pub async fn contribution_calendar(
524 for push in entry.pushes.into_iter() {536 for push in entry.pushes.into_iter() {
525 <li>537 <li>
526 <span>(push.before.as_str())</span>538 <span>(push.before.as_str())</span>
527- <a href=(push.href.as_str())>(push.link.as_str())</a>539+ if let Some(href) = push.href {
540+ <a href=(href.as_str())>(push.link.as_str())</a>
541+ } else {
542+ <span>(push.link.as_str())</span>
543+ }
528 <span>(push.after.as_str())</span>544 <span>(push.after.as_str())</span>
529 <time data-rel="true" datetime=(push.updated.as_str())>(push.relative.as_str())</time>545 <time data-rel="true" datetime=(push.updated.as_str())>(push.relative.as_str())</time>
530 </li>546 </li>
crates/forge-web/src/views/mod.rsmodified+1 -2
@@ -513,7 +513,6 @@ pub async fn shell(
513 .as_ref()513 .as_ref()
514 .and_then(|p| p.get(CORNER_POS))514 .and_then(|p| p.get(CORNER_POS))
515 .and_then(|v| clean_pref(CORNER_POS, v).ok().flatten());515 .and_then(|v| clean_pref(CORNER_POS, v).ok().flatten());
516- let density_attr = crate::pages::settings_appearance::density_attr(prefs.as_ref());
517 let sound_attr = crate::pages::settings_appearance::sound_attr(prefs.as_ref());516 let sound_attr = crate::pages::settings_appearance::sound_attr(prefs.as_ref());
518 let banner_back = back.clone().unwrap_or_else(|| "/".to_owned());517 let banner_back = back.clone().unwrap_or_else(|| "/".to_owned());
519 let dismiss_label = crate::i18n::accounts::t(lang, crate::i18n::accounts::A::Dismiss);518 let dismiss_label = crate::i18n::accounts::t(lang, crate::i18n::accounts::A::Dismiss);
@@ -670,7 +669,7 @@ pub async fn shell(
670 });669 });
671 Ok(view! {670 Ok(view! {
672 <!DOCTYPE html>671 <!DOCTYPE html>
673- <html lang=(lang.code()) data-theme=(theme_attr) data-density=(density_attr) data-sound=(sound_attr)data-accent-light=(accent_light_id) data-accent-dark=(accent_dark_id) data-base-light=(base_light_id) data-base-dark=(base_dark_id) data-sidebar=(sidebar_side) data-rel-words=(rel_words_attr.as_str()) data-rel-now=(rel_now_attr.as_str())>672+ <html lang=(lang.code()) data-theme=(theme_attr) data-sound=(sound_attr)data-accent-light=(accent_light_id) data-accent-dark=(accent_dark_id) data-base-light=(base_light_id) data-base-dark=(base_dark_id) data-sidebar=(sidebar_side) data-rel-words=(rel_words_attr.as_str()) data-rel-now=(rel_now_attr.as_str())>
674 <head>673 <head>
675 <meta charset="utf-8">674 <meta charset="utf-8">
676 <meta name="viewport" content="width=device-width, initial-scale=1">675 <meta name="viewport" content="width=device-width, initial-scale=1">
crates/forge-web/src/views/review_thread.rsmodified+1 -1
@@ -411,7 +411,7 @@ async fn thread_comment(
411 Ok(view! {411 Ok(view! {
412 <article class="review-comment">412 <article class="review-comment">
413 <header class="review-comment-head">413 <header class="review-comment-head">
414- <a href=(profile.as_str())><img class="avatar avatar-sm" src=(avatar.as_str()) alt="" width="24" height="24"></a>414+ <a href=(profile.as_str()) aria-label=(login.as_str())><img class="avatar avatar-sm" src=(avatar.as_str()) alt="" width="24" height="24"></a>
415 <strong>user_link(shown: author.as_str(), login: login.as_str())</strong>415 <strong>user_link(shown: author.as_str(), login: login.as_str())</strong>
416 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>416 <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time>
417 if let Some(href) = history_href {417 if let Some(href) = history_href {
docs/architecture.mdmodified+2 -0
@@ -351,6 +351,8 @@ Written at boot by `write_managed_gitconfig()`. Keys:
351 351
352 A commit is served by hash only if `refs/heads/*`, `refs/tags/*` or `refs/pull/*` reaches it (`browse::resolve_commit`, `browse::commit_reachable`). Protocol v2 fetches any object that exists, so the objects are removed too: a force push, a moved tag or a deleted ref writes `forge-prune-due` in the bare repo, and the `prune` task runs `git gc --prune` once the mark is 15 minutes old. The grace period protects a push whose objects landed before its ref. Every repo is also pruned weekly, which covers mirrors and a fork's old pull heads.352 A commit is served by hash only if `refs/heads/*`, `refs/tags/*` or `refs/pull/*` reaches it (`browse::resolve_commit`, `browse::commit_reachable`). Protocol v2 fetches any object that exists, so the objects are removed too: a force push, a moved tag or a deleted ref writes `forge-prune-due` in the bare repo, and the `prune` task runs `git gc --prune` once the mark is 15 minutes old. The grace period protects a push whose objects landed before its ref. Every repo is also pruned weekly, which covers mirrors and a fork's old pull heads.
353 353
354+After a prune, the repo is queued for replication at once. The standby is passive and never prunes on its own, so the next push writes `forge-standby-prune-due` on the standby's side too, and the worker runs `git gc --prune=now` there once the refs match. Stored co-authored commit messages that the prune made unreachable are blanked. The rows stay, so contribution counts do not change.
355+
354 ### 7.3 Repo path layout356 ### 7.3 Repo path layout
355 357
356 `<data_dir>/repos/<id[0..2]>/<id[2..4]>/<id>.git`, where `<id>` is the lowercased ULID. Created with `git init --bare` through the builder. Renames are DB-only, because the path depends on the id, not the name.358 `<data_dir>/repos/<id[0..2]>/<id[2..4]>/<id>.git`, where `<id>` is the lowercased ULID. Created with `git init --bare` through the builder. Renames are DB-only, because the path depends on the id, not the name.
docs/backup.mdmodified+4 -0
@@ -21,6 +21,10 @@ What a set does **not** contain:
21 - **Release assets under `data_dir/blobs/`.** A set does not copy them. Back them up with the separate `rsync` step in "Release assets" below.21 - **Release assets under `data_dir/blobs/`.** A set does not copy them. Back them up with the separate `rsync` step in "Release assets" below.
22 - **Git LFS objects under `data_dir/lfs/`.** A set does not copy them either. The `lfs_objects` rows are in the set, so a restore without the files gives LFS pointers that cannot be downloaded. Back them up with the `rsync` step in "LFS objects" below.22 - **Git LFS objects under `data_dir/lfs/`.** A set does not copy them either. The `lfs_objects` rows are in the set, so a restore without the files gives LFS pointers that cannot be downloaded. Back them up with the `rsync` step in "LFS objects" below.
23 23
24+Deleted or overwritten history stays in old backup sets. A set holds whatever the repos held when it was made. Forge removes the history from the live server and the standby, but a set leaves backups only when your retention expires it. Plan retention with that in mind.
25+
26+A leaked secret must be rotated. Anyone who fetched it already has a copy, and deleting the commit does not change that.
27+
24 Files in a set are mode 0600 and directories are mode 0700. Treat every set as private data, because it contains the full contents of every repo and the password hashes of every user.28 Files in a set are mode 0600 and directories are mode 0700. Treat every set as private data, because it contains the full contents of every repo and the password hashes of every user.
25 29
26 A set is written under a `.partial-…` name and renamed into place only when it is complete. A crash never leaves something that looks like a finished backup.30 A set is written under a `.partial-…` name and renamed into place only when it is complete. A crash never leaves something that looks like a finished backup.
style/_account_admin.scssmodified+2 -1
@@ -5,7 +5,8 @@
5 align-items: center;5 align-items: center;
6 justify-content: space-between;6 justify-content: space-between;
7 gap: 12px;7 gap: 12px;
8- padding: 8px 16px;8+ margin-bottom: 16px;
9+ padding: 8px 40px;
9 background: var(--surface-2);10 background: var(--surface-2);
10 color: var(--text);11 color: var(--text);
11 border-bottom: 1px solid var(--border);12 border-bottom: 1px solid var(--border);
style/_density.scss → style/_appearance.scssrenamed+0 -42
@@ -1,43 +1,3 @@
1-// Row density: Comfortable (the default) or Compact. The shell puts `data-density="compact"` on
2-// <html> from the viewer's account (signed-out visitors: nav.js reads localStorage). Comfortable
3-// keeps every element's own padding. Compact sets four tokens, and the shared list, table and
4-// pane classes read them, so no page repeats the numbers.
5-
6-:root[data-density="compact"] {
7- --row-pad-y: 6px; // top and bottom padding of a list row
8- --cell-pad-y: 5px; // top and bottom padding of a table cell
9- --head-pad-y: 4px; // top and bottom padding of a table heading
10- --pane-pad: 12px; // padding of a card or a one-screen pane
11-}
12-
13-:root[data-density="compact"] {
14- .item,
15- .repo-item,
16- .notif-row,
17- .ci-row,
18- .runner-row,
19- .security-row {
20- padding-top: var(--row-pad-y);
21- padding-bottom: var(--row-pad-y);
22- }
23-
24- .table th,
25- .table td {
26- padding-top: var(--cell-pad-y);
27- padding-bottom: var(--cell-pad-y);
28- }
29-
30- .table th {
31- padding-top: var(--head-pad-y);
32- padding-bottom: var(--head-pad-y);
33- }
34-
35- .card,
36- .fit-pane {
37- padding: var(--pane-pad);
38- }
39-}
40-
41 // Appearance page layout. Below 1100px the parts stack: general controls, then the sound card, then1 // Appearance page layout. Below 1100px the parts stack: general controls, then the sound card, then
42 // the colours. From 1100px: general controls and the sound card on the left, colours on the right,2 // the colours. From 1100px: general controls and the sound card on the left, colours on the right,
43 // so the page fits one screen. The form is `display: contents` so its two blocks join this grid.3 // so the page fits one screen. The form is `display: contents` so its two blocks join this grid.
@@ -157,7 +117,6 @@
157 height: 16px;117 height: 16px;
158 border-radius: 50%;118 border-radius: 50%;
159 background: var(--surface);119 background: var(--surface);
160- transition: transform 0.15s ease;
161 }120 }
162 121
163 .sound-switch input:checked + .sound-track > .sound-knob {122 .sound-switch input:checked + .sound-track > .sound-knob {
@@ -171,6 +130,5 @@
171 130
172 @media (prefers-reduced-motion: reduce) {131 @media (prefers-reduced-motion: reduce) {
173 .sound-knob {132 .sound-knob {
174- transition: none;
175 }133 }
176 }134 }
style/_canvas_account.scssmodified+1 -1
@@ -103,7 +103,7 @@
103 .table.audit-table {103 .table.audit-table {
104 th,104 th,
105 td {105 td {
106- padding: 14px;106+ padding: 6px 14px;
107 }107 }
108 108
109 th:first-child,109 th:first-child,
style/_canvas_pull.scssmodified+1 -1
@@ -358,7 +358,7 @@
358 .pull-compose .pull-input {358 .pull-compose .pull-input {
359 flex: 1 1 auto;359 flex: 1 1 auto;
360 min-width: 0;360 min-width: 0;
361- height: 36px;361+ height: 32px;
362 padding: 0 12px;362 padding: 0 12px;
363 border: 0;363 border: 0;
364 border-radius: 7px;364 border-radius: 7px;
style/_canvas_repo.scssmodified+9 -16
@@ -65,7 +65,7 @@
65 z-index: 6;65 z-index: 6;
66 }66 }
67 67
68- // The branch is a mono label, not a pill or a button.68+ // The branch keeps its exact spelling: a name is never upper-cased.
69 .ref-select > summary {69 .ref-select > summary {
70 display: inline-flex;70 display: inline-flex;
71 align-items: center;71 align-items: center;
@@ -76,11 +76,9 @@
76 border: 0;76 border: 0;
77 box-shadow: none;77 box-shadow: none;
78 font-family: var(--mono);78 font-family: var(--mono);
79- font-size: 11px;79+ font-size: 13px;
80 font-weight: 500;80 font-weight: 500;
81- letter-spacing: 0.12em;81+ color: var(--text-2);
82- text-transform: uppercase;
83- color: var(--muted);
84 cursor: pointer;82 cursor: pointer;
85 list-style: none;83 list-style: none;
86 }84 }
@@ -125,7 +123,7 @@
125 white-space: nowrap;123 white-space: nowrap;
126 }124 }
127 125
128- // The go-to-file control is the small `t` tag at the right end; the words are for screen readers.126+ // The go-to-file control sits at the right end, named, with its key beside the name.
129 .finder-open {127 .finder-open {
130 position: relative;128 position: relative;
131 align-self: center;129 align-self: center;
@@ -145,12 +143,9 @@
145 }143 }
146 144
147 .finder-open .finder-label {145 .finder-open .finder-label {
148- position: absolute;146+ margin-right: 6px;
149- width: 1px;147+ font-family: var(--font);
150- height: 1px;148+ font-size: 12px;
151- overflow: hidden;
152- clip-path: inset(50%);
153- white-space: nowrap;
154 }149 }
155 150
156 .finder-open kbd {151 .finder-open kbd {
@@ -499,11 +494,9 @@
499 margin: 0;494 margin: 0;
500 padding-top: 2px;495 padding-top: 2px;
501 font-family: var(--mono);496 font-family: var(--mono);
502- font-size: 11px;497+ font-size: 12px;
503 font-weight: 500;498 font-weight: 500;
504- letter-spacing: 0.12em;499+ color: var(--text-2);
505- text-transform: uppercase;
506- color: var(--muted);
507 }500 }
508 501
509 .canvas-dock .history-bars {502 .canvas-dock .history-bars {
style/_heatmap.scssmodified+0 -1
@@ -291,7 +291,6 @@ a.cell {
291 border-right: 1.5px solid var(--muted);291 border-right: 1.5px solid var(--muted);
292 border-bottom: 1.5px solid var(--muted);292 border-bottom: 1.5px solid var(--muted);
293 transform: rotate(-45deg);293 transform: rotate(-45deg);
294- transition: transform 0.15s ease;
295 }294 }
296 }295 }
297 296
style/_kb_rerun.scssmodified+4 -6
@@ -12,7 +12,6 @@
12 right: 8px;12 right: 8px;
13 margin: 0;13 margin: 0;
14 opacity: 0;14 opacity: 0;
15- transition: opacity 120ms ease;
16 15
17 li:hover &,16 li:hover &,
18 li:focus-within &,17 li:focus-within &,
@@ -30,10 +29,10 @@ li:has(> .ci-row-rerun-form) .ci-row-title {
30 }29 }
31 30
32 .ci-row-rerun {31 .ci-row-rerun {
33- padding: 1px 8px;32+ height: 28px;
34- font-size: 0.75rem;33+ padding: 0 10px;
35- line-height: 1.5;34+ font-size: 13px;
36- color: var(--muted);35+ color: var(--text-2);
37 background: var(--surface);36 background: var(--surface);
38 border: 1px solid var(--border);37 border: 1px solid var(--border);
39 border-radius: var(--radius-md);38 border-radius: var(--radius-md);
@@ -47,6 +46,5 @@ li:has(> .ci-row-rerun-form) .ci-row-title {
47 46
48 @media (prefers-reduced-motion: reduce) {47 @media (prefers-reduced-motion: reduce) {
49 .ci-row-rerun-form {48 .ci-row-rerun-form {
50- transition: none;
51 }49 }
52 }50 }
style/_lang_issues.scssmodified+2 -2
@@ -75,7 +75,7 @@
75 button {75 button {
76 height: 32px;76 height: 32px;
77 padding: 0 10px;77 padding: 0 10px;
78- font-size: 13px;78+ font-size: 14px;
79 }79 }
80 }80 }
81 81
@@ -169,7 +169,7 @@
169 .issue-heading {169 .issue-heading {
170 overflow: hidden;170 overflow: hidden;
171 margin: 0;171 margin: 0;
172- font-size: 20px;172+ font-size: 24px;
173 line-height: 1.25;173 line-height: 1.25;
174 white-space: nowrap;174 white-space: nowrap;
175 text-overflow: ellipsis;175 text-overflow: ellipsis;
style/_language.scssmodified+2 -1
@@ -9,7 +9,8 @@
9 9
10 h1 {10 h1 {
11 margin: 0;11 margin: 0;
12- font-size: 20px;12+ font-size: 24px;
13+ font-weight: 700;
13 line-height: 1.2;14 line-height: 1.2;
14 }15 }
15 }16 }
style/_motion.scssmodified+0 -28
@@ -9,39 +9,12 @@ $ease-out: cubic-bezier(0.2, 0, 0, 1);
9 // A press sinks the button a little.9 // A press sinks the button a little.
10 .button,10 .button,
11 button {11 button {
12- transition: background-color 0.15s ease, scale 0.1s ease;
13 12
14 &:active:not(:disabled) {13 &:active:not(:disabled) {
15 scale: 0.97;14 scale: 0.97;
16 }15 }
17 }16 }
18 17
19-// A menu or popover the reader opens drops in from its summary.
20-details.pop[open] > :not(summary) {
21- animation: pop-in 0.14s $ease-out;
22-}
23-
24-@keyframes pop-in {
25- from {
26- opacity: 0;
27- translate: 0 -4px;
28- scale: 0.98;
29- }
30-}
31-
32-// The phone branch switcher is a sheet from the bottom: it rises instead.
33-@media (max-width: 600px) {
34- details.ref-select.pop[open] > .ref-menu {
35- animation: sheet-up 0.2s $ease-out;
36- }
37-}
38-
39-@keyframes sheet-up {
40- from {
41- translate: 0 100%;
42- }
43-}
44-
45 // A stepper's number flashes the accent when a click moves it.18 // A stepper's number flashes the accent when a click moves it.
46 input.tick {19 input.tick {
47 animation: tick 0.3s ease-out;20 animation: tick 0.3s ease-out;
@@ -56,7 +29,6 @@ input.tick {
56 @media (prefers-reduced-motion: reduce) {29 @media (prefers-reduced-motion: reduce) {
57 .button,30 .button,
58 button {31 button {
59- transition: none;
60 32
61 &:active:not(:disabled) {33 &:active:not(:disabled) {
62 scale: none;34 scale: none;
style/_needs.scssmodified+1 -1
@@ -18,7 +18,7 @@
18 padding: 10px 14px;18 padding: 10px 14px;
19 border-bottom: 1px solid var(--border);19 border-bottom: 1px solid var(--border);
20 font-family: var(--mono);20 font-family: var(--mono);
21- font-size: 12px;21+ font-size: 11px;
22 font-weight: 500;22 font-weight: 500;
23 letter-spacing: 0.04em;23 letter-spacing: 0.04em;
24 text-transform: uppercase;24 text-transform: uppercase;
style/_pull.scssmodified+3 -3
@@ -40,8 +40,9 @@
40 gap: 8px;40 gap: 8px;
41 padding: 10px 0 12px;41 padding: 10px 0 12px;
42 border-bottom: 0;42 border-bottom: 0;
43- color: var(--muted);43+ color: var(--text-2);
44- font-weight: 500;44+ font-size: 14px;
45+ font-weight: 400;
45 white-space: nowrap;46 white-space: nowrap;
46 47
47 &:hover {48 &:hover {
@@ -156,7 +157,6 @@
156 .issue-row {157 .issue-row {
157 padding: 14px 16px;158 padding: 14px 16px;
158 border-top-color: var(--border);159 border-top-color: var(--border);
159- transition: background 0.12s ease;
160 160
161 &:hover {161 &:hover {
162 background: var(--surface-2);162 background: var(--surface-2);
style/_repo.scssmodified+0 -4
@@ -864,7 +864,6 @@ html.tree-resizing .repo-split::before {
864 padding: 0 9px;864 padding: 0 9px;
865 border-radius: var(--radius-full);865 border-radius: var(--radius-full);
866 white-space: nowrap;866 white-space: nowrap;
867- transition: background-color 0.2s ease, box-shadow 0.2s ease;
868 867
869 > svg {868 > svg {
870 position: static;869 position: static;
@@ -886,7 +885,6 @@ html.tree-resizing .repo-split::before {
886 line-height: 1;885 line-height: 1;
887 white-space: nowrap;886 white-space: nowrap;
888 opacity: 0;887 opacity: 0;
889- transition: max-width 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
890 }888 }
891 889
892 input[type="radio"]:checked ~ span {890 input[type="radio"]:checked ~ span {
@@ -916,7 +914,6 @@ html.tree-resizing .repo-split::before {
916 @media (prefers-reduced-motion: reduce) {914 @media (prefers-reduced-motion: reduce) {
917 .segmented .segment,915 .segmented .segment,
918 .segmented .segment > span {916 .segmented .segment > span {
919- transition: none;
920 }917 }
921 }918 }
922 }919 }
@@ -1040,7 +1037,6 @@ html.tree-resizing .repo-split::before {
1040 1037
1041 .newrepo-chev {1038 .newrepo-chev {
1042 color: var(--muted);1039 color: var(--muted);
1043- transition: transform 0.15s ease;
1044 }1040 }
1045 1041
1046 &[open] .newrepo-chev {1042 &[open] .newrepo-chev {
style/_shell.scssmodified+0 -2
@@ -948,7 +948,6 @@ a.chip {
948 // Below 900px the panel steps aside while the reader scrolls down (nav.js sets corner-away): it fades948 // Below 900px the panel steps aside while the reader scrolls down (nav.js sets corner-away): it fades
949 // out and takes no pointer, so the page under it can be read and tapped. Reduced motion skips the fade.949 // out and takes no pointer, so the page under it can be read and tapped. Reduced motion skips the fade.
950 .corner-float {950 .corner-float {
951- transition: opacity 0.2s ease;
952 }951 }
953 952
954 .corner-float.corner-away {953 .corner-float.corner-away {
@@ -1249,7 +1248,6 @@ html[aria-busy="true"] body::before {
1249 }1248 }
1250 1249
1251 .corner-float {1250 .corner-float {
1252- transition: none;
1253 }1251 }
1254 1252
1255 .pill.hot .pill-dot,1253 .pill.hot .pill-dot,
style/_system.scssadded+653 -0
@@ -0,0 +1,653 @@
1+// The last word on the kinds that repeat on every page. A control, a chip, a section label and a tab
2+// each have one look, so moving between pages changes the content and nothing else.
3+
4+.button.small,
5+summary.button.small {
6+ height: 28px;
7+ padding: 0 10px;
8+ font-size: 13px;
9+}
10+
11+// Table rows are list rows: 36px.
12+.table th,
13+.table td {
14+ padding-top: 6px;
15+ padding-bottom: 6px;
16+ line-height: 23px;
17+}
18+
19+// Every menu, dropdown and popover is this one panel with these one rows. Pages reach the older
20+// panels with long selectors, so the panel's own look is forced here once.
21+:root {
22+ --pop-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
23+}
24+
25+:root[data-theme="light"] {
26+ --pop-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
27+}
28+
29+@media (prefers-color-scheme: light) {
30+ :root:not([data-theme="dark"]) {
31+ --pop-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
32+ }
33+}
34+
35+.menu-list,
36+.tab-more-list,
37+.list-more-menu,
38+.strip-list,
39+.corner-menu,
40+.ref-menu,
41+.pop-panel,
42+.confirm-pop,
43+.row-menu-panel,
44+.release-assets-pop,
45+.ci-tl-more > p,
46+.dock-expand > .dock-message,
47+details > .status-list {
48+ background: var(--surface) !important;
49+ border: 1px solid var(--border-strong) !important;
50+ border-radius: var(--radius-lg) !important;
51+ box-shadow: var(--pop-shadow) !important;
52+}
53+
54+.tab-more-list,
55+.list-more-menu,
56+.strip-list,
57+.corner-menu,
58+.menu-list:not(.ci-pop, .head-more-list, .watch-list) {
59+ padding: 6px !important;
60+}
61+
62+.tab-more-list > a,
63+.list-more-menu > a,
64+.strip-list a,
65+.corner-menu > a,
66+.corner-link,
67+.menu-list > a,
68+.menu-list > form > button:not(.primary),
69+.row-menu-panel > form > button,
70+.row-menu-panel > button,
71+.row-menu-panel > a {
72+ display: flex;
73+ align-items: center;
74+ justify-content: flex-start;
75+ width: 100%;
76+ height: 32px;
77+ box-sizing: border-box;
78+ padding: 0 10px;
79+ border: 0;
80+ border-radius: var(--radius-sm);
81+ background: transparent;
82+ color: var(--text);
83+ font-family: var(--font);
84+ font-size: 13px;
85+ font-weight: 400;
86+ text-decoration: none;
87+
88+ &:hover {
89+ background: var(--surface-2);
90+ color: var(--text);
91+ text-decoration: none;
92+ }
93+}
94+
95+.watch-menu > .menu-list {
96+ right: 0;
97+ left: auto;
98+}
99+
100+.watch-option {
101+ font-size: 13px;
102+}
103+
104+.pop-panel .button {
105+ font-family: var(--font);
106+}
107+
108+// Native form parts are drawn here, so a select or a tick is ours and not the browser's. The arrow
109+// is an inline image because a stylesheet may not reach other files through the content policy.
110+select:not([multiple], [size]:not([size="1"])) {
111+ appearance: none;
112+ padding-right: 30px;
113+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238b9499' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
114+ background-repeat: no-repeat;
115+ background-position: right 9px center;
116+ background-size: 14px;
117+}
118+
119+input[type="checkbox"] {
120+ position: relative;
121+ appearance: none;
122+ flex: none;
123+ border: 1px solid var(--border-strong);
124+ border-radius: 4px;
125+ background: var(--surface);
126+ cursor: pointer;
127+
128+ &:checked {
129+ border-color: var(--accent);
130+ background: var(--accent);
131+ }
132+
133+ &:checked::before {
134+ content: "";
135+ position: absolute;
136+ inset: 0;
137+ background: var(--accent-text);
138+ clip-path: polygon(22% 50%, 12% 62%, 42% 88%, 88% 28%, 76% 18%, 40% 66%);
139+ }
140+
141+ &:disabled {
142+ opacity: 0.5;
143+ cursor: not-allowed;
144+ }
145+}
146+
147+* {
148+ scrollbar-width: thin;
149+ scrollbar-color: var(--border-strong) transparent;
150+}
151+
152+// Labels: a soft tint of the label's own colour with a readable text, in both themes.
153+.label-chip {
154+ border: 0;
155+ background: color-mix(in oklab, var(--label, var(--muted)) 20%, transparent);
156+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--label, var(--muted)) 40%, transparent);
157+ color: color-mix(in oklab, var(--label, var(--muted)) 55%, var(--text));
158+}
159+
160+// An action repeated on every row of a list is quiet: red text and no box until it is pointed at.
161+main :is(li, tr) > form button.danger,
162+main :is(li, tr) > form > summary.danger,
163+main :is(li, tr) summary.button.small.danger,
164+main :is(li, tr) td button.danger {
165+ border-color: transparent;
166+ background: transparent;
167+
168+ &:hover {
169+ border-color: var(--danger);
170+ }
171+}
172+
173+// Lists page: the filter that is on is marked like any other selected control, not in accent.
174+.explore-sort a.current,
175+.explore-sort a[aria-current="page"],
176+.explore-sort .seg-item.active {
177+ background: var(--surface-2);
178+ color: var(--text);
179+}
180+
181+// A pane already has padding, so the empty text inside it adds none of its own.
182+.card > .empty-state,
183+.fit-pane > .empty-state,
184+.lang-list > .empty-state {
185+ padding: 14px;
186+}
187+
188+.card > .empty-state {
189+ padding: 8px 0;
190+}
191+
192+// When the form to add one sits right beside an empty list, a second button to it is noise.
193+main:has(.lang-side form, .fit-side form, .settings-main form, > .card form) .empty-state-action {
194+ display: none;
195+}
196+
197+.md-attach {
198+ color: var(--text-2);
199+ font-size: 13px;
200+}
201+
202+.snippet-form {
203+ width: 100%;
204+ max-width: none !important;
205+}
206+
207+.ci-scale {
208+ display: none;
209+}
210+
211+.ci-log:empty::before {
212+ content: attr(data-empty);
213+ color: var(--muted);
214+}
215+
216+// Sessions: one row each. What the row says about a session is on one line.
217+.session-pane .item {
218+ display: flex;
219+ align-items: center;
220+ gap: 12px;
221+ min-height: 36px;
222+ padding: 6px 0;
223+}
224+
225+.session-pane .item-main {
226+ display: flex;
227+ flex: 1 1 auto;
228+ flex-direction: row;
229+ align-items: center;
230+ gap: 12px;
231+ min-width: 0;
232+}
233+
234+.session-pane .item-main > a {
235+ flex: none;
236+}
237+
238+.session-pane .item-main > .badge {
239+ flex: none;
240+ align-self: center;
241+}
242+
243+.session-pane .item-main > .muted {
244+ overflow: hidden;
245+ white-space: nowrap;
246+ text-overflow: ellipsis;
247+}
248+
249+.card.fit-pane.session-pane {
250+ max-width: none;
251+}
252+
253+// Issue and pull sidebars: labels sit in two even columns, so the chips line up.
254+.issue-side-section form:has(> .issue-check) {
255+ display: grid;
256+ grid-template-columns: repeat(2, minmax(0, 1fr));
257+ gap: 6px 8px;
258+}
259+
260+.issue-check {
261+ min-width: 0;
262+}
263+
264+.issue-check > .label-chip {
265+ overflow: hidden;
266+ max-width: 100%;
267+ white-space: nowrap;
268+ text-overflow: ellipsis;
269+}
270+
271+.history-bars > a.hs-neutral {
272+ background: var(--border-strong);
273+
274+ &:hover {
275+ background: var(--text-2);
276+ }
277+}
278+
279+// File and folder icons draw in the text colour of the theme, on every list that shows them.
280+.kind-icon {
281+ flex: none;
282+ width: 14px;
283+ height: 14px;
284+ fill: none;
285+ stroke: currentColor;
286+ stroke-width: 1.8;
287+ stroke-linecap: round;
288+ stroke-linejoin: round;
289+ color: var(--muted);
290+
291+ &.is-dir {
292+ color: var(--text-2);
293+ }
294+}
295+
296+// A heading that names a part of a page is a label, wherever it sits.
297+.issue-sidebar h2,
298+main .card > h3,
299+.needs-head,
300+.profile-section-head h2 {
301+ @extend %mono-label;
302+}
303+
304+.profile-section-head a {
305+ font-family: var(--font);
306+ font-size: 13px;
307+ font-weight: 500;
308+ letter-spacing: 0;
309+ text-transform: none;
310+}
311+
312+main fieldset > legend {
313+ font-family: var(--mono) !important;
314+ font-size: 11px !important;
315+ font-weight: 500 !important;
316+ letter-spacing: 0.12em !important;
317+ text-transform: uppercase !important;
318+ color: var(--muted) !important;
319+}
320+
321+// In a form, a fieldset of one choice is one field: its legend reads like the labels beside it.
322+main .side-picker > legend {
323+ font-family: var(--font) !important;
324+ font-size: 14px !important;
325+ letter-spacing: 0 !important;
326+ text-transform: none !important;
327+ color: var(--text) !important;
328+}
329+
330+// Profile and organization tabs are the repo tabs.
331+.profile-tabs {
332+ gap: 22px;
333+}
334+
335+.tabs .tab,
336+.profile-tabs .tab {
337+ padding: 0;
338+ font-size: 14px;
339+ color: var(--text-2);
340+
341+ &.active,
342+ &[aria-current="page"] {
343+ color: var(--text);
344+ font-weight: 600;
345+ }
346+}
347+
348+// Fingers: controls grow to a size a thumb can hit, and text fields use 16px so a phone does not
349+// zoom the page when one takes focus.
350+@media (pointer: coarse), (max-width: 700px) {
351+ :root {
352+ --control-h: 40px;
353+ }
354+
355+ input:not([type="checkbox"], [type="radio"], [type="color"]),
356+ select,
357+ textarea {
358+ font-size: 16px;
359+ }
360+
361+ .button.small,
362+ summary.button.small {
363+ height: 36px;
364+ }
365+
366+ .wordmark,
367+ .tab-more-toggle,
368+ .md-attach {
369+ min-height: 36px;
370+ display: inline-flex;
371+ align-items: center;
372+ }
373+
374+ // Bars 2px wide cannot be tapped, and a phone has no room for them.
375+ .history-bars {
376+ display: none;
377+ }
378+}
379+
380+@media (max-width: 899px) {
381+ .site-banner {
382+ padding: 8px 16px;
383+ }
384+}
385+
386+@media (max-width: 700px) {
387+ // The floating profile corner must not sit over the end of a page.
388+ .shell-body > main {
389+ padding-bottom: 88px;
390+ }
391+
392+ // A list row keeps its title readable: the title on one line, what is known about it on the next.
393+ .issue-pane .issue-list > .issue-row {
394+ align-items: flex-start;
395+ height: auto;
396+ padding: 8px 14px;
397+
398+ > .issue-state {
399+ margin-top: 6px;
400+ }
401+
402+ > .issue-main {
403+ flex-direction: column;
404+ align-items: stretch;
405+ gap: 2px;
406+ }
407+
408+ > .issue-main > .issue-title-line {
409+ flex-wrap: wrap;
410+ overflow: visible;
411+ }
412+
413+ > .issue-main > .issue-title-line > .issue-title {
414+ white-space: normal;
415+ }
416+
417+ > .issue-main > .issue-meta {
418+ flex-wrap: wrap;
419+ margin-left: 0;
420+ padding-left: 0;
421+ }
422+
423+ > .issue-main > .issue-meta > span:first-child {
424+ width: auto;
425+ text-align: left;
426+ }
427+ }
428+
429+ .issue-pane > .issue-toolbar {
430+ flex-wrap: wrap;
431+ height: auto;
432+ min-height: 0;
433+ padding: 10px 14px;
434+
435+ > .issue-tabs {
436+ flex: 1 1 100%;
437+
438+ a {
439+ white-space: nowrap;
440+ }
441+ }
442+
443+ > .issue-search {
444+ flex: 1 1 100%;
445+
446+ input[type="search"],
447+ select {
448+ height: 40px;
449+ }
450+ }
451+
452+ > .issue-tools {
453+ margin-left: auto;
454+ }
455+ }
456+
457+ .ci-tl-headmain,
458+ .ci-tl-line,
459+ .ci-tl-meta {
460+ flex-wrap: wrap;
461+ min-width: 0;
462+ }
463+
464+ .ci-tl-title {
465+ white-space: normal;
466+ }
467+}
468+
469+// Settings and admin pages lay panes side by side, and the head spans that grid, which keeps two
470+// tracks open. A page with one pane takes both, and so does a filter with the list it filters.
471+@media (min-width: 900px) {
472+ .shell-site > .shell-body > main,
473+ .shell-site > .shell-body > main > [data-live] {
474+ > .card:not(.card ~ .card):not(:has(~ .card)),
475+ > .card:has(> .filter-bar),
476+ > .card:has(> .filter-bar) ~ .card {
477+ grid-column: 1 / -1;
478+ }
479+ }
480+}
481+
482+// A note inside a pane is a line of text, not a box in a box.
483+.card p.notice {
484+ padding: 0;
485+ background: none;
486+ border: 0;
487+ color: var(--text-2);
488+}
489+
490+// Create and Import share the page's one head row: the tabs follow the title and stand on its rule.
491+.page-head > .import-tabs {
492+ flex: 1 1 auto;
493+ align-self: stretch;
494+ flex-wrap: nowrap;
495+ max-width: none;
496+ margin: 0 0 0 16px;
497+ border-bottom: 0;
498+}
499+
500+.page-head > .import-tabs > .import-tab {
501+ display: inline-flex;
502+ align-items: center;
503+ margin-bottom: -1px;
504+ padding: 0 12px;
505+ font-size: 14px;
506+ font-weight: 400;
507+ color: var(--text-2);
508+}
509+
510+.page-head > .import-tabs > .import-tab[aria-current="page"] {
511+ color: var(--text);
512+}
513+
514+// Nothing has been imported yet: the form has the page to itself.
515+.import-home:not(:has(> .import-recent)) {
516+ grid-template-columns: minmax(0, 1fr);
517+}
518+
519+// Compare: both ends and the button on one row.
520+.compare-pick .filter-bar input {
521+ width: 20rem;
522+ max-width: 100%;
523+}
524+
525+// Export: its live wrapper is a stack of panes, under the head.
526+.shell-site > .shell-body > main > .export-page {
527+ display: flex;
528+ flex-direction: column;
529+ align-self: start;
530+}
531+
532+// The page column's rows start under the head and do not share out the window's height.
533+@media (min-width: 900px) {
534+ .shell-site > .shell-body > main {
535+ align-content: start;
536+ }
537+}
538+
539+// A folder with no README: the list is what the page is for, so it takes the width and its last
540+// commit column comes back.
541+@media (min-width: 900px) {
542+ .repo-home.canvas-repo.tree-browse:has(.canvas-body > .empty-state) {
543+ grid-template-columns: minmax(0, 1fr) 12px 280px;
544+
545+ .repo-split {
546+ visibility: hidden;
547+ }
548+
549+ .canvas-readme .canvas-head > :not(:last-child) {
550+ display: none;
551+ }
552+ }
553+}
554+
555+// Branch names keep their case.
556+.compare-detail > h2 code {
557+ text-transform: none;
558+ letter-spacing: 0;
559+}
560+
561+// The new issue form: labels are a row of the form, not a box in a pane.
562+.label-picker {
563+ padding: 0;
564+ border: 0;
565+}
566+
567+// Disclosure rows use the same chevron as every other menu, not the browser's triangle.
568+.checks-details > summary,
569+.commit-full-message > summary,
570+.ci-tl-more > summary {
571+ display: inline-flex;
572+ align-items: center;
573+ gap: 4px;
574+ list-style: none;
575+ cursor: pointer;
576+
577+ &::-webkit-details-marker {
578+ display: none;
579+ }
580+
581+ &::before {
582+ content: "";
583+ flex: none;
584+ width: 12px;
585+ height: 12px;
586+ background: currentColor;
587+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
588+ }
589+}
590+
591+.checks-details[open] > summary::before,
592+.commit-full-message[open] > summary::before,
593+.ci-tl-more[open] > summary::before {
594+ transform: rotate(180deg);
595+}
596+
597+.pull-compose-form > .btn {
598+ height: var(--control-h);
599+}
600+
601+// A select never pushes the page wider than the phone.
602+@media (max-width: 700px) {
603+ main select {
604+ max-width: 100%;
605+ }
606+
607+ main .issue-toolbar .issue-search {
608+ flex-wrap: wrap !important;
609+ max-width: 100%;
610+ }
611+
612+ main .issue-toolbar .issue-search > input[type="search"] {
613+ flex: 1 1 100% !important;
614+ width: 100%;
615+ }
616+
617+ // Table rows that stack on a phone keep their labels and values in two straight columns.
618+ main td[data-label] {
619+ width: auto !important;
620+ justify-content: flex-start !important;
621+ text-align: left;
622+
623+ > * {
624+ margin-left: 0;
625+ }
626+
627+ &::before {
628+ width: 6rem;
629+ }
630+
631+ &:empty {
632+ display: none;
633+ }
634+ }
635+
636+ // A session is its name and Revoke on one line, and its dates in full under them.
637+ .session-pane .item {
638+ flex-wrap: nowrap;
639+ align-items: flex-start;
640+ }
641+
642+ .session-pane .item-main {
643+ flex-wrap: wrap;
644+ gap: 2px 8px;
645+ }
646+
647+ .session-pane .item-main > .muted {
648+ order: 1;
649+ flex-basis: 100%;
650+ overflow: visible;
651+ white-space: normal;
652+ }
653+}
style/_timeline_ci.scssmodified+1 -2
@@ -123,7 +123,7 @@
123 .ci-state.ci-running,123 .ci-state.ci-running,
124 .ci-state.ci-queued,124 .ci-state.ci-queued,
125 .ci-state.ci-waiting_approval {125 .ci-state.ci-waiting_approval {
126- color: var(--accent);126+ color: var(--accent-ink);
127 font-weight: 600;127 font-weight: 600;
128 }128 }
129 129
@@ -500,7 +500,6 @@
500 @media (prefers-reduced-motion: reduce) {500 @media (prefers-reduced-motion: reduce) {
501 .ci-tl-job,501 .ci-tl-job,
502 .ci-tl-tab {502 .ci-tl-tab {
503- transition: none;
504 }503 }
505 }504 }
506 505
style/main.scssmodified+19 -21
@@ -124,10 +124,10 @@
124 // Radius scale: sm chips/badges, md every control (buttons, inputs, selects, textareas),124 // Radius scale: sm chips/badges, md every control (buttons, inputs, selects, textareas),
125 // lg cards and panels, full pills. Nested shapes never exceed their container.125 // lg cards and panels, full pills. Nested shapes never exceed their container.
126 --radius-sm: 6px;126 --radius-sm: 6px;
127- --radius-md: 8px;127+ --radius-md: 7px;
128- --radius-lg: 12px;128+ --radius-lg: 10px;
129 --radius-full: 999px;129 --radius-full: 999px;
130- --control-h: 36px;130+ --control-h: 32px;
131 --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;131 --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
132 // Page titles and major headings only (see _look.scss); body text stays on --font.132 // Page titles and major headings only (see _look.scss); body text stays on --font.
133 --display: "Archivo", var(--font);133 --display: "Archivo", var(--font);
@@ -428,8 +428,8 @@ button {
428 box-sizing: border-box;428 box-sizing: border-box;
429 padding: 0 14px;429 padding: 0 14px;
430 font: inherit;430 font: inherit;
431- font-size: 0.875rem;431+ font-size: 13px;
432- font-weight: 500;432+ font-weight: 600;
433 white-space: nowrap;433 white-space: nowrap;
434 border-radius: var(--radius-md);434 border-radius: var(--radius-md);
435 border: 1px solid var(--border-strong);435 border: 1px solid var(--border-strong);
@@ -576,6 +576,7 @@ input,
576 select,576 select,
577 textarea {577 textarea {
578 font: inherit;578 font: inherit;
579+ font-size: 14px;
579 color: var(--text);580 color: var(--text);
580 background: var(--surface);581 background: var(--surface);
581 border: 1px solid var(--border-strong);582 border: 1px solid var(--border-strong);
@@ -627,7 +628,7 @@ select {
627 height: var(--control-h);628 height: var(--control-h);
628 min-height: var(--control-h);629 min-height: var(--control-h);
629 padding: 0 12px;630 padding: 0 12px;
630- font-size: 1rem;631+ font-size: 14px;
631 line-height: 1.25rem;632 line-height: 1.25rem;
632 }633 }
633 634
@@ -661,7 +662,6 @@ select optgroup {
661 662
662 select:not([multiple]):not([size])::picker-icon {663 select:not([multiple]):not([size])::picker-icon {
663 color: var(--muted);664 color: var(--muted);
664- transition: rotate 0.2s ease;
665 }665 }
666 666
667 select:not([multiple]):not([size]):open::picker-icon {667 select:not([multiple]):not([size]):open::picker-icon {
@@ -1319,7 +1319,7 @@ code {
1319 .ref-count {1319 .ref-count {
1320 padding: 0 6px;1320 padding: 0 6px;
1321 font-family: var(--mono);1321 font-family: var(--mono);
1322- font-size: 10px;1322+ font-size: 11px;
1323 letter-spacing: 0;1323 letter-spacing: 0;
1324 line-height: 16px;1324 line-height: 16px;
1325 background: var(--surface-2);1325 background: var(--surface-2);
@@ -2727,7 +2727,7 @@ code {
2727 flex: none;2727 flex: none;
2728 box-sizing: border-box;2728 box-sizing: border-box;
2729 width: 96px;2729 width: 96px;
2730- height: 28px;2730+ height: var(--control-h);
2731 padding: 2px 8px;2731 padding: 2px 8px;
2732 border: 1px solid var(--border-strong);2732 border: 1px solid var(--border-strong);
2733 border-radius: var(--radius-sm);2733 border-radius: var(--radius-sm);
@@ -2919,7 +2919,6 @@ code {
2919 border-right: 2px solid var(--muted);2919 border-right: 2px solid var(--muted);
2920 border-bottom: 2px solid var(--muted);2920 border-bottom: 2px solid var(--muted);
2921 transform: rotate(45deg);2921 transform: rotate(45deg);
2922- transition: transform 0.15s ease;
2923 }2922 }
2924 2923
2925 &[open] > summary .rule-chevron {2924 &[open] > summary .rule-chevron {
@@ -3137,7 +3136,6 @@ code {
3137 border-radius: var(--radius-full);3136 border-radius: var(--radius-full);
3138 background: color-mix(in oklab, var(--text) 32%, var(--surface));3137 background: color-mix(in oklab, var(--text) 32%, var(--surface));
3139 cursor: pointer;3138 cursor: pointer;
3140- transition: background 0.15s ease;
3141 3139
3142 &::after {3140 &::after {
3143 content: "";3141 content: "";
@@ -3148,7 +3146,6 @@ code {
3148 height: 16px;3146 height: 16px;
3149 border-radius: 50%;3147 border-radius: 50%;
3150 background: var(--surface);3148 background: var(--surface);
3151- transition: transform 0.15s ease;
3152 }3149 }
3153 3150
3154 &:checked {3151 &:checked {
@@ -3214,8 +3211,9 @@ code {
3214 display: inline-block;3211 display: inline-block;
3215 padding: 2px 10px;3212 padding: 2px 10px;
3216 border-radius: var(--radius-full);3213 border-radius: var(--radius-full);
3217- font-size: 0.8125rem;3214+ font-size: 12px;
3218 font-weight: 600;3215 font-weight: 600;
3216+ line-height: 16px;
3219 text-decoration: none;3217 text-decoration: none;
3220 }3218 }
3221 3219
@@ -3525,9 +3523,9 @@ code {
3525 display: inline-block;3523 display: inline-block;
3526 padding: 0 0.6rem;3524 padding: 0 0.6rem;
3527 border-radius: var(--radius-full);3525 border-radius: var(--radius-full);
3528- font-size: 0.8rem;3526+ font-size: 12px;
3529 font-weight: 600;3527 font-weight: 600;
3530- line-height: 1.6;3528+ line-height: 16px;
3531 text-decoration: none;3529 text-decoration: none;
3532 }3530 }
3533 3531
@@ -4335,8 +4333,9 @@ span.reaction {
4335 4333
4336 .hook-state {4334 .hook-state {
4337 display: inline-block;4335 display: inline-block;
4338- font-size: 0.75rem;4336+ font-size: 12px;
4339 font-weight: 600;4337 font-weight: 600;
4338+ line-height: 16px;
4340 padding: 2px 8px;4339 padding: 2px 8px;
4341 border-radius: var(--radius-full);4340 border-radius: var(--radius-full);
4342 background: var(--private-bg);4341 background: var(--private-bg);
@@ -6162,7 +6161,6 @@ html.js form.runner-load[data-dirty-form][data-dirty] .runner-save {
6162 .ci-glink {6161 .ci-glink {
6163 color: var(--muted);6162 color: var(--muted);
6164 pointer-events: none;6163 pointer-events: none;
6165- transition: opacity 0.12s ease;
6166 6164
6167 &.ci-hot {6165 &.ci-hot {
6168 color: var(--accent);6166 color: var(--accent);
@@ -6190,7 +6188,6 @@ html.js form.runner-load[data-dirty-form][data-dirty] .runner-save {
6190 6188
6191 .ci-gbar,6189 .ci-gbar,
6192 .ci-glead {6190 .ci-glead {
6193- transition: opacity 0.12s ease;
6194 }6191 }
6195 6192
6196 // Hovering a job's box lights its connectors and the jobs it is linked with, and fades the rest.6193 // Hovering a job's box lights its connectors and the jobs it is linked with, and fades the rest.
@@ -6221,7 +6218,6 @@ html.js form.runner-load[data-dirty-form][data-dirty] .runner-save {
6221 .ci-glink,6218 .ci-glink,
6222 .ci-gbar,6219 .ci-gbar,
6223 .ci-glead {6220 .ci-glead {
6224- transition: none;
6225 }6221 }
6226 }6222 }
6227 6223
@@ -6452,7 +6448,6 @@ button.ci-job-last {
6452 border-right: 1.5px solid currentColor;6448 border-right: 1.5px solid currentColor;
6453 border-bottom: 1.5px solid currentColor;6449 border-bottom: 1.5px solid currentColor;
6454 transform: rotate(-45deg);6450 transform: rotate(-45deg);
6455- transition: transform 0.12s;
6456 6451
6457 [aria-expanded="true"] > & {6452 [aria-expanded="true"] > & {
6458 transform: rotate(45deg);6453 transform: rotate(45deg);
@@ -7918,6 +7913,8 @@ button.ci-job-last {
7918 }7913 }
7919 7914
7920 .context-chip {7915 .context-chip {
7916+ height: 28px;
7917+ font-size: 12px;
7921 padding: 2px 10px;7918 padding: 2px 10px;
7922 border: 1px solid var(--border);7919 border: 1px solid var(--border);
7923 border-radius: var(--radius-full);7920 border-radius: var(--radius-full);
@@ -8049,7 +8046,7 @@ button.ci-job-last {
8049 @import "repo_side";8046 @import "repo_side";
8050 @import "ci_estimate";8047 @import "ci_estimate";
8051 @import "timeline";8048 @import "timeline";
8052-@import "density";8049+@import "appearance";
8053 @import "keyboard";8050 @import "keyboard";
8054 @import "kb_rerun";8051 @import "kb_rerun";
8055 @import "review_flow";8052 @import "review_flow";
@@ -8081,3 +8078,4 @@ button.ci-job-last {
8081 @import "canvas_pull";8078 @import "canvas_pull";
8082 @import "canvas_detail";8079 @import "canvas_detail";
8083 @import "canvas_account";8080 @import "canvas_account";
8081+@import "system";