forge
Explore
Log in

Don't you dare go Hollow

Pages now match the approved design measure for measure: shell, panes, rows, labels and spacing across every page in dark and light, branch protection is a rule list beside an editor, labels are one line each with Delete inside Edit, server settings use the full width, and pages keep clear of the profile corner

Browse files at this commit

1e336175d33506ee971267bd61062c860044d0eaAhmet Kaan GümüşParent: 9011044
All checks have passed
Show checks
  • style
    • pages now match the approved design measure for measure: shell, panes, rows, labels and spacing across every page in dark and light, branch protection is a rule list beside an editor, labels are one line each with Delete inside Edit, server settings use the full width, and pages keep clear of the profile corner
  • feat
    • drag along the commit strip to preview the tree at an older commit, Back to latest or Escape returns
    • repository tabs that do not fit move to a menu
    • issue and pull sidebars apply labels through the server and show them pending until it answers
    • the repo bar shows the commit's author picture and opens the full message
  • fix
    • changing an issue's labels saved the opposite of what was picked
    • the commit strip's drag never started
    • repo owners see Delete again
  • refactor
    • page transitions and the row morph are removed, as is the dead CSS and code they left
Show full message
💄 style: pages now match the approved design measure for measure: shell, panes, rows, labels and spacing across every page in dark and light, branch protection is a rule list beside an editor, labels are one line each with Delete inside Edit, server settings use the full width, and pages keep clear of the profile corner; ✨ feat: drag along the commit strip to preview the tree at an older commit, Back to latest or Escape returns; repository tabs that do not fit move to a menu; issue and pull sidebars apply labels through the server and show them pending until it answers; the repo bar shows the commit's author picture and opens the full message; 🐛 fix: changing an issue's labels saved the opposite of what was picked; the commit strip's drag never started; repo owners see Delete again; ♻️ refactor: page transitions and the row morph are removed, as is the dead CSS and code they left

73 changed files +5716 -1642

crates/forge-web/assets/nav.jsmodified+487 -67
@@ -352,67 +352,6 @@
352 else { window.scrollTo(0, 0); }352 else { window.scrollTo(0, 0); }
353 }353 }
354 354
355- // Continuity: every navigation (a link, back or forward) is one calm View Transition. The top bar and
356- // the repo head stay still, the active tab slides to its new place, and the page body fades in. A link
357- // from a row also grows into the title of the page it opens: the row takes the name forge-row once the
358- // response has arrived, the new page's title takes it in the transition's update callback, where the
359- // swap runs. Names are on only for the transition: `html.is-navigating` in _continuity.scss, and the
360- // row's and title's own names are removed when it ends, since a duplicate name aborts a transition.
361- // Without the API or with reduced motion the swap runs as it always has. Live refreshes and form
362- // posts never animate.
363- var MORPH_NAME = 'forge-row';
364-
365- // The title a row grows into, by page: commit, issue and pull, CI run and job, a repo's title row,
366- // and the active tab for the Code tab, which has no title row. Most specific first: the first of
367- // these that is visible wins, not the first in the page, where the repo's title and tabs come first.
368- var TITLE_SELECTORS = ['.commit-summary-title', '.issue-heading', '.ci-tl-title', '.ci-job-title', '.repo-title', '.repo-tabs .tab.active'];
369-
370- function pageTitle() {
371- for (var i = 0; i < TITLE_SELECTORS.length; i++) {
372- var el = document.querySelector(TITLE_SELECTORS[i]);
373- var box = el ? el.getBoundingClientRect() : null;
374- if (box && box.width > 0 && box.height > 0) { return el; }
375- }
376- return null;
377- }
378-
379- function morph(row, run) {
380- if (!document.startViewTransition || motionHeld()) { run(); return undefined; }
381- var root = document.documentElement;
382- root.classList.add('is-navigating');
383- if (row) { row.style.viewTransitionName = MORPH_NAME; }
384- return new Promise(function (resolve, reject) {
385- var ran = false;
386- var title = null;
387- function update() {
388- if (ran) { return; }
389- ran = true;
390- // The old row leaves the page now, so its name goes with it.
391- if (row) { row.style.viewTransitionName = ''; }
392- try { run(); } catch (err) { reject(err); return; }
393- title = row ? pageTitle() : null;
394- if (title) { title.style.viewTransitionName = MORPH_NAME; }
395- resolve();
396- }
397- var transition;
398- try {
399- transition = document.startViewTransition(update);
400- } catch (err) {
401- update();
402- return;
403- }
404- // A skipped transition may never call its callback: the swap then runs here instead.
405- transition.ready.catch(function () { });
406- transition.updateCallbackDone.then(update, update);
407- var done = function () {
408- root.classList.remove('is-navigating');
409- if (row) { row.style.viewTransitionName = ''; }
410- if (title) { title.style.viewTransitionName = ''; }
411- };
412- transition.finished.then(done, done);
413- });
414- }
415-
416 // A live change keeps the reader's place in a diff. Before the swap: the first element marked355 // A live change keeps the reader's place in a diff. Before the swap: the first element marked
417 // data-keep-anchor (a diff file, keyed by its path) that is still at least partly in view, and356 // data-keep-anchor (a diff file, keyed by its path) that is still at least partly in view, and
418 // its offset from the top of the view. After the swap: the same key, moved so it sits at that357 // its offset from the top of the view. After the swap: the same key, moved so it sits at that
@@ -566,8 +505,6 @@
566 // Other parts of this file follow page changes through this event (list memory, say).505 // Other parts of this file follow page changes through this event (list memory, say).
567 document.dispatchEvent(new CustomEvent('forge:swapped', { detail: { how: how, url: dest } }));506 document.dispatchEvent(new CustomEvent('forge:swapped', { detail: { how: how, url: dest } }));
568 };507 };
569- // A navigation swaps inside its transition, and the load counts as done only after it.
570- if (how === 'nav' || how === 'pop') { return morph(o.morph, finish); }
571 finish();508 finish();
572 }).catch(function () {509 }).catch(function () {
573 if (mark !== latest || o.how === 'live') { return; }510 if (mark !== latest || o.how === 'live') { return; }
@@ -829,7 +766,7 @@
829 766
830 // Dropdown menus: the <details> that float over the page (avatar menu, branch selector, clone767 // Dropdown menus: the <details> that float over the page (avatar menu, branch selector, clone
831 // popover, section menu, profile corner). Inline disclosures are not listed: a click outside leaves them open.768 // popover, section menu, profile corner). Inline disclosures are not listed: a click outside leaves them open.
832- var DROPDOWN = 'details.menu, details.ref-select, details.clone, details.nav-toggle, details.corner, details.strip-runs';769+ var DROPDOWN = 'details.menu, details.ref-select, details.clone, details.nav-toggle, details.corner, details.strip-runs, details.dock-expand';
833 770
834 // Closes every open dropdown that does not contain `from` (pass null to close them all). A click771 // Closes every open dropdown that does not contain `from` (pass null to close them all). A click
835 // inside the floating corner keeps its own menu open.772 // inside the floating corner keeps its own menu open.
@@ -1599,9 +1536,7 @@
1599 return;1536 return;
1600 }1537 }
1601 saveScroll();1538 saveScroll();
1602- // The row the link sits in, if any: the page it opens grows out of that row (see morph).1539+ load({ target: withoutHash(url), dest: url, init: GET_INIT, how: 'nav', keep: false, post: false, form: null });
1603- var row = a.closest('nav, .repo-tabs, .pathbar, .topbar') ? null : a.closest('[data-kb-row], tbody tr, ul > li');
1604- load({ target: withoutHash(url), dest: url, init: GET_INIT, how: 'nav', keep: false, post: false, form: null, morph: row });
1605 }, true);1540 }, true);
1606 1541
1607 document.addEventListener('submit', function (e) {1542 document.addEventListener('submit', function (e) {
@@ -3315,6 +3250,9 @@
3315 load({ target: withoutHash(here), dest: here, init: GET_INIT, how: 'live', keep: true, post: false, form: null });3250 load({ target: withoutHash(here), dest: here, init: GET_INIT, how: 'live', keep: true, post: false, form: null });
3316 }3251 }
3317 3252
3253+ // The timeline scrub (its own section below) ends its preview by asking for the page again here.
3254+ document.addEventListener('forge:refresh', function () { refreshLive(true); });
3255+
3318 // A code view whose path is gone at the new ref keeps its page and shows one inline notice.3256 // A code view whose path is gone at the new ref keeps its page and shows one inline notice.
3319 function showGone() {3257 function showGone() {
3320 var bar = document.querySelector('[data-live-code]');3258 var bar = document.querySelector('[data-live-code]');
@@ -3384,6 +3322,7 @@
3384 3322
3385 function relUpdate() {3323 function relUpdate() {
3386 relTimer = null;3324 relTimer = null;
3325+ heatApply(); // heat as age: rows cool as the ticker runs (see heatApply below)
3387 var words = (document.documentElement.getAttribute('data-rel-words') || '').split('|');3326 var words = (document.documentElement.getAttribute('data-rel-words') || '').split('|');
3388 if (words.length < 21) { return; } // no wording from the server: nothing to re-word3327 if (words.length < 21) { return; } // no wording from the server: nothing to re-word
3389 var nowSec = (Date.now() + relSkew) / 1000;3328 var nowSec = (Date.now() + relSkew) / 1000;
@@ -4488,6 +4427,85 @@
4488 openPalette();4427 openPalette();
4489 });4428 });
4490 4429
4430+ // ---- issue sidebar: labels, milestone and assignees apply on their own ----
4431+ // A form marked data-apply has no Save button for scripts (its button sits in a noscript). Nothing
4432+ // shows as done here: the post goes through the soft path and the answer swaps the sidebar in place.
4433+ // Until then the part being sent is dimmed (is-pending) and the form takes no further input.
4434+ // A failed post clears that state and restores the controls to the page's own values.
4435+ function applyPost(form, data, marked) {
4436+ if (pending.has(form)) { return; }
4437+ var url = pageUrl(form.getAttribute('action') || location.href);
4438+ if (!url) { return; }
4439+ pending.add(form);
4440+ if (marked) { marked.classList.add('is-pending'); }
4441+ saveScroll();
4442+ load({
4443+ target: withoutHash(url),
4444+ dest: url,
4445+ init: { method: 'POST', headers: { accept: 'text/html' }, body: new URLSearchParams(data) },
4446+ how: 'post',
4447+ keep: true,
4448+ post: true,
4449+ form: form,
4450+ submitter: null
4451+ });
4452+ }
4453+
4454+ function applyForm(el) {
4455+ return el && el.form && el.form.hasAttribute('data-apply') ? el.form : null;
4456+ }
4457+
4458+ // A label checkbox. The browser flips a box before its click event and flips it back after
4459+ // preventDefault, so a FormData read here holds the set the reader asked for, and the box shows
4460+ // the old state until the server's answer swaps the sidebar.
4461+ document.addEventListener('click', function (e) {
4462+ var box = e.target && e.target.closest ? e.target.closest('form[data-apply] input[type="checkbox"]') : null;
4463+ if (!box) { return; }
4464+ e.preventDefault();
4465+ var form = box.form;
4466+ if (pending.has(form)) { return; }
4467+ applyPost(form, new FormData(form), box.closest('label'));
4468+ }, false);
4469+
4470+ // Milestone: one choice posts. The select is disabled while it is on the wire, so it is read first.
4471+ // Assignees: the text posts on blur after an edit, and on Enter.
4472+ document.addEventListener('change', function (e) {
4473+ var form = applyForm(e.target);
4474+ if (!form || e.target.tagName !== 'SELECT') {
4475+ if (form && e.target.type === 'text') { applyPost(form, new FormData(form), e.target.closest('.issue-side-section')); }
4476+ return;
4477+ }
4478+ if (pending.has(form)) { return; }
4479+ var data = new FormData(form);
4480+ var section = e.target.closest('.issue-side-section');
4481+ e.target.disabled = true;
4482+ applyPost(form, data, section);
4483+ if (!pending.has(form)) { e.target.disabled = false; }
4484+ }, false);
4485+
4486+ document.addEventListener('keydown', function (e) {
4487+ if (e.key !== 'Enter' || !e.target || e.target.type !== 'text') { return; }
4488+ var form = applyForm(e.target);
4489+ if (!form) { return; }
4490+ e.preventDefault();
4491+ applyPost(form, new FormData(form), e.target.closest('.issue-side-section'));
4492+ }, false);
4493+
4494+ // Any answer that is not a redirect to the page (a refusal, an outage): the sidebar shows its own
4495+ // values again. A success swapped the form out already, so this only touches what is still shown.
4496+ document.addEventListener('forge:submitted', function (e) {
4497+ var form = e.detail ? e.detail.form : null;
4498+ if (!form || !form.hasAttribute || !form.hasAttribute('data-apply') || e.detail.ok) { return; }
4499+ var section = form.closest('.issue-side-section');
4500+ if (section) { section.classList.remove('is-pending'); }
4501+ Array.prototype.forEach.call(form.querySelectorAll('.is-pending'), function (n) { n.classList.remove('is-pending'); });
4502+ Array.prototype.forEach.call(form.querySelectorAll('select'), function (s) {
4503+ s.disabled = false;
4504+ Array.prototype.forEach.call(s.options, function (o) { o.selected = o.defaultSelected; });
4505+ });
4506+ Array.prototype.forEach.call(form.querySelectorAll('input[type="text"]'), function (i) { i.value = i.defaultValue; });
4507+ });
4508+
4491 // Every relative time shows its exact moment on hover, in the reader's own time zone and language,4509 // Every relative time shows its exact moment on hover, in the reader's own time zone and language,
4492 // so one format holds across the site whatever title the server wrote.4510 // so one format holds across the site whatever title the server wrote.
4493 var relFormat = null, relLang = null;4511 var relFormat = null, relLang = null;
@@ -4507,6 +4525,298 @@
4507 if (el.getAttribute('title') !== exact) { el.setAttribute('title', exact); }4525 if (el.getAttribute('title') !== exact) { el.setAttribute('title', exact); }
4508 });4526 });
4509 }4527 }
4528+
4529+ // Heat as age (memory design/ALIVE.md). A row in a list (tree table, commit list, repo list,
4530+ // pinned cards) gets data-heat from the newest time[data-rel] inside it: 3 under an hour, 2 under
4531+ // a day, 1 under a week, and no attribute when older. It runs on load, after a swap, and from
4532+ // relUpdate (the ticker), so rows cool while the page is open. It sets attributes only.
4533+ function heatLevel(row, nowSec) {
4534+ var newest = NaN;
4535+ Array.prototype.forEach.call(row.querySelectorAll('time[data-rel][datetime]'), function (el) {
4536+ var at = Date.parse(el.getAttribute('datetime') || '');
4537+ if (!isNaN(at) && (isNaN(newest) || at > newest)) { newest = at; }
4538+ });
4539+ if (isNaN(newest)) { return 0; }
4540+ var age = nowSec - newest / 1000;
4541+ if (age < 3600) { return 3; }
4542+ if (age < 86400) { return 2; }
4543+ if (age < 604800) { return 1; }
4544+ return 0;
4545+ }
4546+
4547+ function heatApply() {
4548+ var nowSec = (Date.now() + relSkew) / 1000;
4549+ Array.prototype.forEach.call(document.querySelectorAll('.repo-main tbody tr, [data-kb-row], .repo-item, .pin-card'), function (row) {
4550+ var listed = row.matches('.repo-main tbody tr, .repo-item, .pin-card') || !!row.querySelector('.commit-summary');
4551+ if (!listed) { return; }
4552+ var level = heatLevel(row, nowSec);
4553+ if (level) {
4554+ if (row.getAttribute('data-heat') !== String(level)) { row.setAttribute('data-heat', String(level)); }
4555+ } else if (row.hasAttribute('data-heat')) {
4556+ row.removeAttribute('data-heat');
4557+ }
4558+ });
4559+ }
4560+
4561+ document.addEventListener('forge:swapped', heatApply);
4562+ if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', heatApply); } else { heatApply(); }
4563+})();
4564+
4565+// Timeline scrub: dragging across the repo home's commit strip previews the root listing and README at
4566+// that commit. A press that moves more than 4px is a scrub; a plain click still follows the bar's link,
4567+// and the click that ends a real drag is swallowed. A bar change waits 80ms, and each request aborts the
4568+// one before, so only the newest answer is shown. The answer's two wrappers are copied into the page
4569+// with replaceChildren, never innerHTML. The dock note says which commit is shown. Back to latest,
4570+// Escape, a live swap or any navigation ends the preview; Back to latest and Escape also ask the server
4571+// for the page again (forge:refresh), so the page is the truth. A failed request keeps the screen as it is.
4572+(function () {
4573+ 'use strict';
4574+ if (window.__forgeScrub) { return; }
4575+ window.__forgeScrub = true;
4576+
4577+ var DRAG_PX = 4;
4578+ var SETTLE_MS = 80;
4579+ var TEXT = {
4580+ en: { back: 'Back to latest', note: 'Not the latest commit' },
4581+ tr: { back: 'Son haline dön', note: 'En son commit değil' }
4582+ };
4583+
4584+ var drag = null; // the press in progress: { strip, id, x, y, on, bar }
4585+ var swallow = 0; // until this time the click that ends a real drag is swallowed
4586+ var timer = null; // the settle timer before the next request
4587+ var ctrl = null; // the AbortController of the request on the wire
4588+ var active = false; // a preview is on screen
4589+ var note = null; // the dock note while a preview is on screen
4590+
4591+ function lang() {
4592+ return (document.documentElement.getAttribute('lang') || '').toLowerCase().indexOf('tr') === 0 ? 'tr' : 'en';
4593+ }
4594+
4595+ function each(list, fn) { Array.prototype.forEach.call(list, fn); }
4596+
4597+ function barsOf(strip) { return Array.prototype.slice.call(strip.querySelectorAll('.hs-bar')); }
4598+
4599+ function stripOf(el) { return el && el.closest ? el.closest('.history-bars') : null; }
4600+
4601+ // The scrub is for the repo home only: its listing and README are the panes a preview replaces.
4602+ function listing() { return document.querySelector('.repo-home > .repo-main > .table-wrap'); }
4603+ function readmePane() { return document.querySelector('.repo-home > .repo-readme > .canvas-body'); }
4604+
4605+ // The bar whose span holds x, else the nearest one. Works while the pointer is captured.
4606+ function barAt(strip, x) {
4607+ var best = null;
4608+ var dist = Infinity;
4609+ var bars = barsOf(strip);
4610+ for (var i = 0; i < bars.length; i++) {
4611+ var box = bars[i].getBoundingClientRect();
4612+ if (x >= box.left && x <= box.right) { return bars[i]; }
4613+ var d = x < box.left ? box.left - x : x - box.right;
4614+ if (d < dist) { dist = d; best = bars[i]; }
4615+ }
4616+ return best;
4617+ }
4618+
4619+ function unmarkBars() {
4620+ each(document.querySelectorAll('.history-bars .hs-bar.is-scrubbed'), function (b) { b.classList.remove('is-scrubbed'); });
4621+ }
4622+
4623+ function clearMarks() {
4624+ each(document.querySelectorAll('.history-bars.is-scrubbing'), function (s) { s.classList.remove('is-scrubbing'); });
4625+ unmarkBars();
4626+ }
4627+
4628+ // The bar in the pointer's or the keys' place gets the mark at once; its request waits for the settle.
4629+ function pick(bar) {
4630+ unmarkBars();
4631+ bar.classList.add('is-scrubbed');
4632+ clearTimeout(timer);
4633+ timer = setTimeout(function () { timer = null; fetchBar(bar); }, SETTLE_MS);
4634+ }
4635+
4636+ // The request for a bar's commit: /{owner}/{repo}/scrub/{oid}, from the bar's commit link.
4637+ function scrubUrl(bar) {
4638+ var href = bar.getAttribute('href') || '';
4639+ var at = href.indexOf('/commit/');
4640+ var oid = bar.getAttribute('data-oid') || '';
4641+ if (at < 0 || !/^[0-9a-f]{40}$/.test(oid)) { return null; }
4642+ return href.slice(0, at) + '/scrub/' + oid;
4643+ }
4644+
4645+ function fetchBar(bar) {
4646+ var url = bar.isConnected ? scrubUrl(bar) : null;
4647+ if (!url || !listing()) { return; }
4648+ if (ctrl) { ctrl.abort(); }
4649+ var mine = new AbortController();
4650+ ctrl = mine;
4651+ fetch(url, { headers: { accept: 'text/html' }, credentials: 'same-origin', signal: mine.signal })
4652+ .then(function (r) {
4653+ if (!r.ok) { throw new Error('scrub ' + r.status); }
4654+ return r.text();
4655+ })
4656+ .then(function (text) {
4657+ if (mine !== ctrl) { return; }
4658+ ctrl = null;
4659+ show(text, bar.getAttribute('data-oid'));
4660+ })
4661+ .catch(function () {
4662+ // A stale request (aborted or replaced) says nothing. A failed one keeps what is on screen; with
4663+ // no preview up, the bar's mark goes, so no bar looks selected for a page that did not change.
4664+ if (mine !== ctrl) { return; }
4665+ ctrl = null;
4666+ if (!active) { clearMarks(); }
4667+ });
4668+ }
4669+
4670+ // Copies the children of a wrapper in the answer into the page, as imported nodes.
4671+ function copyOf(el) {
4672+ if (!el) { return []; }
4673+ return Array.prototype.map.call(el.childNodes, function (n) { return document.importNode(n, true); });
4674+ }
4675+
4676+ function show(text, oid) {
4677+ var wrap = listing();
4678+ var side = readmePane();
4679+ if (!wrap || !side) { return; }
4680+ var doc = new DOMParser().parseFromString(text, 'text/html');
4681+ var tree = doc.querySelector('[data-scrub-tree]');
4682+ if (!tree) { return; }
4683+ var when = Number(tree.getAttribute('data-scrub-when')) || 0;
4684+ var marker = document.createElement('p');
4685+ marker.className = 'label scrub-marker';
4686+ marker.textContent = TEXT[lang()].note;
4687+ wrap.replaceChildren(marker, ...copyOf(tree));
4688+ side.replaceChildren(...copyOf(doc.querySelector('[data-scrub-readme]')));
4689+ var home = document.querySelector('.repo-home');
4690+ if (home) { home.classList.add('is-scrub-preview'); }
4691+ active = true;
4692+ showNote(oid, when);
4693+ }
4694+
4695+ // Relative time of a unix time, in the page's language.
4696+ function relWhen(unix) {
4697+ var rtf = new Intl.RelativeTimeFormat(lang(), { numeric: 'auto' });
4698+ var diff = unix - Date.now() / 1000;
4699+ var steps = [['year', 31536000], ['month', 2592000], ['week', 604800], ['day', 86400], ['hour', 3600], ['minute', 60]];
4700+ for (var i = 0; i < steps.length; i++) {
4701+ if (Math.abs(diff) >= steps[i][1]) { return rtf.format(Math.round(diff / steps[i][1]), steps[i][0]); }
4702+ }
4703+ return rtf.format(Math.round(diff), 'second');
4704+ }
4705+
4706+ function showNote(oid, when) {
4707+ var dock = document.querySelector('.repo-dock .dock-info');
4708+ if (!dock) { return; }
4709+ if (!note) {
4710+ note = document.createElement('span');
4711+ note.className = 'scrub-note label';
4712+ note.setAttribute('role', 'status');
4713+ var sha = document.createElement('span');
4714+ sha.className = 'mono scrub-sha';
4715+ var age = document.createElement('span');
4716+ age.className = 'scrub-when';
4717+ var back = document.createElement('button');
4718+ back.type = 'button';
4719+ back.className = 'small scrub-back';
4720+ back.addEventListener('click', function () { endPreview(true); });
4721+ note.append(sha, ' · ', age, ' ', back);
4722+ dock.appendChild(note);
4723+ }
4724+ note.querySelector('.scrub-sha').textContent = oid.slice(0, 7);
4725+ note.querySelector('.scrub-when').textContent = relWhen(when);
4726+ note.querySelector('.scrub-back').textContent = TEXT[lang()].back;
4727+ }
4728+
4729+ // Ends the preview and drops everything it left behind. With `restore`, the page is fetched again
4730+ // through the live refresh, so the listing and README are the current ones.
4731+ function endPreview(restore) {
4732+ clearTimeout(timer);
4733+ timer = null;
4734+ if (ctrl) { var c = ctrl; ctrl = null; c.abort(); }
4735+ clearMarks();
4736+ var was = active;
4737+ active = false;
4738+ if (note) { note.remove(); note = null; }
4739+ var home = document.querySelector('.repo-home.is-scrub-preview');
4740+ if (home) { home.classList.remove('is-scrub-preview'); }
4741+ if (was && restore) { document.dispatchEvent(new CustomEvent('forge:refresh')); }
4742+ }
4743+
4744+ // Any swap (a live change, a link, back or forward) replaced the page the preview was on.
4745+ document.addEventListener('forge:swapped', function () {
4746+ drag = null;
4747+ endPreview(false);
4748+ });
4749+
4750+ // The bars are links, and a browser would start dragging the link and stop sending pointer moves.
4751+ document.addEventListener('dragstart', function (e) {
4752+ if (stripOf(e.target)) { e.preventDefault(); }
4753+ });
4754+
4755+ document.addEventListener('pointerdown', function (e) {
4756+ swallow = 0;
4757+ if (e.button !== 0 || !e.isPrimary) { return; }
4758+ var strip = stripOf(e.target);
4759+ if (!strip || !listing()) { return; }
4760+ drag = { strip: strip, id: e.pointerId, x: e.clientX, y: e.clientY, on: false, bar: null };
4761+ });
4762+
4763+ document.addEventListener('pointermove', function (e) {
4764+ if (!drag || e.pointerId !== drag.id) { return; }
4765+ if (!drag.on) {
4766+ var dx = e.clientX - drag.x;
4767+ var dy = e.clientY - drag.y;
4768+ if (Math.sqrt(dx * dx + dy * dy) <= DRAG_PX) { return; }
4769+ drag.on = true;
4770+ try { drag.strip.setPointerCapture(drag.id); } catch (err) { }
4771+ drag.strip.classList.add('is-scrubbing');
4772+ }
4773+ var bar = barAt(drag.strip, e.clientX);
4774+ if (bar && bar !== drag.bar) { drag.bar = bar; pick(bar); }
4775+ });
4776+
4777+ function release(e) {
4778+ if (!drag || e.pointerId !== drag.id) { return; }
4779+ var d = drag;
4780+ drag = null;
4781+ if (!d.on) { return; }
4782+ // The preview stays after the release. The click that ends the drag must not follow a bar's link.
4783+ swallow = Date.now() + 400;
4784+ try { d.strip.releasePointerCapture(d.id); } catch (err) { }
4785+ d.strip.classList.remove('is-scrubbing');
4786+ }
4787+ document.addEventListener('pointerup', release);
4788+ document.addEventListener('pointercancel', release);
4789+
4790+ window.addEventListener('click', function (e) {
4791+ if (Date.now() >= swallow) { return; }
4792+ swallow = 0;
4793+ e.preventDefault();
4794+ e.stopPropagation();
4795+ }, true);
4796+
4797+ // Left and Right on a focused bar move the preview one bar, older to the left.
4798+ document.addEventListener('keydown', function (e) {
4799+ if (e.key === 'Escape') {
4800+ if (!active || document.querySelector('dialog[open]')) { return; }
4801+ var t = e.target;
4802+ if (t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))) { return; }
4803+ endPreview(true);
4804+ return;
4805+ }
4806+ if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') { return; }
4807+ if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || !listing()) { return; }
4808+ var bar = e.target && e.target.closest ? e.target.closest('.history-bars .hs-bar') : null;
4809+ if (!bar) { return; }
4810+ var strip = stripOf(bar);
4811+ var bars = barsOf(strip);
4812+ var mark = strip.querySelector('.hs-bar.is-scrubbed');
4813+ var base = mark || bar;
4814+ var i = bars.indexOf(base) + (e.key === 'ArrowLeft' ? -1 : 1);
4815+ e.preventDefault();
4816+ if (i < 0 || i >= bars.length) { return; }
4817+ bars[i].focus({ preventScroll: true });
4818+ pick(bars[i]);
4819+ });
4510 })();4820 })();
4511 4821
4512 // Code browsing: line selection on blobs and blame, the permalink copy and `y` shortcut, the file4822 // Code browsing: line selection on blobs and blame, the permalink copy and `y` shortcut, the file
@@ -5790,3 +6100,113 @@
5790 }6100 }
5791 });6101 });
5792 })();6102 })();
6103+
6104+// ---- alive: arrivals, the live bar's breath, settling, the CI tab and the favicon --------------------
6105+// See memory design/ALIVE.md. The page as it was before each live swap is kept here. After a live swap,
6106+// a data-arrive value that was not there gets `arrived`, and a live `.hs-bar` (data-oid) that is no longer
6107+// live gets `hs-settle`; each class goes once its animation ends. The CI tab gets `tab-live` while a run
6108+// of this repo goes, and the favicon shows a dot then. Nothing moves under reduced motion.
6109+(function () {
6110+ 'use strict';
6111+
6112+ var still = window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;
6113+ var before = null; // { arrive: {value: true}, live: {oid: true} } of the page before the last swap
6114+ var pending = false;
6115+
6116+ function snapshot() {
6117+ var arrive = Object.create(null), live = Object.create(null);
6118+ Array.prototype.forEach.call(document.querySelectorAll('[data-arrive]'), function (el) { arrive[el.getAttribute('data-arrive')] = true; });
6119+ Array.prototype.forEach.call(document.querySelectorAll('.hs-bar.hs-live[data-oid]'), function (el) { live[el.getAttribute('data-oid')] = true; });
6120+ return { arrive: arrive, live: live };
6121+ }
6122+
6123+ // Adds the class and removes it when its animation ends (the element's own end, not a child's).
6124+ function flash(el, cls) {
6125+ var end = function (e) {
6126+ if (e.target !== el) { return; }
6127+ el.classList.remove(cls);
6128+ el.removeEventListener('animationend', end);
6129+ };
6130+ el.addEventListener('animationend', end);
6131+ el.classList.add(cls);
6132+ }
6133+
6134+ function afterLive(prev) {
6135+ if (still && still.matches) { return; }
6136+ Array.prototype.forEach.call(document.querySelectorAll('[data-arrive]'), function (el) {
6137+ if (!prev.arrive[el.getAttribute('data-arrive')]) { flash(el, 'arrived'); }
6138+ });
6139+ Array.prototype.forEach.call(document.querySelectorAll('.hs-bar[data-oid]'), function (el) {
6140+ if (prev.live[el.getAttribute('data-oid')] && !el.classList.contains('hs-live')) { flash(el, 'hs-settle'); }
6141+ });
6142+ }
6143+
6144+ // The favicon: the page's own link[rel~=icon], or one made here when the page has none. While a run goes
6145+ // it shows a stand-in forge mark with an accent dot; when idle the original is put back (a made link is removed).
6146+ var icon = null, iconMade = false, iconOrig = null, iconLive = false;
6147+
6148+ function liveIcon() {
6149+ var accent = getComputedStyle(document.documentElement).getPropertyValue('--accent').trim() || '#e5484d';
6150+ var svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">' +
6151+ '<rect width="32" height="32" rx="7" fill="#1b1d22"/>' +
6152+ '<circle cx="15" cy="16" r="9" fill="none" stroke="#e8e8e6" stroke-width="3"/>' +
6153+ '<circle cx="25" cy="7" r="5" fill="' + accent + '"/></svg>';
6154+ return 'data:image/svg+xml,' + encodeURIComponent(svg);
6155+ }
6156+
6157+ function setIcon(on) {
6158+ if (on === iconLive) { return; }
6159+ if (!icon) {
6160+ icon = document.querySelector('link[rel~="icon"]');
6161+ if (!icon) {
6162+ if (!on) { return; }
6163+ icon = document.createElement('link');
6164+ icon.rel = 'icon';
6165+ iconMade = true;
6166+ document.head.appendChild(icon);
6167+ }
6168+ iconOrig = icon.getAttribute('href');
6169+ }
6170+ iconLive = on;
6171+ if (on) { icon.setAttribute('href', liveIcon()); }
6172+ else if (iconMade) { icon.parentNode.removeChild(icon); icon = null; iconMade = false; }
6173+ else if (iconOrig !== null) { icon.setAttribute('href', iconOrig); }
6174+ }
6175+
6176+ // The CI tab's dot: a running pill of this repo in the top bar, or a live bar on the page. The strip's
6177+ // pill is redrawn by the activity poll, so the body's changes are watched too.
6178+ function syncLive() {
6179+ var tab = document.querySelector('.repo-tabs a[href$="/ci"]');
6180+ var base = tab ? tab.getAttribute('href') : '';
6181+ var going = false;
6182+ if (tab) {
6183+ going = !!document.querySelector('.hs-live') || Array.prototype.some.call(
6184+ document.querySelectorAll('.live-strip a.pill.hot, .live-strip .strip-list a.strip-row.hot'),
6185+ function (a) { return (a.getAttribute('href') || '').indexOf(base + '/') === 0; });
6186+ tab.classList.toggle('tab-live', going);
6187+ }
6188+ setIcon(going || !!document.querySelector('.ci-run .ci-state.ci-running'));
6189+ }
6190+
6191+ function queueSync() {
6192+ if (pending) { return; }
6193+ pending = true;
6194+ requestAnimationFrame(function () { pending = false; syncLive(); });
6195+ }
6196+
6197+ document.addEventListener('forge:swapped', function (e) {
6198+ var prev = before;
6199+ before = snapshot();
6200+ queueSync();
6201+ if (prev && e.detail && e.detail.how === 'live') { afterLive(prev); }
6202+ });
6203+
6204+ function init() {
6205+ before = snapshot();
6206+ syncLive();
6207+ new MutationObserver(queueSync).observe(document.body, { childList: true, subtree: true });
6208+ }
6209+
6210+ if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); }
6211+ else { init(); }
6212+})();
crates/forge-web/src/i18n/code.rsmodified+0 -20
@@ -39,10 +39,8 @@ pub enum K {
39 HadRecentPushes,39 HadRecentPushes,
40 CompareAndPr,40 CompareAndPr,
41 BranchLabel,41 BranchLabel,
42- NameHeader,
43 LastCommitHeader,42 LastCommitHeader,
44 AgeHeader,43 AgeHeader,
45- LatestCommitLabel,
46 KindDir,44 KindDir,
47 KindFile,45 KindFile,
48 KindExec,46 KindExec,
@@ -104,7 +102,6 @@ pub enum K {
104 FilteredTo,102 FilteredTo,
105 ClearFilter,103 ClearFilter,
106 NoCommits,104 NoCommits,
107- Committed,
108 BrowseFilesShort,105 BrowseFilesShort,
109 NewerLink,106 NewerLink,
110 OlderLink,107 OlderLink,
@@ -199,14 +196,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
199 (CompareAndPr, Tr) => "Karşılaştır ve çekme isteği aç",196 (CompareAndPr, Tr) => "Karşılaştır ve çekme isteği aç",
200 (BranchLabel, En) => "Branch",197 (BranchLabel, En) => "Branch",
201 (BranchLabel, Tr) => "Dal",198 (BranchLabel, Tr) => "Dal",
202- (NameHeader, En) => "Name",
203- (NameHeader, Tr) => "Ad",
204 (LastCommitHeader, En) => "Last commit",199 (LastCommitHeader, En) => "Last commit",
205 (LastCommitHeader, Tr) => "Son commit",200 (LastCommitHeader, Tr) => "Son commit",
206 (AgeHeader, En) => "Age",201 (AgeHeader, En) => "Age",
207 (AgeHeader, Tr) => "Zaman",202 (AgeHeader, Tr) => "Zaman",
208- (LatestCommitLabel, En) => "Latest commit",
209- (LatestCommitLabel, Tr) => "Son commit",
210 (KindDir, En) => "dir",203 (KindDir, En) => "dir",
211 (KindDir, Tr) => "dizin",204 (KindDir, Tr) => "dizin",
212 (KindFile, En) => "file",205 (KindFile, En) => "file",
@@ -329,8 +322,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
329 (ClearFilter, Tr) => "Filtreyi temizle",322 (ClearFilter, Tr) => "Filtreyi temizle",
330 (NoCommits, En) => "No commits yet. Push a branch and its history shows up here.",323 (NoCommits, En) => "No commits yet. Push a branch and its history shows up here.",
331 (NoCommits, Tr) => "Henüz commit yok. Bir dal gönderin, geçmişi burada görünsün.",324 (NoCommits, Tr) => "Henüz commit yok. Bir dal gönderin, geçmişi burada görünsün.",
332- (Committed, En) => "committed",
333- (Committed, Tr) => "commit etti",
334 (BrowseFilesShort, En) => "Browse files",325 (BrowseFilesShort, En) => "Browse files",
335 (BrowseFilesShort, Tr) => "Dosyalara göz at",326 (BrowseFilesShort, Tr) => "Dosyalara göz at",
336 (NewerLink, En) => "Newer",327 (NewerLink, En) => "Newer",
@@ -453,14 +444,6 @@ pub fn changed_files(lang: Lang, count: usize) -> String {
453 }444 }
454 }445 }
455 446
456-/// `N commits` in English (`1 commit` for one), `N commit` in Turkish.
457-pub fn commit_count(lang: Lang, count: u64) -> String {
458- match lang {
459- Lang::En => format!("{count} commit{}", if count == 1 { "" } else { "s" }),
460- Lang::Tr => format!("{count} commit"),
461- }
462-}
463-
464 /// The note that a diff stops at `max` files. `subject` names what the diff shows.447 /// The note that a diff stops at `max` files. `subject` names what the diff shows.
465 pub fn diff_truncated(lang: Lang, max: usize, subject: &str) -> String {448 pub fn diff_truncated(lang: Lang, max: usize, subject: &str) -> String {
466 match lang {449 match lang {
@@ -584,10 +567,8 @@ mod tests {
584 K::HadRecentPushes,567 K::HadRecentPushes,
585 K::CompareAndPr,568 K::CompareAndPr,
586 K::BranchLabel,569 K::BranchLabel,
587- K::NameHeader,
588 K::LastCommitHeader,570 K::LastCommitHeader,
589 K::AgeHeader,571 K::AgeHeader,
590- K::LatestCommitLabel,
591 K::KindDir,572 K::KindDir,
592 K::KindFile,573 K::KindFile,
593 K::KindExec,574 K::KindExec,
@@ -649,7 +630,6 @@ mod tests {
649 K::FilteredTo,630 K::FilteredTo,
650 K::ClearFilter,631 K::ClearFilter,
651 K::NoCommits,632 K::NoCommits,
652- K::Committed,
653 K::BrowseFilesShort,633 K::BrowseFilesShort,
654 K::NewerLink,634 K::NewerLink,
655 K::OlderLink,635 K::OlderLink,
crates/forge-web/src/pages/admin_server.rsmodified+2 -2
@@ -265,7 +265,7 @@ async fn server_view(
265 for r in rows.iter() {265 for r in rows.iter() {
266 <div class="srv-field">266 <div class="srv-field">
267 <div class="srv-head">267 <div class="srv-head">
268- <span class="srv-label">(r.label)</span>268+ <span class="srv-label" title=(r.label)>(r.label)</span>
269 <span class=(r.kind_class)>(r.kind_label)</span>269 <span class=(r.kind_class)>(r.kind_label)</span>
270 <span class="badge srv-source">(r.source_label)</span>270 <span class="badge srv-source">(r.source_label)</span>
271 if r.pending {271 if r.pending {
@@ -293,7 +293,7 @@ async fn server_view(
293 <input type="password" name=(r.key) autocomplete="new-password" maxlength="1024" aria-label=(r.label)>293 <input type="password" name=(r.key) autocomplete="new-password" maxlength="1024" aria-label=(r.label)>
294 <p class="muted small"><strong>(r.secret_state)</strong> ". " (g::t(lang, K::SrvSecretHint))</p>294 <p class="muted small"><strong>(r.secret_state)</strong> ". " (g::t(lang, K::SrvSecretHint))</p>
295 } else if r.fixed {295 } else if r.fixed {
296- <code class="srv-fixed">(r.value.as_str())</code>296+ <code class="srv-fixed" title=(r.value.as_str())>(r.value.as_str())</code>
297 } else {297 } else {
298 <input type="text" name=(r.key) value=(r.value.as_str()) maxlength="1024" autocomplete="off" aria-label=(r.label)>298 <input type="text" name=(r.key) value=(r.value.as_str()) maxlength="1024" autocomplete="off" aria-label=(r.label)>
299 }299 }
crates/forge-web/src/pages/blame.rsmodified+4 -4
@@ -117,11 +117,11 @@ async fn blame_table(rows: Vec<Row>, lang: Lang) -> Result<impl View> {
117 <a class="mono" href=(meta.commit_href.as_str())>(meta.short.as_str())</a>117 <a class="mono" href=(meta.commit_href.as_str())>(meta.short.as_str())</a>
118 <span class="blame-author">(meta.author.as_str())</span>118 <span class="blame-author">(meta.author.as_str())</span>
119 <time class="muted" data-rel="true" datetime=(meta.iso.as_str())>(meta.age.as_str())</time>119 <time class="muted" data-rel="true" datetime=(meta.iso.as_str())>(meta.age.as_str())</time>
120+ if let Some(prior) = meta.prior_href {
121+ <a class="blame-prior" href=(prior.as_str()) title=(b::t(lang, b::K::BlamePrior)) aria-label=(b::t(lang, b::K::BlamePrior))>"↶"</a>
122+ }
120 </div>123 </div>
121- <a class="blame-summary" href=(meta.commit_href.as_str()) title=(meta.summary.as_str())>commit_line(subject: meta.summary.clone(), no_tag: true)</a>124+ <a class="blame-summary" href=(meta.commit_href.as_str()) title=(meta.summary.as_str())>commit_line(subject: meta.summary.clone())</a>
122- if let Some(prior) = meta.prior_href {
123- <a class="blame-prior small" href=(prior.as_str())>(b::t(lang, b::K::BlamePrior))</a>
124- }
125 </td>125 </td>
126 }126 }
127 <td class="ln"><a href=(format!("#L{}", row.line.num))>(row.line.num.as_str())</a></td>127 <td class="ln"><a href=(format!("#L{}", row.line.num))>(row.line.num.as_str())</a></td>
crates/forge-web/src/pages/ci_job.rsmodified+51 -31
@@ -35,12 +35,13 @@ 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, duration_text, events_response, job_href, run_href,38+ age_text, can_write, changed_event, dock_bars, duration_text, events_response, job_href,
39- state_text, strip_ansi,39+ 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};
43 use crate::state::AppState;43 use crate::state::AppState;
44+use crate::views::timeline::{StripBar, history_strip};
44 use crate::views::{enc, human_size, shell};45 use crate::views::{enc, human_size, shell};
45 46
46 path_param!(owner);47 path_param!(owner);
@@ -375,6 +376,9 @@ async fn job_body(
375 truncated: bool,376 truncated: bool,
376 artifacts: Vec<ArtifactRow>,377 artifacts: Vec<ArtifactRow>,
377 live: String,378 live: String,
379+ owner: String,
380+ repo: String,
381+ bars: Vec<StripBar>,
378 ) -> Result<impl View> {382 ) -> Result<impl View> {
379 Ok(view! {383 Ok(view! {
380 repo_head(head: RepoHead { live: String::new(), ..head })384 repo_head(head: RepoHead { live: String::new(), ..head })
@@ -408,48 +412,61 @@ async fn job_body(
408 }412 }
409 </header>413 </header>
410 <div class="ci-tl-main">414 <div class="ci-tl-main">
411- <section class="card ci-tl-jobs">415+ <section class="ci-pane ci-tl-jobs">
412- if !job.started.is_empty() {416+ <h2 class="ci-tl-label">(crate::pages::passkeys::s(lang, "Details", "Ayrıntılar"))</h2>
413- <p class="muted small">(g::t(lang, K::Started)) " " <time datetime=(job.started_full.as_str()) data-rel="true" title=(full_date(job.started_full.as_str()))>(job.started.as_str())</time></p>417+ <div class="ci-tl-pad ci-tl-facts">
414- }418+ if !job.started.is_empty() {
415- if !job.finished.is_empty() {419+ <p class="muted small">(g::t(lang, K::Started)) " " <time datetime=(job.started_full.as_str()) data-rel="true" title=(full_date(job.started_full.as_str()))>(job.started.as_str())</time></p>
416- <p class="muted small">(g::t(lang, K::Finished)) " " <time datetime=(job.finished_full.as_str()) data-rel="true" title=(full_date(job.finished_full.as_str()))>(job.finished.as_str())</time></p>420+ }
417- }421+ if !job.finished.is_empty() {
418- if !job.message.is_empty() {422+ <p class="muted small">(g::t(lang, K::Finished)) " " <time datetime=(job.finished_full.as_str()) data-rel="true" title=(full_date(job.finished_full.as_str()))>(job.finished.as_str())</time></p>
419- <p>(job.message.as_str())</p>423+ }
420- }424+ if !job.message.is_empty() {
421- if let Some(kills) = job.oom_kills {425+ <p>(job.message.as_str())</p>
422- <p class="alert" title=(format!("oom_kill {kills}"))>(if matches!(lang, Lang::Tr) { "sonlandırıldı: bellek yetersiz" } else { "killed: out of memory" })</p>426+ }
423- }427+ if let Some(kills) = job.oom_kills {
428+ <p class="alert" title=(format!("oom_kill {kills}"))>(if matches!(lang, Lang::Tr) { "sonlandırıldı: bellek yetersiz" } else { "killed: out of memory" })</p>
429+ }
430+ </div>
424 if !artifacts.is_empty() {431 if !artifacts.is_empty() {
425- <p class="ci-tl-label">(g::t(lang, K::Artifacts))</p>432+ <h3 class="ci-tl-label ci-tl-pad">(g::t(lang, K::Artifacts))</h3>
426- <ul class="ci-artifacts">433+ <ul class="ci-artifacts ci-tl-pad">
427 for artifact in artifacts.iter() {434 for artifact in artifacts.iter() {
428 <li><a href=(artifact.href.as_str())>(artifact.name.as_str())</a> " (" (artifact.size.as_str()) ")"</li>435 <li><a href=(artifact.href.as_str())>(artifact.name.as_str())</a> " (" (artifact.size.as_str()) ")"</li>
429 }436 }
430 </ul>437 </ul>
431 }438 }
432 </section>439 </section>
433- <section class="card ci-tl-log">440+ <section class="ci-pane ci-tl-log">
434 <div class="ci-logbar ci-tl-logbar">441 <div class="ci-logbar ci-tl-logbar">
435- <span class="ci-tl-label">(g::t(lang, K::Log))</span>442+ <div class="ci-tl-tabs">
436- <input type="search" class="ci-logsearch" data-log-q="true" placeholder=(g::t(lang, K::LogSearch)) aria-label=(g::t(lang, K::LogSearch)) autocomplete="off" spellcheck="false">443+ <span class="ci-tl-label ci-tl-tab-log">(g::t(lang, K::Log))</span>
437- <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span>444+ </div>
438- <button type="button" class="ci-mini" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev)) title=(g::t(lang, K::LogPrev))>"\u{2191}"</button>445+ <div class="ci-tl-tools">
439- <button type="button" class="ci-mini" data-log-next="true" aria-label=(g::t(lang, K::LogNext)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button>446+ <input type="search" class="ci-logsearch" data-log-q="true" placeholder=(g::t(lang, K::LogSearch)) aria-label=(g::t(lang, K::LogSearch)) autocomplete="off" spellcheck="false">
440- <button type="button" class="ci-mini" data-copy-log=(job.log_href.as_str()) data-palette-action="click" data-copied=(g::t(lang, K::CopyDone)) data-failed=(g::t(lang, K::CopyFailed))>(g::t(lang, K::CopyLog))</button>447+ <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span>
441- <a class="ci-mini" href=(job.log_href.as_str())>(g::t(lang, K::FullLog))</a>448+ <button type="button" class="ci-mini" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev)) title=(g::t(lang, K::LogPrev))>"\u{2191}"</button>
442- <span class="ci-logfold" data-log-fold-box="true" hidden="hidden">449+ <button type="button" class="ci-mini" data-log-next="true" aria-label=(g::t(lang, K::LogNext)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button>
443- <button type="button" class="ci-mini" data-log-fold="close">(g::t(lang, K::LogCollapseAll))</button>450+ <button type="button" class="ci-mini" data-copy-log=(job.log_href.as_str()) data-palette-action="click" data-copied=(g::t(lang, K::CopyDone)) data-failed=(g::t(lang, K::CopyFailed))>(g::t(lang, K::CopyLog))</button>
444- <button type="button" class="ci-mini" data-log-fold="open">(g::t(lang, K::LogExpandAll))</button>451+ <a class="ci-mini" href=(job.log_href.as_str())>(g::t(lang, K::FullLog))</a>
445- </span>452+ <span class="ci-logfold" data-log-fold-box="true" hidden="hidden">
453+ <button type="button" class="ci-mini" data-log-fold="close">(g::t(lang, K::LogCollapseAll))</button>
454+ <button type="button" class="ci-mini" data-log-fold="open">(g::t(lang, K::LogExpandAll))</button>
455+ </span>
456+ </div>
446 </div>457 </div>
447 if truncated {458 if truncated {
448- <p class="muted small">(g::t(lang, K::LogTruncated))</p>459+ <p class="muted small ci-tl-pad">(g::t(lang, K::LogTruncated))</p>
449 }460 }
450 <pre class="ci-log ci-tl-code" data-live-log="true" data-offset=(log_offset.as_str()) data-first=(first_line.as_str())>(log.as_str())</pre>461 <pre class="ci-log ci-tl-code" data-live-log="true" data-offset=(log_offset.as_str()) data-first=(first_line.as_str())>(log.as_str())</pre>
451 </section>462 </section>
452 </div>463 </div>
464+ <section class="ci-pane ci-dock">
465+ <p class="ci-dock-note">(crate::pages::passkeys::s(lang, "bar height is lines changed", "çubuk yüksekliği değişen satır sayısıdır"))</p>
466+ <div class="dock-history">
467+ history_strip(lang: lang, owner: owner, repo: repo, bars: bars)
468+ </div>
469+ </section>
453 </div>470 </div>
454 })471 })
455 }472 }
@@ -538,11 +555,14 @@ async fn job_page(cx: &Cx) -> Result<impl View> {
538 },555 },
539 };556 };
540 let head = ctx.head(state, "ci").await?;557 let head = ctx.head(state, "ci").await?;
558+ let bars = dock_bars(state, &ctx).await;
559+ let dock_owner = ctx.repo.owner_name.clone();
560+ let dock_repo = ctx.repo.name.clone();
541 let page_title = format!("{title} \u{b7} CI \u{b7} {}", view.name);561 let page_title = format!("{title} \u{b7} CI \u{b7} {}", view.name);
542 Ok(view! {562 Ok(view! {
543 shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(),563 shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(),
544 job_body(head: head, lang: lang, job: view, log: log, log_offset: log_offset.to_string(), first_line: first_line.to_string(),564 job_body(head: head, lang: lang, job: view, log: log, log_offset: log_offset.to_string(), first_line: first_line.to_string(),
545- truncated: truncated, artifacts: artifacts, live: live))565+ truncated: truncated, artifacts: artifacts, live: live, owner: dock_owner, repo: dock_repo, bars: bars))
546 })566 })
547 }567 }
548 568
crates/forge-web/src/pages/ci_runs.rsmodified+194 -236
@@ -472,7 +472,6 @@ struct RunDetail {
472 472
473 /// The log pane of the run page: the selected job's name, its links and the tail of its log.473 /// The log pane of the run page: the selected job's name, its links and the tail of its log.
474 struct JobLog {474 struct JobLog {
475- name: String,
476 href: String,475 href: String,
477 log_href: String,476 log_href: String,
478 /// The job's event stream (plain lines) while the job is not finished; None once it is.477 /// The job's event stream (plain lines) while the job is not finished; None once it is.
@@ -1679,7 +1678,6 @@ async fn run_detail(
1679 } = log_tail(&log_path(&state.config.data_dir, &job.id)).await?;1678 } = log_tail(&log_path(&state.config.data_dir, &job.id)).await?;
1680 let href = job_href(title, &job.id);1679 let href = job_href(title, &job.id);
1681 Some(JobLog {1680 Some(JobLog {
1682- name: job.name.clone(),
1683 log_href: format!("{href}/log.txt"),1681 log_href: format!("{href}/log.txt"),
1684 live: (!job.state.is_terminal()).then(|| format!("{href}/events?plain=1")),1682 live: (!job.state.is_terminal()).then(|| format!("{href}/events?plain=1")),
1685 href,1683 href,
@@ -1913,73 +1911,13 @@ async fn runs_body(
1913 </nav>1911 </nav>
1914 }1912 }
1915 </section>1913 </section>
1916- <section class="card ci-main">1914+ <section class="ci-detail">
1917 if let Some(run) = detail {1915 if let Some(run) = detail {
1918- <header class="ci-tl-head" data-run=(run.number)>1916+ run_head(lang: lang, run: &run, all_href: None)
1919- <div class="ci-tl-headmain">1917+ <div class="ci-tl-main">
1920- <div class="ci-tl-line">1918+ run_jobs(lang: lang, run: &run)
1921- <span class="ci-tl-no">(g::t(lang, K::RunNumber)) (run.number)</span>1919+ run_log(lang: lang, run: &run, timeline: false)
1922- <h2 class="ci-tl-title">(headline(run.title.as_str()))</h2>1920+ </div>
1923- <details class="ci-tl-more">
1924- <summary>(crate::i18n::code::t(lang, crate::i18n::code::K::ShowFullMessage))</summary>
1925- <p class="small">(run.title.as_str())</p>
1926- </details>
1927- </div>
1928- <div class="ci-tl-meta">
1929- <span class=(run.state_class.as_str())>(run.state.as_str())</span>
1930- <span class="muted">(run.trigger.as_str()) " \u{b7} " (run.branch.as_str())</span>
1931- <a href=(run.commit_href.as_str())><code>(run.commit.as_str())</code></a>
1932- if !run.actor.is_empty() {
1933- <span class="muted">(run.actor.as_str())</span>
1934- }
1935- if !run.duration.is_empty() {
1936- if let Some(est) = run.est.as_ref() {
1937- <span class="ci-tl-dur" data-since=(run.since.as_deref()) data-expected=(est.expected.as_str()) data-left=(est.left.as_str()) data-over=(est.over.as_str()) data-lm=(est.minutes.as_str())>(run.duration.as_str())</span>
1938- } else {
1939- <span class="ci-tl-dur" data-since=(run.since.as_deref())>(run.duration.as_str())</span>
1940- }
1941- }
1942- <time class="muted" datetime=(run.when_at.as_str()) data-rel="true">(run.when.as_str())</time>
1943- </div>
1944- </div>
1945- if let Some(csrf) = run.writer_csrf.as_ref() {
1946- <div class="ci-actions ci-tl-actions">
1947- if run.can_approve {
1948- action_button(action: format!("{}/approve", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::ApproveAndRun))
1949- }
1950- if run.can_cancel && run.stopping {
1951- <button type="button" class="ci-stopping" disabled="disabled">(g::t(lang, K::StoppingButton))</button>
1952- } else if run.can_cancel {
1953- action_button(action: format!("{}/cancel", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Cancel))
1954- }
1955- if run.can_rerun_failed {
1956- action_button(action: format!("{}/rerun-failed", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::RerunFailed))
1957- }
1958- action_button(action: format!("{}/rerun", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Rerun))
1959- </div>
1960- }
1961- </header>
1962- if let Some(est) = run.est.as_ref() {
1963- <progress class="ci-est ci-est-run" max="100" value=(est.pct.as_str()) data-est="true" data-since=(run.since.as_deref()) data-expected=(est.expected.as_str())></progress>
1964- }
1965- if let Some(fail) = run.failing.clone() {
1966- fail_first_block(lang: lang, fail: fail)
1967- }
1968- if let Some(message) = run.config_error.as_ref() {
1969- <pre class="ci-config-error">(message.as_str())</pre>
1970- }
1971- if !run.warnings.is_empty() {
1972- <section class="ci-warnings" role="status">
1973- <p class="ci-warnings-title">(g::t(lang, K::ConfigWarnings))</p>
1974- <p class="muted small">(g::t(lang, K::ConfigWarningsHint))</p>
1975- <ul>
1976- for warning in run.warnings.iter() {
1977- <li><code>(warning.as_str())</code></li>
1978- }
1979- </ul>
1980- </section>
1981- }
1982- run_timeline(lang: lang, run: &run)
1983 } else {1921 } else {
1984 empty_state(title: g::t(lang, K::NoRunsYet), hint: Some(g::t(lang, K::NoRunsHint)))1922 empty_state(title: g::t(lang, K::NoRunsYet), hint: Some(g::t(lang, K::NoRunsHint)))
1985 }1923 }
@@ -2084,26 +2022,193 @@ async fn run_timeline(lang: Lang, run: &RunDetail) -> Result<impl View> {
2084 }2022 }
2085 </ul>2023 </ul>
2086 }2024 }
2087- if !run.artifacts.is_empty() {2025+ })
2088- <div class="ci-art-head">2026+}
2089- <h4 class="ci-art-title">(g::t(lang, K::Artifacts))</h4>2027+
2090- if let Some(href) = run.zip_href.as_ref() {2028+/// The head of a run: `Run #N` and the commit's first clause, the full message on demand, a meta line
2091- <a class="button ci-mini" href=(href.as_str()) download="">(g::t(lang, K::DownloadAll))</a>2029+/// (the state in accent while it is live) and at most two actions at the right. `all_href` adds the All
2092- }2030+/// runs link, which the run page needs; the list page has the runs beside it.
2093- </div>2031+#[component]
2094- <ul class="ci-art-list">2032+async fn run_head(lang: Lang, run: &RunDetail, all_href: Option<String>) -> Result<impl View> {
2095- for artifact in run.artifacts.iter() {2033+ Ok(view! {
2096- <li>2034+ <header class="ci-tl-head" data-run=(run.number)>
2097- <span class="ci-art-name">(artifact.name.as_str())</span>2035+ <div class="ci-tl-headmain">
2098- <span class="muted small">(artifact.job.as_str()) " \u{b7} " (artifact.size.as_str())</span>2036+ <div class="ci-tl-line">
2099- <a class="ci-art-dl" href=(artifact.href.as_str()) download="">(g::t(lang, K::Download))</a>2037+ <span class="ci-tl-no">(g::t(lang, K::RunNumber)) (run.number)</span>
2100- </li>2038+ <h2 class="ci-tl-title">(headline(run.title.as_str()))</h2>
2039+ <details class="ci-tl-more">
2040+ <summary>(crate::i18n::code::t(lang, crate::i18n::code::K::ShowFullMessage))</summary>
2041+ <p class="small">(run.title.as_str())</p>
2042+ </details>
2043+ </div>
2044+ <div class="ci-tl-meta">
2045+ <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>
2047+ <a href=(run.commit_href.as_str())><code>(run.commit.as_str())</code></a>
2048+ if !run.actor.is_empty() {
2049+ <span class="muted">(run.actor.as_str())</span>
2050+ }
2051+ if !run.duration.is_empty() {
2052+ if let Some(est) = run.est.as_ref() {
2053+ <span class="ci-tl-dur" data-since=(run.since.as_deref()) data-expected=(est.expected.as_str()) data-left=(est.left.as_str()) data-over=(est.over.as_str()) data-lm=(est.minutes.as_str())>(run.duration.as_str())</span>
2054+ } else {
2055+ <span class="ci-tl-dur" data-since=(run.since.as_deref())>(run.duration.as_str())</span>
2056+ }
2057+ }
2058+ <time class="muted" datetime=(run.when_at.as_str()) data-rel="true">(run.when.as_str())</time>
2059+ if let Some(href) = all_href {
2060+ <a class="small" href=(href.as_str())>(tl::t(lang, TK::AllRuns))</a>
2061+ }
2062+ </div>
2063+ if let Some(est) = run.est.as_ref() {
2064+ <progress class="ci-est ci-est-run" max="100" value=(est.pct.as_str()) data-est="true" data-since=(run.since.as_deref()) data-expected=(est.expected.as_str())></progress>
2065+ }
2066+ </div>
2067+ if let Some(csrf) = run.writer_csrf.as_ref() {
2068+ <div class="ci-actions ci-tl-actions">
2069+ if run.can_approve {
2070+ action_button(action: format!("{}/approve", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::ApproveAndRun))
2071+ }
2072+ if run.can_cancel && run.stopping {
2073+ <button type="button" class="ci-stopping" disabled="disabled">(g::t(lang, K::StoppingButton))</button>
2074+ } else if run.can_cancel {
2075+ action_button(action: format!("{}/cancel", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Cancel))
2076+ }
2077+ 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))
2079+ }
2080+ if !run.can_approve {
2081+ action_button(action: format!("{}/rerun", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Rerun))
2082+ }
2083+ </div>
2084+ }
2085+ </header>
2086+ })
2087+}
2088+
2089+/// The jobs pane (300 px): `Jobs`, one 36 px row per job with its dot, name, image and time at the right,
2090+/// then the run's artifacts. The selected job is the one the log shows.
2091+#[component]
2092+async fn run_jobs(lang: Lang, run: &RunDetail) -> Result<impl View> {
2093+ Ok(view! {
2094+ <section class="ci-pane ci-tl-jobs">
2095+ <h2 class="ci-tl-label">(g::t(lang, K::Jobs))</h2>
2096+ if run.jobs.is_empty() {
2097+ <p class="muted small ci-tl-pad">(g::t(lang, K::NoJobs))</p>
2098+ } else {
2099+ <ul class="ci-tl-list">
2100+ for job in run.jobs.iter() {
2101+ if let Some(group) = job.group.as_ref() {
2102+ <li class="ci-tl-group">(group.as_str())</li>
2103+ }
2104+ <li class=(job.sub.then_some("ci-tl-sub")) data-kb-row="">
2105+ <a class="ci-tl-job" href=(job.pick.as_str()) aria-current=(if job.selected { "true" } else { "false" })>
2106+ <span class=(job.dot.as_str())></span>
2107+ <span class="ci-tl-name">(job.name.as_str())</span>
2108+ if !job.detail.is_empty() {
2109+ <span class="ci-tl-tag">(job.detail.as_str())</span>
2110+ }
2111+ if job.stopping {
2112+ <span class="muted small">(g::t(lang, K::StateStopping))</span>
2113+ }
2114+ if job.duration.is_empty() {
2115+ <span class="ci-tl-dur muted">(g::t(lang, K::Waiting))</span>
2116+ } else {
2117+ <span class="ci-tl-dur" data-since=(job.since.as_deref())>(job.duration.as_str())</span>
2118+ }
2119+ </a>
2120+ </li>
2121+ }
2122+ </ul>
2123+ }
2124+ if !run.artifacts.is_empty() {
2125+ <div class="ci-tl-artline">
2126+ <h3 class="ci-tl-label">(g::t(lang, K::Artifacts))</h3>
2127+ if let Some(href) = run.zip_href.as_ref() {
2128+ <a class="button ci-mini" href=(href.as_str()) download="">(g::t(lang, K::DownloadAll))</a>
2129+ }
2130+ </div>
2131+ <ul class="ci-art-list">
2132+ for artifact in run.artifacts.iter() {
2133+ <li>
2134+ <span class="ci-art-name">(artifact.name.as_str())</span>
2135+ <span class="muted small">(artifact.job.as_str()) " \u{b7} " (artifact.size.as_str())</span>
2136+ <a class="ci-art-dl" href=(artifact.href.as_str()) download="">(g::t(lang, K::Download))</a>
2137+ </li>
2138+ }
2139+ </ul>
2140+ }
2141+ </section>
2142+ })
2143+}
2144+
2145+/// The log pane: a 48 px bar with the Log and Timeline tabs and the log's tools, then the selected job's
2146+/// log on `--bg` (or the config errors and the fail-first block above it). The timeline is the other tab.
2147+#[component]
2148+async fn run_log(lang: Lang, run: &RunDetail, timeline: bool) -> Result<impl View> {
2149+ Ok(view! {
2150+ <section class="ci-pane ci-tl-log">
2151+ <input type="radio" name="ci-view" id="ci-view-log" class="ci-tl-radio" checked=(if timeline { None } else { Some("checked") })>
2152+ <input type="radio" name="ci-view" id="ci-view-timeline" class="ci-tl-radio" checked=(if timeline { Some("checked") } else { None })>
2153+ <div class="ci-logbar ci-tl-logbar">
2154+ <div class="ci-tl-tabs">
2155+ <label for="ci-view-log" class="ci-tl-tab ci-tl-tab-log">(g::t(lang, K::Log))</label>
2156+ <label for="ci-view-timeline" class="ci-tl-tab ci-tl-tab-timeline">(g::t(lang, K::Timeline))</label>
2157+ </div>
2158+ if let Some(log) = run.log.as_ref() {
2159+ <div class="ci-tl-tools">
2160+ <input type="search" class="ci-logsearch" data-log-q="true" placeholder=(g::t(lang, K::LogSearch)) aria-label=(g::t(lang, K::LogSearch)) autocomplete="off" spellcheck="false">
2161+ <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span>
2162+ <button type="button" class="ci-mini" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev)) title=(g::t(lang, K::LogPrev))>"\u{2191}"</button>
2163+ <button type="button" class="ci-mini" data-log-next="true" aria-label=(g::t(lang, K::LogNext)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button>
2164+ <button type="button" class="ci-mini" data-copy-log=(log.log_href.as_str()) data-palette-action="click" data-copied=(g::t(lang, K::CopyDone)) data-failed=(g::t(lang, K::CopyFailed))>(g::t(lang, K::CopyLog))</button>
2165+ <a class="ci-mini" href=(log.href.as_str())>(g::t(lang, K::FullLog))</a>
2166+ if let (Some(action), Some(csrf)) = (log.rerun.as_ref(), run.writer_csrf.as_ref()) {
2167+ <form method="post" action=(action.as_str()) class="inline-form ci-job-rerun">
2168+ <input type="hidden" name="csrf" value=(csrf.as_str())>
2169+ <button type="submit" class="ci-mini">(crate::pages::passkeys::s(lang, "Re-run job", "İşi yeniden çalıştır"))</button>
2170+ </form>
2171+ }
2172+ <span class="ci-logfold" data-log-fold-box="true" hidden="hidden">
2173+ <button type="button" class="ci-mini" data-log-fold="close">(g::t(lang, K::LogCollapseAll))</button>
2174+ <button type="button" class="ci-mini" data-log-fold="open">(g::t(lang, K::LogExpandAll))</button>
2175+ </span>
2176+ </div>
2177+ }
2178+ </div>
2179+ <div class="ci-tl-panel ci-tl-panel-log">
2180+ if let Some(message) = run.config_error.as_ref() {
2181+ <pre class="ci-config-error">(message.as_str())</pre>
2182+ }
2183+ if !run.warnings.is_empty() {
2184+ <section class="ci-warnings" role="status">
2185+ <p class="ci-warnings-title">(g::t(lang, K::ConfigWarnings))</p>
2186+ <p class="muted small">(g::t(lang, K::ConfigWarningsHint))</p>
2187+ <ul>
2188+ for warning in run.warnings.iter() {
2189+ <li><code>(warning.as_str())</code></li>
2101 }2190 }
2102 </ul>2191 </ul>
2192+ </section>
2193+ }
2194+ if let Some(fail) = run.failing.clone() {
2195+ fail_first_block(lang: lang, fail: fail)
2196+ }
2197+ if let Some(log) = run.log.as_ref() {
2198+ if log.truncated {
2199+ <p class="muted small">(g::t(lang, K::LogTruncated))</p>
2103 }2200 }
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>
2202+ } else {
2203+ <p class="muted ci-tl-pad">(g::t(lang, K::NoJobs))</p>
2204+ }
2205+ </div>
2206+ <div class="ci-tl-panel ci-tl-panel-timeline">
2207+ run_timeline(lang: lang, run: run)
2208+ </div>
2209+ </section>
2104 })2210 })
2105 }2211 }
2106-
2107 /// The run page body: a one-line header with the run's actions, the jobs (left) and the selected job's2212 /// The run page body: a one-line header with the run's actions, the jobs (left) and the selected job's
2108 /// log (right), and the history dock under them. The page fits the window: the panes scroll inside.2213 /// log (right), and the history dock under them. The page fits the window: the panes scroll inside.
2109 /// The live region is the run list's stream, so the page re-renders when a run or a job changes.2214 /// The live region is the run list's stream, so the page re-renders when a run or a job changes.
@@ -2131,160 +2236,13 @@ async fn run_body(
2131 }2236 }
2132 }2237 }
2133 <div data-live=(live.as_deref()) class="ci-run fit-pane" data-run=(run.number) data-now=(now_unix().to_string()) data-fm=(fm.as_str()) data-fs=(fs.as_str())>2238 <div data-live=(live.as_deref()) class="ci-run fit-pane" data-run=(run.number) data-now=(now_unix().to_string()) data-fm=(fm.as_str()) data-fs=(fs.as_str())>
2134- <header class="ci-tl-head">2239+ run_head(lang: lang, run: &run, all_href: Some(all_href))
2135- <div class="ci-tl-headmain">
2136- <div class="ci-tl-line">
2137- <span class="ci-tl-no">(g::t(lang, K::RunNumber)) (run.number)</span>
2138- <h2 class="ci-tl-title">(headline(run.title.as_str()))</h2>
2139- <details class="ci-tl-more">
2140- <summary>(crate::i18n::code::t(lang, crate::i18n::code::K::ShowFullMessage))</summary>
2141- <p class="small">(run.title.as_str())</p>
2142- </details>
2143- </div>
2144- <div class="ci-tl-meta">
2145- <span class=(run.state_class.as_str())>(run.state.as_str())</span>
2146- <span class="muted">(run.trigger.as_str()) " \u{b7} " (run.branch.as_str())</span>
2147- <a href=(run.commit_href.as_str())><code>(run.commit.as_str())</code></a>
2148- if !run.actor.is_empty() {
2149- <span class="muted">(run.actor.as_str())</span>
2150- }
2151- if !run.duration.is_empty() {
2152- if let Some(est) = run.est.as_ref() {
2153- <span class="ci-tl-dur" data-since=(run.since.as_deref()) data-expected=(est.expected.as_str()) data-left=(est.left.as_str()) data-over=(est.over.as_str()) data-lm=(est.minutes.as_str())>(run.duration.as_str())</span>
2154- } else {
2155- <span class="ci-tl-dur" data-since=(run.since.as_deref())>(run.duration.as_str())</span>
2156- }
2157- }
2158- <time class="muted" datetime=(run.when_at.as_str()) data-rel="true">(run.when.as_str())</time>
2159- <a class="small" href=(all_href.as_str())>(tl::t(lang, TK::AllRuns))</a>
2160- </div>
2161- if let Some(est) = run.est.as_ref() {
2162- <progress class="ci-est ci-est-run" max="100" value=(est.pct.as_str()) data-est="true" data-since=(run.since.as_deref()) data-expected=(est.expected.as_str())></progress>
2163- }
2164- </div>
2165- if let Some(csrf) = run.writer_csrf.as_ref() {
2166- <div class="ci-actions ci-tl-actions">
2167- if run.can_approve {
2168- action_button(action: format!("{}/approve", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::ApproveAndRun))
2169- }
2170- if run.can_cancel && run.stopping {
2171- <button type="button" class="ci-stopping" disabled="disabled">(g::t(lang, K::StoppingButton))</button>
2172- } else if run.can_cancel {
2173- action_button(action: format!("{}/cancel", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Cancel))
2174- }
2175- if run.can_rerun_failed {
2176- action_button(action: format!("{}/rerun-failed", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::RerunFailed))
2177- }
2178- action_button(action: format!("{}/rerun", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Rerun))
2179- </div>
2180- }
2181- </header>
2182 <div class="ci-tl-main">2240 <div class="ci-tl-main">
2183- <section class="card ci-tl-jobs">2241+ run_jobs(lang: lang, run: &run)
2184- <h2 class="ci-tl-label">(g::t(lang, K::Jobs))</h2>2242+ run_log(lang: lang, run: &run, timeline: timeline)
2185- if run.jobs.is_empty() {
2186- <p class="muted small">(g::t(lang, K::NoJobs))</p>
2187- } else {
2188- <ul class="ci-tl-list">
2189- for job in run.jobs.iter() {
2190- if let Some(group) = job.group.as_ref() {
2191- <li class="ci-tl-group">(group.as_str())</li>
2192- }
2193- <li class=(job.sub.then_some("ci-tl-sub")) data-kb-row="">
2194- <a class="ci-tl-job" href=(job.pick.as_str()) aria-current=(if job.selected { "true" } else { "false" })>
2195- <span class=(job.dot.as_str())></span>
2196- <span class="ci-tl-name">(job.name.as_str())</span>
2197- if !job.detail.is_empty() {
2198- <span class="ci-tl-tag">(job.detail.as_str())</span>
2199- }
2200- if job.stopping {
2201- <span class="muted small">(g::t(lang, K::StateStopping))</span>
2202- }
2203- if job.duration.is_empty() {
2204- <span class="ci-tl-dur muted">(g::t(lang, K::Waiting))</span>
2205- } else {
2206- <span class="ci-tl-dur" data-since=(job.since.as_deref())>(job.duration.as_str())</span>
2207- }
2208- </a>
2209- </li>
2210- }
2211- </ul>
2212- }
2213- if !run.artifacts.is_empty() {
2214- <h3 class="ci-tl-label">(g::t(lang, K::Artifacts))</h3>
2215- <ul class="ci-art-list">
2216- for artifact in run.artifacts.iter() {
2217- <li>
2218- <span class="ci-art-name">(artifact.name.as_str())</span>
2219- <span class="muted small">(artifact.job.as_str()) " \u{b7} " (artifact.size.as_str())</span>
2220- <a class="ci-art-dl" href=(artifact.href.as_str()) download="">(g::t(lang, K::Download))</a>
2221- </li>
2222- }
2223- </ul>
2224- if let Some(href) = run.zip_href.as_ref() {
2225- <a class="button ci-mini" href=(href.as_str()) download="">(g::t(lang, K::DownloadAll))</a>
2226- }
2227- }
2228- </section>
2229- <section class="card ci-tl-log">
2230- <input type="radio" name="ci-view" id="ci-view-log" class="ci-tl-radio" checked=(if timeline { None } else { Some("checked") })>
2231- <input type="radio" name="ci-view" id="ci-view-timeline" class="ci-tl-radio" checked=(if timeline { Some("checked") } else { None })>
2232- <div class="ci-tl-tabs">
2233- <label for="ci-view-log" class="ci-tl-tab ci-tl-tab-log">(g::t(lang, K::Log))</label>
2234- <label for="ci-view-timeline" class="ci-tl-tab ci-tl-tab-timeline">(g::t(lang, K::Timeline))</label>
2235- </div>
2236- <div class="ci-tl-panel ci-tl-panel-log">
2237- if let Some(message) = run.config_error.as_ref() {
2238- <pre class="ci-config-error">(message.as_str())</pre>
2239- }
2240- if !run.warnings.is_empty() {
2241- <section class="ci-warnings" role="status">
2242- <p class="ci-warnings-title">(g::t(lang, K::ConfigWarnings))</p>
2243- <p class="muted small">(g::t(lang, K::ConfigWarningsHint))</p>
2244- <ul>
2245- for warning in run.warnings.iter() {
2246- <li><code>(warning.as_str())</code></li>
2247- }
2248- </ul>
2249- </section>
2250- }
2251- if let Some(fail) = run.failing.clone() {
2252- fail_first_block(lang: lang, fail: fail)
2253- }
2254- if let Some(log) = run.log.as_ref() {
2255- <div class="ci-logbar ci-tl-logbar">
2256- <span class="ci-tl-label">(g::t(lang, K::Log)) " \u{b7} " (log.name.as_str())</span>
2257- <input type="search" class="ci-logsearch" data-log-q="true" placeholder=(g::t(lang, K::LogSearch)) aria-label=(g::t(lang, K::LogSearch)) autocomplete="off" spellcheck="false">
2258- <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span>
2259- <button type="button" class="ci-mini" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev)) title=(g::t(lang, K::LogPrev))>"\u{2191}"</button>
2260- <button type="button" class="ci-mini" data-log-next="true" aria-label=(g::t(lang, K::LogNext)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button>
2261- <button type="button" class="ci-mini" data-copy-log=(log.log_href.as_str()) data-palette-action="click" data-copied=(g::t(lang, K::CopyDone)) data-failed=(g::t(lang, K::CopyFailed))>(g::t(lang, K::CopyLog))</button>
2262- <a class="ci-mini" href=(log.href.as_str())>(g::t(lang, K::FullLog))</a>
2263- if let (Some(action), Some(csrf)) = (log.rerun.as_ref(), run.writer_csrf.as_ref()) {
2264- <form method="post" action=(action.as_str()) class="inline-form ci-job-rerun">
2265- <input type="hidden" name="csrf" value=(csrf.as_str())>
2266- <button type="submit" class="ci-mini">(g::t(lang, K::Rerun))</button>
2267- </form>
2268- }
2269- <span class="ci-logfold" data-log-fold-box="true" hidden="hidden">
2270- <button type="button" class="ci-mini" data-log-fold="close">(g::t(lang, K::LogCollapseAll))</button>
2271- <button type="button" class="ci-mini" data-log-fold="open">(g::t(lang, K::LogExpandAll))</button>
2272- </span>
2273- </div>
2274- if log.truncated {
2275- <p class="muted small">(g::t(lang, K::LogTruncated))</p>
2276- }
2277- <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>
2278- } else {
2279- <p class="muted">(g::t(lang, K::NoJobs))</p>
2280- }
2281- </div>
2282- <div class="ci-tl-panel ci-tl-panel-timeline">
2283- run_timeline(lang: lang, run: &run)
2284- </div>
2285- </section>
2286 </div>2243 </div>
2287- <section class="repo-dock">2244+ <section class="ci-pane ci-dock">
2245+ <p class="ci-dock-note">(crate::pages::passkeys::s(lang, "bar height is lines changed", "çubuk yüksekliği değişen satır sayısıdır"))</p>
2288 <div class="dock-history">2246 <div class="dock-history">
2289 history_strip(lang: lang, owner: owner, repo: repo, bars: bars)2247 history_strip(lang: lang, owner: owner, repo: repo, bars: bars)
2290 </div>2248 </div>
@@ -2346,7 +2304,7 @@ async fn run_page(cx: &Cx) -> Result<impl View> {
2346 2304
2347 /// The dock's bars: the newest commits of the default branch, oldest first, each with its latest CI2305 /// The dock's bars: the newest commits of the default branch, oldest first, each with its latest CI
2348 /// state. Empty when the branch cannot be read, which draws no strip.2306 /// state. Empty when the branch cannot be read, which draws no strip.
2349-async fn dock_bars(state: &AppState, ctx: &RepoCtx) -> Vec<StripBar> {2307+pub(crate) async fn dock_bars(state: &AppState, ctx: &RepoCtx) -> Vec<StripBar> {
2350 let path = ctx.path.clone();2308 let path = ctx.path.clone();
2351 let branch = ctx.repo.default_branch.clone();2309 let branch = ctx.repo.default_branch.clone();
2352 let head = tokio::task::spawn_blocking(move || {2310 let head = tokio::task::spawn_blocking(move || {
crates/forge-web/src/pages/commit.rsmodified+39 -36
@@ -231,35 +231,42 @@ async fn commit_page(cx: &Cx) -> Result<impl View> {
231 .get(&full_oid)231 .get(&full_oid)
232 .map(|badge| SigBadgeView::from_badge(badge, lang));232 .map(|badge| SigBadgeView::from_badge(badge, lang));
233 233
234- let (copy, copied, copy_failed) = match lang {234+ let short = short_oid(&info.oid).to_owned();
235- i18n::Lang::En => ("Copy", "Copied", "Failed"),235+ // The committer is not shown on the line when it is the author: a title holds it when it differs.
236- i18n::Lang::Tr => ("Kopyala", "Kopyalandı", "Başarısız"),236+ let who_title = if committer_differs {
237+ format!(
238+ "{} {} <{}>\n{} {} <{}> · {}",
239+ g::t(lang, K::AuthorLabel),
240+ author.name,
241+ author.email,
242+ g::t(lang, K::CommitterLabel),
243+ committer.name,
244+ committer.email,
245+ committer.absolute,
246+ )
247+ } else if author.email.is_empty() {
248+ String::new()
249+ } else {
250+ format!("<{}>", author.email)
251+ };
252+ let (copied, copy_failed) = match lang {
253+ i18n::Lang::En => ("Copied", "Failed"),
254+ i18n::Lang::Tr => ("Kopyalandı", "Başarısız"),
237 };255 };
238 let mut header = ctx.head(state, "commits").await?;256 let mut header = ctx.head(state, "commits").await?;
239 header.live = ref_live::live_url(&owner_name, &repo_name);257 header.live = ref_live::live_url(&owner_name, &repo_name);
240- let author_mailto = format!("mailto:{}", author.email);
241- let committer_mailto = format!("mailto:{}", committer.email);
242 Ok(view! {258 Ok(view! {
243 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),259 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
244 repo_head(head: header)260 repo_head(head: header)
245 <h2 class="commit-summary-title">(heading.as_str())</h2>261 <h2 class="commit-summary-title">(heading.as_str())</h2>
246- <section class="card commit-info">262+ <div class="commit-facts muted">
247- <p class="commit-full-oid">263+ <button type="button" class="commit-hash" data-copy="commit-oid" data-copied=(copied) data-failed=(copy_failed) title=(full_oid.as_str())>(short.as_str())</button>
248- <span class="copy-box">264+ <code id="commit-oid" class="sr-only">(full_oid.as_str())</code>
249- <code id="commit-oid" title=(full_oid.as_str())>(full_oid.as_str())</code>265+ if let Some(badge) = sig {
250- <button type="button" data-copy="commit-oid" data-copied=(copied) data-failed=(copy_failed)>(copy)</button>266+ <span class=(badge.class) title=(badge.title.as_str())>(badge.label)</span>
251- </span>
252- if let Some(badge) = sig {
253- <span class=(badge.class) title=(badge.title.as_str())>(badge.label)</span>
254- }
255- </p>
256- if let Some(summary) = checks {
257- checks_summary(summary: summary, lang: StatusLang(lang))
258 }267 }
259- <div class="muted commit-author-line">(g::t(lang, K::AuthorLabel)) <strong>(author.name.as_str())</strong>268+ <span class="commit-author-line" title=(who_title.as_str())>
260- if !author.email.is_empty() {269+ <strong>(author.name.as_str())</strong>
261- " " <a class="commit-email" href=(author_mailto.as_str())>(author.email.as_str())</a>
262- }
263 if has_coauthors {270 if has_coauthors {
264 (g::t(lang, K::CoAuthorAnd))271 (g::t(lang, K::CoAuthorAnd))
265 for c in coauthors.iter() {272 for c in coauthors.iter() {
@@ -298,26 +305,22 @@ async fn commit_page(cx: &Cx) -> Result<impl View> {
298 </details>305 </details>
299 }306 }
300 }307 }
301- " · " <time data-rel="true" datetime=(author.iso.as_str()) title=(author.absolute.as_str())>(author.relative.as_str())</time>308+ </span>
302- </div>309+ <time data-rel="true" datetime=(author.iso.as_str()) title=(author.absolute.as_str())>(author.relative.as_str())</time>
303- if committer_differs {
304- <p class="muted">(g::t(lang, K::CommitterLabel)) <strong>(committer.name.as_str())</strong>
305- if !committer.email.is_empty() {
306- " " <a class="commit-email" href=(committer_mailto.as_str())>(committer.email.as_str())</a>
307- }
308- " · " <time data-rel="true" datetime=(committer.iso.as_str()) title=(committer.absolute.as_str())>(committer.relative.as_str())</time></p>
309- }
310 if is_root {310 if is_root {
311- <p class="muted">(g::t(lang, K::RootCommit))</p>311+ <span>(g::t(lang, K::RootCommit))</span>
312 } else {312 } else {
313- <p class="muted">(g::t(lang, K::ParentLabel))313+ <span>(g::t(lang, K::ParentLabel))
314 for p in parents.iter() {314 for p in parents.iter() {
315- <a class="mono" href=(p.href.as_str())>(p.short.as_str())</a> " "315+ <a class="mono" href=(p.href.as_str())>(p.short.as_str())</a>
316 }316 }
317- </p>317+ </span>
318 }318 }
319- <p><a href=(tree_href.as_str())>(g::t(lang, K::BrowseFiles))</a></p>319+ if let Some(summary) = checks {
320- </section>320+ checks_summary(summary: summary, lang: StatusLang(lang))
321+ }
322+ <a class="commit-browse" href=(tree_href.as_str())>(g::t(lang, K::BrowseFiles))</a>
323+ </div>
321 if let Some(msg) = parsed.as_ref() {324 if let Some(msg) = parsed.as_ref() {
322 <ul class="commit-groups" aria-label=(changes_label)>325 <ul class="commit-groups" aria-label=(changes_label)>
323 for group in msg.groups.iter() {326 for group in msg.groups.iter() {
crates/forge-web/src/pages/commits.rsmodified+129 -39
@@ -5,10 +5,11 @@ use std::time::{SystemTime, UNIX_EPOCH};
5 5
6 use std::collections::HashMap;6 use std::collections::HashMap;
7 7
8-use forge_core::store::commit_status::CommitStatus;8+use forge_core::store::commit_status::{CommitStatus, StatusState};
9-use forge_core::tz::format_in_tz;9+use forge_core::tz::{format_in_tz, local_date};
10 use forge_git::browse::{self, CommitInfo};10 use forge_git::browse::{self, CommitInfo};
11 use forge_git::history;11 use forge_git::history;
12+use jiff::{Timestamp, civil};
12 use topcoat::Result;13 use topcoat::Result;
13 use topcoat::context::{Cx, app_context};14 use topcoat::context::{Cx, app_context};
14 use topcoat::router::error::{bad_request, not_found};15 use topcoat::router::error::{bad_request, not_found};
@@ -17,14 +18,16 @@ use topcoat::view::{View, view};
17 18
18 use crate::i18n::code::{self as g, K};19 use crate::i18n::code::{self as g, K};
19 use crate::i18n::{self, Lang};20 use crate::i18n::{self, Lang};
21+use crate::pages::passkeys::s;
20 use crate::pages::ref_live;22 use crate::pages::ref_live;
21 use crate::pages::repo::repo_head;23 use crate::pages::repo::repo_head;
22 use crate::pages::repo_ctx::load_repo;24 use crate::pages::repo_ctx::load_repo;
25+use crate::render::commit_message::CommitMessage;
23 use crate::render::emoji::emojify;26 use crate::render::emoji::emojify;
24 use crate::signatures::{self, SigBadge};27 use crate::signatures::{self, SigBadge};
25 use crate::state::AppState;28 use crate::state::AppState;
26 use crate::views::commit_line::commit_line;29 use crate::views::commit_line::commit_line;
27-use crate::views::commit_status::{StatusLang, StatusSummary, commit_status};30+use crate::views::commit_status::{StatusLang, StatusSummary, commit_status, status_list};
28 use crate::views::{empty_state, shell};31 use crate::views::{empty_state, shell};
29 32
30 path_param!(owner);33 path_param!(owner);
@@ -106,6 +109,8 @@ pub(crate) fn short_oid(oid: &str) -> &str {
106 109
107 /// One commit as shown in the history list.110 /// One commit as shown in the history list.
108 pub(crate) struct CommitRow {111 pub(crate) struct CommitRow {
112+ /// The full oid: the row's `data-arrive` value.
113+ pub oid: String,
109 pub summary: String,114 pub summary: String,
110 pub author: String,115 pub author: String,
111 pub email: String,116 pub email: String,
@@ -119,6 +124,44 @@ pub(crate) struct CommitRow {
119 pub status: StatusSummary,124 pub status: StatusSummary,
120 /// Signature badge. `None` for unsigned commits and commits not checked on this page.125 /// Signature badge. `None` for unsigned commits and commits not checked on this page.
121 pub sig: Option<SigBadgeView>,126 pub sig: Option<SigBadgeView>,
127+ /// The civil day of the author time in the viewer's zone: the list's group.
128+ pub day: Option<civil::Date>,
129+ /// The full message, shown under the row. `None` unless the subject has more than one clause
130+ /// or the message has a body, so only those rows get a chevron.
131+ pub body: Option<String>,
132+}
133+
134+/// One day's rows in the history list, newest first.
135+struct DayGroup {
136+ label: String,
137+ rows: Vec<CommitRow>,
138+}
139+
140+/// The group label for a day: Today, Yesterday, or the ISO date.
141+fn day_label(
142+ lang: Lang,
143+ day: Option<civil::Date>,
144+ today: Option<civil::Date>,
145+ yesterday: Option<civil::Date>,
146+) -> String {
147+ match day {
148+ Some(day) if Some(day) == today => s(lang, "Today", "Bugün").to_owned(),
149+ Some(day) if Some(day) == yesterday => s(lang, "Yesterday", "Dün").to_owned(),
150+ Some(day) => day.to_string(),
151+ None => String::new(),
152+ }
153+}
154+
155+impl CommitRow {
156+ /// The CI dot's class: none without statuses, ok, bad, or live while a status is pending.
157+ pub(crate) fn dot(&self) -> &'static str {
158+ match self.status.state {
159+ None => "commits-dot none",
160+ Some(StatusState::Success) => "commits-dot ok",
161+ Some(StatusState::Failure | StatusState::Error) => "commits-dot bad",
162+ Some(StatusState::Pending) => "commits-dot live",
163+ }
164+ }
122 }165 }
123 166
124 /// A signature badge prepared for display: the CSS classes, the visible label and the title.167 /// A signature badge prepared for display: the CSS classes, the visible label and the title.
@@ -155,8 +198,15 @@ impl CommitRow {
155 tz: &str,198 tz: &str,
156 lang: Lang,199 lang: Lang,
157 ) -> Self {200 ) -> Self {
201+ let summary = emojify(&info.summary).into_owned();
202+ let message = emojify(&info.message).trim_end().to_owned();
203+ let has_body = message
204+ .split_once('\n')
205+ .is_some_and(|(_, rest)| !rest.trim().is_empty());
206+ let more_clauses = CommitMessage::parse(&summary).is_some_and(|parsed| parsed.extra() > 0);
158 Self {207 Self {
159- summary: emojify(&info.summary).into_owned(),208+ oid: info.oid.clone(),
209+ summary,
160 author: info.author_name.clone(),210 author: info.author_name.clone(),
161 email: info.author_email.clone(),211 email: info.author_email.clone(),
162 commit_href: format!("/{owner}/{repo}/commit/{}", info.oid),212 commit_href: format!("/{owner}/{repo}/commit/{}", info.oid),
@@ -167,6 +217,10 @@ impl CommitRow {
167 iso: iso_time(info.author_time),217 iso: iso_time(info.author_time),
168 status: StatusSummary::default(),218 status: StatusSummary::default(),
169 sig: None,219 sig: None,
220+ day: Timestamp::from_second(info.author_time)
221+ .ok()
222+ .map(|at| local_date(at, tz)),
223+ body: (has_body || more_clauses).then_some(message),
170 }224 }
171 }225 }
172 226
@@ -279,19 +333,36 @@ async fn commits_page(cx: &Cx) -> Result<impl View> {
279 let filter_text = filter.unwrap_or_default();333 let filter_text = filter.unwrap_or_default();
280 let page_label = g::page_label(lang, page_no);334 let page_label = g::page_label(lang, page_no);
281 335
336+ // Groups by the viewer's day, newest first. Rows keep the order git gave them.
337+ let today = Timestamp::from_second(now)
338+ .ok()
339+ .map(|at| local_date(at, &tz));
340+ let yesterday = today.and_then(|day| day.yesterday().ok());
341+ let mut groups: Vec<DayGroup> = Vec::new();
342+ for row in rows {
343+ let label = day_label(lang, row.day, today, yesterday);
344+ match groups.last_mut() {
345+ Some(group) if group.label == label => group.rows.push(row),
346+ _ => groups.push(DayGroup {
347+ label,
348+ rows: vec![row],
349+ }),
350+ }
351+ }
352+
282 let mut header = ctx.head(state, "commits").await?;353 let mut header = ctx.head(state, "commits").await?;
283 header.live = ref_live::live_url(&owner_name, &repo_name);354 header.live = ref_live::live_url(&owner_name, &repo_name);
284 Ok(view! {355 Ok(view! {
285 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),356 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
286 repo_head(head: header)357 repo_head(head: header)
287 <div class="commits-fit fit-pane lang-list">358 <div class="commits-fit fit-pane lang-list">
288- <div class="list-bar">359+ <div class="commits-head">
289- <p class="muted">(g::t(lang, K::CommitsOn)) <code>(ref_name.as_str())</code></p>360+ <span class="label">(g::t(lang, K::CommitsOn))</span>
361+ <span class="tag">(ref_name.as_str())</span>
290 if has_filter {362 if has_filter {
291- <p class="muted">(g::t(lang, K::FilteredTo)) <code>(filter_text.as_str())</code> " · " <a href=(clear_href.as_str())>(g::t(lang, K::ClearFilter))</a></p>363+ <span class="commits-filter small muted">(g::t(lang, K::FilteredTo)) <code>(filter_text.as_str())</code> " · " <a href=(clear_href.as_str())>(g::t(lang, K::ClearFilter))</a></span>
292 }364 }
293 </div>365 </div>
294- <div class="list-scroll">
295 if empty {366 if empty {
296 empty_state(title: g::t(lang, K::NoCommits),367 empty_state(title: g::t(lang, K::NoCommits),
297 if has_filter {368 if has_filter {
@@ -299,38 +370,54 @@ async fn commits_page(cx: &Cx) -> Result<impl View> {
299 }370 }
300 )371 )
301 } else {372 } else {
302- <ul class="commit-list">373+ <div class="commits-pane">
303- for row in rows.iter() {374+ for group in groups.iter() {
304- <li class="commit-row" data-kb-row="">375+ <div class="commits-g"><span class="label">(group.label.as_str())</span></div>
305- <div class="commit-main">376+ <ul class="commits-list">
306- <a class="commit-summary" href=(row.commit_href.as_str())>commit_line(subject: row.summary.clone())</a>377+ for row in group.rows.iter() {
307- <div class="commit-meta muted small">378+ <li class="commits-item" data-kb-row="" data-arrive=(row.oid.as_str())>
308- <span class="commit-author">(row.author.as_str())</span>379+ if let Some(body) = row.body.clone() {
309- if !row.email.is_empty() {380+ <details class="commits-d">
310- <span class="commit-email">(row.email.as_str())</span>381+ <summary class="commits-r">
311- }382+ <span class="commits-slot"><span class="commits-chev" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg></span></span>
312- if lang == Lang::Tr {383+ <span class=(row.dot())></span>
313- <time data-rel="true" datetime=(row.iso.as_str()) title=(row.absolute.as_str())>(row.relative.as_str())</time>384+ <a class="commits-sub commit-summary" href=(row.commit_href.as_str())>commit_line(subject: row.summary.clone())</a>
314- <span>(g::t(lang, K::Committed))</span>385+ <span class="commits-au" title=(row.email.as_str())>(row.author.as_str())</span>
386+ if let Some(badge) = row.sig.clone() {
387+ <span class=(badge.class) title=(badge.title.as_str())>(badge.label)</span>
388+ }
389+ <time class="commits-age" data-rel="true" datetime=(row.iso.as_str()) title=(row.absolute.as_str())>(row.relative.as_str())</time>
390+ <a class="sha commits-sha" href=(row.commit_href.as_str())>(row.short.as_str())</a>
391+ <a class="commits-ic" href=(row.tree_href.as_str()) aria-label=(g::t(lang, K::BrowseFilesShort))><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg></a>
392+ </summary>
393+ <pre class="commits-x">(body.as_str())</pre>
394+ if !row.status.items.is_empty() {
395+ <div class="commit-status">
396+ status_list(items: row.status.items.clone(), lang: lang)
397+ </div>
398+ }
399+ </details>
315 } else {400 } else {
316- <span>(g::t(lang, K::Committed))</span>401+ <div class="commits-r">
317- <time data-rel="true" datetime=(row.iso.as_str()) title=(row.absolute.as_str())>(row.relative.as_str())</time>402+ <span class="commits-slot"></span>
403+ <span class=(row.dot())></span>
404+ <a class="commits-sub commit-summary" href=(row.commit_href.as_str())>commit_line(subject: row.summary.clone())</a>
405+ <span class="commits-au" title=(row.email.as_str())>(row.author.as_str())</span>
406+ if let Some(badge) = row.sig.clone() {
407+ <span class=(badge.class) title=(badge.title.as_str())>(badge.label)</span>
408+ }
409+ <time class="commits-age" data-rel="true" datetime=(row.iso.as_str()) title=(row.absolute.as_str())>(row.relative.as_str())</time>
410+ <a class="sha commits-sha" href=(row.commit_href.as_str())>(row.short.as_str())</a>
411+ commit_status(summary: row.status.clone(), lang: StatusLang(lang))
412+ <a class="commits-ic" href=(row.tree_href.as_str()) aria-label=(g::t(lang, K::BrowseFilesShort))><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg></a>
413+ </div>
318 }414 }
319- </div>415+ </li>
320- </div>416+ }
321- <div class="commit-actions">417+ </ul>
322- commit_status(summary: row.status.clone(), lang: StatusLang(lang))
323- if let Some(badge) = row.sig.clone() {
324- <span class=(badge.class) title=(badge.title.as_str())>(badge.label)</span>
325- }
326- <a class="mono commit-oid" href=(row.commit_href.as_str())>(row.short.as_str())</a>
327- <a class="small muted" href=(row.tree_href.as_str())>(g::t(lang, K::BrowseFilesShort))</a>
328- </div>
329- </li>
330 }418 }
331- </ul>419+ </div>
332 }420 }
333- </div>
334 if has_newer || has_older {421 if has_newer || has_older {
335 <nav class="pager">422 <nav class="pager">
336 if has_newer {423 if has_newer {
@@ -552,7 +639,7 @@ mod tests {
552 let (status, _, body) = get(&fx.router, &base).await;639 let (status, _, body) = get(&fx.router, &base).await;
553 assert_eq!(status, 200);640 assert_eq!(status, 200);
554 let html = String::from_utf8(body).unwrap();641 let html = String::from_utf8(body).unwrap();
555- assert_eq!(html.matches("class=\"commit-row\"").count(), 50);642+ assert_eq!(html.matches("class=\"commits-r\"").count(), 50);
556 assert!(html.contains("filler 53"));643 assert!(html.contains("filler 53"));
557 assert!(!html.contains("root commit"));644 assert!(!html.contains("root commit"));
558 assert!(html.contains(">Older<"));645 assert!(html.contains(">Older<"));
@@ -565,7 +652,7 @@ mod tests {
565 let (status, _, body) = get(&fx.router, &format!("{base}?page=2")).await;652 let (status, _, body) = get(&fx.router, &format!("{base}?page=2")).await;
566 assert_eq!(status, 200);653 assert_eq!(status, 200);
567 let html = String::from_utf8(body).unwrap();654 let html = String::from_utf8(body).unwrap();
568- assert_eq!(html.matches("class=\"commit-row\"").count(), 5);655+ assert_eq!(html.matches("class=\"commits-r\"").count(), 5);
569 assert!(html.contains("root commit"));656 assert!(html.contains("root commit"));
570 assert!(html.contains(">Newer<"));657 assert!(html.contains(">Newer<"));
571 assert!(!html.contains(">Older<"));658 assert!(!html.contains(">Older<"));
@@ -584,7 +671,10 @@ mod tests {
584 get(&fx.router, &format!("/{OWNER}/{REPO}/commits/main/a.txt")).await;671 get(&fx.router, &format!("/{OWNER}/{REPO}/commits/main/a.txt")).await;
585 assert_eq!(status, 200);672 assert_eq!(status, 200);
586 let html = String::from_utf8(body).unwrap();673 let html = String::from_utf8(body).unwrap();
587- assert_eq!(html.matches("class=\"commit-row\"").count(), 2);674+ assert_eq!(html.matches("class=\"commits-r\"").count(), 2);
675+ // Only the modified commit has a body, so only its row has a disclosure.
676+ assert_eq!(html.matches("class=\"commits-d\"").count(), 1);
677+ assert!(html.contains("Body line one."));
588 assert!(html.contains("Modify a.txt and add new.txt"));678 assert!(html.contains("Modify a.txt and add new.txt"));
589 assert!(html.contains("root commit"));679 assert!(html.contains("root commit"));
590 assert!(!html.contains("filler 53"));680 assert!(!html.contains("filler 53"));
crates/forge-web/src/pages/discussion_settings.rsmodified+2 -2
@@ -32,7 +32,7 @@ pub(crate) async fn discussions_card(
32 enabled: bool,32 enabled: bool,
33 ) -> Result<impl View> {33 ) -> Result<impl View> {
34 Ok(view! {34 Ok(view! {
35- <section class="card" id="discussions">35+ <section class="settings-section" id="discussions">
36 <h2>(g::t(lang, K::Discussions))</h2>36 <h2>(g::t(lang, K::Discussions))</h2>
37 <p class="muted small">(g::t(lang, K::DiscussionsDescription))</p>37 <p class="muted small">(g::t(lang, K::DiscussionsDescription))</p>
38 <form method="post" action=(action.as_str()) class="inline-form">38 <form method="post" action=(action.as_str()) class="inline-form">
@@ -92,5 +92,5 @@ async fn settings_discussions_save(cx: &Cx, Form(form): Form<ToggleForm>) -> Res
92 )92 )
93 .await;93 .await;
94 let back = repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings", "");94 let back = repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings", "");
95- Ok(see_other(format!("{back}#discussions")))95+ Ok(see_other(format!("{back}?section=discussions")))
96 }96 }
crates/forge-web/src/pages/explore.rsmodified+11 -9
@@ -214,15 +214,17 @@ async fn explore_body(
214 </ul>214 </ul>
215 </section>215 </section>
216 }216 }
217- <form method="get" action="/explore" class="explore-search" role="search">217+ <div class="explore-toolbar">
218- <input type="search" name="q" value=(q.as_str()) data-live-search=""218+ <form method="get" action="/explore" class="explore-search" role="search">
219- placeholder=(g::t(lang, K::SearchPublicRepos)) aria-label=(g::t(lang, K::SearchPublicRepos))>219+ <input type="search" name="q" value=(q.as_str()) data-live-search=""
220- <input type="hidden" name="sort" value=(sort)>220+ placeholder=(g::t(lang, K::SearchPublicRepos)) aria-label=(g::t(lang, K::SearchPublicRepos))>
221- <button type="submit">(g::t(lang, K::Search))</button>221+ <input type="hidden" name="sort" value=(sort)>
222- </form>222+ <button type="submit">(g::t(lang, K::Search))</button>
223- <div class="repo-subbar">223+ </form>
224- sort_chips(links: sort_links, lang: lang)224+ <div class="repo-subbar">
225- <p class="muted small repo-count">(g::repo_count(lang, total))</p>225+ sort_chips(links: sort_links, lang: lang)
226+ <p class="muted small repo-count">(g::repo_count(lang, total))</p>
227+ </div>
226 </div>228 </div>
227 if empty {229 if empty {
228 empty_state(title: g::t(lang, K::NoPublicReposMatch),230 empty_state(title: g::t(lang, K::NoPublicReposMatch),
crates/forge-web/src/pages/finder.rsmodified+1 -1
@@ -37,7 +37,7 @@ pub async fn file_finder(
37 let base = format!("{}/", repo_href(&owner, &repo, "blob", &ref_name));37 let base = format!("{}/", repo_href(&owner, &repo, "blob", &ref_name));
38 Ok(view! {38 Ok(view! {
39 <button type="button" class="button finder-open" data-finder-open="" data-palette-action="click" title=(b::t(lang, b::K::FinderHint))>39 <button type="button" class="button finder-open" data-finder-open="" data-palette-action="click" title=(b::t(lang, b::K::FinderHint))>
40- (b::t(lang, b::K::GoToFile))40+ <span class="finder-label">(b::t(lang, b::K::GoToFile))</span>
41 <kbd>"t"</kbd>41 <kbd>"t"</kbd>
42 </button>42 </button>
43 <dialog class="finder" data-finder="" data-src=(src.as_str()) data-base=(base.as_str())43 <dialog class="finder" data-finder="" data-src=(src.as_str()) data-base=(base.as_str())
crates/forge-web/src/pages/issue_parts.rsmodified+9 -13
@@ -1044,7 +1044,7 @@ pub(crate) async fn labels_box(
1044 <section class="issue-side-section">1044 <section class="issue-side-section">
1045 <h2>(g::t(lang, K::Labels))</h2>1045 <h2>(g::t(lang, K::Labels))</h2>
1046 if write {1046 if write {
1047- <form method="post" action=(action.as_str()) class="stack">1047+ <form method="post" action=(action.as_str()) class="stack" data-apply="true">
1048 <input type="hidden" name="csrf" value=(csrf.as_str())>1048 <input type="hidden" name="csrf" value=(csrf.as_str())>
1049 if labels.is_empty() {1049 if labels.is_empty() {
1050 <p class="muted small">(g::t(lang, K::NoRepoLabels))</p>1050 <p class="muted small">(g::t(lang, K::NoRepoLabels))</p>
@@ -1055,7 +1055,7 @@ pub(crate) async fn labels_box(
1055 <span class=(row.chip.as_str())>(row.name.as_str())</span>1055 <span class=(row.chip.as_str())>(row.name.as_str())</span>
1056 </label>1056 </label>
1057 }1057 }
1058- <div><button type="submit">(g::t(lang, K::SaveLabels))</button></div>1058+ <noscript><div><button type="submit">(g::t(lang, K::SaveLabels))</button></div></noscript>
1059 </form>1059 </form>
1060 } else {1060 } else {
1061 if !any_attached {1061 if !any_attached {
@@ -1094,11 +1094,10 @@ pub(crate) async fn assignees_box(
1094 <button type="submit" class="link-button" data-palette-action="post">(g::t(lang, K::AssignToMe))</button>1094 <button type="submit" class="link-button" data-palette-action="post">(g::t(lang, K::AssignToMe))</button>
1095 </form>1095 </form>
1096 }1096 }
1097- <form method="post" action=(action.as_str()) class="stack">1097+ <form method="post" action=(action.as_str()) class="stack" data-apply="true">
1098 <input type="hidden" name="csrf" value=(csrf.as_str())>1098 <input type="hidden" name="csrf" value=(csrf.as_str())>
1099- <input type="text" name="assignees" value=(text.as_str()) autocomplete="off" spellcheck="false" aria-label=(g::t(lang, K::Assignees))>1099+ <input type="text" name="assignees" value=(text.as_str()) autocomplete="off" spellcheck="false" aria-label=(g::t(lang, K::Assignees)) title=(g::t(lang, K::CommaUsernames)) placeholder=(crate::pages::passkeys::s(lang, "Type a username", "Kullanıcı adı yaz"))>
1100- <p class="muted small">(g::t(lang, K::CommaUsernames))</p>1100+ <noscript><div><button type="submit">(g::t(lang, K::SaveAssignees))</button></div></noscript>
1101- <div><button type="submit">(g::t(lang, K::SaveAssignees))</button></div>
1102 </form>1101 </form>
1103 } else {1102 } else {
1104 if names.is_empty() {1103 if names.is_empty() {
@@ -1128,7 +1127,7 @@ pub(crate) async fn milestone_box(
1128 <section class="issue-side-section">1127 <section class="issue-side-section">
1129 <h2>(g::t(lang, K::MilestoneBox))</h2>1128 <h2>(g::t(lang, K::MilestoneBox))</h2>
1130 if write {1129 if write {
1131- <form method="post" action=(action.as_str()) class="stack">1130+ <form method="post" action=(action.as_str()) class="stack" data-apply="true">
1132 <input type="hidden" name="csrf" value=(csrf.as_str())>1131 <input type="hidden" name="csrf" value=(csrf.as_str())>
1133 <select name="milestone_id" aria-label=(g::t(lang, K::MilestoneBox))>1132 <select name="milestone_id" aria-label=(g::t(lang, K::MilestoneBox))>
1134 <option value="" selected=(none_selected)>(g::t(lang, K::NoneOption))</option>1133 <option value="" selected=(none_selected)>(g::t(lang, K::NoneOption))</option>
@@ -1136,7 +1135,7 @@ pub(crate) async fn milestone_box(
1136 <option value=(row.id.as_str()) selected=(row.selected)>(row.title.as_str())</option>1135 <option value=(row.id.as_str()) selected=(row.selected)>(row.title.as_str())</option>
1137 }1136 }
1138 </select>1137 </select>
1139- <div><button type="submit">(g::t(lang, K::SaveMilestone))</button></div>1138+ <noscript><div><button type="submit">(g::t(lang, K::SaveMilestone))</button></div></noscript>
1140 </form>1139 </form>
1141 } else {1140 } else {
1142 if current.is_empty() {1141 if current.is_empty() {
@@ -1275,16 +1274,13 @@ pub(crate) async fn comment_form(
1275 ) -> Result<impl View> {1274 ) -> Result<impl View> {
1276 Ok(view! {1275 Ok(view! {
1277 <section class="card issue-comment">1276 <section class="card issue-comment">
1278- <h2>(g::t(lang, K::AddComment))</h2>1277+ <h2 class="label">(g::t(lang, K::AddComment))</h2>
1279 if let Some(message) = error {1278 if let Some(message) = error {
1280 alert(message: message.as_str())1279 alert(message: message.as_str())
1281 }1280 }
1282 <form method="post" action=(action.as_str()) class="stack">1281 <form method="post" action=(action.as_str()) class="stack">
1283 <input type="hidden" name="csrf" value=(csrf.as_str())>1282 <input type="hidden" name="csrf" value=(csrf.as_str())>
1284- <label>1283+ <textarea name="body" rows="3" aria-label=(g::t(lang, K::Comment))>(draft.as_str())</textarea>
1285- <span>(g::t(lang, K::Comment))</span>
1286- <textarea name="body" rows="6">(draft.as_str())</textarea>
1287- </label>
1288 <div class="issue-actions">1284 <div class="issue-actions">
1289 <button type="submit" class="primary" name="action" value="comment">(g::t(lang, K::Comment))</button>1285 <button type="submit" class="primary" name="action" value="comment">(g::t(lang, K::Comment))</button>
1290 if can_close {1286 if can_close {
crates/forge-web/src/pages/issues_list.rsmodified+12 -6
@@ -266,6 +266,8 @@ pub(crate) struct MilestoneView {
266 266
267 /// One issue row, with every string the template shows already built.267 /// One issue row, with every string the template shows already built.
268 struct RowView {268 struct RowView {
269+ /// The number, the `data-arrive` value that marks a row new after a live update.
270+ arrive: String,
269 state_class: &'static str,271 state_class: &'static str,
270 state_label: &'static str,272 state_label: &'static str,
271 number_text: String,273 number_text: String,
@@ -313,6 +315,7 @@ fn row_view(row: RowCtx<'_>, item: &IssueListItem) -> RowView {
313 let open = matches!(issue.state, IssueState::Open);315 let open = matches!(issue.state, IssueState::Open);
314 let comments = issue.comment_count.max(0);316 let comments = issue.comment_count.max(0);
315 RowView {317 RowView {
318+ arrive: issue.number.to_string(),
316 state_class: if open {319 state_class: if open {
317 "issue-state issue-state-open"320 "issue-state issue-state-open"
318 } else {321 } else {
@@ -515,13 +518,16 @@ async fn issues_list_page(cx: &Cx) -> Result<impl View> {
515 <option value=(option.value) selected=(option.selected)>(option.label)</option>518 <option value=(option.value) selected=(option.selected)>(option.label)</option>
516 }519 }
517 </select>520 </select>
518- <button type="submit">(g::t(lang, K::Search))</button>521+ <button type="submit" class="sr-only">(g::t(lang, K::Search))</button>
519 </form>522 </form>
520 <div class="issue-tools">523 <div class="issue-tools">
521- <nav aria-label=(g::t(lang, K::LabelsAndMilestones))>524+ <details class="list-more">
522- <a class="button" href=(labels_page_href.as_str())>(g::t(lang, K::Labels))</a>525+ <summary aria-label=(crate::pages::passkeys::s(lang, "More", "Diğer"))>"…"</summary>
523- <a class="button" href=(milestones_href.as_str())>(g::t(lang, K::Milestones))</a>526+ <nav class="list-more-menu" aria-label=(g::t(lang, K::LabelsAndMilestones))>
524- </nav>527+ <a href=(labels_page_href.as_str())>(g::t(lang, K::Labels))</a>
528+ <a href=(milestones_href.as_str())>(g::t(lang, K::Milestones))</a>
529+ </nav>
530+ </details>
525 if can_create {531 if can_create {
526 <a class="button" href=(new_href.as_str()) data-palette-action="go">(g::t(lang, K::NewIssue))</a>532 <a class="button" href=(new_href.as_str()) data-palette-action="go">(g::t(lang, K::NewIssue))</a>
527 }533 }
@@ -562,7 +568,7 @@ async fn issues_list_page(cx: &Cx) -> Result<impl View> {
562 } else {568 } else {
563 <ul class="issue-list">569 <ul class="issue-list">
564 for row in rows.iter() {570 for row in rows.iter() {
565- <li class="issue-row" data-kb-row="">571+ <li class="issue-row" data-kb-row="" data-arrive=(row.arrive.as_str())>
566 <span class=(row.state_class) role="img" aria-label=(row.state_label)></span>572 <span class=(row.state_class) role="img" aria-label=(row.state_label)></span>
567 <div class="issue-main">573 <div class="issue-main">
568 <div class="issue-title-line">574 <div class="issue-title-line">
crates/forge-web/src/pages/labels_page.rsmodified+14 -20
@@ -120,18 +120,14 @@ async fn labels_body(
120 <ul class="label-list">120 <ul class="label-list">
121 for row in rows.iter() {121 for row in rows.iter() {
122 <li class="label-row" data-kb-row="">122 <li class="label-row" data-kb-row="">
123- <div class="label-head">123+ <a class=(row.chip_class.as_str()) href=(row.issues_href.as_str())>(row.name.as_str())</a>
124- <a class=(row.chip_class.as_str()) href=(row.issues_href.as_str())>(row.name.as_str())</a>124+ <p class="muted small label-desc" title=(row.description.as_str())>(row.description.as_str())</p>
125- <a class="small" href=(row.issues_href.as_str())>(row.open_text.as_str())</a>125+ <a class="small label-open" href=(row.issues_href.as_str())>(row.open_text.as_str())</a>
126- </div>
127- if !row.description.is_empty() {
128- <p class="muted small">(row.description.as_str())</p>
129- }
130 if can_triage {126 if can_triage {
131- <div class="label-actions">127+ <details class="label-edit">
132- <details>128+ <summary>(g::t(lang, K::Edit))</summary>
133- <summary>(g::t(lang, K::Edit))</summary>129+ <div class="label-edit-body">
134- <form method="post" action=(row.edit_action.as_str()) class="stack">130+ <form method="post" action=(row.edit_action.as_str()) class="label-edit-form">
135 <input type="hidden" name="csrf" value=(csrf.as_str())>131 <input type="hidden" name="csrf" value=(csrf.as_str())>
136 <label>132 <label>
137 <span>(g::t(lang, K::Name))</span>133 <span>(g::t(lang, K::Name))</span>
@@ -145,16 +141,14 @@ async fn labels_body(
145 <span>(g::t(lang, K::Description))</span>141 <span>(g::t(lang, K::Description))</span>
146 <input type="text" name="description" value=(row.description.as_str()) autocomplete="off" maxlength="500">142 <input type="text" name="description" value=(row.description.as_str()) autocomplete="off" maxlength="500">
147 </label>143 </label>
148- <div>144+ <button type="submit">(g::t(lang, K::SaveLabel))</button>
149- <button type="submit">(g::t(lang, K::SaveLabel))</button>
150- </div>
151 </form>145 </form>
152- </details>146+ <form method="post" action=(row.delete_action.as_str()) class="remove-form">
153- <form method="post" action=(row.delete_action.as_str()) class="remove-form">147+ <input type="hidden" name="csrf" value=(csrf.as_str())>
154- <input type="hidden" name="csrf" value=(csrf.as_str())>148+ <button type="submit" class="danger">(g::t(lang, K::Delete))</button>
155- <button type="submit" class="danger">(g::t(lang, K::Delete))</button>149+ </form>
156- </form>150+ </div>
157- </div>151+ </details>
158 }152 }
159 </li>153 </li>
160 }154 }
crates/forge-web/src/pages/mod.rsmodified+1 -0
@@ -114,6 +114,7 @@ pub mod repo_collaborators;
114 pub mod repo_ctx;114 pub mod repo_ctx;
115 pub mod repo_mirrors;115 pub mod repo_mirrors;
116 pub mod repo_rename;116 pub mod repo_rename;
117+pub mod repo_scrub;
117 pub mod repo_secrets;118 pub mod repo_secrets;
118 pub mod repo_security;119 pub mod repo_security;
119 pub mod repo_settings;120 pub mod repo_settings;
crates/forge-web/src/pages/profile.rsmodified+10 -1
@@ -670,7 +670,8 @@ async fn profile_card(
670 profile_tabs(username: user.username.clone(), items: tab_items, current: tab.clone(), counts: tab_counts)670 profile_tabs(username: user.username.clone(), items: tab_items, current: tab.clone(), counts: tab_counts)
671 if overview_on {671 if overview_on {
672 if let Some((calendar, selected)) = heat {672 if let Some((calendar, selected)) = heat {
673- contribution_calendar(calendar: calendar, selected: selected, lang: lang, base: base.clone())673+ contribution_calendar(calendar: calendar, selected: selected, lang: lang, base: base.clone(),
674+ live: Some(format!("/users/{}/events", user.username)))
674 }675 }
675 <div class=(overview_class)>676 <div class=(overview_class)>
676 <section class="profile-pinned">677 <section class="profile-pinned">
@@ -1311,6 +1312,14 @@ mod tests {
1311 assert!(day.contains("class=\"heat\""), "day link: calendar");1312 assert!(day.contains("class=\"heat\""), "day link: calendar");
1312 }1313 }
1313 1314
1315+ /// The calendar's stream is the profile's own: an unknown name is 404.
1316+ #[tokio::test]
1317+ async fn profile_events_is_404_for_an_unknown_user() {
1318+ let site = seeded().await;
1319+ let (status, _) = get(&site.router, "/users/no-such-user/events", None).await;
1320+ assert_eq!(status, 404);
1321+ }
1322+
1314 fn count(body: &str, needle: &str) -> usize {1323 fn count(body: &str, needle: &str) -> usize {
1315 body.matches(needle).count()1324 body.matches(needle).count()
1316 }1325 }
crates/forge-web/src/pages/pull_files.rsmodified+276 -115
@@ -7,6 +7,7 @@
7 use std::collections::HashMap;7 use std::collections::HashMap;
8 use std::sync::Arc;8 use std::sync::Arc;
9 9
10+use forge_core::store::commit_status::StatusState;
10 use forge_core::{Action, IssueState, PullRequest, Side, Thread, authorize};11 use forge_core::{Action, IssueState, PullRequest, Side, Thread, authorize};
11 use forge_git::command::ObjectSource;12 use forge_git::command::ObjectSource;
12 use forge_git::history::{CommitDiff, DiffStatus, FileDiff};13 use forge_git::history::{CommitDiff, DiffStatus, FileDiff};
@@ -21,10 +22,14 @@ use topcoat::router::{page, path_param, route};
21 use topcoat::view::{View, component, view};22 use topcoat::view::{View, component, view};
22 23
23 use crate::auth::require_user;24 use crate::auth::require_user;
25+use crate::i18n::browse as b;
24 use crate::i18n::pulls::{self as g, K};26 use crate::i18n::pulls::{self as g, K};
25 use crate::i18n::{self, Lang};27 use crate::i18n::{self, Lang};
26 use crate::pages::edit_history::thread_edit_counts;28 use crate::pages::edit_history::thread_edit_counts;
27-use crate::pages::issue_parts::{check_write, csrf_of, may_converse, parse_number, triage, viewer};29+use crate::pages::issue_parts::{
30+ When, check_write, csrf_of, may_converse, parse_number, triage, viewer,
31+};
32+use crate::pages::passkeys;
28 use crate::pages::pull_reviews::{error_text_in, pull_diff, suggest_states};33 use crate::pages::pull_reviews::{error_text_in, pull_diff, suggest_states};
29 use crate::pages::pull_view::{commits_of, frame_in, is_merged, pull_header, pull_subnav_in};34 use crate::pages::pull_view::{commits_of, frame_in, is_merged, pull_header, pull_subnav_in};
30 use crate::pages::repo::repo_head;35 use crate::pages::repo::repo_head;
@@ -33,7 +38,7 @@ use crate::pages::tree::link_context;
33 use crate::state::AppState;38 use crate::state::AppState;
34 use crate::views::diff::{DiffLang, DiffOpts, LIMITS, LineComments, diff_section};39 use crate::views::diff::{DiffLang, DiffOpts, LIMITS, LineComments, diff_section};
35 use crate::views::review_thread::ThreadCtx;40 use crate::views::review_thread::ThreadCtx;
36-use crate::views::{alert, repo_href, shell};41+use crate::views::{alert, now_unix, repo_href, shell};
37 42
38 path_param!(owner);43 path_param!(owner);
39 path_param!(repo);44 path_param!(repo);
@@ -115,99 +120,159 @@ impl MarkState {
115 }120 }
116 }121 }
117 122
118-/// One file of the Viewed panel.123+/// One file of the full diff, as the Files pane lists it.
119-struct ViewedRow {124+struct FileRow {
120 path: String,125 path: String,
121 /// The heading `diff_section` gives the file, to find its section on the page.126 /// The heading `diff_section` gives the file, to find its section on the page.
122 label: String,127 label: String,
123 state: MarkState,128 state: MarkState,
129+ additions: u32,
130+ deletions: u32,
131+ /// The file's index in the diff the page shows, when that diff lists it.
132+ index: Option<usize>,
124 }133 }
125 134
126-/// Everything the Viewed panel needs. `None` on the page for a signed-out viewer.135+/// Where the viewed checkboxes post, for a signed-in viewer.
127-struct ViewedPanel {136+struct ViewedControls {
128- rows: Vec<ViewedRow>,
129 pr_href: String,137 pr_href: String,
130 csrf: String,138 csrf: String,
131 archived: bool,139 archived: bool,
132 }140 }
133 141
134 /// One row per file of the full diff. A mark counts only while its blob is the file's blob at the142 /// One row per file of the full diff. A mark counts only while its blob is the file's blob at the
135-/// head, so a file a later push changed shows as changed.143+/// head, so a file a later push changed shows as changed. `marks` is `None` for a signed-out
136-async fn viewed_rows(144+/// viewer, whose rows carry no marks and so no blob reads.
145+async fn file_rows(
137 state: &AppState,146 state: &AppState,
138 ctx: &RepoCtx,147 ctx: &RepoCtx,
139 pr: &PullRequest,148 pr: &PullRequest,
140- diff: &CommitDiff,149+ full: &CommitDiff,
141- marks: &HashMap<String, String>,150+ shown: &CommitDiff,
142-) -> Result<Vec<ViewedRow>> {151+ marks: Option<&HashMap<String, String>>,
152+) -> Result<Vec<FileRow>> {
143 let mut rows = Vec::new();153 let mut rows = Vec::new();
144- for file in &diff.files {154+ for file in &full.files {
145 let Some(path) = mark_path(file) else {155 let Some(path) = mark_path(file) else {
146 continue;156 continue;
147 };157 };
148- let blob = blob_at(&state.git, &ctx.path, &pr.head_oid, path)158+ let mark = match marks {
149- .await?
150- .unwrap_or_default();
151- let mark = match marks.get(path) {
152- Some(marked) if *marked == blob => MarkState::Viewed,
153- Some(_) => MarkState::Changed,
154 None => MarkState::Unviewed,159 None => MarkState::Unviewed,
160+ Some(marks) => {
161+ let blob = blob_at(&state.git, &ctx.path, &pr.head_oid, path)
162+ .await?
163+ .unwrap_or_default();
164+ match marks.get(path) {
165+ Some(marked) if *marked == blob => MarkState::Viewed,
166+ Some(_) => MarkState::Changed,
167+ None => MarkState::Unviewed,
168+ }
169+ }
155 };170 };
156- rows.push(ViewedRow {171+ rows.push(FileRow {
157 path: path.to_owned(),172 path: path.to_owned(),
158 label: file_label(file),173 label: file_label(file),
159 state: mark,174 state: mark,
175+ additions: file.additions,
176+ deletions: file.deletions,
177+ index: file_index(shown, path),
160 });178 });
161 }179 }
162 Ok(rows)180 Ok(rows)
163 }181 }
164 182
165-/// The Viewed panel: `N of M viewed` with a thin bar, then one row per file with its checkbox.183+/// What one Files pane row shows, with its classes and link worked out.
166-/// The checkbox posts to the pull's `viewed` route from nav.js and shows the new state only after184+struct FileItem {
167-/// the server answered; a changed file says so. Collapsing viewed files is done by nav.js too.185+ path: String,
186+ label: String,
187+ class: &'static str,
188+ href: Option<String>,
189+ state: MarkState,
190+ additions: String,
191+ deletions: String,
192+}
193+
194+/// The Files pane: `Files` with the viewer's `N of M viewed`, then one 36px row per file with its
195+/// icon, its path, its counts and, for a signed-in viewer, the Viewed checkbox. A row links to its
196+/// file in the diff pane. The checkbox posts to the pull's `viewed` route from nav.js and shows the
197+/// new state only after the server answered; a changed file says so.
168 #[component]198 #[component]
169-async fn viewed_panel(lang: Lang, panel: ViewedPanel) -> Result<impl View> {199+async fn files_pane(
170- let total = panel.rows.len();200+ lang: Lang,
171- let done = panel201+ rows: Vec<FileRow>,
172- .rows202+ selected: Option<usize>,
203+ controls: Option<ViewedControls>,
204+) -> Result<impl View> {
205+ let signed_in = controls.is_some();
206+ let total = rows.len();
207+ let done = rows
173 .iter()208 .iter()
174 .filter(|row| row.state == MarkState::Viewed)209 .filter(|row| row.state == MarkState::Viewed)
175 .count();210 .count();
176- let count = g::viewed_count(lang, done, total);211+ let count = if signed_in {
177- let width = if total == 0 {212+ g::viewed_count(lang, done, total)
178- "width:0%".to_owned()
179 } else {213 } else {
180- format!("width:{:.1}%", done as f64 * 100.0 / total as f64)214+ String::new()
215+ };
216+ let (action, csrf, archived) = match controls {
217+ Some(c) => (format!("{}/viewed", c.pr_href), c.csrf, c.archived),
218+ None => (String::new(), String::new(), false),
181 };219 };
182- let action = format!("{}/viewed", panel.pr_href);220+ let items: Vec<FileItem> = rows
183- let csrf = panel.csrf;221+ .into_iter()
184- let archived = panel.archived;222+ .map(|row| {
223+ let current = row.index.is_some() && row.index == selected;
224+ FileItem {
225+ href: row.index.map(|i| format!("?file={i}#file-{}", i + 1)),
226+ class: if current {
227+ "pull-file current"
228+ } else {
229+ "pull-file"
230+ },
231+ additions: format!("+{}", row.additions),
232+ deletions: format!("\u{2212}{}", row.deletions),
233+ path: row.path,
234+ label: row.label,
235+ state: row.state,
236+ }
237+ })
238+ .collect();
185 let mark = g::t(lang, K::ViewedMark);239 let mark = g::t(lang, K::ViewedMark);
186 let changed = g::t(lang, K::ChangedSinceViewed);240 let changed = g::t(lang, K::ChangedSinceViewed);
241+ let heading = passkeys::s(lang, "Files", "Dosyalar");
242+ let hint = g::t(lang, K::ViewedHint);
243+ let viewed_files = g::t(lang, K::ViewedFiles);
187 Ok(view! {244 Ok(view! {
188- <section class="card viewed-panel" data-viewed-panel="" data-action=(action.as_str()) data-csrf=(csrf.as_str())>245+ <section class="pane pull-files" data-viewed-panel="" data-action=(action.as_str()) data-csrf=(csrf.as_str()) aria-label=(viewed_files)>
189- <div class="viewed-head">246+ <div class="pull-cap">
190- <h2>(g::t(lang, K::ViewedFiles))</h2>247+ <span class="label">(heading)</span>
191- <span class="viewed-count">(count.as_str())</span>248+ if signed_in {
249+ <span class="pull-count" title=(hint)>(count.as_str())</span>
250+ }
192 </div>251 </div>
193- <div class="viewed-bar"><b style=(width.as_str())></b></div>252+ <ul class="pull-file-list">
194- <p class="muted viewed-hint">(g::t(lang, K::ViewedHint))</p>253+ for item in items.into_iter() {
195- <ul class="viewed-list">254+ <li class=(item.class) data-viewed-row="" data-state=(item.state.name()) data-label=(item.label.as_str())>
196- for row in panel.rows.into_iter() {255+ if let Some(href) = item.href {
197- <li data-viewed-row="" data-state=(row.state.name()) data-label=(row.label.as_str())>256+ <a class="pull-file-link" href=(href.as_str())>
198- if archived {257+ <svg class="pull-file-ico" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6"/></svg>
199- <span class="viewed-path">(row.path.as_str())</span>258+ <span class="mono clip">(item.path.as_str())</span>
259+ <span class="pull-counts"><span class="ok">(item.additions.as_str())</span> <span class="bad">(item.deletions.as_str())</span></span>
260+ </a>
200 } else {261 } else {
201- <label class="viewed-item">262+ <span class="pull-file-link">
202- if row.state == MarkState::Viewed {263+ <svg class="pull-file-ico" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6"/></svg>
203- <input type="checkbox" checked="" data-viewed-toggle="" data-path=(row.path.as_str()) title=(mark)>264+ <span class="mono clip">(item.path.as_str())</span>
204- } else {265+ <span class="pull-counts"><span class="ok">(item.additions.as_str())</span> <span class="bad">(item.deletions.as_str())</span></span>
205- <input type="checkbox" data-viewed-toggle="" data-path=(row.path.as_str()) title=(mark)>266+ </span>
206- }267+ }
207- <span class="viewed-path">(row.path.as_str())</span>268+ if signed_in && !archived {
208- </label>269+ if item.state == MarkState::Viewed {
270+ <input type="checkbox" checked="" data-viewed-toggle="" data-path=(item.path.as_str()) title=(mark)>
271+ } else {
272+ <input type="checkbox" data-viewed-toggle="" data-path=(item.path.as_str()) title=(mark)>
273+ }
209 }274 }
210- if row.state == MarkState::Changed {275+ if item.state == MarkState::Changed {
211 <span class="viewed-note">(changed)</span>276 <span class="viewed-note">(changed)</span>
212 }277 }
213 </li>278 </li>
@@ -217,6 +282,55 @@ async fn viewed_panel(lang: Lang, panel: ViewedPanel) -> Result<impl View> {
217 })282 })
218 }283 }
219 284
285+/// One status context in the Checks pane: its dot, its name and how long ago it last reported.
286+struct CheckItem {
287+ context: String,
288+ dot: &'static str,
289+ when: String,
290+}
291+
292+/// The Checks pane: the head commit's contexts with a dot, the name and the time of the last report.
293+#[component]
294+async fn checks_pane(lang: Lang, items: Vec<CheckItem>) -> Result<impl View> {
295+ let heading = passkeys::s(lang, "Checks", "Kontroller");
296+ Ok(view! {
297+ <section class="pane pull-checks">
298+ <div class="pull-cap"><span class="label">(heading)</span></div>
299+ for item in items.into_iter() {
300+ <div class="pull-check">
301+ <span class=(item.dot)></span>
302+ <span class="clip">(item.context.as_str())</span>
303+ <time class="pull-time">(item.when.as_str())</time>
304+ </div>
305+ }
306+ </section>
307+ })
308+}
309+
310+/// The diff pane's top row: Unified or Split, and whitespace. Its links are the toolbar's own.
311+#[component]
312+async fn diff_top(
313+ lang: Lang,
314+ unified: String,
315+ split: String,
316+ ws: String,
317+ split_on: bool,
318+ ws_on: bool,
319+) -> Result<impl View> {
320+ let unified_on = if split_on { "false" } else { "true" };
321+ let split_pressed = if split_on { "true" } else { "false" };
322+ let ws_pressed = if ws_on { "true" } else { "false" };
323+ Ok(view! {
324+ <div class="pull-diff-top">
325+ <div class="seg" role="group" aria-label=(b::t(lang, b::K::DiffView))>
326+ <a class="seg-item" href=(unified.as_str()) aria-pressed=(unified_on)>(b::t(lang, b::K::Unified))</a>
327+ <a class="seg-item" href=(split.as_str()) aria-pressed=(split_pressed)>(b::t(lang, b::K::Split))</a>
328+ </div>
329+ <a class="seg-item toggle" href=(ws.as_str()) aria-pressed=(ws_pressed)>(b::t(lang, b::K::IgnoreWhitespace))</a>
330+ </div>
331+ })
332+}
333+
220 /// The Viewed form body: `viewed` is `1` to mark the file, anything else clears the mark.334 /// The Viewed form body: `viewed` is `1` to mark the file, anything else clears the mark.
221 #[derive(Deserialize)]335 #[derive(Deserialize)]
222 struct ViewedForm {336 struct ViewedForm {
@@ -274,49 +388,52 @@ async fn viewed_post(cx: &Cx, Form(form): Form<ViewedForm>) -> Result<SeeOther>
274 Ok(see_other(files))388 Ok(see_other(files))
275 }389 }
276 390
277-/// The review bar: the viewer's pending comment count, a summary, the review type and Submit,391+/// The review compose box at the foot of the diff pane. It shows one line, the summary, and the
278-/// plus Discard. The PR author can only comment, so approve and request changes are left out.392+/// Comment button. Focusing the line opens the rest: the pending count and Discard. Approve and
393+/// Request changes are in the pull's head and submit this same form.
279 #[component]394 #[component]
280 async fn review_bar(395 async fn review_bar(
281 lang: Lang,396 lang: Lang,
282 pr_href: String,397 pr_href: String,
283 csrf: String,398 csrf: String,
284 pending: usize,399 pending: usize,
285- is_author: bool,
286 ) -> Result<impl View> {400 ) -> Result<impl View> {
287 let reviews_action = format!("{pr_href}/reviews");401 let reviews_action = format!("{pr_href}/reviews");
288 let discard_action = format!("{pr_href}/reviews/discard");402 let discard_action = format!("{pr_href}/reviews/discard");
289 let pending_text = g::pending_comments(lang, pending);403 let pending_text = g::pending_comments(lang, pending);
404+ let finish = g::t(lang, K::FinishReview);
405+ let discard = g::t(lang, K::DiscardPending);
406+ let summary = g::t(lang, K::ReviewSummary);
407+ let submit = g::t(lang, K::SubmitReview);
408+ let comment = g::t(lang, K::CommentChoice).trim();
409+ let placeholder = passkeys::s(lang, "Leave a comment", "Yorum bırakın");
290 Ok(view! {410 Ok(view! {
291- <section class="card review-bar">411+ <section class="review-bar pull-compose">
292- <h2>(g::t(lang, K::FinishReview))</h2>412+ <div class="pull-more">
293- <p class="muted">(pending_text.as_str())</p>413+ <h2>(finish)</h2>
294- <form id="review-form" method="post" action=(reviews_action.as_str()) class="stack">414+ <p class="muted">(pending_text.as_str())</p>
295- <input type="hidden" name="csrf" value=(csrf.as_str())>
296- <label>
297- <span>(g::t(lang, K::ReviewSummary))</span>
298- <textarea name="body" rows="4"></textarea>
299- </label>
300- <fieldset class="review-choices">
301- <legend>(g::t(lang, K::ReviewType))</legend>
302- <label><input type="radio" name="state" value="comment" checked=""> (g::t(lang, K::CommentChoice))</label>
303- if !is_author {
304- <label><input type="radio" name="state" value="approve"> (g::t(lang, K::ApproveChoice))</label>
305- <label><input type="radio" name="state" value="request_changes"> (g::t(lang, K::RequestChangesChoice))</label>
306- }
307- </fieldset>
308- </form>
309- <div class="review-actions">
310- <button type="submit" class="primary" form="review-form">(g::t(lang, K::SubmitReview))</button>
311 <form method="post" action=(discard_action.as_str()) class="review-inline">415 <form method="post" action=(discard_action.as_str()) class="review-inline">
312 <input type="hidden" name="csrf" value=(csrf.as_str())>416 <input type="hidden" name="csrf" value=(csrf.as_str())>
313- <button type="submit" class="link-button">(g::t(lang, K::DiscardPending))</button>417+ <button type="submit" class="link-button">(discard)</button>
314 </form>418 </form>
315 </div>419 </div>
420+ <form id="review-form" method="post" action=(reviews_action.as_str()) class="pull-compose-form" aria-label=(submit)>
421+ <input type="hidden" name="csrf" value=(csrf.as_str())>
422+ <input class="pull-input" type="text" name="body" aria-label=(summary) placeholder=(placeholder)>
423+ <button type="submit" class="btn primary" name="state" value="comment">(comment)</button>
424+ </form>
316 </section>425 </section>
317 })426 })
318 }427 }
319 428
429+/// The `file=<index>` param: the diff file the Files pane marks as current.
430+fn file_param(cx: &Cx) -> Option<usize> {
431+ let request = uri(cx);
432+ let query = request.query()?;
433+ let (_, raw) = form_urlencoded::parse(query.as_bytes()).find(|(key, _)| *key == "file")?;
434+ digits::<usize>(&raw)
435+}
436+
320 #[page("/{owner}/{repo}/pulls/{number}/files")]437 #[page("/{owner}/{repo}/pulls/{number}/files")]
321 async fn pull_files(cx: &Cx) -> Result<impl View> {438 async fn pull_files(cx: &Cx) -> Result<impl View> {
322 let number = parse_number(path_param::<Number>(cx))?;439 let number = parse_number(path_param::<Number>(cx))?;
@@ -330,42 +447,64 @@ async fn pull_files(cx: &Cx) -> Result<impl View> {
330 let lang = i18n::lang(cx, viewer(&ctx));447 let lang = i18n::lang(cx, viewer(&ctx));
331 let commit_count = commits_of(state, &ctx, &pr).await?.len();448 let commit_count = commits_of(state, &ctx, &pr).await?.len();
332 let full_diff = pull_diff(state, &ctx, &pr).await?;449 let full_diff = pull_diff(state, &ctx, &pr).await?;
333- let frame = frame_in(lang, state, &ctx, &pr, commit_count, full_diff.files.len()).await?;450+ let mut frame = frame_in(lang, state, &ctx, &pr, commit_count, full_diff.files.len()).await?;
451+ frame.totals = Some(full_diff.files.iter().fold((0, 0), |(add, del), file| {
452+ (add + file.additions, del + file.deletions)
453+ }));
334 let opts = DiffOpts::from_cx(cx, None).await?;454 let opts = DiffOpts::from_cx(cx, None).await?;
335- // The Viewed panel lists the full diff, so it is built before `diff` may shrink below.455+ // The Files pane lists the full diff. Its marks are read here, and its rows are built once the
336- let panel = match viewer(&ctx) {456+ // shown diff is known, since a whitespace-ignoring view may list fewer files.
337- Some(user) => {457+ let viewer_user = viewer(&ctx);
338- let marks = state458+ let marks = match &viewer_user {
459+ Some(user) => Some(
460+ state
339 .store461 .store
340 .pull_viewed_files(&user.id, &pr.issue.id)462 .pull_viewed_files(&user.id, &pr.issue.id)
341- .await?;463+ .await?,
342- Some(ViewedPanel {464+ ),
343- rows: viewed_rows(state, &ctx, &pr, &full_diff, &marks).await?,
344- pr_href: frame.href.clone(),
345- csrf: csrf_of(&ctx),
346- archived: ctx.repo.archived,
347- })
348- }
349 None => None,465 None => None,
350 };466 };
467+ let controls = viewer_user.as_ref().map(|_| ViewedControls {
468+ pr_href: frame.href.clone(),
469+ csrf: csrf_of(&ctx),
470+ archived: ctx.repo.archived,
471+ });
351 // With whitespace ignored the file list can shrink, so file indexes differ from the comment472 // With whitespace ignored the file list can shrink, so file indexes differ from the comment
352 // routes' view. Existing threads still show; new inline comments wait for the full diff.473 // routes' view. Existing threads still show; new inline comments wait for the full diff.
353- let diff = if opts.ignore_ws {474+ let shown_ws = if opts.ignore_ws {
354- range_diff_files_ws(475+ Some(
355- &state.git,476+ range_diff_files_ws(
356- &ctx.path,477+ &state.git,
357- ObjectSource::default(),478+ &ctx.path,
358- &pr.base_oid,479+ ObjectSource::default(),
359- &pr.head_oid,480+ &pr.base_oid,
360- LIMITS,481+ &pr.head_oid,
361- true,482+ LIMITS,
483+ true,
484+ )
485+ .await?,
362 )486 )
363- .await?
364 } else {487 } else {
365- full_diff488+ None
366 };489 };
367-490+ let diff: &CommitDiff = shown_ws.as_ref().unwrap_or(&full_diff);
368- let viewer_id = viewer(&ctx).map(|user| user.id.clone());491+ let rows = file_rows(state, &ctx, &pr, &full_diff, diff, marks.as_ref()).await?;
492+ let selected = file_param(cx).or((!diff.files.is_empty()).then_some(0));
493+ let statuses = state.store.statuses_for(&ctx.repo.id, &pr.head_oid).await?;
494+ let checks: Vec<CheckItem> = statuses
495+ .iter()
496+ .map(|status| CheckItem {
497+ context: status.context.clone(),
498+ dot: match status.state {
499+ StatusState::Success => "dot ok",
500+ StatusState::Failure | StatusState::Error => "dot bad",
501+ StatusState::Pending => "dot live",
502+ },
503+ when: When::new(lang, &status.updated_at, ctx.viewer_tz(), now_unix()).relative,
504+ })
505+ .collect();
506+
507+ let viewer_id = viewer_user.as_ref().map(|user| user.id.clone());
369 let signed_in = viewer_id.is_some();508 let signed_in = viewer_id.is_some();
370 let archived = ctx.repo.archived;509 let archived = ctx.repo.archived;
371 let open = matches!(pr.issue.state, IssueState::Open) && !is_merged(&pr);510 let open = matches!(pr.issue.state, IssueState::Open) && !is_merged(&pr);
@@ -382,6 +521,8 @@ async fn pull_files(cx: &Cx) -> Result<impl View> {
382 .is_ok();521 .is_ok();
383 // Comments and replies stay open on a closed pull request; new reviews do not.522 // Comments and replies stay open on a closed pull request; new reviews do not.
384 let can_review = can_comment && open;523 let can_review = can_comment && open;
524+ // Approve and request changes are offered to every viewer who may review but did not open it.
525+ frame.head_review = can_review && !is_author;
385 let href = frame.href.clone();526 let href = frame.href.clone();
386 let csrf = csrf_of(&ctx);527 let csrf = csrf_of(&ctx);
387 528
@@ -396,7 +537,7 @@ async fn pull_files(cx: &Cx) -> Result<impl View> {
396 let suggest = suggest_states(state, &ctx, &pr, viewer(&ctx), &threads).await?;537 let suggest = suggest_states(state, &ctx, &pr, viewer(&ctx), &threads).await?;
397 let mut by_line: HashMap<(usize, Side, u32), Vec<Thread>> = HashMap::new();538 let mut by_line: HashMap<(usize, Side, u32), Vec<Thread>> = HashMap::new();
398 for thread in threads.into_iter().filter(|t| !t.root.outdated) {539 for thread in threads.into_iter().filter(|t| !t.root.outdated) {
399- if let Some(index) = file_index(&diff, &thread.root.path) {540+ if let Some(index) = file_index(diff, &thread.root.path) {
400 by_line541 by_line
401 .entry((index, thread.root.side, thread.root.line))542 .entry((index, thread.root.side, thread.root.line))
402 .or_default()543 .or_default()
@@ -404,6 +545,9 @@ async fn pull_files(cx: &Cx) -> Result<impl View> {
404 }545 }
405 }546 }
406 547
548+ // The view owns the diff it shows, so the shown diff moves here once every borrow of it is done.
549+ let diff = shown_ws.unwrap_or(full_diff);
550+
407 let link = link_context(state, &ctx.repo, &ctx.repo.default_branch, "");551 let link = link_context(state, &ctx.repo, &ctx.repo.default_branch, "");
408 let thread_ctx = ThreadCtx {552 let thread_ctx = ThreadCtx {
409 pr_href: href.clone(),553 pr_href: href.clone(),
@@ -427,6 +571,15 @@ async fn pull_files(cx: &Cx) -> Result<impl View> {
427 ctx: thread_ctx,571 ctx: thread_ctx,
428 };572 };
429 573
574+ // The diff pane has its own top row, so the section's toolbar is left off.
575+ let mut section_opts = opts.clone();
576+ section_opts.enabled = false;
577+ let unified_href = opts.href(false, opts.ignore_ws);
578+ let split_href = opts.href(true, opts.ignore_ws);
579+ let ws_href = opts.href(opts.split, !opts.ignore_ws);
580+ let split_on = opts.split;
581+ let ws_on = opts.ignore_ws;
582+
430 let error = review_error_from(lang, cx);583 let error = review_error_from(lang, cx);
431 // The page follows the pull request's event stream: a change re-renders it.584 // The page follows the pull request's event stream: a change re-renders it.
432 let live = format!("{href}/events");585 let live = format!("{href}/events");
@@ -444,16 +597,24 @@ async fn pull_files(cx: &Cx) -> Result<impl View> {
444 if let Some(message) = error {597 if let Some(message) = error {
445 alert(message: message.as_str())598 alert(message: message.as_str())
446 }599 }
447- <div class="fit-pane" data-live=(live.as_str())>600+ <div class="fit-pane pull-page" data-live=(live.as_str())>
448- if can_review {601+ <div class="pull-cols">
449- review_bar(lang: lang, pr_href: href.clone(), csrf: csrf.clone(), pending: pending, is_author: is_author)602+ <div class="pull-left">
450- }603+ files_pane(lang: lang, rows: rows, selected: selected, controls: controls)
451- if let Some(panel) = panel {604+ checks_pane(lang: lang, items: checks)
452- viewed_panel(lang: lang, panel: panel)605+ </div>
453- }606+ <section class="pane pull-diff">
454- diff_section(diff: &diff, owner: owner.as_str(), repo: name.as_str(),607+ diff_top(lang: lang, unified: unified_href, split: split_href, ws: ws_href, split_on: split_on, ws_on: ws_on)
455- oid: pr.head_oid.as_str(), parent: parent.as_deref(),608+ <div class="pull-diff-scroll">
456- subject: g::t(lang, K::ThisPullRequest), lang: DiffLang(lang), comments: comments, opts: opts)609+ diff_section(diff: &diff, owner: owner.as_str(), repo: name.as_str(),
610+ oid: pr.head_oid.as_str(), parent: parent.as_deref(),
611+ subject: g::t(lang, K::ThisPullRequest), lang: DiffLang(lang), comments: comments, opts: section_opts)
612+ </div>
613+ if can_review {
614+ review_bar(lang: lang, pr_href: href.clone(), csrf: csrf.clone(), pending: pending)
615+ }
616+ </section>
617+ </div>
457 </div>618 </div>
458 )619 )
459 })620 })
crates/forge-web/src/pages/pull_view.rsmodified+34 -7
@@ -20,6 +20,7 @@ use topcoat::router::{page, path_param};
20 use topcoat::view::{View, component, view};20 use topcoat::view::{View, component, view};
21 21
22 use crate::auth::require_user;22 use crate::auth::require_user;
23+use crate::i18n::pulls as review_strings;
23 use crate::i18n::pulls_review::{self as g, K};24 use crate::i18n::pulls_review::{self as g, K};
24 use crate::i18n::{self, Lang};25 use crate::i18n::{self, Lang};
25 use crate::pages::commits::{CommitRow, now_secs};26 use crate::pages::commits::{CommitRow, now_secs};
@@ -121,6 +122,10 @@ pub(crate) struct Frame {
121 state_class: &'static str,122 state_class: &'static str,
122 state_text: &'static str,123 state_text: &'static str,
123 lang: Lang,124 lang: Lang,
125+ /// The Files tab's review buttons: they submit the review form on that tab.
126+ pub(crate) head_review: bool,
127+ /// Lines added and removed across the whole diff, shown on the Files tab.
128+ pub(crate) totals: Option<(u32, u32)>,
124 }129 }
125 130
126 /// The header for a pull request, with its strings in `lang`.131 /// The header for a pull request, with its strings in `lang`.
@@ -181,6 +186,8 @@ pub(crate) async fn frame_in(
181 head_label,186 head_label,
182 state_class,187 state_class,
183 state_text,188 state_text,
189+ head_review: false,
190+ totals: None,
184 })191 })
185 }192 }
186 193
@@ -196,9 +203,12 @@ pub(crate) async fn pull_header(frame: Frame) -> Result<impl View> {
196 author_known,203 author_known,
197 opened,204 opened,
198 commit_count,205 commit_count,
206+ file_count,
199 base_branch,207 base_branch,
200 head_label,208 head_label,
201 lang,209 lang,
210+ head_review,
211+ totals,
202 ..212 ..
203 } = frame;213 } = frame;
204 let number_label = format!("#{number}");214 let number_label = format!("#{number}");
@@ -211,10 +221,26 @@ pub(crate) async fn pull_header(frame: Frame) -> Result<impl View> {
211 let byline_end = g::t(lang, K::BylineEnd);221 let byline_end = g::t(lang, K::BylineEnd);
212 // Turkish puts the source branch first and the commit count before the verb.222 // Turkish puts the source branch first and the commit count before the verb.
213 let turkish = matches!(lang, Lang::Tr);223 let turkish = matches!(lang, Lang::Tr);
224+ let changes_label = review_strings::t(lang, review_strings::K::RequestChangesChoice).trim();
225+ let approve_label = review_strings::t(lang, review_strings::K::ApproveChoice).trim();
226+ let totals_text = totals.map(|(add, del)| {
227+ format!(
228+ "{} \u{b7} +{add} \u{2212}{del}",
229+ g::files_tab(lang, file_count)
230+ )
231+ });
214 Ok(view! {232 Ok(view! {
215- <section class="issue-head" data-live=(live_url.as_str())>233+ <section class="issue-head pull-head" data-live=(live_url.as_str())>
216- <h1 class="issue-heading">(title.as_str()) " " <span class="issue-number">(number_label.as_str())</span></h1>234+ <div class="pull-line1">
217- <p class="issue-byline">235+ <h1 class="issue-heading">(title.as_str()) " " <span class="issue-number">(number_label.as_str())</span></h1>
236+ if head_review {
237+ <div class="pull-actions" role="group" aria-label=(review_strings::t(lang, review_strings::K::ReviewType))>
238+ <button type="submit" class="btn" form="review-form" name="state" value="request_changes">(changes_label)</button>
239+ <button type="submit" class="btn main" form="review-form" name="state" value="approve">(approve_label)</button>
240+ </div>
241+ }
242+ </div>
243+ <p class="issue-byline pull-line2">
218 <span class=(state_class)>(state_text)</span>244 <span class=(state_class)>(state_text)</span>
219 <strong>245 <strong>
220 if author_known {246 if author_known {
@@ -228,13 +254,14 @@ pub(crate) async fn pull_header(frame: Frame) -> Result<impl View> {
228 (from) <code>(base_branch.as_str())</code>254 (from) <code>(base_branch.as_str())</code>
229 (into) (commits_text.as_str())255 (into) (commits_text.as_str())
230 } else {256 } else {
231- (wants) (commits_text.as_str()) (into)257+ (wants) <code>(head_label.as_str())</code>
232- <code>(base_branch.as_str())</code>258+ (into) <code>(base_branch.as_str())</code>
233- (from)
234- <code>(head_label.as_str())</code>
235 }259 }
236 (byline_end)260 (byline_end)
237 <time data-rel="true" datetime=(opened.iso.as_str()) title=(opened.absolute.as_str())>(opened.relative.as_str())</time>261 <time data-rel="true" datetime=(opened.iso.as_str()) title=(opened.absolute.as_str())>(opened.relative.as_str())</time>
262+ if let Some(text) = totals_text {
263+ <span class="pull-totals">(text.as_str())</span>
264+ }
238 </p>265 </p>
239 </section>266 </section>
240 })267 })
crates/forge-web/src/pages/pulls_list.rsmodified+5 -2
@@ -34,6 +34,8 @@ const PER_PAGE: u32 = 25;
34 34
35 /// One pull request row, with every string the template shows already built.35 /// One pull request row, with every string the template shows already built.
36 struct PullRowView {36 struct PullRowView {
37+ /// The number, the `data-arrive` value that marks a row new after a live update.
38+ arrive: String,
37 state_class: &'static str,39 state_class: &'static str,
38 state_label: &'static str,40 state_label: &'static str,
39 badge_class: &'static str,41 badge_class: &'static str,
@@ -123,6 +125,7 @@ fn row_view(
123 state_label,125 state_label,
124 badge_class,126 badge_class,
125 badge_label,127 badge_label,
128+ arrive: issue.number.to_string(),
126 number_text: format!("#{}", issue.number),129 number_text: format!("#{}", issue.number),
127 href: format!("{base}/{}", issue.number),130 href: format!("{base}/{}", issue.number),
128 title: issue.title.clone(),131 title: issue.title.clone(),
@@ -290,7 +293,7 @@ async fn pulls_list_page(cx: &Cx) -> Result<impl View> {
290 <option value=(option.value) selected=(option.selected)>(option.label)</option>293 <option value=(option.value) selected=(option.selected)>(option.label)</option>
291 }294 }
292 </select>295 </select>
293- <button type="submit">(g::t(lang, K::Search))</button>296+ <button type="submit" class="sr-only">(g::t(lang, K::Search))</button>
294 </form>297 </form>
295 <div class="issue-tools">298 <div class="issue-tools">
296 <a class="issue-tab-link" href=(queue_href.as_str())>(mq::t(lang, mq::K::MergeQueueTitle))</a>299 <a class="issue-tab-link" href=(queue_href.as_str())>(mq::t(lang, mq::K::MergeQueueTitle))</a>
@@ -319,7 +322,7 @@ async fn pulls_list_page(cx: &Cx) -> Result<impl View> {
319 } else {322 } else {
320 <ul class="issue-list">323 <ul class="issue-list">
321 for row in rows.iter() {324 for row in rows.iter() {
322- <li class="issue-row" data-kb-row="">325+ <li class="issue-row" data-kb-row="" data-arrive=(row.arrive.as_str())>
323 <span class=(row.state_class) role="img" aria-label=(row.state_label)></span>326 <span class=(row.state_class) role="img" aria-label=(row.state_label)></span>
324 <div class="issue-main">327 <div class="issue-main">
325 <div class="issue-title-line">328 <div class="issue-title-line">
crates/forge-web/src/pages/refs.rsmodified+3 -0
@@ -194,6 +194,9 @@ async fn tags_page(cx: &Cx) -> Result<impl View> {
194 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),194 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
195 repo_head(head: header)195 repo_head(head: header)
196 <div class="lang-list fit-pane">196 <div class="lang-list fit-pane">
197+ <div class="list-bar">
198+ <p class="label">(g::t(lang, K::TagsTitle))</p>
199+ </div>
197 <div class="list-scroll">200 <div class="list-scroll">
198 refs_table(rows: rows, kind_label: g::t(lang, K::TagKindLabel), lang: lang)201 refs_table(rows: rows, kind_label: g::t(lang, K::TagKindLabel), lang: lang)
199 </div>202 </div>
crates/forge-web/src/pages/releases.rsmodified+14 -14
@@ -516,7 +516,8 @@ async fn list_body(
516 }516 }
517 <div class="list-scroll">517 <div class="list-scroll">
518 for card in cards.iter() {518 for card in cards.iter() {
519- <article class="release-card" data-kb-row="">519+ <article class="release-card" data-kb-row="" title=(card.body.as_str())>
520+ <code class="release-tag">(card.tag.as_str())</code>
520 <h3>521 <h3>
521 <a href=(card.href.as_str())>(card.title.as_str())</a>522 <a href=(card.href.as_str())>(card.title.as_str())</a>
522 if card.latest {523 if card.latest {
@@ -529,24 +530,23 @@ async fn list_body(
529 " " <span class="badge draft">(g::t(lang, K::Draft))</span>530 " " <span class="badge draft">(g::t(lang, K::Draft))</span>
530 }531 }
531 </h3>532 </h3>
532- <p class="muted small">533+ <span class="muted small release-meta">
533- <code>(card.tag.as_str())</code>534+ <time data-rel="true" datetime=(card.when.iso.as_str()) title=(card.when.absolute.as_str())>(card.when.relative.as_str())</time>
534- " \u{b7} " <time data-rel="true" datetime=(card.when.iso.as_str()) title=(card.when.absolute.as_str())>(card.when.relative.as_str())</time>
535 if !card.author.is_empty() {535 if !card.author.is_empty() {
536 " \u{b7} " user_link(shown: card.author.as_str(), login: card.author.as_str())536 " \u{b7} " user_link(shown: card.author.as_str(), login: card.author.as_str())
537 }537 }
538- </p>538+ </span>
539- if !card.body.is_empty() {
540- <div class="markdown-body">(Unescaped::new_unchecked(render_markdown(&card.body, None)))</div>
541- }
542 if !card.assets.is_empty() {539 if !card.assets.is_empty() {
543- <ul class="release-asset-list">540+ <details class="release-assets-pop">
544- for asset in card.assets.iter() {541+ <summary class="small">(card.assets.len().to_string()) " " (crate::pages::passkeys::s(lang, "assets", "dosya"))</summary>
545- <li><a href=(asset.href.as_str())>(asset.name.as_str())</a> " (" (asset.size.as_str()) ", " (g::download_count(lang, asset.downloads)) ")"</li>542+ <ul class="release-asset-list">
546- }543+ for asset in card.assets.iter() {
547- </ul>544+ <li><a href=(asset.href.as_str())>(asset.name.as_str())</a> " (" (asset.size.as_str()) ", " (g::download_count(lang, asset.downloads)) ")"</li>
545+ }
546+ </ul>
547+ </details>
548 }548 }
549- <p><a href=(card.edit_href.as_str())>(g::t(lang, K::Edit))</a></p>549+ <a class="small release-edit" href=(card.edit_href.as_str())>(g::t(lang, K::Edit))</a>
550 </article>550 </article>
551 }551 }
552 </div>552 </div>
crates/forge-web/src/pages/repo.rsmodified+82 -47
@@ -29,15 +29,17 @@ use crate::pages::passkeys::s;
29 use crate::pages::refs::{load_refs, ref_links};29 use crate::pages::refs::{load_refs, ref_links};
30 use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo};30 use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo};
31 use crate::pages::repo_side::{31 use crate::pages::repo_side::{
32- StripFacts, commit_strip, readme_meta, repo_dock, repo_strip, run_rows, run_states, strip_bars,32+ StripFacts, TreeFacts, commit_strip, readme_meta, repo_dock, repo_strip, run_rows, run_states,
33- tree_facts,33+ strip_bars, tree_facts,
34 };34 };
35 use crate::pages::tree::{35 use crate::pages::tree::{
36 entry_rows, last_commits, latest_bar, load_readme, read_dir, readme_card, tree_table,36 entry_rows, last_commits, latest_bar, load_readme, read_dir, readme_card, tree_table,
37 };37 };
38 use crate::state::AppState;38 use crate::state::AppState;
39 use crate::views::repo_list::badge_class;39 use crate::views::repo_list::badge_class;
40-use crate::views::{now_unix, ref_selector, rel_time, relative_time, repo_href, repo_tabs, shell};40+use crate::views::{
41+ empty_state, now_unix, ref_selector, rel_time, relative_time, repo_href, repo_tabs, shell,
42+};
41 43
42 path_param!(owner);44 path_param!(owner);
43 path_param!(repo);45 path_param!(repo);
@@ -78,6 +80,7 @@ pub async fn repo_head(head: RepoHead) -> Result<impl View> {
78 active,80 active,
79 hide_search: _,81 hide_search: _,
80 can_admin,82 can_admin,
83+ can_delete: _,
81 open_issues,84 open_issues,
82 open_pulls,85 open_pulls,
83 forked_from,86 forked_from,
@@ -96,6 +99,7 @@ pub async fn repo_head(head: RepoHead) -> Result<impl View> {
96 ..99 ..
97 } = head;100 } = head;
98 let badge = badge_class(visibility);101 let badge = badge_class(visibility);
102+ let private = matches!(visibility, forge_core::Visibility::Private);
99 let vis = i18n::visibility_label(lang, visibility);103 let vis = i18n::visibility_label(lang, visibility);
100 let active = active.to_owned();104 let active = active.to_owned();
101 // The fork button posts with the same session CSRF token as the star form.105 // The fork button posts with the same session CSRF token as the star form.
@@ -174,19 +178,10 @@ pub async fn repo_head(head: RepoHead) -> Result<impl View> {
174 }178 }
175 repo_tabs(owner: owner.clone(), repo: name.clone(), default_branch: default_branch.clone(), active: active.clone(), can_admin: can_admin, lang: lang, open_issues: Some(open_issues), open_pulls: Some(open_pulls), discussions: discussions, wiki: wiki, security: security)179 repo_tabs(owner: owner.clone(), repo: name.clone(), default_branch: default_branch.clone(), active: active.clone(), can_admin: can_admin, lang: lang, open_issues: Some(open_issues), open_pulls: Some(open_pulls), discussions: discussions, wiki: wiki, security: security)
176 <div class="header-actions">180 <div class="header-actions">
177- <span class=(badge)>(vis)</span>181+ // A private repo says so beside the star; public needs no mark outside the menu.
178- if let Some((action, csrf)) = fork_control {182+ if private {
179- <form method="post" action=(action.as_str()) class="fork-form">183+ <span class=(badge)>(vis)</span>
180- <input type="hidden" name="csrf" value=(csrf.as_str())>
181- <button type="submit" class="fork-button">(g::t(lang, K::ForkButton))</button>
182- </form>
183- }
184- if let Some((action, csrf, level)) = watch_control {
185- watch_form(lang: lang, action: action, csrf: csrf, level: level, watchers: watchers)
186- } else {
187- <span class="muted small">(watch_count.as_str())</span>
188 }184 }
189- <span class="muted small">(fork_count.as_str())</span>
190 <div class="star-control">185 <div class="star-control">
191 if let Some((action, label, csrf)) = star_control {186 if let Some((action, label, csrf)) = star_control {
192 <form method="post" action=(action.as_str()) class="star-form">187 <form method="post" action=(action.as_str()) class="star-form">
@@ -197,6 +192,26 @@ pub async fn repo_head(head: RepoHead) -> Result<impl View> {
197 <span class="muted" aria-label=(g::t(lang, K::StarsAria))>(anon_count.as_str())</span>192 <span class="muted" aria-label=(g::t(lang, K::StarsAria))>(anon_count.as_str())</span>
198 }193 }
199 </div>194 </div>
195+ <details class="menu head-more">
196+ <summary aria-label=(s(lang, "Repository actions", "Depo işlemleri"))>
197+ <span aria-hidden="true">"…"</span>
198+ </summary>
199+ <div class="menu-list head-more-list">
200+ <span class=(badge)>(vis)</span>
201+ if let Some((action, csrf)) = fork_control {
202+ <form method="post" action=(action.as_str()) class="fork-form">
203+ <input type="hidden" name="csrf" value=(csrf.as_str())>
204+ <button type="submit" class="fork-button">(g::t(lang, K::ForkButton))</button>
205+ </form>
206+ }
207+ if let Some((action, csrf, level)) = watch_control {
208+ watch_form(lang: lang, action: action, csrf: csrf, level: level, watchers: watchers)
209+ } else {
210+ <span class="muted small">(watch_count.as_str())</span>
211+ }
212+ <span class="muted small">(fork_count.as_str())</span>
213+ </div>
214+ </details>
200 </div>215 </div>
201 </section>216 </section>
202 if archived {217 if archived {
@@ -245,6 +260,28 @@ async fn clone_popover(
245 })260 })
246 }261 }
247 262
263+/// Head of the README pane, shared by the repo home and the tree pages: the file name at the left,
264+/// then the repo facts (licence, size, top language) and the Clone popover at the right.
265+#[component]
266+pub(crate) async fn readme_head(
267+ label: String,
268+ facts: Option<TreeFacts>,
269+ https: String,
270+ ssh: String,
271+ downloads: Option<(String, String)>,
272+ lang: Lang,
273+) -> Result<impl View> {
274+ Ok(view! {
275+ <div class="canvas-head canvas-readme-head">
276+ <span class="label">(label.as_str())</span>
277+ <div class="canvas-facts">
278+ readme_meta(lang: lang, facts: facts)
279+ clone_popover(https: https, ssh: ssh, downloads: downloads, lang: lang)
280+ </div>
281+ </div>
282+ })
283+}
284+
248 /// Shown for an empty repo (or one whose default branch is missing): the branches that exist,285 /// Shown for an empty repo (or one whose default branch is missing): the branches that exist,
249 /// or push instructions when there are none.286 /// or push instructions when there are none.
250 #[component]287 #[component]
@@ -446,16 +483,7 @@ async fn repo_page(cx: &Cx) -> Result<impl View> {
446 facts = Some(tree_facts(state, repo, &ctx.path, commit, &names).await?);483 facts = Some(tree_facts(state, repo, &ctx.path, commit, &names).await?);
447 let (last, latest) = tokio::join!(484 let (last, latest) = tokio::join!(
448 last_commits(state, &ctx.path, commit, "", &names),485 last_commits(state, &ctx.path, commit, "", &names),
449- latest_bar(486+ latest_bar(state, repo, &ctx.path, commit, "", lang, ctx.viewer_tz()),
450- state,
451- repo,
452- &ctx.path,
453- &branch,
454- commit,
455- "",
456- lang,
457- ctx.viewer_tz()
458- ),
459 );487 );
460 bar = latest;488 bar = latest;
461 readme = load_readme(state, repo, &ctx.path, &branch, commit, "", &entries).await?;489 readme = load_readme(state, repo, &ctx.path, &branch, commit, "", &entries).await?;
@@ -481,7 +509,6 @@ async fn repo_page(cx: &Cx) -> Result<impl View> {
481 header.live = live;509 header.live = live;
482 let latest = crate::pages::releases::latest_release_for_home(state, &ctx).await?;510 let latest = crate::pages::releases::latest_release_for_home(state, &ctx).await?;
483 let runs = run_rows(state, lang, repo).await?;511 let runs = run_rows(state, lang, repo).await?;
484- let ci_href = repo_href(&owner_name, &repo_name, "ci", "");
485 let banners = recent_push_banners(state, &ctx, header.forked_from.clone()).await?;512 let banners = recent_push_banners(state, &ctx, header.forked_from.clone()).await?;
486 let viewer_user = ctx.viewer.as_ref().map(|(user, _)| user);513 let viewer_user = ctx.viewer.as_ref().map(|(user, _)| user);
487 let packages = packages::repo_package_links(state, viewer_user, &repo.id).await?;514 let packages = packages::repo_package_links(state, viewer_user, &repo.id).await?;
@@ -495,8 +522,8 @@ async fn repo_page(cx: &Cx) -> Result<impl View> {
495 &format!("{branch}.tar.gz"),522 &format!("{branch}.tar.gz"),
496 ),523 ),
497 );524 );
498- // The dock: the history strip of the newest commits (cached per head) and the latest run's525+ // The dock: the history strip of the newest commits (cached per head), the newest run and the
499- // commit subject. Empty repos have no tree, so they have no dock.526+ // head commit's subject. Empty repos have no tree, so they have no dock.
500 let strip = match &head {527 let strip = match &head {
501 Some(commit) if tree.is_some() => commit_strip(state, repo, &ctx.path, commit).await,528 Some(commit) if tree.is_some() => commit_strip(state, repo, &ctx.path, commit).await,
502 _ => StripFacts::default(),529 _ => StripFacts::default(),
@@ -504,46 +531,53 @@ async fn repo_page(cx: &Cx) -> Result<impl View> {
504 let ci_states = run_states(state, &repo.id).await?;531 let ci_states = run_states(state, &repo.id).await?;
505 let bars = strip_bars(&strip.commits, &ci_states);532 let bars = strip_bars(&strip.commits, &ci_states);
506 let total = strip.total;533 let total = strip.total;
507- let search_href = repo_href(&owner_name, &repo_name, "search", "");534+ let ci_href = repo_href(&owner_name, &repo_name, "ci", "");
508- let show_search = !header.hide_search;
509 let has_chips = latest.is_some() || !packages.is_empty();535 let has_chips = latest.is_some() || !packages.is_empty();
536+ let readme_label = readme
537+ .as_ref()
538+ .map(|readme| readme.name.clone())
539+ .unwrap_or_else(|| "README".to_owned());
510 Ok(view! {540 Ok(view! {
511 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),541 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
512 repo_head(head: header)542 repo_head(head: header)
513- if has_chips {
514- repo_strip(lang: lang, facts: None, release: latest, packages: packages)
515- }
516 if !banners.is_empty() {543 if !banners.is_empty() {
517 recent_pushes(banners: banners, now: now, lang: lang)544 recent_pushes(banners: banners, now: now, lang: lang)
518 }545 }
519 if let Some(rows) = tree {546 if let Some(rows) = tree {
520- <div class="repo-grid repo-home">547+ // Two panes over the dock: the tree on the left, the README on the right.
521- <div class="repo-main">548+ <div class="repo-grid repo-home canvas-repo">
522- <div class="browse-bar" data-live-code=(follows.then_some("true")) data-live-gone=(g::t(lang, K::LivePathGone))>549+ <div class="repo-main canvas-files">
550+ <div class="browse-bar canvas-head" data-live-code=(follows.then_some("true")) data-live-gone=(g::t(lang, K::LivePathGone))>
523 ref_selector(lang: lang, label: g::t(lang, K::BranchLabel), current: branch.clone(), branches: branches, tags: tags,551 ref_selector(lang: lang, label: g::t(lang, K::BranchLabel), current: branch.clone(), branches: branches, tags: tags,
524 branches_href: branches_href, tags_href: tags_href)552 branches_href: branches_href, tags_href: tags_href)
525 file_finder(lang: lang, owner: owner_name.clone(), repo: repo_name.clone(),553 file_finder(lang: lang, owner: owner_name.clone(), repo: repo_name.clone(),
526 ref_name: branch.clone())554 ref_name: branch.clone())
527- if show_search {
528- <a class="small repo-search-link" href=(search_href.as_str()) data-palette-action="go">(g::t(lang, K::SearchCodePlaceholder))</a>
529- }
530- clone_popover(https: https, ssh: ssh, downloads: Some(downloads), lang: lang)
531 </div>555 </div>
532- tree_table(rows: rows, latest: bar, lang: lang)556+ tree_table(rows: rows, lang: lang)
533 </div>557 </div>
534 <div class="repo-split" role="separator" aria-orientation="vertical"558 <div class="repo-split" role="separator" aria-orientation="vertical"
535 aria-label=(s(lang, "Resize file tree", "Dosya ağacını boyutlandır")) tabindex="0"559 aria-label=(s(lang, "Resize file tree", "Dosya ağacını boyutlandır")) tabindex="0"
536 data-repo-split=""></div>560 data-repo-split=""></div>
537- <div class="repo-readme">561+ <div class="repo-readme canvas-readme">
538- readme_meta(lang: lang, facts: facts)562+ readme_head(label: readme_label, facts: facts, https: https, ssh: ssh, downloads: Some(downloads), lang: lang)
539- if let Some(readme) = readme {563+ <div class="canvas-body">
540- readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)564+ if has_chips {
541- }565+ repo_strip(lang: lang, facts: None, release: latest, packages: packages)
566+ }
567+ if let Some(readme) = readme {
568+ readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)
569+ } else {
570+ empty_state(title: s(lang, "No README yet", "Henüz README yok"))
571+ }
572+ </div>
542 </div>573 </div>
543 </div>574 </div>
544 repo_dock(lang: lang, runs: runs, total: total, ci_href: ci_href,575 repo_dock(lang: lang, runs: runs, total: total, ci_href: ci_href,
545- owner: owner_name.clone(), repo: repo_name.clone(), bars: bars)576+ owner: owner_name.clone(), repo: repo_name.clone(), bars: bars, latest: bar)
546 } else {577 } else {
578+ if has_chips {
579+ repo_strip(lang: lang, facts: None, release: latest, packages: packages)
580+ }
547 <div class="browse-bar">581 <div class="browse-bar">
548 clone_popover(https: https, ssh: ssh, downloads: None, lang: lang)582 clone_popover(https: https, ssh: ssh, downloads: None, lang: lang)
549 </div>583 </div>
@@ -695,6 +729,7 @@ mod tests {
695 assert!(body.contains("/tahinli/demo/archive/main.tar.gz"));729 assert!(body.contains("/tahinli/demo/archive/main.tar.gz"));
696 assert!(body.contains("/tahinli/demo/branches"));730 assert!(body.contains("/tahinli/demo/branches"));
697 assert!(body.contains("data-ref-filter"), "branch switcher rendered");731 assert!(body.contains("data-ref-filter"), "branch switcher rendered");
732+ assert!(body.contains("canvas-dock"), "dock under the two panes");
698 733
699 // Trees list their entries and link to subtrees and blobs.734 // Trees list their entries and link to subtrees and blobs.
700 let (status, body) = get(&router, "/tahinli/demo/tree/main/src").await;735 let (status, body) = get(&router, "/tahinli/demo/tree/main/src").await;
crates/forge-web/src/pages/repo_collaborators.rsmodified+2 -1
@@ -304,9 +304,10 @@ async fn collaborators_body(
304 let header = frame.head;304 let header = frame.head;
305 let nav_title = frame.title.clone();305 let nav_title = frame.title.clone();
306 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));306 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));
307+ let can_delete = header.can_delete;
307 Ok(view! {308 Ok(view! {
308 repo_head(head: header)309 repo_head(head: header)
309- settings_frame(lang: lang, title: nav_title, current: "collaborators",310+ settings_frame(lang: lang, title: nav_title, current: "collaborators", can_delete: can_delete,
310 if let Some((text, is_error)) = notice {311 if let Some((text, is_error)) = notice {
311 if is_error {312 if is_error {
312 alert(message: text)313 alert(message: text)
crates/forge-web/src/pages/repo_ctx.rsmodified+3 -0
@@ -62,6 +62,8 @@ pub struct RepoHead {
62 pub hide_search: bool,62 pub hide_search: bool,
63 /// Whether the viewer may open the Settings tab.63 /// Whether the viewer may open the Settings tab.
64 pub can_admin: bool,64 pub can_admin: bool,
65+ /// Whether the viewer may delete the repo: the settings nav lists Danger zone only then.
66+ pub can_delete: bool,
65 /// Open issues, for the Issues tab count.67 /// Open issues, for the Issues tab count.
66 pub open_issues: u64,68 pub open_issues: u64,
67 /// Open pull requests, for the Pull requests tab count.69 /// Open pull requests, for the Pull requests tab count.
@@ -246,6 +248,7 @@ impl RepoCtx {
246 active,248 active,
247 hide_search: false,249 hide_search: false,
248 can_admin: self.can_admin(),250 can_admin: self.can_admin(),
251+ can_delete: self.can_delete(),
249 open_issues: self.open_issues(state).await?,252 open_issues: self.open_issues(state).await?,
250 open_pulls,253 open_pulls,
251 forked_from,254 forked_from,
crates/forge-web/src/pages/repo_mirrors.rsmodified+2 -1
@@ -396,9 +396,10 @@ async fn frame_top(
396 lang: Lang,396 lang: Lang,
397 #[default] child: Child<'_>,397 #[default] child: Child<'_>,
398 ) -> Result<impl View> {398 ) -> Result<impl View> {
399+ let can_delete = head.can_delete;
399 Ok(view! {400 Ok(view! {
400 repo_head(head: head)401 repo_head(head: head)
401- settings_frame(lang: lang, title: title, current: "mirrors",402+ settings_frame(lang: lang, title: title, current: "mirrors", can_delete: can_delete,
402 if let Some((text, is_error)) = notice {403 if let Some((text, is_error)) = notice {
403 if is_error {404 if is_error {
404 alert(message: text)405 alert(message: text)
crates/forge-web/src/pages/repo_rename.rsmodified+1 -1
@@ -120,7 +120,7 @@ async fn rename_body(
120 } = forms;120 } = forms;
121 Ok(view! {121 Ok(view! {
122 repo_head(head: head)122 repo_head(head: head)
123- settings_frame(lang: lang, title: nav_title, current: "rename",123+ settings_frame(lang: lang, title: nav_title, current: "rename", can_delete: can_delete,
124 if let Some(key) = notice {124 if let Some(key) = notice {
125 <section class="card notice" role="status">(g::t(lang, key))</section>125 <section class="card notice" role="status">(g::t(lang, key))</section>
126 }126 }
crates/forge-web/src/pages/repo_scrub.rsadded+248 -0
@@ -0,0 +1,248 @@
1+//! Page: one commit's root listing and README at `/{owner}/{repo}/scrub/{oid}`, fetched by the
2+//! repo home's timeline scrub (nav.js). The page is a full HTML page whose content is two
3+//! wrappers: `[data-scrub-tree]` holds the listing rows and carries the commit time in
4+//! `data-scrub-when`, and `[data-scrub-readme]` holds the README. Both use the home page's pieces
5+//! (`entry_rows`, `load_readme`, `readme_card`). A commit's content never changes, so the built
6+//! parts are cached in memory.
7+
8+use std::collections::{HashMap, VecDeque};
9+use std::path::PathBuf;
10+use std::sync::{Arc, Mutex};
11+
12+use forge_core::Repo as RepoRow;
13+use forge_git::browse;
14+use topcoat::Result;
15+use topcoat::context::{Cx, app_context};
16+use topcoat::router::error::not_found;
17+use topcoat::router::{page, path_param};
18+use topcoat::view::{View, component, view};
19+
20+use crate::i18n::Lang;
21+use crate::i18n::code::{self as g};
22+use crate::pages::repo_ctx::{RepoCtx, load_repo};
23+use crate::pages::tree::{entry_rows, load_readme, read_dir, readme_card};
24+use crate::state::AppState;
25+use crate::views::{now_unix, shell};
26+
27+/// Most parts kept in memory at once. The oldest entry goes first.
28+const CACHE_CAP: usize = 64;
29+
30+/// One row of the scrubbed listing: no last-commit column, the name links to the entry at the commit.
31+#[derive(Clone)]
32+struct ScrubRow {
33+ kind: &'static str,
34+ name: String,
35+ href: Option<String>,
36+ short: String,
37+}
38+
39+/// The README at the commit, already rendered like the home page's.
40+#[derive(Clone)]
41+struct ScrubReadme {
42+ name: String,
43+ markdown: bool,
44+ body: String,
45+}
46+
47+/// What the page renders for one commit.
48+struct Parts {
49+ when: i64,
50+ rows: Vec<ScrubRow>,
51+ readme: Option<ScrubReadme>,
52+}
53+
54+/// A cached `Parts`. Owner and name are part of the check, since the links inside it carry them.
55+struct Cached {
56+ repo_id: String,
57+ owner: String,
58+ name: String,
59+ oid: String,
60+ lang: Lang,
61+ parts: Arc<Parts>,
62+}
63+
64+static CACHE: Mutex<VecDeque<Cached>> = Mutex::new(VecDeque::new());
65+
66+path_param!(owner);
67+path_param!(repo);
68+path_param!(oid);
69+
70+/// A full commit id: 40 lowercase hex digits.
71+fn is_full_oid(oid: &str) -> bool {
72+ oid.len() == 40
73+ && oid
74+ .bytes()
75+ .all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b))
76+}
77+
78+fn cache_get(repo: &RepoRow, oid: &str, lang: Lang) -> Option<Arc<Parts>> {
79+ let cache = CACHE.lock().expect("scrub cache");
80+ cache
81+ .iter()
82+ .find(|c| {
83+ c.repo_id == repo.id
84+ && c.oid == oid
85+ && c.lang == lang
86+ && c.owner == repo.owner_name
87+ && c.name == repo.name
88+ })
89+ .map(|c| c.parts.clone())
90+}
91+
92+fn cache_put(repo: &RepoRow, oid: &str, lang: Lang, parts: Arc<Parts>) {
93+ let mut cache = CACHE.lock().expect("scrub cache");
94+ // A stale entry for the same commit (an older owner or name) is replaced, not kept beside it.
95+ cache.retain(|c| !(c.repo_id == repo.id && c.oid == oid && c.lang == lang));
96+ while cache.len() >= CACHE_CAP {
97+ cache.pop_front();
98+ }
99+ cache.push_back(Cached {
100+ repo_id: repo.id.clone(),
101+ owner: repo.owner_name.clone(),
102+ name: repo.name.clone(),
103+ oid: oid.to_owned(),
104+ lang,
105+ parts,
106+ });
107+}
108+
109+/// The parts for `oid`, from the cache or built now. None when the commit does not exist.
110+async fn scrub_parts(state: &AppState, ctx: &RepoCtx, oid: &str) -> Result<Option<Arc<Parts>>> {
111+ let repo = &ctx.repo;
112+ if let Some(hit) = cache_get(repo, oid, ctx.lang) {
113+ return Ok(Some(hit));
114+ }
115+ let path: PathBuf = ctx.path.clone();
116+ let commit = oid.to_owned();
117+ let info = tokio::task::spawn_blocking(move || browse::read_commit(&path, &commit)).await??;
118+ let Some(info) = info else {
119+ return Ok(None);
120+ };
121+ let Some(entries) = read_dir(ctx.path.clone(), oid.to_owned(), String::new()).await? else {
122+ return Ok(None);
123+ };
124+ // The commit's own id is the ref, so links in the listing and README point at this commit.
125+ let readme = load_readme(state, repo, &ctx.path, oid, oid, "", &entries).await?;
126+ let rows = entry_rows(
127+ ctx.lang,
128+ repo,
129+ oid,
130+ "",
131+ entries,
132+ &HashMap::new(),
133+ now_unix(),
134+ ctx.viewer_tz(),
135+ )
136+ .into_iter()
137+ .map(|row| ScrubRow {
138+ kind: row.kind,
139+ name: row.name,
140+ href: row.href,
141+ short: row.short,
142+ })
143+ .collect();
144+ let parts = Arc::new(Parts {
145+ when: info.author_time,
146+ rows,
147+ readme: readme.map(|r| ScrubReadme {
148+ name: r.name,
149+ markdown: r.markdown,
150+ body: r.body,
151+ }),
152+ });
153+ cache_put(repo, oid, ctx.lang, parts.clone());
154+ Ok(Some(parts))
155+}
156+
157+/// The listing rows. Names link to their entry at the commit; directories get the folder icon.
158+#[component]
159+async fn scrub_table(rows: Vec<ScrubRow>, lang: Lang) -> Result<impl View> {
160+ Ok(view! {
161+ for row in rows.into_iter() {
162+ <div class="tree-entry">
163+ <span class="tree-kind">
164+ if row.kind == "dir" {
165+ <svg class="kind-icon is-dir" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.7-.9l-.8-1.2A2 2 0 0 0 7.9 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>
166+ } else {
167+ <svg class="kind-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>
168+ }
169+ <span class="sr-only">(g::kind_label(lang, row.kind))</span>
170+ </span>
171+ if let Some(href) = row.href {
172+ <a class="tree-entry-name" href=(href)>(row.name)</a>
173+ } else {
174+ <span class="tree-entry-name">(row.name)</span>
175+ <span class="tree-entry-sha mono">(row.short)</span>
176+ }
177+ </div>
178+ }
179+ })
180+}
181+
182+#[page("/{owner}/{repo}/scrub/{oid}")]
183+async fn scrub_page(cx: &Cx) -> Result<impl View> {
184+ let owner = path_param::<Owner>(cx);
185+ let name = path_param::<Repo>(cx);
186+ let oid = path_param::<Oid>(cx);
187+ let ctx = load_repo(cx, owner, name).await?;
188+ if !is_full_oid(&oid) {
189+ return Err(not_found().into());
190+ }
191+ let state = app_context::<AppState>(cx);
192+ let Some(parts) = scrub_parts(state, &ctx, &oid).await? else {
193+ return Err(not_found().into());
194+ };
195+ let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name);
196+ let when = parts.when.to_string();
197+ let rows = parts.rows.clone();
198+ let readme = parts.readme.clone();
199+ let lang = ctx.lang;
200+ Ok(view! {
201+ shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
202+ <div data-scrub-tree="" data-scrub-when=(when.as_str())>
203+ scrub_table(rows: rows, lang: lang)
204+ </div>
205+ <div data-scrub-readme="">
206+ if let Some(readme) = readme {
207+ readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)
208+ }
209+ </div>
210+ )
211+ })
212+}
213+
214+#[cfg(test)]
215+mod tests {
216+ use forge_core::Visibility;
217+
218+ use crate::auth::SESSION_COOKIE;
219+ use crate::pages::commits::test_support::{Fixture, OWNER, REPO, get};
220+ use crate::test_support::create_session;
221+
222+ /// A private repo's scrub page is a 404 for anonymous visitors. The owner gets the root's names.
223+ #[tokio::test]
224+ async fn scrub_page_follows_read_access() {
225+ let fx = Fixture::new(Visibility::Private).await;
226+ let uri = format!("/{OWNER}/{REPO}/scrub/{}", fx.root);
227+ let (status, _, _) = get(&fx.router, &uri).await;
228+ assert_eq!(status, 404);
229+
230+ let owner = fx.store.user_by_username(OWNER).await.unwrap().unwrap();
231+ create_session(&fx.store, &owner.id, "scrub-owner", "scrub-csrf").await;
232+ let req = http::Request::builder()
233+ .method("GET")
234+ .uri(&uri)
235+ .header("cookie", format!("__Host-{SESSION_COOKIE}=scrub-owner"))
236+ .body(topcoat::router::Body::empty())
237+ .unwrap();
238+ let res = fx.router.handle(req).await;
239+ assert_eq!(res.status().as_u16(), 200);
240+ let bytes = topcoat::router::to_bytes(res.into_body(), usize::MAX)
241+ .await
242+ .unwrap();
243+ let body = String::from_utf8_lossy(&bytes);
244+ assert!(body.contains("data-scrub-tree"));
245+ assert!(body.contains("a.txt"));
246+ assert!(body.contains("dir"));
247+ }
248+}
crates/forge-web/src/pages/repo_secrets.rsmodified+2 -1
@@ -158,9 +158,10 @@ async fn frame_top(
158 #[default] child: Child<'_>,158 #[default] child: Child<'_>,
159 ) -> Result<impl View> {159 ) -> Result<impl View> {
160 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));160 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));
161+ let can_delete = head.can_delete;
161 Ok(view! {162 Ok(view! {
162 repo_head(head: head)163 repo_head(head: head)
163- settings_frame(lang: lang, title: title, current: "secrets",164+ settings_frame(lang: lang, title: title, current: "secrets", can_delete: can_delete,
164 if let Some((text, is_error)) = notice {165 if let Some((text, is_error)) = notice {
165 if is_error {166 if is_error {
166 alert(message: text)167 alert(message: text)
crates/forge-web/src/pages/repo_settings.rsmodified+103 -50
@@ -1,7 +1,7 @@
1 //! Page: repo settings (`/{owner}/{repo}/settings`). The owner, an instance admin and collaborators1 //! Page: repo settings (`/{owner}/{repo}/settings`). The owner, an instance admin and collaborators
2-//! with the Admin role get the page. It holds the General section (description, default branch,2+//! with the Admin role get the page. It shows one section at a time, chosen by `?section=`: General
3-//! visibility, archive), the branch protection rules (Admin) and the danger zone (Delete: owner or3+//! (description, default branch, visibility, archive; the default), branch protection rules (Admin),
4-//! instance admin only). Deleting moves the bare repo into `data_dir/trash` and removes its database4+//! discussions and the danger zone (Delete: owner or instance admin only). Deleting moves the bare repo into `data_dir/trash` and removes its database
5 //! rows in one transaction. The repo is never erased from disk, so an admin can recover it from the5 //! rows in one transaction. The repo is never erased from disk, so an admin can recover it from the
6 //! trash.6 //! trash.
7 7
@@ -25,7 +25,7 @@ use topcoat::context::{Cx, app_context};
25 use topcoat::cookie::{Cookie, Cookies, SameSite, cookies};25 use topcoat::cookie::{Cookie, Cookies, SameSite, cookies};
26 use topcoat::router::content::Form;26 use topcoat::router::content::Form;
27 use topcoat::router::error::{SeeOther, forbidden, see_other};27 use topcoat::router::error::{SeeOther, forbidden, see_other};
28-use topcoat::router::{page, path_param, route};28+use topcoat::router::{page, path_param, query_params, route};
29 use topcoat::view::{Child, View, component, view};29 use topcoat::view::{Child, View, component, view};
30 30
31 use crate::audit::{self, Actor, Target};31 use crate::audit::{self, Actor, Target};
@@ -45,6 +45,23 @@ use crate::views::{alert, enc, shell};
45 path_param!(owner);45 path_param!(owner);
46 path_param!(repo);46 path_param!(repo);
47 47
48+/// The `?section=` query of the settings page. Unknown values show General.
49+#[query_params(error = bad_request)]
50+pub(crate) struct SectionQuery {
51+ section: Option<String>,
52+}
53+
54+/// The section to show: `branches`, `discussions`, or `danger` (only for a viewer who may delete the
55+/// repo). Anything else is `general`.
56+fn pick_section(raw: Option<&str>, can_delete: bool) -> &'static str {
57+ match raw {
58+ Some("branches") => "branches",
59+ Some("discussions") => "discussions",
60+ Some("danger") if can_delete => "danger",
61+ _ => "general",
62+ }
63+}
64+
48 /// Cookie that carries a one-shot notice (the deleted repo's `owner/name`) to the next profile page.65 /// Cookie that carries a one-shot notice (the deleted repo's `owner/name`) to the next profile page.
49 pub const NOTICE_COOKIE: &str = "forge_notice";66 pub const NOTICE_COOKIE: &str = "forge_notice";
50 67
@@ -197,6 +214,11 @@ fn back_to_settings(title: &str) -> SeeOther {
197 see_other(format!("/{title}/settings"))214 see_other(format!("/{title}/settings"))
198 }215 }
199 216
217+/// Redirect back to one section of the settings page (its `?section=` value).
218+fn back_to_section(title: &str, section: &str) -> SeeOther {
219+ see_other(format!("/{title}/settings?section={section}"))
220+}
221+
200 /// Drops control characters (so the text is one line) and surrounding spaces.222 /// Drops control characters (so the text is one line) and surrounding spaces.
201 fn clean_description(raw: &str) -> String {223 fn clean_description(raw: &str) -> String {
202 raw.chars()224 raw.chars()
@@ -249,9 +271,9 @@ async fn danger_zone(
249 ) -> Result<impl View> {271 ) -> Result<impl View> {
250 let action = format!("/{title}/settings/delete");272 let action = format!("/{title}/settings/delete");
251 Ok(view! {273 Ok(view! {
252- <section class="card">274+ <section class="settings-section">
253 <h2>(g::t(lang, K::DangerZone))</h2>275 <h2>(g::t(lang, K::DangerZone))</h2>
254- <p>(g::t(lang, K::DeleteRepoHelp))</p>276+ <p class="settings-intro">(g::t(lang, K::DeleteRepoHelp))</p>
255 <p class="muted small">(g::t(lang, K::DeleteTrashHelp))</p>277 <p class="muted small">(g::t(lang, K::DeleteTrashHelp))</p>
256 if let Some(message) = error {278 if let Some(message) = error {
257 alert(message: message.as_str())279 alert(message: message.as_str())
@@ -270,15 +292,25 @@ async fn danger_zone(
270 292
271 /// The settings frame: the sections in a left pane and the page's own content (its children) in a293 /// The settings frame: the sections in a left pane and the page's own content (its children) in a
272 /// right pane. Both fill the window below the repo head (see `.settings-layout` in `_lang_browse.scss`).294 /// right pane. Both fill the window below the repo head (see `.settings-layout` in `_lang_browse.scss`).
273-/// `current` names the section shown (`general`, `webhooks`, ...) and gets `aria-current`.295+/// `current` names the section shown (`general`, `branches`, `webhooks`, ...) and gets `aria-current`.
296+/// The General page's sections (`branches`, `discussions`, `danger`) are `?section=` links right after
297+/// General; the danger link is only for a viewer who may delete the repo (`can_delete`).
274 #[component]298 #[component]
275 pub async fn settings_frame(299 pub async fn settings_frame(
276 lang: Lang,300 lang: Lang,
277 title: String,301 title: String,
278 current: &'static str,302 current: &'static str,
303+ can_delete: bool,
279 #[default] child: Child<'_>,304 #[default] child: Child<'_>,
280 ) -> Result<impl View> {305 ) -> Result<impl View> {
281 let general = format!("/{title}/settings");306 let general = format!("/{title}/settings");
307+ let branches = format!("/{title}/settings?section=branches");
308+ let discussions = format!("/{title}/settings?section=discussions");
309+ let danger = format!("/{title}/settings?section=danger");
310+ let branches_on = current == "branches";
311+ let discussions_on = current == "discussions";
312+ let danger_on = current == "danger";
313+ let discussions_label = crate::i18n::community::t(lang, crate::i18n::community::K::Discussions);
282 let collaborators = format!("/{title}/settings/collaborators");314 let collaborators = format!("/{title}/settings/collaborators");
283 let rename = format!("/{title}/settings/rename");315 let rename = format!("/{title}/settings/rename");
284 let hooks = format!("/{title}/settings/hooks");316 let hooks = format!("/{title}/settings/hooks");
@@ -293,13 +325,30 @@ pub async fn settings_frame(
293 let wiki = format!("/{title}/settings/wiki");325 let wiki = format!("/{title}/settings/wiki");
294 let wiki_on = current == "wiki";326 let wiki_on = current == "wiki";
295 Ok(view! {327 Ok(view! {
296- <div class="settings-layout">328+ <div class="settings-layout fit-pane">
297 <nav class="settings-nav" aria-label=(g::t(lang, K::SettingsNavLabel))>329 <nav class="settings-nav" aria-label=(g::t(lang, K::SettingsNavLabel))>
298 if general_on {330 if general_on {
299 <a href=(general) aria-current="page">(g::t(lang, K::General))</a>331 <a href=(general) aria-current="page">(g::t(lang, K::General))</a>
300 } else {332 } else {
301 <a href=(general)>(g::t(lang, K::General))</a>333 <a href=(general)>(g::t(lang, K::General))</a>
302 }334 }
335+ if branches_on {
336+ <a href=(branches.as_str()) aria-current="page">(g::t(lang, K::BranchProtection))</a>
337+ } else {
338+ <a href=(branches.as_str())>(g::t(lang, K::BranchProtection))</a>
339+ }
340+ if discussions_on {
341+ <a href=(discussions.as_str()) aria-current="page">(discussions_label)</a>
342+ } else {
343+ <a href=(discussions.as_str())>(discussions_label)</a>
344+ }
345+ if can_delete {
346+ if danger_on {
347+ <a href=(danger.as_str()) aria-current="page">(g::t(lang, K::DangerZone))</a>
348+ } else {
349+ <a href=(danger.as_str())>(g::t(lang, K::DangerZone))</a>
350+ }
351+ }
303 if collaborators_on {352 if collaborators_on {
304 <a href=(collaborators) aria-current="page">(g::t(lang, K::Collaborators))</a>353 <a href=(collaborators) aria-current="page">(g::t(lang, K::Collaborators))</a>
305 } else {354 } else {
@@ -379,7 +428,7 @@ async fn general_section(
379 })428 })
380 .collect();429 .collect();
381 Ok(view! {430 Ok(view! {
382- <section class="card">431+ <section class="settings-section">
383 <h2>(g::t(lang, K::General))</h2>432 <h2>(g::t(lang, K::General))</h2>
384 <form method="post" action=(general_action) class="stack">433 <form method="post" action=(general_action) class="stack">
385 <input type="hidden" name="csrf" value=(csrf.clone())>434 <input type="hidden" name="csrf" value=(csrf.clone())>
@@ -623,6 +672,7 @@ async fn branch_rule_cards(
623 delete_action: delete_action.clone(), rule_id: None,672 delete_action: delete_action.clone(), rule_id: None,
624 draft: new_draft, contexts: contexts.clone())673 draft: new_draft, contexts: contexts.clone())
625 </details>674 </details>
675+ <p class="rule-pick muted">(passkeys::s(lang, "Pick a rule to edit it.", "Düzenlemek için bir kural seç."))</p>
626 </div>676 </div>
627 })677 })
628 }678 }
@@ -669,10 +719,7 @@ async fn branch_rule_form(
669 <input type="hidden" name="csrf" value=(csrf.as_str())>719 <input type="hidden" name="csrf" value=(csrf.as_str())>
670 <fieldset class="rule-section">720 <fieldset class="rule-section">
671 <legend>(g::t(lang, K::SectionPattern))</legend>721 <legend>(g::t(lang, K::SectionPattern))</legend>
672- <label>722+ <input type="text" name="pattern" value=(pattern.as_str()) aria-label=(g::t(lang, K::BranchPattern)) autocomplete="off" spellcheck="false" required=(true)>
673- <span>(g::t(lang, K::BranchPattern))</span>
674- <input type="text" name="pattern" value=(pattern.as_str()) autocomplete="off" spellcheck="false" required=(true)>
675- </label>
676 <p class="muted small">(g::t(lang, K::PatternHelpA))<code>"*"</code>(g::t(lang, K::PatternHelpB))<code>"**"</code>(g::t(lang, K::PatternHelpC))<code>"/"</code>(g::t(lang, K::PatternHelpD))</p>723 <p class="muted small">(g::t(lang, K::PatternHelpA))<code>"*"</code>(g::t(lang, K::PatternHelpB))<code>"**"</code>(g::t(lang, K::PatternHelpC))<code>"/"</code>(g::t(lang, K::PatternHelpD))</p>
677 </fieldset>724 </fieldset>
678 <div class="rule-pair">725 <div class="rule-pair">
@@ -716,10 +763,7 @@ async fn branch_rule_form(
716 </div>763 </div>
717 <fieldset class="rule-section">764 <fieldset class="rule-section">
718 <legend>(g::t(lang, K::SectionChecks))</legend>765 <legend>(g::t(lang, K::SectionChecks))</legend>
719- <label>766+ <input type="text" name="required_checks" value=(required_checks.as_str()) aria-label=(g::t(lang, K::RequiredChecks)) autocomplete="off" spellcheck="false" placeholder="ci/test, ci/lint">
720- <span>(g::t(lang, K::RequiredChecks))</span>
721- <input type="text" name="required_checks" value=(required_checks.as_str()) autocomplete="off" spellcheck="false" placeholder="ci/test, ci/lint">
722- </label>
723 <p class="muted small">(g::t(lang, K::RequiredChecksHelp))</p>767 <p class="muted small">(g::t(lang, K::RequiredChecksHelp))</p>
724 if !contexts.is_empty() {768 if !contexts.is_empty() {
725 <div class="context-picker">769 <div class="context-picker">
@@ -801,8 +845,8 @@ struct SettingsView {
801 contexts: Vec<String>,845 contexts: Vec<String>,
802 }846 }
803 847
804-/// The settings body: the repo header tabs with Settings active, the sub-navigation, the General848+/// The settings body: the repo header tabs with Settings active, the sub-navigation, then one section
805-/// section, the branch protection section, then the danger zone when the viewer may delete the repo.849+/// (`section`: general, branches, discussions or danger) in one left aligned column.
806 #[component]850 #[component]
807 async fn settings_body(851 async fn settings_body(
808 lang: Lang,852 lang: Lang,
@@ -813,6 +857,7 @@ async fn settings_body(
813 title: String,857 title: String,
814 csrf: String,858 csrf: String,
815 can_delete: bool,859 can_delete: bool,
860+ section: &'static str,
816 page: SettingsView,861 page: SettingsView,
817 ) -> Result<impl View> {862 ) -> Result<impl View> {
818 let builtin_row = !page863 let builtin_row = !page
@@ -849,15 +894,22 @@ async fn settings_body(
849 }894 }
850 let new_draft = draft.unwrap_or_else(|| RuleDraft::for_default_branch(&default_branch));895 let new_draft = draft.unwrap_or_else(|| RuleDraft::for_default_branch(&default_branch));
851 // The New rule form stays collapsed unless its draft was rejected with an error.896 // The New rule form stays collapsed unless its draft was rejected with an error.
852- let new_open = new_draft.error.is_some();897+ let mut new_open = new_draft.error.is_some();
898+ // The editor pane is never blank on arrival: the first rule, or the new rule if there is none.
899+ if !new_open && !cards.iter().any(|card| card.open) {
900+ match cards.first_mut() {
901+ Some(first) => first.open = true,
902+ None => new_open = true,
903+ }
904+ }
853 let (description, visibility) = (head.description.clone(), head.visibility);905 let (description, visibility) = (head.description.clone(), head.visibility);
854 let discussions_on = head.discussions;906 let discussions_on = head.discussions;
855 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));907 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));
856- // Three columns on a wide window: the General section, the branch rules, then discussions and the908+ // Only one section is rendered. The danger section is only chosen for a viewer who may delete
857- // danger zone. The pane holds them to one screen (see _fit_settings.scss).909+ // (see `pick_section`), and it is last so that its moves come after every clone.
858 Ok(view! {910 Ok(view! {
859 repo_head(head: head)911 repo_head(head: head)
860- settings_frame(lang: lang, title: title.clone(), current: "general",912+ settings_frame(lang: lang, title: title.clone(), current: section, can_delete: can_delete,
861 if let Some((text, is_error)) = notice {913 if let Some((text, is_error)) = notice {
862 if is_error {914 if is_error {
863 alert(message: text)915 alert(message: text)
@@ -865,28 +917,26 @@ async fn settings_body(
865 <section class="card notice" role="status">(text)</section>917 <section class="card notice" role="status">(text)</section>
866 }918 }
867 }919 }
868- <div class="fit-pane settings-split">920+ if section == "general" {
869- <div class="settings-col">921+ general_section(lang: lang, title: title.clone(), csrf: csrf.clone(), description: description,
870- general_section(lang: lang, title: title.clone(), csrf: csrf.clone(), description: description,922+ default_branch: default_branch.clone(), branches: branches,
871- default_branch: default_branch.clone(), branches: branches,923+ visibility: visibility, archived: archived)
872- visibility: visibility, archived: archived)924+ }
873- </div>925+ if section == "branches" {
874- <div class="settings-col">926+ <section class="settings-section settings-rules">
875- <section class="card">927+ <h2>(g::t(lang, K::BranchProtection))</h2>
876- <h2>(g::t(lang, K::BranchProtection))</h2>928+ <p class="muted small">(g::t(lang, K::BranchProtectionHelp))</p>
877- <p class="muted small">(g::t(lang, K::BranchProtectionHelp))</p>929+ branch_rule_cards(lang: lang, cards: cards, builtin_row: builtin_row, default_branch: default_branch.clone(),
878- branch_rule_cards(lang: lang, cards: cards, builtin_row: builtin_row, default_branch: default_branch.clone(),930+ new_draft: new_draft, new_open: new_open, csrf: csrf.clone(), save_action: rules_action,
879- new_draft: new_draft, new_open: new_open, csrf: csrf.clone(), save_action: rules_action,931+ delete_action: delete_action, contexts: contexts)
880- delete_action: delete_action, contexts: contexts)932+ </section>
881- </section>933+ }
882- </div>934+ if section == "discussions" {
883- <div class="settings-col">935+ discussions_card(lang: lang, action: format!("/{title}/settings/discussions"), csrf: csrf.clone(), enabled: discussions_on)
884- discussions_card(lang: lang, action: format!("/{title}/settings/discussions"), csrf: csrf.clone(), enabled: discussions_on)936+ }
885- if can_delete {937+ if section == "danger" && can_delete {
886- danger_zone(lang: lang, csrf: csrf, title: title, error: delete_error)938+ danger_zone(lang: lang, csrf: csrf, title: title, error: delete_error)
887- }939+ }
888- </div>
889- </div>
890 )940 )
891 })941 })
892 }942 }
@@ -927,6 +977,8 @@ async fn settings_page(cx: &Cx) -> Result<impl View> {
927 return Err(forbidden().into());977 return Err(forbidden().into());
928 }978 }
929 let lang = i18n::lang(cx, Some(&user));979 let lang = i18n::lang(cx, Some(&user));
980+ let query = query_params::<SectionQuery>(cx)?;
981+ let section = pick_section(query.section.as_deref(), ctx.can_delete());
930 let rules = app_context::<AppState>(cx)982 let rules = app_context::<AppState>(cx)
931 .store983 .store
932 .list_branch_rules(&ctx.repo.id)984 .list_branch_rules(&ctx.repo.id)
@@ -948,7 +1000,7 @@ async fn settings_page(cx: &Cx) -> Result<impl View> {
948 shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),1000 shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
949 settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,1001 settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,
950 branches: branches, title: frame.title, csrf: csrf,1002 branches: branches, title: frame.title, csrf: csrf,
951- can_delete: frame.can_delete, page: page))1003+ can_delete: frame.can_delete, section: section, page: page))
952 })1004 })
953 }1005 }
954 1006
@@ -1255,11 +1307,12 @@ async fn settings_delete(cx: &Cx, Form(form): Form<DeleteForm>) -> Result<impl V
1255 let csrf = session.csrf_token.clone();1307 let csrf = session.csrf_token.clone();
1256 let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?;1308 let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?;
1257 let branches = load_branch_names(&ctx).await?;1309 let branches = load_branch_names(&ctx).await?;
1310+ // The delete form lives in the danger section, so a failed confirmation re-renders that section.
1258 Ok(view! {1311 Ok(view! {
1259 shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),1312 shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
1260 settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,1313 settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,
1261 branches: branches, title: frame.title, csrf: csrf,1314 branches: branches, title: frame.title, csrf: csrf,
1262- can_delete: frame.can_delete, page: page))1315+ can_delete: frame.can_delete, section: "danger", page: page))
1263 })1316 })
1264 }1317 }
1265 1318
@@ -1316,7 +1369,7 @@ async fn settings_branch_save(cx: &Cx, Form(form): Form<BranchForm>) -> Result<i
1316 shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),1369 shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
1317 settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,1370 settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,
1318 branches: branches, title: frame.title, csrf: csrf,1371 branches: branches, title: frame.title, csrf: csrf,
1319- can_delete: frame.can_delete, page: page))1372+ can_delete: frame.can_delete, section: "branches", page: page))
1320 });1373 });
1321 }1374 }
1322 };1375 };
@@ -1340,7 +1393,7 @@ async fn settings_branch_save(cx: &Cx, Form(form): Form<BranchForm>) -> Result<i
1340 "branch rule saved"1393 "branch rule saved"
1341 );1394 );
1342 set_settings_notice(cx, "saved");1395 set_settings_notice(cx, "saved");
1343- Err(see_other(format!("/{title}/settings")).into())1396+ Err(back_to_section(&title, "branches").into())
1344 }1397 }
1345 1398
1346 /// Removes a branch rule by id, scoped to this repo. Same checks as the save form.1399 /// Removes a branch rule by id, scoped to this repo. Same checks as the save form.
@@ -1373,7 +1426,7 @@ async fn settings_branch_delete(cx: &Cx, Form(form): Form<BranchDeleteForm>) ->
1373 .await;1426 .await;
1374 set_settings_notice(cx, "removed");1427 set_settings_notice(cx, "removed");
1375 let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name);1428 let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name);
1376- Ok(see_other(format!("/{title}/settings")))1429+ Ok(back_to_section(&title, "branches"))
1377 }1430 }
1378 1431
1379 #[cfg(test)]1432 #[cfg(test)]
crates/forge-web/src/pages/repo_side.rsmodified+37 -13
@@ -24,8 +24,10 @@ use crate::pages::ci_runs::{duration_templates, duration_text, run_href, state_t
24 use crate::pages::packages::PackageLink;24 use crate::pages::packages::PackageLink;
25 use crate::pages::passkeys::s;25 use crate::pages::passkeys::s;
26 use crate::pages::releases::LatestRelease;26 use crate::pages::releases::LatestRelease;
27+use crate::pages::tree::LatestBar;
27 use crate::repo_stats::{LangShare, languages, license_file, license_id};28 use crate::repo_stats::{LangShare, languages, license_file, license_id};
28 use crate::state::AppState;29 use crate::state::AppState;
30+use crate::views::commit_line::commit_line;
29 use crate::views::timeline::{StripBar, history_strip};31 use crate::views::timeline::{StripBar, history_strip};
30 use crate::views::{human_size, now_unix, rel_time, short_oid};32 use crate::views::{human_size, now_unix, rel_time, short_oid};
31 33
@@ -190,8 +192,6 @@ pub struct RunRow {
190 pub href: String,192 pub href: String,
191 pub number: i64,193 pub number: i64,
192 pub state: RunState,194 pub state: RunState,
193- /// The full commit id the run tests.
194- pub commit: String,
195 pub dot: &'static str,195 pub dot: &'static str,
196 /// Unix seconds the run started, for the ticking clock of a run still going.196 /// Unix seconds the run started, for the ticking clock of a run still going.
197 pub since: Option<String>,197 pub since: Option<String>,
@@ -324,7 +324,6 @@ pub async fn run_rows(state: &AppState, lang: Lang, repo: &Repo) -> Result<Vec<R
324 href: run_href(&title, run.number),324 href: run_href(&title, run.number),
325 number: run.number,325 number: run.number,
326 state: run.state,326 state: run.state,
327- commit: run.commit_oid.clone(),
328 dot: run_dot(run.state),327 dot: run_dot(run.state),
329 since,328 since,
330 pre,329 pre,
@@ -482,17 +481,23 @@ pub async fn readme_meta(lang: Lang, facts: Option<TreeFacts>) -> Result<impl Vi
482 let show = !parts.is_empty();481 let show = !parts.is_empty();
483 Ok(view! {482 Ok(view! {
484 if show {483 if show {
485- <div class="readme-head">484+ <span class="readme-meta" title=(all.as_str())>(text.as_str())</span>
486- <span class="readme-meta" title=(all.as_str())>(text.as_str())</span>
487- </div>
488 }485 }
489 })486 })
490 }487 }
491 488
492-/// The repo page's bottom dock, always shown: the newest CI run in one line (its dot, number,489+/// The dot's state word is accent only while the run goes; every other state is plain text.
493-/// state, sha, commit subject and, while it goes, the elapsed and the time left), the commit count490+fn dock_state_class(run: RunState) -> &'static str {
494-/// and a link to all runs; under it the history strip. The clock attributes on the root let the491+ match run {
495-/// page's ticker count a running run.492+ RunState::Running | RunState::Queued => "dock-state is-live",
493+ _ => "dock-state",
494+ }
495+}
496+
497+/// The repo's bottom dock, shown under the panes on the repo home and the tree pages: one info row
498+/// (the newest CI run's dot, number and state, the commit's sha, author and subject with a
499+/// full-message expander, the commit count and All runs), then the history strip. `latest` is the
500+/// commit the page shows. The clock attributes on the root let the page's ticker count a running run.
496 #[component]501 #[component]
497 pub async fn repo_dock(502 pub async fn repo_dock(
498 lang: Lang,503 lang: Lang,
@@ -502,6 +507,7 @@ pub async fn repo_dock(
502 owner: String,507 owner: String,
503 repo: String,508 repo: String,
504 bars: Vec<StripBar>,509 bars: Vec<StripBar>,
510+ latest: Option<LatestBar>,
505 ) -> Result<impl View> {511 ) -> Result<impl View> {
506 // The clock: the server's time and the duration words the page's ticker rewrites with.512 // The clock: the server's time and the duration words the page's ticker rewrites with.
507 let now = now_unix();513 let now = now_unix();
@@ -509,16 +515,16 @@ pub async fn repo_dock(
509 let commits = tl::commit_count(lang, total);515 let commits = tl::commit_count(lang, total);
510 let all_runs = tl::t(lang, TK::AllRuns);516 let all_runs = tl::t(lang, TK::AllRuns);
511 let aria = tl::t(lang, TK::Timeline);517 let aria = tl::t(lang, TK::Timeline);
518+ let expand = s(lang, "Full commit message", "Commit mesajının tamamı");
512 Ok(view! {519 Ok(view! {
513- <section class="repo-dock" aria-label=(aria) data-now=(now.to_string()) data-fm=(fm.as_str()) data-fs=(fs.as_str())>520+ <section class="repo-dock canvas-dock" aria-label=(aria) data-now=(now.to_string()) data-fm=(fm.as_str()) data-fs=(fs.as_str())>
514 <div class="dock-info">521 <div class="dock-info">
515 if let Some(run) = runs.first() {522 if let Some(run) = runs.first() {
516 <a class="dock-run" href=(run.href.as_str()) title=(run.title.as_str())>523 <a class="dock-run" href=(run.href.as_str()) title=(run.title.as_str())>
517 <span class=(run.dot)></span>524 <span class=(run.dot)></span>
518 <span class="side-run-name">(format!("CI #{}", run.number))</span>525 <span class="side-run-name">(format!("CI #{}", run.number))</span>
519 </a>526 </a>
520- <span class="dock-state">(state_text(lang, run.state.as_str()))</span>527+ <span class=(dock_state_class(run.state))>(state_text(lang, run.state.as_str()))</span>
521- <span class="sha">(short_oid(&run.commit))</span>
522 if let Some(since) = run.since.as_deref() {528 if let Some(since) = run.since.as_deref() {
523 if let Some(est) = run.est.as_ref() {529 if let Some(est) = run.est.as_ref() {
524 <span class="dock-clock muted" data-since=(since) data-pre=(run.pre.as_deref()) data-expected=(est.expected.as_str()) data-left=(est.left.as_str()) data-over=(est.over.as_str()) data-lm=(est.minutes.as_str())>(run.label.as_str())</span>530 <span class="dock-clock muted" data-since=(since) data-pre=(run.pre.as_deref()) data-expected=(est.expected.as_str()) data-left=(est.left.as_str()) data-over=(est.over.as_str()) data-lm=(est.minutes.as_str())>(run.label.as_str())</span>
@@ -527,6 +533,24 @@ pub async fn repo_dock(
527 }533 }
528 }534 }
529 }535 }
536+ if let Some(bar) = latest {
537+ <span class="sha dock-sha">(bar.short.as_str())</span>
538+ if let (Some(src), Some(href)) = (bar.avatar, bar.author_href) {
539+ <a class="dock-author" href=(href) title=(bar.author.as_str())>
540+ <img class="avatar avatar-sm dock-avatar" src=(src) alt=(bar.author.as_str()) width="20" height="20">
541+ </a>
542+ } else {
543+ <span class="avatar avatar-sm avatar-blank dock-avatar" aria-hidden="true" title=(bar.author.as_str())>(bar.author.chars().next().map(|c| c.to_uppercase().collect::<String>()).unwrap_or_default())</span>
544+ }
545+ <a class="dock-subject" href=(bar.last.href.as_str()) title=(bar.last.absolute.as_str())>commit_line(subject: bar.last.summary.clone())</a>
546+ <details class="dock-expand">
547+ <summary aria-label=(expand) title=(expand)><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></summary>
548+ <div class="dock-message">
549+ <p class="dock-message-by muted small">(bar.author.as_str())</p>
550+ <pre class="dock-message-text">(bar.message.as_str())</pre>
551+ </div>
552+ </details>
553+ }
530 <span class="dock-count muted small">(commits.as_str())</span>554 <span class="dock-count muted small">(commits.as_str())</span>
531 <a class="small dock-all" href=(ci_href.as_str())>(all_runs)</a>555 <a class="small dock-all" href=(ci_href.as_str())>(all_runs)</a>
532 </div>556 </div>
crates/forge-web/src/pages/repo_webhooks.rsmodified+2 -1
@@ -495,9 +495,10 @@ async fn frame_top(
495 lang: Lang,495 lang: Lang,
496 #[default] child: Child<'_>,496 #[default] child: Child<'_>,
497 ) -> Result<impl View> {497 ) -> Result<impl View> {
498+ let can_delete = head.can_delete;
498 Ok(view! {499 Ok(view! {
499 repo_head(head: head)500 repo_head(head: head)
500- settings_frame(lang: lang, title: title, current: "webhooks",501+ settings_frame(lang: lang, title: title, current: "webhooks", can_delete: can_delete,
501 if let Some((text, is_error)) = notice {502 if let Some((text, is_error)) = notice {
502 if is_error {503 if is_error {
503 alert(message: text)504 alert(message: text)
crates/forge-web/src/pages/settings_sessions.rsmodified+1 -1
@@ -66,7 +66,7 @@ async fn sessions_view(
66 </form>66 </form>
67 }67 }
68 </section>68 </section>
69- <section class="card fit-pane">69+ <section class="card fit-pane session-pane">
70 <ul class="item-list">70 <ul class="item-list">
71 for session in sessions.into_iter() {71 for session in sessions.into_iter() {
72 <li class="item">72 <li class="item">
crates/forge-web/src/pages/snippets.rsmodified+1 -5
@@ -307,11 +307,7 @@ async fn snippet_list_body(
307 </section>307 </section>
308 <section class="card list-pane fit-pane">308 <section class="card list-pane fit-pane">
309 if rows.is_empty() {309 if rows.is_empty() {
310- empty_state(title: g::t(lang, K::NoSnippets),310+ empty_state(title: g::t(lang, K::NoSnippets))
311- if signed_in {
312- <a class="button primary" href="/snippets/new">(g::t(lang, K::NewSnippet))</a>
313- }
314- )
315 } else {311 } else {
316 snippet_rows(lang: lang, rows: rows)312 snippet_rows(lang: lang, rows: rows)
317 }313 }
crates/forge-web/src/pages/tree.rsmodified+130 -172
@@ -22,15 +22,17 @@ use crate::pages::code_live::{follows_branch, live_url};
22 use crate::pages::finder::file_finder;22 use crate::pages::finder::file_finder;
23 use crate::pages::passkeys::s;23 use crate::pages::passkeys::s;
24 use crate::pages::refs::{load_refs, ref_links};24 use crate::pages::refs::{load_refs, ref_links};
25-use crate::pages::repo::repo_head;25+use crate::pages::repo::{https_clone_url, readme_head, repo_head, ssh_clone_url};
26 use crate::pages::repo_ctx::load_repo;26 use crate::pages::repo_ctx::load_repo;
27+use crate::pages::repo_side::{
28+ commit_strip, repo_dock, run_rows, run_states, strip_bars, tree_facts,
29+};
27 use crate::raw::raw_url;30 use crate::raw::raw_url;
28 use crate::render::emoji::emojify;31 use crate::render::emoji::emojify;
29 use crate::render::markdown::{LinkContext, render_markdown};32 use crate::render::markdown::{LinkContext, render_markdown};
30 use crate::state::AppState;33 use crate::state::AppState;
31-use crate::views::commit_line::commit_line;
32 use crate::views::{34 use crate::views::{
33- Crumb, avatar_url, breadcrumb, display_name, iso_time, now_unix, ref_selector, relative_time,35+ Crumb, avatar_url, display_name, empty_state, iso_time, now_unix, ref_selector, relative_time,
34 repo_href, shell, short_oid, user_href,36 repo_href, shell, short_oid, user_href,
35 };37 };
36 38
@@ -117,8 +119,8 @@ pub struct LastCommit {
117 pub age: String,119 pub age: String,
118 }120 }
119 121
120-/// The bar above a directory listing: the newest commit that touched the directory (or the122+/// The newest commit of a ref, as the dock shows it: its subject, short sha, author and the whole
121-/// whole ref at the root), with its author, short sha, age and the number of commits.123+/// message for the expander.
122 pub struct LatestBar {124 pub struct LatestBar {
123 pub last: LastCommit,125 pub last: LastCommit,
124 pub short: String,126 pub short: String,
@@ -127,35 +129,27 @@ pub struct LatestBar {
127 pub author_href: Option<String>,129 pub author_href: Option<String>,
128 /// Avatar of that user. None for plain-text authors.130 /// Avatar of that user. None for plain-text authors.
129 pub avatar: Option<String>,131 pub avatar: Option<String>,
130- pub commits_href: String,132+ /// The full commit message, body included, emoji rendered.
131- pub commits_label: String,133+ pub message: String,
132 }134 }
133 135
134-/// Latest commit bar for the listing of `dir` at `commit` (`""` is the root). The commit lookup136+/// Latest commit bar for `dir` at `commit` (`""` is the root). Errors and timeouts leave the bar
135-/// and the commit count run side by side. Errors and timeouts leave the bar out, or the count137+/// out.
136-/// out of its label.
137-#[allow(clippy::too_many_arguments)]
138 pub async fn latest_bar(138 pub async fn latest_bar(
139 state: &AppState,139 state: &AppState,
140 repo: &RepoRow,140 repo: &RepoRow,
141 path: &Path,141 path: &Path,
142- ref_name: &str,
143 commit: &str,142 commit: &str,
144 dir: &str,143 dir: &str,
145 lang: Lang,144 lang: Lang,
146 tz: &str,145 tz: &str,
147 ) -> Option<LatestBar> {146 ) -> Option<LatestBar> {
148 let filter = (!dir.is_empty()).then_some(dir);147 let filter = (!dir.is_empty()).then_some(dir);
149- let (log, count) = tokio::join!(148+ let log = tokio::time::timeout(
150- tokio::time::timeout(149+ LAST_COMMIT_TIMEOUT,
151- LAST_COMMIT_TIMEOUT,150+ history::log(&state.git, path, commit, filter, 0, 1),
152- history::log(&state.git, path, commit, filter, 0, 1),151+ )
153- ),152+ .await;
154- tokio::time::timeout(
155- LAST_COMMIT_TIMEOUT,
156- history::count(&state.git, path, commit, filter),
157- ),
158- );
159 let info = match log {153 let info = match log {
160 Ok(Ok(commits)) => commits.into_iter().next()?,154 Ok(Ok(commits)) => commits.into_iter().next()?,
161 Ok(Err(e)) => {155 Ok(Err(e)) => {
@@ -167,24 +161,8 @@ pub async fn latest_bar(
167 return None;161 return None;
168 }162 }
169 };163 };
170- let count = match count {
171- Ok(Ok(n)) => Some(n),
172- Ok(Err(e)) => {
173- tracing::warn!(error = %e, "commit count failed");
174- None
175- }
176- Err(_) => {
177- tracing::warn!("commit count timed out");
178- None
179- }
180- };
181 164
182- let user = state165+ let user = author_account(state, repo, &info.author_email).await;
183- .store
184- .verified_user_by_email(&info.author_email)
185- .await
186- .ok()
187- .flatten();
188 let (author, author_href, avatar) = match user {166 let (author, author_href, avatar) = match user {
189 Some(user) => (167 Some(user) => (
190 display_name(lang, &user.username),168 display_name(lang, &user.username),
@@ -193,23 +171,13 @@ pub async fn latest_bar(
193 ),171 ),
194 None => (info.author_name.clone(), None, None),172 None => (info.author_name.clone(), None, None),
195 };173 };
196- let rest = if dir.is_empty() {
197- ref_name.to_owned()
198- } else {
199- format!("{ref_name}/{dir}")
200- };
201- let commits_label = match count {
202- Some(n) => g::commit_count(lang, n),
203- None => g::t(lang, K::TabCommits).to_owned(),
204- };
205 Some(LatestBar {174 Some(LatestBar {
206 last: last_commit_view(lang, repo, &info, now_unix(), tz),175 last: last_commit_view(lang, repo, &info, now_unix(), tz),
207 short: short_oid(&info.oid).to_owned(),176 short: short_oid(&info.oid).to_owned(),
208 author,177 author,
209 author_href,178 author_href,
210 avatar,179 avatar,
211- commits_href: repo_href(&repo.owner_name, &repo.name, "commits", &rest),180+ message: emojify(&info.message).into_owned(),
212- commits_label,
213 })181 })
214 }182 }
215 183
@@ -271,6 +239,30 @@ pub fn entry_rows(
271 .collect()239 .collect()
272 }240 }
273 241
242+/// The account a commit's author address belongs to: a verified address of any user, or else the
243+/// address the repo's owner has on their account, verified or not, since an instance without mail
244+/// cannot verify one and only people the owner let in can push here.
245+pub(crate) async fn author_account(
246+ state: &AppState,
247+ repo: &RepoRow,
248+ email: &str,
249+) -> Option<forge_core::User> {
250+ if let Ok(Some(user)) = state.store.verified_user_by_email(email).await {
251+ return Some(user);
252+ }
253+ let owner = state
254+ .store
255+ .user_by_id(&repo.owner_id)
256+ .await
257+ .ok()
258+ .flatten()?;
259+ let same = owner
260+ .email
261+ .as_deref()
262+ .is_some_and(|own| own.eq_ignore_ascii_case(email));
263+ same.then_some(owner)
264+}
265+
274 /// Display form of a commit: link, summary, ISO time and relative age.266 /// Display form of a commit: link, summary, ISO time and relative age.
275 pub fn last_commit_view(267 pub fn last_commit_view(
276 lang: Lang,268 lang: Lang,
@@ -390,115 +382,44 @@ pub async fn load_readme(
390 }382 }
391 }383 }
392 384
393-/// The latest commit bar above a listing. It is the first row of the listing box, and its385+/// One row of a listing: a stretched link to the entry (the whole row is the target), its icon,
394-/// padding and columns match the table rows below it.386+/// its name and its age at the right end. Submodules have no page, so their row shows the short sha.
395 #[component]387 #[component]
396-pub async fn latest_commit_bar(bar: LatestBar, lang: Lang) -> Result<impl View> {388+pub async fn tree_table(rows: Vec<EntryRow>, lang: Lang) -> Result<impl View> {
397- let LatestBar {
398- last,
399- short,
400- author,
401- author_href,
402- avatar,
403- commits_href,
404- commits_label,
405- } = bar;
406- let initial = author
407- .chars()
408- .next()
409- .map(|c| c.to_uppercase().collect::<String>())
410- .unwrap_or_default();
411 Ok(view! {389 Ok(view! {
412- <div class="latest-commit" aria-label=(g::t(lang, K::LatestCommitLabel))>390+ <div class="table-wrap tree-list">
413- <span class="latest-author">391+ for row in rows.into_iter() {
414- if let Some(src) = avatar {392+ <div class="tree-entry" data-kb-row="">
415- <img class="avatar avatar-sm" src=(src) alt="" width="20" height="20">393+ <span class="tree-kind">
416- } else {394+ if row.kind == "dir" {
417- <span class="avatar avatar-sm avatar-blank" aria-hidden="true">(initial)</span>395+ <svg class="kind-icon is-dir" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>
418- }396+ } else {
419- if let Some(href) = author_href {397+ <svg class="kind-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>
420- <a href=(href)>(author)</a>398+ }
421- } else {399+ <span class="sr-only">(g::kind_label(lang, row.kind))</span>
422- <span>(author)</span>400+ </span>
423- }401+ if let Some(href) = row.href {
424- </span>402+ <a class="tree-entry-name" href=(href)>(row.name)</a>
425- <a class="latest-subject" href=(last.href.as_str())>commit_line(subject: last.summary.clone())</a>403+ } else {
426- <span class="latest-meta">404+ <span class="tree-entry-name">(row.name)</span>
427- <a class="mono latest-sha" href=(last.href.as_str())>(short)</a>405+ <span class="tree-entry-sha mono">(row.short)</span>
428- <time class="latest-age" data-rel="true" datetime=(last.iso.as_str()) title=(last.absolute.as_str())>(last.age)</time>406+ }
429- <a class="latest-count" href=(commits_href.as_str())>407+ if let Some(last) = row.last {
430- <svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l3 2"/></svg>408+ <time class="tree-entry-age" data-rel="true" datetime=(last.iso) title=(last.absolute)>(last.age)</time>
431- (commits_label)
432- </a>
433- </span>
434- </div>
435- })
436-}
437-
438-/// Directory listing table: kind, name, last commit and its age. `latest` is the bar above it.
439-#[component]
440-pub async fn tree_table(
441- rows: Vec<EntryRow>,
442- latest: Option<LatestBar>,
443- lang: Lang,
444-) -> Result<impl View> {
445- Ok(view! {
446- <div class="table-wrap">
447- if let Some(bar) = latest {
448- latest_commit_bar(bar: bar, lang: lang)
449- }
450- <table class="table tree-table">
451- <thead>
452- <tr>
453- <th>(g::t(lang, K::NameHeader))</th>
454- <th>(g::t(lang, K::LastCommitHeader))</th>
455- <th class="age">(g::t(lang, K::AgeHeader))</th>
456- </tr>
457- </thead>
458- <tbody>
459- for row in rows.into_iter() {
460- <tr>
461- <td class="tree-name">
462- <span class="kind">
463- if row.kind == "dir" {
464- <svg class="kind-icon is-dir" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>
465- } else {
466- <svg class="kind-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>
467- }
468- <span class="sr-only">(g::kind_label(lang, row.kind))</span>
469- </span>
470- <span class="tree-label">
471- if let Some(href) = row.href {
472- <a href=(href)>(row.name)</a>
473- } else {
474- <span>(row.name)</span>
475- <span class="muted small">(row.short)</span>
476- }
477- </span>
478- </td>
479- if let Some(last) = row.last {
480- <td class="tree-commit"><a href=(last.href)>commit_line(subject: last.summary.clone())</a></td>
481- <td class="age">
482- <time data-rel="true" datetime=(last.iso.clone()) title=(last.absolute)>(last.age)</time>
483- </td>
484- } else {
485- <td class="tree-commit"></td>
486- <td class="age"></td>
487- }
488- </tr>
489 }409 }
490- </tbody>410+ </div>
491- </table>411+ }
492 </div>412 </div>
493 })413 })
494 }414 }
495 415
496-/// README card. Markdown HTML is embedded only from `render_markdown`; plain text is escaped.416+/// README body. Markdown HTML is embedded only from `render_markdown`; plain text is escaped. The
417+/// file name is for screen readers: the pane head shows it.
497 #[component]418 #[component]
498 pub async fn readme_card(name: String, markdown: bool, body: String) -> Result<impl View> {419 pub async fn readme_card(name: String, markdown: bool, body: String) -> Result<impl View> {
499 Ok(view! {420 Ok(view! {
500- <section class="card readme">421+ <section class="readme">
501- <p class="readme-name muted small">(name)</p>422+ <p class="sr-only">(name)</p>
502 if markdown {423 if markdown {
503 <div class="markdown-body">(Unescaped::new_unchecked(body))</div>424 <div class="markdown-body">(Unescaped::new_unchecked(body))</div>
504 } else {425 } else {
@@ -525,19 +446,29 @@ async fn tree_page(cx: &Cx) -> Result<impl View> {
525 return Err(not_found().into());446 return Err(not_found().into());
526 };447 };
527 let names: Vec<String> = entries.iter().map(|e| e.name.clone()).collect();448 let names: Vec<String> = entries.iter().map(|e| e.name.clone()).collect();
528- let (last, bar) = tokio::join!(449+ // The dock and the README's facts describe the whole ref, so the root names are needed too.
450+ let root_names: Vec<String> = if dir.is_empty() {
451+ names.clone()
452+ } else {
453+ read_dir(ctx.path.clone(), commit.clone(), String::new())
454+ .await?
455+ .unwrap_or_default()
456+ .into_iter()
457+ .map(|e| e.name)
458+ .collect()
459+ };
460+ let (last, bar, strip, ci_states, runs) = tokio::join!(
529 last_commits(state, &ctx.path, &commit, &dir, &names),461 last_commits(state, &ctx.path, &commit, &dir, &names),
530- latest_bar(462+ latest_bar(state, repo, &ctx.path, &commit, "", lang, ctx.viewer_tz()),
531- state,463+ commit_strip(state, repo, &ctx.path, &commit),
532- repo,464+ run_states(state, &repo.id),
533- &ctx.path,465+ run_rows(state, lang, repo),
534- &ref_name,
535- &commit,
536- &dir,
537- lang,
538- ctx.viewer_tz()
539- ),
540 );466 );
467+ let ci_states = ci_states?;
468+ let runs = runs?;
469+ let facts = tree_facts(state, repo, &ctx.path, &commit, &root_names).await?;
470+ let bars = strip_bars(&strip.commits, &ci_states);
471+ let total = strip.total;
541 let refs: Vec<RefInfo> = load_refs(ctx.path.clone()).await?;472 let refs: Vec<RefInfo> = load_refs(ctx.path.clone()).await?;
542 let readme = load_readme(state, repo, &ctx.path, &ref_name, &commit, &dir, &entries).await?;473 let readme = load_readme(state, repo, &ctx.path, &ref_name, &commit, &dir, &entries).await?;
543 let rows = entry_rows(474 let rows = entry_rows(
@@ -553,44 +484,71 @@ async fn tree_page(cx: &Cx) -> Result<impl View> {
553 let (branches, tags) = ref_links(&refs, &ref_name, &repo.default_branch, repo);484 let (branches, tags) = ref_links(&refs, &ref_name, &repo.default_branch, repo);
554 let branches_href = repo_href(&repo.owner_name, &repo.name, "branches", "");485 let branches_href = repo_href(&repo.owner_name, &repo.name, "branches", "");
555 let tags_href = repo_href(&repo.owner_name, &repo.name, "tags", "");486 let tags_href = repo_href(&repo.owner_name, &repo.name, "tags", "");
487+ let ci_href = repo_href(&repo.owner_name, &repo.name, "ci", "");
556 let live = follows_branch(&refs, &ref_name)488 let live = follows_branch(&refs, &ref_name)
557 .then(|| live_url(&repo.owner_name, &repo.name, &refs, &ref_name));489 .then(|| live_url(&repo.owner_name, &repo.name, &refs, &ref_name));
558 490
559 let title = format!("{}/{}", repo.owner_name, repo.name);491 let title = format!("{}/{}", repo.owner_name, repo.name);
560- let crumbs = path_crumbs(repo, &ref_name, "tree", &dir);
561 let finder_owner = repo.owner_name.clone();492 let finder_owner = repo.owner_name.clone();
562 let finder_repo = repo.name.clone();493 let finder_repo = repo.name.clone();
494+ let dock_owner = finder_owner.clone();
495+ let dock_repo = finder_repo.clone();
563 let finder_ref = ref_name.clone();496 let finder_ref = ref_name.clone();
497+ let https = https_clone_url(&state.config, &repo.owner_name, &repo.name);
498+ let ssh = ssh_clone_url(&state.config, &repo.owner_name, &repo.name);
499+ let downloads = (
500+ repo_href(
501+ &repo.owner_name,
502+ &repo.name,
503+ "archive",
504+ &format!("{ref_name}.zip"),
505+ ),
506+ repo_href(
507+ &repo.owner_name,
508+ &repo.name,
509+ "archive",
510+ &format!("{ref_name}.tar.gz"),
511+ ),
512+ );
513+ let readme_label = readme
514+ .as_ref()
515+ .map(|readme| readme.name.clone())
516+ .unwrap_or_else(|| "README".to_owned());
564 let mut header = ctx.head(state, "code").await?;517 let mut header = ctx.head(state, "code").await?;
565 // The header and the browse bar share the branch's stream: the client follows the first518 // The header and the browse bar share the branch's stream: the client follows the first
566 // [data-live] on the page, which is the header.519 // [data-live] on the page, which is the header.
567 if let Some(url) = &live {520 if let Some(url) = &live {
568 header.live = url.clone();521 header.live = url.clone();
569 }522 }
570- // The listing and the README sit side by side from 900px, as on the repo home, so the page fits523+ // The same two panes as the repo home, over the same dock, so the page fits the window.
571- // the window: each column scrolls on its own (the grid is the repo home's, see _repo.scss).
572 Ok(view! {524 Ok(view! {
573 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),525 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
574 repo_head(head: header)526 repo_head(head: header)
575- <div class="repo-grid repo-home tree-browse">527+ <div class="repo-grid repo-home canvas-repo tree-browse">
576- <div class="repo-main">528+ <div class="repo-main canvas-files">
577- <div class="browse-bar" data-live=(live.as_deref()) data-live-code=(live.is_some().then_some("true")) data-live-gone=(g::t(lang, K::LivePathGone))>529+ <div class="browse-bar canvas-head" data-live=(live.as_deref()) data-live-code=(live.is_some().then_some("true")) data-live-gone=(g::t(lang, K::LivePathGone))>
578 ref_selector(lang: lang, label: mi::t(lang, MK::RefLabel), current: ref_name.clone(), branches: branches, tags: tags,530 ref_selector(lang: lang, label: mi::t(lang, MK::RefLabel), current: ref_name.clone(), branches: branches, tags: tags,
579 branches_href: branches_href, tags_href: tags_href)531 branches_href: branches_href, tags_href: tags_href)
580- breadcrumb(lang: lang, crumbs: crumbs)
581 file_finder(lang: lang, owner: finder_owner, repo: finder_repo, ref_name: finder_ref)532 file_finder(lang: lang, owner: finder_owner, repo: finder_repo, ref_name: finder_ref)
582 </div>533 </div>
583- tree_table(rows: rows, latest: bar, lang: lang)534+ tree_table(rows: rows, lang: lang)
584 </div>535 </div>
585 <div class="repo-split" role="separator" aria-orientation="vertical"536 <div class="repo-split" role="separator" aria-orientation="vertical"
586 aria-label=(s(lang, "Resize file tree", "Dosya ağacını boyutlandır")) tabindex="0"537 aria-label=(s(lang, "Resize file tree", "Dosya ağacını boyutlandır")) tabindex="0"
587 data-repo-split=""></div>538 data-repo-split=""></div>
588- <div class="repo-readme">539+ <div class="repo-readme canvas-readme">
589- if let Some(readme) = readme {540+ readme_head(label: readme_label, facts: Some(facts), https: https, ssh: ssh, downloads: Some(downloads), lang: lang)
590- readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)541+ <div class="canvas-body">
591- }542+ if let Some(readme) = readme {
543+ readme_card(name: readme.name, markdown: readme.markdown, body: readme.body)
544+ } else {
545+ empty_state(title: s(lang, "No README in this folder", "Bu klasörde README yok"))
546+ }
547+ </div>
592 </div>548 </div>
593 </div>549 </div>
550+ repo_dock(lang: lang, runs: runs, total: total, ci_href: ci_href,
551+ owner: dock_owner, repo: dock_repo, bars: bars, latest: bar)
594 )552 )
595 })553 })
596 }554 }
crates/forge-web/src/pages/wiki.rsmodified+1 -0
@@ -725,6 +725,7 @@ async fn wiki_settings_page(cx: &Cx) -> Result<impl View> {
725 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),725 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
726 repo_head(head: header)726 repo_head(head: header)
727 settings_frame(lang: lang, title: format!("{}/{}", ctx.repo.owner_name, ctx.repo.name), current: "wiki",727 settings_frame(lang: lang, title: format!("{}/{}", ctx.repo.owner_name, ctx.repo.name), current: "wiki",
728+ can_delete: ctx.can_delete(),
728 wiki_settings_body(lang: lang, action: action, csrf: csrf, enabled: enabled)729 wiki_settings_body(lang: lang, action: action, csrf: csrf, enabled: enabled)
729 )730 )
730 )731 )
crates/forge-web/src/render/commit_message.rsmodified+0 -6
@@ -73,11 +73,6 @@ impl CommitMessage {
73 Some(Self { groups })73 Some(Self { groups })
74 }74 }
75 75
76- /// The type of the first group.
77- pub fn kind(&self) -> &str {
78- self.groups.first().map_or("", |group| group.kind.as_str())
79- }
80-
81 /// The first clause, with its first letter uppercased when it is a lowercase letter.76 /// The first clause, with its first letter uppercased when it is a lowercase letter.
82 pub fn title(&self) -> String {77 pub fn title(&self) -> String {
83 let first = self78 let first = self
@@ -178,7 +173,6 @@ mod tests {
178 💄 style: pages fit the window; an overview is redesigned; 🐛 fix: the bell opens once",173 💄 style: pages fit the window; an overview is redesigned; 🐛 fix: the bell opens once",
179 )174 )
180 .expect("typed subject");175 .expect("typed subject");
181- assert_eq!(message.kind(), "feat");
182 assert_eq!(message.extra(), 4);176 assert_eq!(message.extra(), 4);
183 assert_eq!(message.title(), "The tab bar is built from lists, so X");177 assert_eq!(message.title(), "The tab bar is built from lists, so X");
184 let kinds: Vec<&str> = message.groups.iter().map(|g| g.kind.as_str()).collect();178 let kinds: Vec<&str> = message.groups.iter().map(|g| g.kind.as_str()).collect();
crates/forge-web/src/views/commit_line.rsmodified+7 -26
@@ -1,7 +1,6 @@
1 //! A commit subject on one line, shared by every list that shows subjects one per row: the commit1 //! A commit subject on one line, shared by every list that shows subjects one per row: the commit
2-//! list, compare, branches, the tree's last-commit cells, blame and the CI runs. A subject that2+//! list, compare, branches, the tree's last-commit cells, blame and the CI runs. It shows the
3-//! parses shows its first clause with a neutral type tag and a muted count of the clauses after3+//! subject as written, like GitHub. The full subject is the `title` attribute.
4-//! it. Any other subject shows as it always did. The full subject is the `title` attribute.
5 4
6 use topcoat::Result;5 use topcoat::Result;
7 use topcoat::view::{View, component, view};6 use topcoat::view::{View, component, view};
@@ -19,32 +18,14 @@ pub fn headline(subject: &str) -> String {
19 }18 }
20 }19 }
21 20
22-/// One subject on one line, truncated by CSS. `no_tag` drops the type tag where the column is21+/// One subject on one line as it was written, header included, truncated by CSS. The full subject
23-/// too narrow for it (blame).22+/// is the `title` attribute.
24 #[component]23 #[component]
25-pub async fn commit_line(subject: String, #[default] no_tag: bool) -> Result<impl View> {24+pub async fn commit_line(subject: String) -> Result<impl View> {
26- let emojified = emojify(&subject).into_owned();25+ let text = emojify(&subject).into_owned();
27- let parsed = CommitMessage::parse(&emojified);
28- let has_tag = parsed.is_some() && !no_tag;
29- let kind = parsed
30- .as_ref()
31- .map_or_else(String::new, |message| message.kind().to_string());
32- let extra = parsed.as_ref().map_or(0, CommitMessage::extra);
33- let has_extra = extra > 0;
34- let extra_text = format!("+{extra}");
35- let text = match &parsed {
36- Some(message) => message.title(),
37- None => emojified.clone(),
38- };
39 Ok(view! {26 Ok(view! {
40- <span class="commit-line" title=(emojified.as_str())>27+ <span class="commit-line" title=(text.as_str())>
41- if has_tag {
42- <span class="commit-line-kind">(kind.as_str())</span>
43- }
44 <span class="commit-line-text">(text.as_str())</span>28 <span class="commit-line-text">(text.as_str())</span>
45- if has_extra {
46- <span class="commit-line-extra">(extra_text.as_str())</span>
47- }
48 </span>29 </span>
49 })30 })
50 }31 }
crates/forge-web/src/views/heatmap.rsmodified+14 -3
@@ -182,6 +182,8 @@ struct CellView {
182 class: String,182 class: String,
183 href: Option<String>,183 href: Option<String>,
184 title: String,184 title: String,
185+ /// `{date}:{count}` for a day with contributions, so a raised count animates once on a live update.
186+ arrive: Option<String>,
185 }187 }
186 188
187 /// 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.
@@ -336,13 +338,15 @@ fn day_entries(lang: Lang, items: &[ContributionItem], now: i64) -> Vec<DayEntry
336 338
337 /// The contribution card: heading and date range, the four stats, the month labels and the339 /// The contribution card: heading and date range, the four stats, the month labels and the
338 /// 53-week grid, then the motivating line and the Less/More legend, then the selected day's340 /// 53-week grid, then the motivating line and the Less/More legend, then the selected day's
339-/// contributions when a day is picked. `base` is the profile's path the day links point at.341+/// contributions when a day is picked. `base` is the profile's path the day links point at. `live`
342+/// is the stream URL the card re-renders on; it is set on a person's overview only.
340 #[component]343 #[component]
341 pub async fn contribution_calendar(344 pub async fn contribution_calendar(
342 calendar: Calendar,345 calendar: Calendar,
343 selected: Option<DayDetail>,346 selected: Option<DayDetail>,
344 lang: Lang,347 lang: Lang,
345 base: String,348 base: String,
349+ live: Option<String>,
346 ) -> Result<impl View> {350 ) -> Result<impl View> {
347 let range = {351 let range = {
348 let from = g::date_text(352 let from = g::date_text(
@@ -408,18 +412,25 @@ pub async fn contribution_calendar(
408 day.count,412 day.count,
409 &g::date_text(lang, day.date.0, day.date.1, day.date.2),413 &g::date_text(lang, day.date.0, day.date.1, day.date.2),
410 ),414 ),
415+ arrive: (day.count > 0).then(|| {
416+ format!(
417+ "{:04}-{:02}-{:02}:{}",
418+ day.date.0, day.date.1, day.date.2, day.count
419+ )
420+ }),
411 }421 }
412 }422 }
413 None => CellView {423 None => CellView {
414 class: "cell blank".to_owned(),424 class: "cell blank".to_owned(),
415 href: None,425 href: None,
416 title: String::new(),426 title: String::new(),
427+ arrive: None,
417 },428 },
418 })429 })
419 .collect();430 .collect();
420 431
421 Ok(view! {432 Ok(view! {
422- <section class="heat" aria-labelledby="contributions-h">433+ <section class="heat" aria-labelledby="contributions-h" data-live=(live.as_deref())>
423 <div class="heat-head">434 <div class="heat-head">
424 <div>435 <div>
425 <h2 id="contributions-h">(g::t(lang, K::ContributionsTitle))</h2>436 <h2 id="contributions-h">(g::t(lang, K::ContributionsTitle))</h2>
@@ -464,7 +475,7 @@ pub async fn contribution_calendar(
464 <div class="heat-grid" role="group" aria-label=(summary.as_str())>475 <div class="heat-grid" role="group" aria-label=(summary.as_str())>
465 for cell in cells.into_iter() {476 for cell in cells.into_iter() {
466 if let Some(href) = cell.href {477 if let Some(href) = cell.href {
467- <a class=(cell.class.as_str()) href=(href.as_str()) title=(cell.title.as_str()) data-keep-scroll="true"></a>478+ <a class=(cell.class.as_str()) href=(href.as_str()) title=(cell.title.as_str()) data-keep-scroll="true" data-arrive=(cell.arrive.as_deref())></a>
468 } else {479 } else {
469 <span class=(cell.class.as_str()) title=(cell.title.as_str())></span>480 <span class=(cell.class.as_str()) title=(cell.title.as_str())></span>
470 }481 }
crates/forge-web/src/views/mod.rsmodified+76 -33
@@ -39,6 +39,7 @@ use crate::i18n::orgs::{self as o, K as OK};
39 use crate::i18n::packages::{self as pk, K as PK};39 use crate::i18n::packages::{self as pk, K as PK};
40 use crate::i18n::{self, Key, Lang, t};40 use crate::i18n::{self, Key, Lang, t};
41 use crate::pages::assets::highlight_css_text;41 use crate::pages::assets::highlight_css_text;
42+use crate::pages::passkeys::s;
42 use crate::pages::user_prefs::{CORNER_POS, TREE_WIDTH, clean_pref};43 use crate::pages::user_prefs::{CORNER_POS, TREE_WIDTH, clean_pref};
43 use crate::state::AppState;44 use crate::state::AppState;
44 45
@@ -136,9 +137,19 @@ fn percent_decode(s: &str) -> String {
136 String::from_utf8_lossy(&out).into_owned()137 String::from_utf8_lossy(&out).into_owned()
137 }138 }
138 139
139-/// The path bar for a request path, as `(label, href)` pairs. The root and the global pages show140+/// A path part as the path bar labels it: a 40-hex commit id shows its first 7 characters.
140-/// one segment: the page `title`. A repo path shows the owner, the repo and, for a `tree` or141+fn crumb_label(part: &str) -> String {
141-/// `blob` path, one segment per path part. The last segment never links. Labels are decoded.142+ if part.len() == 40 && part.bytes().all(|b| b.is_ascii_hexdigit()) {
143+ part[..7].to_owned()
144+ } else {
145+ part.to_owned()
146+ }
147+}
148+
149+/// The path bar for a request path, as `(label, href)` pairs. The root and the top-level pages
150+/// return no segments: their page head already shows the name, so the bar only holds its hint. A
151+/// repo path shows the owner, the repo and, for a `tree` or `blob` path, one segment per path
152+/// part. The last segment never links. Labels are decoded.
142 fn path_segments(path: &str, title: &str) -> Vec<(String, Option<String>)> {153 fn path_segments(path: &str, title: &str) -> Vec<(String, Option<String>)> {
143 let parts: Vec<String> = path154 let parts: Vec<String> = path
144 .trim_matches('/')155 .trim_matches('/')
@@ -147,10 +158,10 @@ fn path_segments(path: &str, title: &str) -> Vec<(String, Option<String>)> {
147 .map(percent_decode)158 .map(percent_decode)
148 .collect();159 .collect();
149 let Some(owner) = parts.first() else {160 let Some(owner) = parts.first() else {
150- return vec![(title.to_owned(), None)];161+ return Vec::new();
151 };162 };
152 if owner.starts_with('-') || TOP_LEVEL_PAGES.contains(&owner.as_str()) {163 if owner.starts_with('-') || TOP_LEVEL_PAGES.contains(&owner.as_str()) {
153- return vec![(title.to_owned(), None)];164+ return Vec::new();
154 }165 }
155 let mut segments = vec![(owner.clone(), Some(user_href(owner)))];166 let mut segments = vec![(owner.clone(), Some(user_href(owner)))];
156 if let Some(repo) = parts.get(1) {167 if let Some(repo) = parts.get(1) {
@@ -163,12 +174,26 @@ fn path_segments(path: &str, title: &str) -> Vec<(String, Option<String>)> {
163 for part in prefix {174 for part in prefix {
164 at.push('/');175 at.push('/');
165 at.push_str(part);176 at.push_str(part);
166- segments.push((part.clone(), Some(repo_href(owner, repo, "tree", &at))));177+ segments.push((crumb_label(part), Some(repo_href(owner, repo, "tree", &at))));
167 }178 }
168 }179 }
169 // The repo's home: the repo name is the last segment already.180 // The repo's home: the repo name is the last segment already.
170 [] => {}181 [] => {}
171- _ => segments.push((title.to_owned(), None)),182+ // Titles read "owner/repo · Page": the path bar has the repo already. A page titled by
183+ // the repo alone is named by its route.
184+ [_, ..] => {
185+ let page = title.rsplit(" · ").next().unwrap_or(title);
186+ let page = if page == format!("{owner}/{repo}") {
187+ parts[2..]
188+ .iter()
189+ .map(|part| crumb_label(part))
190+ .collect::<Vec<_>>()
191+ .join("/")
192+ } else {
193+ page.to_owned()
194+ };
195+ segments.push((page, None));
196+ }
172 }197 }
173 }198 }
174 if let Some(last) = segments.last_mut() {199 if let Some(last) = segments.last_mut() {
@@ -1550,8 +1575,18 @@ fn tab_class(on: bool) -> &'static str {
1550 if on { "tab active" } else { "tab" }1575 if on { "tab active" } else { "tab" }
1551 }1576 }
1552 1577
1578+fn tab_more_class(on: bool) -> &'static str {
1579+ if on {
1580+ "tab-more-link is-current"
1581+ } else {
1582+ "tab-more-link"
1583+ }
1584+}
1585+
1553 /// Header tabs for a repo. `active` is one of `code`, `issues`, `commits`, `branches`, `tags`,1586 /// Header tabs for a repo. `active` is one of `code`, `issues`, `commits`, `branches`, `tags`,
1554-/// `settings`. `open_issues` is the count shown on the Issues tab; `None` shows the tab without one.1587+/// `releases`, `settings`. Commits, branches, tags and releases sit in a menu after the Code tab,
1588+/// and the Code tab stays active while one of them is open. `open_issues` and `open_pulls` are the
1589+/// counts shown on their tabs; a zero count (or `None`) shows the tab without one.
1555 #[component]1590 #[component]
1556 pub async fn repo_tabs(1591 pub async fn repo_tabs(
1557 owner: String,1592 owner: String,
@@ -1568,9 +1603,9 @@ pub async fn repo_tabs(
1568 ) -> Result<impl View> {1603 ) -> Result<impl View> {
1569 let home = repo_href(&owner, &repo, "", "");1604 let home = repo_href(&owner, &repo, "", "");
1570 let issues = repo_href(&owner, &repo, "issues", "");1605 let issues = repo_href(&owner, &repo, "issues", "");
1571- let issues_count = open_issues.map(|n| n.to_string());1606+ let issues_count = open_issues.filter(|n| *n > 0).map(|n| n.to_string());
1572 let pulls = repo_href(&owner, &repo, "pulls", "");1607 let pulls = repo_href(&owner, &repo, "pulls", "");
1573- let pulls_count = open_pulls.map(|n| n.to_string());1608+ let pulls_count = open_pulls.filter(|n| *n > 0).map(|n| n.to_string());
1574 let pulls_on = active == "pulls";1609 let pulls_on = active == "pulls";
1575 let commits = repo_href(&owner, &repo, "commits", &default_branch);1610 let commits = repo_href(&owner, &repo, "commits", &default_branch);
1576 let branches = repo_href(&owner, &repo, "branches", "");1611 let branches = repo_href(&owner, &repo, "branches", "");
@@ -1578,7 +1613,12 @@ pub async fn repo_tabs(
1578 let releases = repo_href(&owner, &repo, "releases", "");1613 let releases = repo_href(&owner, &repo, "releases", "");
1579 let ci = repo_href(&owner, &repo, "ci", "");1614 let ci = repo_href(&owner, &repo, "ci", "");
1580 let ci_on = active == "ci";1615 let ci_on = active == "ci";
1581- let code_on = active == "code";1616+ // The four code pages sit in a menu after the Code tab, which stays active while one is open.
1617+ let more_on = matches!(
1618+ active.as_str(),
1619+ "commits" | "branches" | "tags" | "releases"
1620+ );
1621+ let code_on = active == "code" || more_on;
1582 let issues_on = active == "issues";1622 let issues_on = active == "issues";
1583 let commits_on = active == "commits";1623 let commits_on = active == "commits";
1584 let branches_on = active == "branches";1624 let branches_on = active == "branches";
@@ -1599,36 +1639,31 @@ pub async fn repo_tabs(
1599 <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="m16 18 6-6-6-6M8 6l-6 6 6 6"/></svg></span>1639 <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="m16 18 6-6-6-6M8 6l-6 6 6 6"/></svg></span>
1600 (t(lang, Key::Code))1640 (t(lang, Key::Code))
1601 </a>1641 </a>
1642+ <details class="menu tab-more">
1643+ <summary class="tab tab-more-toggle" aria-label=(s(lang, "More code pages", "Diğer kod sayfaları"))>
1644+ <svg viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
1645+ </summary>
1646+ <div class="tab-more-list">
1647+ <a class=(tab_more_class(commits_on)) href=(commits)>(g::t(lang, K::TabCommits))</a>
1648+ <a class=(tab_more_class(branches_on)) href=(branches)>(g::t(lang, K::BranchesTitle))</a>
1649+ <a class=(tab_more_class(tags_on)) href=(tags)>(g::t(lang, K::TagsTitle))</a>
1650+ <a class=(tab_more_class(releases_on)) href=(releases)>(g::t(lang, K::TabReleases))</a>
1651+ </div>
1652+ </details>
1602 <a class=(tab_class(issues_on)) href=(issues)>1653 <a class=(tab_class(issues_on)) href=(issues)>
1603 <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="1"/></svg></span>1654 <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="1"/></svg></span>
1604 (g::t(lang, K::TabIssues))1655 (g::t(lang, K::TabIssues))
1605 if let Some(count) = issues_count {1656 if let Some(count) = issues_count {
1606- " " <span class="tab-count">(count.as_str())</span>1657+ " " <span class="tab-count" data-arrive=(count.as_str())>(count.as_str())</span>
1607 }1658 }
1608 </a>1659 </a>
1609 <a class=(tab_class(pulls_on)) href=(pulls)>1660 <a class=(tab_class(pulls_on)) href=(pulls)>
1610 <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="6" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="18" r="3"/><path d="M6 9v6M18 15V9a3 3 0 0 0-3-3h-3"/></svg></span>1661 <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="6" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="18" r="3"/><path d="M6 9v6M18 15V9a3 3 0 0 0-3-3h-3"/></svg></span>
1611 (g::t(lang, K::TabPulls))1662 (g::t(lang, K::TabPulls))
1612 if let Some(count) = pulls_count {1663 if let Some(count) = pulls_count {
1613- " " <span class="tab-count">(count.as_str())</span>1664+ " " <span class="tab-count" data-arrive=(count.as_str())>(count.as_str())</span>
1614 }1665 }
1615 </a>1666 </a>
1616- <a class=(tab_class(commits_on)) href=(commits)>
1617- <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M3 12h6M15 12h6"/></svg></span>
1618- (g::t(lang, K::TabCommits))
1619- </a>
1620- <a class=(tab_class(branches_on)) href=(branches)>
1621- <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="6" cy="18" r="3"/><circle cx="18" cy="6" r="3"/><path d="M6 3v12M18 9a9 9 0 0 1-9 9"/></svg></span>
1622- (g::t(lang, K::BranchesTitle))
1623- </a>
1624- <a class=(tab_class(tags_on)) href=(tags)>
1625- <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12.6 2.6A2 2 0 0 0 11.2 2H4a2 2 0 0 0-2 2v7.2a2 2 0 0 0 .6 1.4l8.7 8.7a2.4 2.4 0 0 0 3.4 0l6.6-6.6a2.4 2.4 0 0 0 0-3.4z"/><circle cx="7.5" cy="7.5" r="1"/></svg></span>
1626- (g::t(lang, K::TagsTitle))
1627- </a>
1628- <a class=(tab_class(releases_on)) href=(releases)>
1629- <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M21 8l-9-5-9 5v8l9 5 9-5zM3.3 7 12 12l8.7-5M12 22V12"/></svg></span>
1630- (g::t(lang, K::TabReleases))
1631- </a>
1632 <a class=(tab_class(ci_on)) href=(ci)>1667 <a class=(tab_class(ci_on)) href=(ci)>
1633 <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M10 8.5v7l5.5-3.5z"/></svg></span>1668 <span class="tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M10 8.5v7l5.5-3.5z"/></svg></span>
1634 (g::t(lang, K::TabCi))1669 (g::t(lang, K::TabCi))
@@ -1855,10 +1890,18 @@ mod tests {
1855 ("forge".to_owned(), None),1890 ("forge".to_owned(), None),
1856 ]1891 ]
1857 );1892 );
1858- assert_eq!(1893+ let (last, _) = path_segments("/tahinli/forge/issues", "tahinli/forge · Issues").remove(2);
1859- path_segments("/explore", "Explore"),1894+ assert_eq!(last, "Issues");
1860- vec![("Explore".to_owned(), None)]1895+ let (last, _) = path_segments("/tahinli/forge/commits/main", "tahinli/forge").remove(2);
1861- );1896+ assert_eq!(last, "commits/main");
1897+ assert!(path_segments("/explore", "Explore").is_empty());
1898+ assert!(path_segments("/", "Home").is_empty());
1899+ let (last, _) = path_segments(
1900+ "/tahinli/forge/commit/0123456789abcdef0123456789abcdef01234567",
1901+ "tahinli/forge",
1902+ )
1903+ .remove(2);
1904+ assert_eq!(last, "commit/0123456");
1862 }1905 }
1863 1906
1864 #[test]1907 #[test]
crates/forge-web/src/views/repo_list.rsmodified+5 -7
@@ -53,19 +53,17 @@ pub async fn repo_rows(rows: Vec<RepoRow>, lang: Lang) -> Result<impl View> {
53 <ul class="repo-list">53 <ul class="repo-list">
54 for row in rows.into_iter() {54 for row in rows.into_iter() {
55 <li class="repo-item" data-kb-row="">55 <li class="repo-item" data-kb-row="">
56- <div class="repo-item-head">56+ <a class="repo-name" href=(row.href.as_str())>(row.title.as_str())</a>
57- <a class="repo-name" href=(row.href.as_str())>(row.title.as_str())</a>57+ <span class=(badge_class(row.visibility))>(i18n::visibility_label(lang, row.visibility))</span>
58- <span class=(badge_class(row.visibility))>(i18n::visibility_label(lang, row.visibility))</span>
59- </div>
60 if !row.description.is_empty() {58 if !row.description.is_empty() {
61- <p class="muted repo-desc" title=(row.description.as_str())>(row.description.as_str())</p>59+ <span class="repo-desc" title=(row.description.as_str())>(row.description.as_str())</span>
62 }60 }
63- <p class="muted small repo-stats">61+ <span class="muted small repo-stats">
64 "\u{2605} " (row.stars.to_string())62 "\u{2605} " (row.stars.to_string())
65 (before)63 (before)
66 <time data-rel="true" datetime=(row.when.iso.as_str()) title=(row.when.absolute.as_str())>(row.when.relative.as_str())</time>64 <time data-rel="true" datetime=(row.when.iso.as_str()) title=(row.when.absolute.as_str())>(row.when.relative.as_str())</time>
67 (after)65 (after)
68- </p>66+ </span>
69 </li>67 </li>
70 }68 }
71 </ul>69 </ul>
crates/forge-web/src/views/timeline.rsmodified+3 -1
@@ -46,6 +46,7 @@ struct BarView {
46 class: String,46 class: String,
47 href: String,47 href: String,
48 label: String,48 label: String,
49+ oid: String,
49 }50 }
50 51
51 /// The strip for `bars`, given oldest first. Fewer than two commits draw nothing. The label52 /// The strip for `bars`, given oldest first. Fewer than two commits draw nothing. The label
@@ -77,6 +78,7 @@ pub async fn history_strip(
77 short_oid(&bar.oid),78 short_oid(&bar.oid),
78 tl::lines_changed(lang, bar.lines)79 tl::lines_changed(lang, bar.lines)
79 ),80 ),
81+ oid: bar.oid,
80 })82 })
81 .collect();83 .collect();
82 Ok(view! {84 Ok(view! {
@@ -85,7 +87,7 @@ pub async fn history_strip(
85 <p class="history-label label">(heading.as_str())</p>87 <p class="history-label label">(heading.as_str())</p>
86 <div class="history-bars" role="group" aria-label=(aria)>88 <div class="history-bars" role="group" aria-label=(aria)>
87 for item in items.iter() {89 for item in items.iter() {
88- <a class=(item.class.as_str()) href=(item.href.as_str()) aria-label=(item.label.as_str()) title=(item.label.as_str())></a>90+ <a class=(item.class.as_str()) href=(item.href.as_str()) aria-label=(item.label.as_str()) title=(item.label.as_str()) data-oid=(item.oid.as_str()) data-arrive=(item.oid.as_str())></a>
89 }91 }
90 </div>92 </div>
91 </div>93 </div>
crates/forge-web/tests/e2e/browse_e2e.rsmodified+14 -14
@@ -124,25 +124,25 @@ fn element_texts(body: &str, selector: &str) -> Vec<String> {
124 .collect()124 .collect()
125 }125 }
126 126
127-/// Checks the latest commit bar of a listing: one bar, with the subject, the short sha of `oid`127+/// Checks the dock of a repo page: one dock, with the subject of the commit, its short sha, the
128-/// and the commit count label.128+/// commit count label and the subject's absolute time in its title.
129 fn assert_latest_bar(body: &str, what: &str, subject: &str, oid: &str, count: &str) {129 fn assert_latest_bar(body: &str, what: &str, subject: &str, oid: &str, count: &str) {
130- let bars = element_texts(body, ".latest-commit");130+ let docks = element_texts(body, ".canvas-dock");
131- assert_eq!(bars.len(), 1, "{what}: exactly one latest commit bar");131+ assert_eq!(docks.len(), 1, "{what}: exactly one dock");
132- let subjects = element_texts(body, ".latest-commit .latest-subject");132+ let subjects = element_texts(body, ".canvas-dock .dock-subject");
133- assert_eq!(subjects.len(), 1, "{what}: bar must show the subject");133+ assert_eq!(subjects.len(), 1, "{what}: dock must show the subject");
134- assert_eq!(subjects[0].trim(), subject, "{what}: bar subject");134+ assert_eq!(subjects[0].trim(), subject, "{what}: dock subject");
135- let shas = element_texts(body, ".latest-commit .latest-sha");135+ let shas = element_texts(body, ".canvas-dock .dock-sha");
136- assert_eq!(shas.len(), 1, "{what}: bar must show the sha");136+ assert_eq!(shas.len(), 1, "{what}: dock must show the sha");
137- assert_eq!(shas[0].trim(), &oid[..7], "{what}: bar short sha");137+ assert_eq!(shas[0].trim(), &oid[..7], "{what}: dock short sha");
138- let counts = element_texts(body, ".latest-commit .latest-count");138+ let counts = element_texts(body, ".canvas-dock .dock-count");
139 assert!(139 assert!(
140 counts.iter().any(|c| c.trim() == count),140 counts.iter().any(|c| c.trim() == count),
141- "{what}: bar must show {count:?}, got {counts:?}"141+ "{what}: dock must show {count:?}, got {counts:?}"
142 );142 );
143 assert!(143 assert!(
144- !attr_values(body, ".latest-commit .latest-age", "title").is_empty(),144+ !attr_values(body, ".canvas-dock .dock-subject", "title").is_empty(),
145- "{what}: bar age needs an absolute time in its title"145+ "{what}: dock subject needs an absolute time in its title"
146 );146 );
147 }147 }
148 148
crates/forge-web/tests/e2e/repo_settings_e2e.rsmodified+51 -16
@@ -133,7 +133,9 @@ async fn repo_settings_end_to_end() {
133 133
134 // A collaborator with the Admin role gets the settings page (branch rules) but no danger zone,134 // A collaborator with the Admin role gets the settings page (branch rules) but no danger zone,
135 // and a POST to the delete form is 403. The repo stays.135 // and a POST to the delete form is 403. The repo stays.
136- let carol_page = http.get("/bob/priv/settings", Some(&carol)).await;136+ let carol_page = http
137+ .get("/bob/priv/settings?section=danger", Some(&carol))
138+ .await;
137 assert_eq!(carol_page.status, 200, "admin collaborator settings page");139 assert_eq!(carol_page.status, 200, "admin collaborator settings page");
138 assert!(140 assert!(
139 !carol_page.body.contains("Danger zone"),141 !carol_page.body.contains("Danger zone"),
@@ -151,7 +153,9 @@ async fn repo_settings_end_to_end() {
151 assert_eq!(http.get("/bob/priv", Some(&carol)).await.status, 200);153 assert_eq!(http.get("/bob/priv", Some(&carol)).await.status, 200);
152 154
153 // The owner sees the danger zone, and the Settings tab appears on the repo header.155 // The owner sees the danger zone, and the Settings tab appears on the repo header.
154- let owner_page = http.get("/bob/pub/settings", Some(&bob)).await;156+ let owner_page = http
157+ .get("/bob/pub/settings?section=danger", Some(&bob))
158+ .await;
155 assert_eq!(owner_page.status, 200, "owner settings page");159 assert_eq!(owner_page.status, 200, "owner settings page");
156 assert!(160 assert!(
157 owner_page.body.contains("Danger zone"),161 owner_page.body.contains("Danger zone"),
@@ -452,15 +456,20 @@ async fn branch_protection_end_to_end() {
452 let dan = login(&http, "dan", PW).await;456 let dan = login(&http, "dan", PW).await;
453 457
454 // Owner: the built-in row is there before any rule, and the danger zone is shown.458 // Owner: the built-in row is there before any rule, and the danger zone is shown.
455- let page = http.get("/bob/app/settings", Some(&bob)).await;459+ let page = http
460+ .get("/bob/app/settings?section=branches", Some(&bob))
461+ .await;
456 assert_eq!(page.status, 200, "owner settings page");462 assert_eq!(page.status, 200, "owner settings page");
457 assert!(page.body.contains("Branch protection"), "section missing");463 assert!(page.body.contains("Branch protection"), "section missing");
458 assert!(464 assert!(
459 page.body.contains("(default branch): protected by default"),465 page.body.contains("(default branch): protected by default"),
460 "built-in row missing"466 "built-in row missing"
461 );467 );
468+ let danger_page = http
469+ .get("/bob/app/settings?section=danger", Some(&bob))
470+ .await;
462 assert!(471 assert!(
463- page.body.contains("Danger zone"),472+ danger_page.body.contains("Danger zone"),
464 "owner sees the danger zone"473 "owner sees the danger zone"
465 );474 );
466 assert_eq!(475 assert_eq!(
@@ -483,10 +492,16 @@ async fn branch_protection_end_to_end() {
483 )492 )
484 .await;493 .await;
485 assert_eq!(added.status, 303, "add rule: {}", added.body);494 assert_eq!(added.status, 303, "add rule: {}", added.body);
486- assert_eq!(added.header(LOCATION).as_deref(), Some("/bob/app/settings"));495+ assert_eq!(
496+ added.header(LOCATION).as_deref(),
497+ Some("/bob/app/settings?section=branches")
498+ );
487 let notice = cookie_named(&added, "forge_settings_notice").expect("settings notice cookie");499 let notice = cookie_named(&added, "forge_settings_notice").expect("settings notice cookie");
488 let page = http500 let page = http
489- .get("/bob/app/settings", Some(&format!("{bob}; {notice}")))501+ .get(
502+ "/bob/app/settings?section=branches",
503+ Some(&format!("{bob}; {notice}")),
504+ )
490 .await;505 .await;
491 assert!(506 assert!(
492 page.body.contains("Branch rule saved."),507 page.body.contains("Branch rule saved."),
@@ -511,7 +526,9 @@ async fn branch_protection_end_to_end() {
511 )526 )
512 .await;527 .await;
513 assert_eq!(updated.status, 303, "update rule: {}", updated.body);528 assert_eq!(updated.status, 303, "update rule: {}", updated.body);
514- let page = http.get("/bob/app/settings", Some(&bob)).await;529+ let page = http
530+ .get("/bob/app/settings?section=branches", Some(&bob))
531+ .await;
515 assert_eq!(532 assert_eq!(
516 rule_row(&page.body, "main"),533 rule_row(&page.body, "main"),
517 Some(vec!["main".into(), "No extra rules".into()]),534 Some(vec!["main".into(), "No extra rules".into()]),
@@ -544,7 +561,9 @@ async fn branch_protection_end_to_end() {
544 invalid.body.contains("value=\"bad..name\""),561 invalid.body.contains("value=\"bad..name\""),
545 "the entered pattern is kept in the form"562 "the entered pattern is kept in the form"
546 );563 );
547- let page = http.get("/bob/app/settings", Some(&bob)).await;564+ let page = http
565+ .get("/bob/app/settings?section=branches", Some(&bob))
566+ .await;
548 assert!(567 assert!(
549 rule_row(&page.body, "bad..name").is_none(),568 rule_row(&page.body, "bad..name").is_none(),
550 "invalid rule must not be saved"569 "invalid rule must not be saved"
@@ -567,7 +586,9 @@ async fn branch_protection_end_to_end() {
567 )586 )
568 .await;587 .await;
569 assert_eq!(no_csrf_delete.status, 403, "missing CSRF on remove");588 assert_eq!(no_csrf_delete.status, 403, "missing CSRF on remove");
570- let page = http.get("/bob/app/settings", Some(&bob)).await;589+ let page = http
590+ .get("/bob/app/settings?section=branches", Some(&bob))
591+ .await;
571 assert!(592 assert!(
572 rule_row(&page.body, "release/*").is_none(),593 rule_row(&page.body, "release/*").is_none(),
573 "rule saved without CSRF"594 "rule saved without CSRF"
@@ -587,7 +608,9 @@ async fn branch_protection_end_to_end() {
587 )608 )
588 .await;609 .await;
589 assert_eq!(removed.status, 303, "remove rule: {}", removed.body);610 assert_eq!(removed.status, 303, "remove rule: {}", removed.body);
590- let page = http.get("/bob/app/settings", Some(&bob)).await;611+ let page = http
612+ .get("/bob/app/settings?section=branches", Some(&bob))
613+ .await;
591 assert!(rule_row(&page.body, "main").is_none(), "main removed");614 assert!(rule_row(&page.body, "main").is_none(), "main removed");
592 assert!(615 assert!(
593 page.body.contains("(default branch): protected by default"),616 page.body.contains("(default branch): protected by default"),
@@ -595,7 +618,9 @@ async fn branch_protection_end_to_end() {
595 );618 );
596 619
597 // A Write collaborator cannot open the settings or post rules.620 // A Write collaborator cannot open the settings or post rules.
598- let dan_page = http.get("/bob/app/settings", Some(&dan)).await;621+ let dan_page = http
622+ .get("/bob/app/settings?section=branches", Some(&dan))
623+ .await;
599 assert_eq!(dan_page.status, 403, "write collaborator settings page");624 assert_eq!(dan_page.status, 403, "write collaborator settings page");
600 let dan_csrf = csrf_for(&http, &dan).await;625 let dan_csrf = csrf_for(&http, &dan).await;
601 let dan_save = http626 let dan_save = http
@@ -607,7 +632,7 @@ async fn branch_protection_end_to_end() {
607 .await;632 .await;
608 assert_eq!(dan_save.status, 403, "write collaborator save");633 assert_eq!(dan_save.status, 403, "write collaborator save");
609 assert!(634 assert!(
610- http.get("/bob/app/settings", Some(&bob))635+ http.get("/bob/app/settings?section=branches", Some(&bob))
611 .await636 .await
612 .body637 .body
613 .contains("(default branch): protected by default"),638 .contains("(default branch): protected by default"),
@@ -615,11 +640,16 @@ async fn branch_protection_end_to_end() {
615 );640 );
616 641
617 // An Admin collaborator manages rules, sees no danger zone and cannot delete the repo.642 // An Admin collaborator manages rules, sees no danger zone and cannot delete the repo.
618- let carol_page = http.get("/bob/app/settings", Some(&carol)).await;643+ let carol_page = http
644+ .get("/bob/app/settings?section=branches", Some(&carol))
645+ .await;
619 assert_eq!(carol_page.status, 200, "admin collaborator settings page");646 assert_eq!(carol_page.status, 200, "admin collaborator settings page");
620 assert!(carol_page.body.contains("Branch protection"));647 assert!(carol_page.body.contains("Branch protection"));
648+ let carol_danger = http
649+ .get("/bob/app/settings?section=danger", Some(&carol))
650+ .await;
621 assert!(651 assert!(
622- !carol_page.body.contains("Danger zone"),652+ !carol_danger.body.contains("Danger zone"),
623 "admin collaborator must not see the danger zone"653 "admin collaborator must not see the danger zone"
624 );654 );
625 assert!(655 assert!(
@@ -642,7 +672,9 @@ async fn branch_protection_end_to_end() {
642 )672 )
643 .await;673 .await;
644 assert_eq!(carol_save.status, 303, "admin collaborator save");674 assert_eq!(carol_save.status, 303, "admin collaborator save");
645- let page = http.get("/bob/app/settings", Some(&carol)).await;675+ let page = http
676+ .get("/bob/app/settings?section=branches", Some(&carol))
677+ .await;
646 assert_eq!(678 assert_eq!(
647 rule_row(&page.body, "release/*"),679 rule_row(&page.body, "release/*"),
648 Some(vec!["release/*".into(), "Force push allowed".into()]),680 Some(vec!["release/*".into(), "Force push allowed".into()]),
@@ -661,7 +693,10 @@ async fn branch_protection_end_to_end() {
661 assert_eq!(carol_delete_rule.status, 303, "admin collaborator remove");693 assert_eq!(carol_delete_rule.status, 303, "admin collaborator remove");
662 assert!(694 assert!(
663 rule_row(695 rule_row(
664- &http.get("/bob/app/settings", Some(&bob)).await.body,696+ &http
697+ .get("/bob/app/settings?section=branches", Some(&bob))
698+ .await
699+ .body,
665 "release/*"700 "release/*"
666 )701 )
667 .is_none(),702 .is_none(),
style/_alive_head.scssadded+99 -0
@@ -0,0 +1,99 @@
1+// alive_head: see memory design/ALIVE.md.
2+// Repo head: the code-pages menu after the Code tab and the actions menu at the right end. Both
3+// panels float over the page. The tab bar clips its overflow (it scrolls on narrow windows), so the
4+// tab menu takes no position of its own: its panel is placed at its static position, and its
5+// containing block is an ancestor outside the bar, which the bar does not clip. The page head has
6+// no overflow rule, so the actions panel is not clipped either.
7+
8+// Code pages menu (Commits, Branches, Tags, Releases).
9+.tab-more {
10+ position: static;
11+ flex: none;
12+}
13+
14+.repo-tabs .tab-more-toggle {
15+ display: inline-flex;
16+ align-items: center;
17+ margin-left: -16px;
18+ padding: 0 2px;
19+ border: 0;
20+ border-radius: 0;
21+ list-style: none;
22+ cursor: pointer;
23+
24+ &::-webkit-details-marker {
25+ display: none;
26+ }
27+
28+ svg {
29+ width: 14px;
30+ height: 14px;
31+ fill: none;
32+ stroke: currentColor;
33+ stroke-width: 2;
34+ stroke-linecap: round;
35+ stroke-linejoin: round;
36+ }
37+}
38+
39+.tab-more[open] > .tab-more-toggle {
40+ color: var(--text);
41+}
42+
43+.tab-more-list {
44+ position: absolute;
45+ z-index: 10;
46+ display: flex;
47+ flex-direction: column;
48+ min-width: 180px;
49+ margin-top: 6px;
50+ padding: 6px 0;
51+ background: var(--surface);
52+ border: 1px solid var(--border);
53+ border-radius: var(--radius-lg);
54+}
55+
56+.tab-more-link {
57+ display: block;
58+ padding: 8px 14px;
59+ color: var(--muted);
60+ white-space: nowrap;
61+ text-decoration: none;
62+
63+ &:hover {
64+ color: var(--text);
65+ text-decoration: none;
66+ }
67+
68+ &.is-current {
69+ color: var(--text);
70+ font-weight: 600;
71+ }
72+}
73+
74+// Actions menu: a 28px "…" beside the star, holding the badge, watch, fork and their counts.
75+.header-actions .head-more > summary {
76+ display: inline-flex;
77+ align-items: center;
78+ justify-content: center;
79+ width: 28px;
80+ height: 28px;
81+ padding: 0;
82+ font-size: 16px;
83+ line-height: 1;
84+ color: var(--text);
85+ background: var(--surface);
86+ border: 1px solid var(--border-strong);
87+ border-radius: var(--radius-md);
88+}
89+
90+.head-more-list {
91+ right: 0;
92+ display: flex;
93+ flex-direction: column;
94+ align-items: flex-start;
95+ gap: 10px;
96+ min-width: 240px;
97+ padding: 12px 14px;
98+}
99+
style/_alive_heat.scssadded+61 -0
@@ -0,0 +1,61 @@
1+// alive_heat: see memory design/ALIVE.md.
2+// Heat as age. nav.js sets data-heat on a row from its newest time[data-rel]: 3 under an hour,
3+// 2 under a day, 1 under a week, no attribute when older. Tone only: the name moves from --text-2
4+// (the floor, which passes 4.5:1 in both themes) towards --text. No accent, and the only motion
5+// is the colour fade on the name. The hover colour of a tree name is restored at the end.
6+
7+// The base state, for every row in these lists: the name is --text-2.
8+.tree-table tbody tr .tree-label > a,
9+.tree-table tbody tr .tree-label > span,
10+[data-kb-row] .commit-summary,
11+.repo-item .repo-name,
12+.pin-card .repo-name {
13+ color: var(--text-2);
14+}
15+
16+@media (prefers-reduced-motion: no-preference) {
17+ .tree-table tbody tr .tree-label > a,
18+ .tree-table tbody tr .tree-label > span,
19+ [data-kb-row] .commit-summary,
20+ .repo-item .repo-name,
21+ .pin-card .repo-name {
22+ transition: color 1s;
23+ }
24+}
25+
26+// Level 1: slightly brighter than the base.
27+.tree-table tbody tr[data-heat="1"] .tree-label > a,
28+.tree-table tbody tr[data-heat="1"] .tree-label > span,
29+[data-kb-row][data-heat="1"] .commit-summary,
30+.repo-item[data-heat="1"] .repo-name,
31+.pin-card[data-heat="1"] .repo-name {
32+ color: color-mix(in srgb, var(--text) 30%, var(--text-2));
33+}
34+
35+// Level 2: brighter.
36+.tree-table tbody tr[data-heat="2"] .tree-label > a,
37+.tree-table tbody tr[data-heat="2"] .tree-label > span,
38+[data-kb-row][data-heat="2"] .commit-summary,
39+.repo-item[data-heat="2"] .repo-name,
40+.pin-card[data-heat="2"] .repo-name {
41+ color: color-mix(in srgb, var(--text) 65%, var(--text-2));
42+}
43+
44+// Level 3: the newest rows. The name is --text and bold, and the time is --text.
45+.tree-table tbody tr[data-heat="3"] .tree-label > a,
46+.tree-table tbody tr[data-heat="3"] .tree-label > span,
47+[data-kb-row][data-heat="3"] .commit-summary,
48+.repo-item[data-heat="3"] .repo-name,
49+.pin-card[data-heat="3"] .repo-name {
50+ color: var(--text);
51+ font-weight: 600;
52+}
53+
54+[data-heat="3"] time[data-rel] {
55+ color: var(--text);
56+}
57+
58+// The tree name's hover colour is unchanged: it stays --text on every row.
59+.tree-table tbody tr .tree-label > a:hover {
60+ color: var(--text);
61+}
style/_alive_issue.scssadded+8 -0
@@ -0,0 +1,8 @@
1+// alive_issue: see memory design/ALIVE.md.
2+
3+// A sidebar part whose form is on the wire: dimmed, no spinner. The swap that follows replaces it.
4+.issue-side-section.is-pending,
5+.issue-check.is-pending {
6+ opacity: 0.6;
7+ cursor: progress;
8+}
style/_alive_lists.scssadded+88 -0
@@ -0,0 +1,88 @@
1+// alive_lists: see memory design/ALIVE.md.
2+
3+// Issues and pulls toolbar: Labels and Milestones sit in one "…" menu beside New issue. The
4+// summary is drawn like a .button so the row keeps one height.
5+.list-more {
6+ position: relative;
7+
8+ > summary {
9+ display: inline-flex;
10+ align-items: center;
11+ justify-content: center;
12+ height: var(--control-h);
13+ min-width: var(--control-h);
14+ padding: 0 10px;
15+ box-sizing: border-box;
16+ border: 1px solid var(--border-strong);
17+ border-radius: var(--radius-md);
18+ background: var(--surface);
19+ color: var(--text);
20+ font-size: 1rem;
21+ line-height: 1;
22+ cursor: pointer;
23+ list-style: none;
24+ user-select: none;
25+
26+ &::-webkit-details-marker {
27+ display: none;
28+ }
29+ }
30+
31+ &[open] > summary {
32+ background: var(--surface-2);
33+ }
34+
35+ > .list-more-menu {
36+ position: absolute;
37+ top: calc(100% + 4px);
38+ right: 0;
39+ z-index: 20;
40+ display: flex;
41+ flex-direction: column;
42+ min-width: 160px;
43+ padding: 4px;
44+ border: 1px solid var(--border);
45+ border-radius: var(--radius-md);
46+ background: var(--surface);
47+
48+ > a {
49+ padding: 7px 10px;
50+ border-radius: var(--radius-sm);
51+ color: var(--text);
52+ text-decoration: none;
53+ white-space: nowrap;
54+
55+ &:hover {
56+ background: var(--surface-2);
57+ }
58+ }
59+ }
60+}
61+
62+// Commit page: one line under the title holds the hash, signature, author, time, parents, checks
63+// and the Browse files link. It wraps on a narrow window and never becomes a card.
64+.commit-facts {
65+ display: flex;
66+ flex-wrap: wrap;
67+ align-items: center;
68+ gap: 6px 14px;
69+ margin: 0 0 12px;
70+ font-size: 0.875rem;
71+ line-height: 1.5;
72+
73+ > .commit-hash {
74+ height: auto;
75+ padding: 2px 8px;
76+ border-radius: var(--radius-full);
77+ font-family: var(--mono);
78+ font-size: 0.8125rem;
79+ }
80+
81+ > .checks-summary {
82+ flex: 0 0 auto;
83+ }
84+
85+ > .commit-browse {
86+ margin-left: auto;
87+ }
88+}
style/_alive_motion.scssadded+92 -0
@@ -0,0 +1,92 @@
1+// alive_motion: see memory design/ALIVE.md. Motion only where something real happened: an arrival after
2+// a live update, the running bar's breath, a finished bar settling, and the CI tab's live dot. The
3+// classes come from nav.js (`arrived`, `hs-settle`, `tab-live`); everything moves only when the reader
4+// has not asked for less motion.
5+
6+@media (prefers-reduced-motion: no-preference) {
7+ @keyframes arrive-in {
8+ from { opacity: 0; transform: translateY(-6px); }
9+ to { opacity: 1; transform: none; }
10+ }
11+
12+ @keyframes arrive-grow {
13+ from { transform: scaleY(0); }
14+ to { transform: scaleY(1); }
15+ }
16+
17+ @keyframes arrive-count {
18+ 0% { transform: scale(1); }
19+ 40% { transform: scale(1.3); }
20+ 100% { transform: scale(1); }
21+ }
22+
23+ @keyframes arrive-lift {
24+ 0% { filter: brightness(1.6); }
25+ 100% { filter: brightness(1); }
26+ }
27+
28+ @keyframes hs-breathe {
29+ 0%, 100% { opacity: 1; }
30+ 50% { opacity: 0.35; }
31+ }
32+
33+ // Only the start is given: the bar settles to its own final tone.
34+ @keyframes hs-settle {
35+ from { background-color: var(--accent); }
36+ }
37+
38+ @keyframes tab-breathe {
39+ 0%, 100% { opacity: 1; }
40+ 50% { opacity: 0.35; }
41+ }
42+
43+ // Rows slide in with a short fade; the commit bars grow from the strip's floor; a count and a
44+ // calendar cell mark the change. Later rules win the same-specificity ties.
45+ [data-arrive].arrived {
46+ animation: arrive-in 300ms ease-out both;
47+ }
48+
49+ .hs-bar.arrived {
50+ transform-origin: 50% 100%;
51+ animation: arrive-grow 300ms ease-out both;
52+ }
53+
54+ .tab-count.arrived {
55+ display: inline-block;
56+ animation: arrive-count 300ms ease-out;
57+ }
58+
59+ .cell.arrived {
60+ animation: arrive-lift 300ms ease-out;
61+ }
62+
63+ .history-bars > a.hs-live {
64+ animation: hs-breathe 2.4s ease-in-out infinite;
65+ }
66+
67+ .history-bars > a.hs-settle {
68+ animation: hs-settle 1.2s ease-out;
69+ }
70+
71+ .repo-tabs a.tab-live::after {
72+ animation: tab-breathe 2.4s ease-in-out infinite;
73+ }
74+}
75+
76+// The running bar is the accent in every state, with or without motion.
77+.history-bars > a.hs-live {
78+ background: var(--accent);
79+ opacity: 1;
80+}
81+
82+// The CI tab's dot while a run goes: static under reduced motion, breathing otherwise.
83+.repo-tabs a.tab-live::after {
84+ content: "";
85+ display: inline-block;
86+ width: 6px;
87+ height: 6px;
88+ margin-left: 6px;
89+ border-radius: 50%;
90+ background: var(--accent);
91+ vertical-align: middle;
92+}
style/_alive_scrub.scssadded+61 -0
@@ -0,0 +1,61 @@
1+// alive_scrub: see memory design/ALIVE.md. The timeline scrub on the repo home (nav.js).
2+
3+// Touch drags across the strip move the preview instead of scrolling the page.
4+.history-bars > a {
5+ touch-action: none;
6+}
7+
8+.history-bars.is-scrubbing {
9+ cursor: ew-resize;
10+}
11+
12+// The bar the preview shows, and the bar under the pointer while scrubbing: full tone, in the accent.
13+.history-bars > a.is-scrubbed {
14+ background: var(--accent);
15+ opacity: 1;
16+}
17+
18+// The preview's listing is not the latest commit: a quiet label says so.
19+.scrub-marker {
20+ color: var(--muted);
21+ margin: 0 0 8px;
22+}
23+
24+// The dock note: the commit shown, its age, and the way back.
25+.scrub-note {
26+ display: inline-flex;
27+ align-items: center;
28+ gap: 8px;
29+ color: var(--muted);
30+}
31+
32+.scrub-sha {
33+ color: var(--text);
34+}
35+
36+.scrub-back {
37+ background: none;
38+ border: 0;
39+ padding: 0;
40+ color: var(--text);
41+ font: inherit;
42+ text-decoration: underline;
43+ text-underline-offset: 3px;
44+ cursor: pointer;
45+}
46+
47+.scrub-back:focus-visible {
48+ outline: 2px solid var(--focus);
49+ outline-offset: 2px;
50+}
51+
52+// The label takes a row of the tree pane, on the rows' own inset.
53+.repo-home .tree-list > .scrub-marker {
54+ flex: none;
55+ margin: 0;
56+ padding: 8px 14px;
57+}
58+
59+.repo-home .tree-list .tree-entry {
60+ cursor: default;
61+}
style/_alive_settings.scssadded+245 -0
@@ -0,0 +1,245 @@
1+// alive_settings: see memory design/ALIVE.md.
2+
3+// The repo General page shows one section at a time. A section is plain content on the page background,
4+// one left aligned column at 720px, under a mono label. Nothing in it is a card.
5+.settings-main > .settings-section {
6+ display: flex;
7+ flex-direction: column;
8+ gap: 16px;
9+ box-sizing: border-box;
10+ max-width: 720px;
11+ min-width: 0;
12+
13+ > h2 {
14+ @extend %mono-label;
15+ margin: 0;
16+ }
17+}
18+
19+// Branch protection: the rules are a list pane, the rule being edited fills the pane beside it. The
20+// rows stay one `details` group, so the panes are drawn by the list and the open row's form is laid
21+// over the right one: opening a row needs no script and closes the row that was open.
22+@media (min-width: 900px) {
23+ .settings-main > .settings-rules {
24+ flex: 1 1 auto;
25+ gap: 8px;
26+ max-width: none;
27+ min-height: 0;
28+ }
29+
30+ .rule-list {
31+ position: relative;
32+ display: block;
33+ flex: 1 1 auto;
34+ min-height: 0;
35+ margin: 0;
36+ overflow: visible;
37+ border: 0;
38+ background: none;
39+
40+ &::before,
41+ &::after {
42+ content: "";
43+ position: absolute;
44+ top: 0;
45+ bottom: 0;
46+ box-sizing: border-box;
47+ background: var(--surface);
48+ border: 1px solid var(--border);
49+ border-radius: 10px;
50+ }
51+
52+ &::before {
53+ left: 0;
54+ width: 300px;
55+ }
56+
57+ &::after {
58+ left: 312px;
59+ right: 0;
60+ }
61+
62+ > * + * {
63+ border-top: 0;
64+ }
65+
66+ > .rule-row,
67+ > .rule-builtin {
68+ position: static;
69+ box-sizing: border-box;
70+ width: 300px;
71+ }
72+ }
73+
74+ .rule-row > summary,
75+ .rule-new > summary,
76+ .rule-builtin {
77+ position: relative;
78+ z-index: 1;
79+ box-sizing: border-box;
80+ height: 36px;
81+ padding: 0 14px;
82+ box-shadow: inset 0 -1px var(--border);
83+ font-size: 13px;
84+ overflow: hidden;
85+ white-space: nowrap;
86+ }
87+
88+ .rule-builtin {
89+ display: flex;
90+ align-items: center;
91+ gap: 12px;
92+ }
93+
94+ .rule-row > summary:focus-visible {
95+ outline-offset: -2px;
96+ }
97+
98+ .rule-row[open] > summary {
99+ background: var(--surface-2);
100+ }
101+
102+ .rule-row[open] > summary .rule-edit {
103+ visibility: hidden;
104+ }
105+
106+ .rule-row[open] > summary .rule-chevron {
107+ transform: rotate(-45deg);
108+ }
109+
110+ .rule-pills {
111+ display: flex;
112+ gap: 6px;
113+ min-width: 0;
114+ overflow: hidden;
115+ }
116+
117+ .rule-pick {
118+ position: absolute;
119+ z-index: 1;
120+ top: 20px;
121+ left: 332px;
122+ margin: 0;
123+ }
124+
125+ .rule-list:has(details[open]) .rule-pick {
126+ display: none;
127+ }
128+
129+ .rule-row > .rule-form {
130+ position: absolute;
131+ z-index: 1;
132+ inset: 0 0 0 312px;
133+ display: grid;
134+ grid-template-columns: repeat(2, minmax(0, 1fr));
135+ align-content: start;
136+ gap: 20px 32px;
137+ box-sizing: border-box;
138+ padding: 20px;
139+ overflow: auto;
140+ border: 0;
141+ background: none;
142+
143+ input[type="text"],
144+ input[name="pattern"] {
145+ max-width: none;
146+ }
147+
148+ > :not(.rule-section, .rule-pair) {
149+ grid-column: 1 / -1;
150+ }
151+
152+ > .rule-section:has(input[name="required_checks"]) {
153+ order: 1;
154+ }
155+
156+ > .rule-pair {
157+ display: contents;
158+
159+ > .rule-section {
160+ order: 2;
161+ }
162+ }
163+
164+ > .form-actions {
165+ order: 3;
166+ }
167+ }
168+
169+ .rule-section {
170+ > legend {
171+ margin-bottom: 8px;
172+ font-family: var(--mono);
173+ font-size: 11px;
174+ font-weight: 500;
175+ letter-spacing: 0.12em;
176+ }
177+
178+ > p.muted.small {
179+ max-width: none;
180+ }
181+ }
182+
183+ .rule-form .switch-list {
184+ padding: 0;
185+ border: 0;
186+ border-top: 1px solid var(--border);
187+ border-radius: 0;
188+ }
189+
190+ .rule-form .switch-row:first-child {
191+ border-top: 0;
192+ }
193+}
194+
195+// The danger zone's intro: the same 14px text-2 as the other section intros.
196+.settings-intro {
197+ margin: 0;
198+ font-size: 14px;
199+ color: var(--text-2);
200+}
201+
202+// Branch protection rows: the open row differs from a closed one only in its background. Both keep
203+// the Edit text and a right chevron, so nothing swaps when a row opens.
204+.rule-row > summary .rule-chevron,
205+.rule-row[open] > summary .rule-chevron {
206+ transform: rotate(-45deg);
207+}
208+
209+.rule-row[open] > summary .rule-edit {
210+ visibility: visible;
211+}
212+
213+// Appearance: the preset swatches fit in rows of seven or more; the seven accents sit on one row.
214+.colour-choices {
215+ display: grid;
216+ grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr));
217+ gap: 12px 8px;
218+}
219+
220+.colour-choices > .colour-choice {
221+ width: auto;
222+}
223+
224+// The sound row spans the left column, so its label stays on one line beside the switch.
225+@media (min-width: 1100px) {
226+ .appearance-page {
227+ align-items: stretch;
228+ }
229+
230+ .appearance-top > .sound-toggle {
231+ grid-column: 1 / -1;
232+ }
233+}
234+
235+.sound-toggle .sound-row > span:first-child {
236+ min-width: 0;
237+ white-space: nowrap;
238+}
239+
240+// The profile avatar's Edit pill sits inside the circle's bottom right, clear of the edge.
241+.profile-settings-avatar-menu {
242+ left: auto;
243+ right: 30px;
244+ bottom: 30px;
245+}
style/_canvas.scssadded+109 -0
@@ -0,0 +1,109 @@
1+// The shell of the approved canvases. Imported after every other sheet, so it wins by order.
2+// Sizes are the canvases' own: a 54px path row with no box and no rule, a 36px tab row, 40px page
3+// margins, the body's accent wash, and no footer once signed in.
4+
5+@media (min-width: 900px) {
6+ .topbar {
7+ height: 54px;
8+ padding: 0 40px;
9+ background: transparent;
10+ border-bottom: 0;
11+ }
12+
13+ .pathbar,
14+ .pathbar:has(.pathbar-edit) {
15+ max-width: none;
16+ padding: 0;
17+ background: transparent;
18+ border: 0;
19+ box-shadow: none;
20+ border-radius: 0;
21+ }
22+
23+ .pathbar-ico {
24+ display: none;
25+ }
26+
27+ .pathbar-segs {
28+ font-family: var(--mono);
29+ font-size: 13px;
30+ }
31+
32+ // The profile corner floats over the left of the page's foot. Panes stop above it, so it covers
33+ // nothing; only pages with a dock or a left column that leaves it room reach the window's foot.
34+ .shell-body > main {
35+ padding: 0 40px 72px;
36+ }
37+
38+ .shell-body > main:has(.repo-home, .ci-run, .ci-job, .pull-page) {
39+ padding-bottom: 20px;
40+ }
41+
42+ .settings-layout.fit-pane {
43+ grid-template-rows: minmax(0, 1fr);
44+ overflow: hidden;
45+ }
46+
47+ // The accent wash shows through on signed-in pages: the shell itself paints nothing.
48+ .shell,
49+ .shell-body {
50+ background: transparent;
51+ }
52+
53+ body[data-signed-in] .site-footer {
54+ display: none;
55+ }
56+
57+ .corner-float {
58+ left: 40px;
59+ bottom: 20px;
60+ display: flex;
61+ align-items: center;
62+ box-sizing: border-box;
63+ height: 40px;
64+ padding: 0 8px 0 5px;
65+ background: var(--surface-2);
66+ border-radius: 9px;
67+ box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
68+ }
69+
70+ .corner-float .corner-avatar .avatar {
71+ width: 28px;
72+ height: 28px;
73+ border-radius: 6px;
74+ }
75+
76+ // The tab row: 36px, one hairline, the active tab a 2px accent rule on it.
77+ .repo-tabs,
78+ .page-head {
79+ min-height: 36px;
80+ }
81+
82+ .repo-tabs {
83+ gap: 22px;
84+
85+ .tab {
86+ padding: 0;
87+ height: 36px;
88+ line-height: 36px;
89+ font-size: 14px;
90+ color: var(--text-2);
91+ }
92+
93+ .tab[aria-current="page"],
94+ .tab.active {
95+ color: var(--text);
96+ font-weight: 600;
97+ box-shadow: inset 0 -2px var(--accent);
98+ }
99+
100+ .tab-count {
101+ height: 18px;
102+ padding: 0 4px;
103+ background: transparent;
104+ font-family: var(--mono);
105+ font-size: 11px;
106+ line-height: 18px;
107+ }
108+ }
109+}
style/_canvas_account.scssadded+140 -0
@@ -0,0 +1,140 @@
1+// canvas_account: details of the account, explore, admin and snippet pages.
2+// Imported last in main.scss, so these rules win over the page partials they correct.
3+
4+// Page heads: one 40px row, the right action centred in it at 32px, so at least 4px of the
5+// row sits under the button before the rule.
6+@media (min-width: 900px) {
7+ .page-head {
8+ min-height: 40px;
9+ box-sizing: border-box;
10+ align-items: center;
11+ }
12+}
13+
14+.page-head .inline-form {
15+ margin: 0;
16+}
17+
18+.page-head .button,
19+.page-head button {
20+ height: 32px;
21+ box-sizing: border-box;
22+ display: inline-flex;
23+ align-items: center;
24+ margin: 0;
25+ padding-top: 0;
26+ padding-bottom: 0;
27+}
28+
29+// Explore: the search and its button sit on one 32px line in the 44px toolbar, sort after them.
30+.explore > .explore-toolbar > .explore-search {
31+ flex: 0 1 20rem;
32+ display: flex;
33+ flex-wrap: nowrap;
34+ align-items: center;
35+ gap: 8px;
36+ width: auto;
37+ height: 32px;
38+ min-width: 0;
39+ margin: 0;
40+
41+ input[type="search"] {
42+ flex: 1 1 0;
43+ width: auto;
44+ min-width: 0;
45+ height: 32px;
46+ box-sizing: border-box;
47+ margin: 0;
48+ padding-top: 0;
49+ padding-bottom: 0;
50+ }
51+
52+ button {
53+ flex: none;
54+ height: 32px;
55+ box-sizing: border-box;
56+ margin: 0;
57+ padding-top: 0;
58+ padding-bottom: 0;
59+ }
60+
61+ @media (max-width: 479px) {
62+ input[type="search"] {
63+ flex: 1 1 0;
64+ }
65+ }
66+}
67+
68+.explore > .explore-toolbar .explore-sort {
69+ margin: 0;
70+}
71+
72+// Sessions: names are plain text; only the "This session" badge takes the accent. The pane
73+// scrolls inside itself, so the last Revoke is reachable.
74+.card.fit-pane.session-pane {
75+ overflow-y: auto;
76+ overflow-x: hidden;
77+ overscroll-behavior: contain;
78+ min-height: 0;
79+
80+ .item-main > a,
81+ .item-main > a strong {
82+ color: var(--text);
83+ }
84+
85+ > .item-list {
86+ padding-bottom: 8px;
87+ }
88+}
89+
90+// Snippet head: the visibility control and Save are both 32px.
91+.snippet-head .snippet-segmented.segmented {
92+ height: 32px;
93+}
94+
95+// Heatmap: the last column's month label ends at the grid's edge and runs back over the
96+// columns before it, so "Nov" does not clip at the card's right edge.
97+.heat-months > span:last-child {
98+ justify-self: end;
99+}
100+
101+// Audit log: WHEN 140px, ACTOR 160px (only on the admin table, which has six columns), ACTION
102+// and TARGET and DETAILS take the rest, 14px cell padding.
103+.table.audit-table {
104+ th,
105+ td {
106+ padding: 14px;
107+ }
108+
109+ th:first-child,
110+ td:first-child {
111+ width: 140px;
112+ }
113+}
114+
115+.table.audit-table:has(> thead > tr > th:nth-child(6)) {
116+ th:nth-child(2),
117+ td:nth-child(2) {
118+ width: 160px;
119+ }
120+}
121+
122+// Security danger zone: the repo names line up with the body text beside the icon.
123+.card.security-danger .security-row > .security-repos {
124+ padding-left: 36px;
125+}
126+
127+// Explore: one pane with the shared 14px inset, nothing more.
128+.explore {
129+ padding: 0;
130+}
131+
132+.explore > .explore-toolbar,
133+.explore > ul,
134+.explore > .repo-list {
135+ margin: 0;
136+}
137+
138+.srv-form {
139+ margin-top: 12px;
140+}
style/_canvas_ci.scssadded+110 -0
@@ -0,0 +1,110 @@
1+// The CI pages as the approved canvases (memory design/ALIVE.md): the runs list keeps its rows, drawn
2+// as the canvas's rows, and the selected run's column stacks the head and the panes.
3+
4+// The runs list: a hairline under each row, 14 px sides, the open run on --surface-2.
5+.ci-split > .ci-side .ci-row {
6+ padding: 10px 14px;
7+ box-shadow: inset 0 -1px var(--border);
8+ border-radius: 0;
9+}
10+
11+.ci-split > .ci-side .ci-row[aria-current="true"] {
12+ background: var(--surface-2);
13+}
14+
15+// The selected run's column: its head, its panes, and no scrolling of its own.
16+.ci-split > .ci-detail {
17+ display: flex;
18+ flex-direction: column;
19+ gap: 12px;
20+ min-width: 0;
21+ min-height: 0;
22+ overflow: hidden;
23+ padding: 0;
24+ background: none;
25+ border: 0;
26+ box-shadow: none;
27+}
28+
29+.ci-split > .ci-detail > .ci-tl-main {
30+ flex: 1 1 0;
31+ min-height: 0;
32+}
33+
34+// The page reaches the window's foot, and the dock is the repo page's: 156px with the label in a
35+// 254px column, so the floating profile corner covers no bars.
36+.ci-run.fit-pane,
37+.ci-job.fit-pane {
38+ height: calc(100dvh - var(--pane-top, 107px) - 20px);
39+}
40+
41+.ci-dock {
42+ flex: none;
43+ height: 156px;
44+ box-sizing: border-box;
45+}
46+
47+.ci-tl-tab {
48+ flex-direction: row;
49+}
50+
51+// The dock's note sits under the `Last 48 commits` label, in the 254px label column, so no bar sits
52+// under it. Below 900px the dock stacks and the note takes its own line.
53+.ci-dock .ci-dock-note {
54+ top: 34px;
55+ left: 14px;
56+ right: auto;
57+ width: 226px;
58+ margin: 0;
59+ font-size: 12px;
60+ line-height: 1.3;
61+ color: var(--muted);
62+}
63+
64+// The header's actions (Re-run, Re-run failed jobs, Cancel) and the log toolbar's buttons are one size:
65+// 32px high, 13px text. Copy log and Full log take the same treatment.
66+.ci-tl-actions button,
67+.ci-tl-actions .button {
68+ height: 32px;
69+ font-size: 13px;
70+}
71+
72+.ci-tl-tools .ci-mini {
73+ display: inline-flex;
74+ align-items: center;
75+ justify-content: center;
76+ box-sizing: border-box;
77+ height: 32px;
78+ padding: 0 12px;
79+ font-size: 13px;
80+ line-height: 1;
81+ text-decoration: none;
82+}
83+
84+.ci-tl-tools .ci-logsearch {
85+ height: 32px;
86+ box-sizing: border-box;
87+}
88+
89+@media (max-width: 899px) {
90+ .ci-dock .ci-dock-note {
91+ position: static;
92+ width: auto;
93+ margin-bottom: 6px;
94+ }
95+}
96+
97+.ci-tl-tools a.ci-mini {
98+ display: inline-flex;
99+ align-items: center;
100+ box-sizing: border-box;
101+ height: 32px;
102+ padding: 0 12px;
103+ border: 1px solid var(--border);
104+ border-radius: 7px;
105+ background: transparent;
106+ font-size: 13px;
107+ font-weight: 600;
108+ color: var(--text);
109+ text-decoration: none;
110+}
style/_canvas_commits.scssadded+272 -0
@@ -0,0 +1,272 @@
1+// canvas_commits: the commits list, matched to project/Commits.dc.html in the One Lit Thing
2+// artifact (see memory design/ALIVE.md). A head line, then one pane of day groups. Each row is one
3+// 36px line; a row with more than one clause or a body is a <details> whose message opens below it.
4+// Everything is scoped to .commits-fit so no other page changes.
5+
6+.commits-fit {
7+ // Head line: "Commits on", the branch tag and, when a path filter is set, its note. 36px high.
8+ > .commits-head {
9+ display: flex;
10+ align-items: center;
11+ flex-wrap: wrap;
12+ gap: 10px;
13+ min-height: 36px;
14+ box-sizing: border-box;
15+ }
16+
17+ .commits-head .label,
18+ .commits-g .label {
19+ font-family: var(--mono);
20+ font-size: 11px;
21+ font-weight: 500;
22+ letter-spacing: 0.12em;
23+ text-transform: uppercase;
24+ color: var(--muted);
25+ }
26+
27+ .commits-head .tag {
28+ font-family: var(--mono);
29+ font-size: 11px;
30+ padding: 1px 7px;
31+ border-radius: 5px;
32+ background: var(--surface-2);
33+ color: var(--text-2);
34+ }
35+
36+ .commits-filter {
37+ display: inline-flex;
38+ flex-wrap: wrap;
39+ gap: 6px;
40+ }
41+
42+ // The one pane. It fills what is left under the head line and scrolls inside itself; the pager
43+ // sits below it.
44+ > .commits-pane {
45+ display: flex;
46+ flex-direction: column;
47+ flex: 1 1 auto;
48+ min-height: 0;
49+ margin-top: 12px;
50+ box-sizing: border-box;
51+ overflow-y: auto;
52+ overscroll-behavior: contain;
53+ background: var(--surface);
54+ border: 1px solid var(--border);
55+ border-radius: 10px;
56+ }
57+
58+ // Day group header: 28px, a hairline under it.
59+ .commits-g {
60+ flex: none;
61+ display: flex;
62+ align-items: center;
63+ height: 28px;
64+ box-sizing: border-box;
65+ padding: 0 14px;
66+ box-shadow: inset 0 -1px var(--border);
67+ }
68+
69+ .commits-list {
70+ list-style: none;
71+ margin: 0;
72+ padding: 0;
73+ }
74+
75+ // One row per commit, with its hairline. A disclosure's body sits inside the same item, so the
76+ // hairline falls under the message too.
77+ .commits-item {
78+ box-shadow: inset 0 -1px var(--border);
79+ }
80+
81+ .commits-d {
82+ margin: 0;
83+
84+ > summary {
85+ list-style: none;
86+ cursor: pointer;
87+
88+ &::-webkit-details-marker {
89+ display: none;
90+ }
91+ }
92+ }
93+
94+ // The row line: 36px, one line, 14px side padding. The subject, the author and the sha are
95+ // clipped in place; nothing wraps.
96+ .commits-r {
97+ display: flex;
98+ align-items: center;
99+ gap: 12px;
100+ height: 36px;
101+ box-sizing: border-box;
102+ padding: 0 14px;
103+ min-width: 0;
104+ white-space: nowrap;
105+ }
106+
107+ .commits-slot {
108+ flex: none;
109+ width: 14px;
110+ display: flex;
111+ align-items: center;
112+ justify-content: center;
113+ color: var(--muted);
114+
115+ svg {
116+ display: block;
117+ width: 14px;
118+ height: 14px;
119+ }
120+ }
121+
122+ .commits-d[open] .commits-chev svg {
123+ transform: rotate(180deg);
124+ }
125+
126+ // CI dot: none, ok, bad, or live while a status is pending. Live follows the accent.
127+ .commits-dot {
128+ flex: none;
129+ width: 8px;
130+ height: 8px;
131+ border-radius: 50%;
132+ background: var(--muted);
133+
134+ &.ok {
135+ background: var(--ok);
136+ }
137+
138+ &.bad {
139+ background: var(--bad);
140+ }
141+
142+ &.live {
143+ background: var(--accent);
144+ animation: commits-beat 1.6s ease-in-out infinite;
145+ }
146+ }
147+
148+ // The subject takes the free width and clips. The heat rule in _alive_heat.scss sets its colour.
149+ .commits-sub {
150+ flex: 1 1 auto;
151+ display: flex;
152+ min-width: 0;
153+ overflow: hidden;
154+ font-size: 14px;
155+ font-weight: 400;
156+ overflow-wrap: normal;
157+
158+ .commit-line {
159+ flex: 1 1 auto;
160+ min-width: 0;
161+ max-width: 100%;
162+ }
163+
164+ .commit-line-text {
165+ font-size: 14px;
166+ }
167+ }
168+
169+ .commits-au {
170+ flex: none;
171+ font-size: 13px;
172+ color: var(--text-2);
173+ white-space: nowrap;
174+ }
175+
176+ .commits-age {
177+ flex: none;
178+ width: 92px;
179+ font-size: 13px;
180+ color: var(--muted);
181+ white-space: nowrap;
182+ }
183+
184+ .commits-sha {
185+ flex: none;
186+ font-family: var(--mono);
187+ font-size: 12px;
188+ color: var(--text-2);
189+ text-decoration: none;
190+
191+ &:hover {
192+ color: var(--text);
193+ }
194+ }
195+
196+ .commits-ic {
197+ flex: none;
198+ display: flex;
199+ color: var(--muted);
200+
201+ svg {
202+ display: block;
203+ width: 16px;
204+ height: 16px;
205+ }
206+
207+ &:hover {
208+ color: var(--text);
209+ }
210+ }
211+
212+ // The message under an expandable row: 13px, indented to 136px, every line kept.
213+ .commits-x {
214+ margin: 0;
215+ padding: 2px 14px 10px 136px;
216+ font-family: var(--font);
217+ font-size: 13px;
218+ line-height: 1.5;
219+ color: var(--text-2);
220+ white-space: pre-wrap;
221+ overflow-wrap: anywhere;
222+ }
223+
224+ // The checks of an expanded row list under its message, at the same indent.
225+ .commits-d > .commit-status {
226+ margin: 0 14px 10px 136px;
227+ }
228+
229+ > .pager {
230+ flex: none;
231+ }
232+}
233+
234+@keyframes commits-beat {
235+ 50% {
236+ opacity: 0.4;
237+ }
238+}
239+
240+@media (prefers-reduced-motion: reduce) {
241+ .commits-fit .commits-dot.live {
242+ animation: none;
243+ }
244+}
245+
246+// Below 900px the page stacks and the pane is as tall as its rows.
247+@media (max-width: 899px) {
248+ .commits-fit > .commits-pane {
249+ flex: none;
250+ overflow: visible;
251+ }
252+}
253+
254+// One pane: the outer list is only the frame, and the head sits inside it on the same 14px margin.
255+.commits-fit.lang-list {
256+ background: transparent;
257+ border: 0;
258+ border-radius: 0;
259+ box-shadow: none;
260+}
261+
262+.commits-fit > .commits-head {
263+ padding: 0;
264+}
265+
266+.commits-fit > .commits-head .label {
267+ margin: 0;
268+}
269+
270+.commits-fit > .pager {
271+ border-top: 0;
272+}
style/_canvas_detail.scssadded+308 -0
@@ -0,0 +1,308 @@
1+// canvas_detail: the small fixes of the issue and pull conversation, and the label style.
2+// Tokens only; motion is not used here.
3+
4+// Mono uppercase section label (the Add a comment heading).
5+.label,
6+.issue-comment > .label {
7+ @extend %mono-label;
8+ margin: 0 0 10px;
9+ color: var(--muted);
10+}
11+
12+// Conversation: the outer pane is not a card. Each comment, the merge box and the compose box sit
13+// directly on the page as 10px panes, with the same gap between them.
14+@media (min-width: 900px) {
15+ .issue-layout > .issue-column.fit-pane {
16+ gap: 12px;
17+ padding: 0;
18+ border: 0;
19+ border-radius: 0;
20+ background: none;
21+
22+ > .issue-timeline {
23+ gap: 12px;
24+ }
25+ }
26+}
27+
28+.issue-item,
29+.review-item,
30+.merge-box,
31+.issue-comment {
32+ border-radius: 10px;
33+}
34+
35+.issue-comment {
36+ margin: 0;
37+ padding: 14px;
38+ border: 1px solid var(--border);
39+ background: var(--surface);
40+ box-shadow: none;
41+}
42+
43+// Event rows sit under the comment avatars: the avatar starts 15px in (border plus 14px head pad).
44+.issue-timeline > .issue-event {
45+ padding: 0 15px;
46+}
47+
48+// Right sidebar: one pane, hairline-separated sections, scrolling inside itself. The notifications
49+// section is a plain section, not a card nested in the pane.
50+@media (min-width: 900px) {
51+ .issue-layout > .issue-sidebar.fit-pane {
52+ padding: 0 14px;
53+ overflow-y: auto;
54+
55+ > .issue-side-section,
56+ > .notif-box {
57+ margin: 0;
58+ padding: 14px 0;
59+ }
60+
61+ > .notif-box {
62+ border: 0;
63+ border-radius: 0;
64+ background: none;
65+ box-shadow: none;
66+ }
67+ }
68+}
69+
70+// The list toolbar's selects match its 32px search field.
71+.issue-search select {
72+ height: 32px;
73+ min-height: 0;
74+ padding-block: 0;
75+}
76+
77+// The commit page: the facts sit on one line's top, and the disclosure has air above the file count.
78+.commit-facts {
79+ align-items: flex-start;
80+}
81+
82+// Labels: one line each, columns line up down the pane. Edit opens under its row and holds Delete,
83+// so a pane of labels is not a pane of red buttons.
84+.label-list .label-row {
85+ position: relative;
86+ display: grid;
87+ grid-template-columns: 220px minmax(0, 1fr) 80px 56px;
88+ grid-template-rows: 36px auto;
89+ column-gap: 16px;
90+ align-items: center;
91+ padding: 0;
92+
93+ > .label-chip {
94+ justify-self: start;
95+ max-width: 100%;
96+ overflow: hidden;
97+ text-overflow: ellipsis;
98+ white-space: nowrap;
99+ }
100+
101+ > .label-desc {
102+ margin: 0;
103+ min-width: 0;
104+ overflow: hidden;
105+ text-overflow: ellipsis;
106+ white-space: nowrap;
107+ }
108+
109+ > .label-open {
110+ text-align: right;
111+ color: var(--text-2);
112+ white-space: nowrap;
113+ }
114+
115+ > .label-chip,
116+ > .label-desc,
117+ > .label-open {
118+ grid-row: 1;
119+ position: relative;
120+ z-index: 1;
121+ }
122+
123+ > .label-chip {
124+ grid-column: 1;
125+ }
126+
127+ > .label-desc {
128+ grid-column: 2;
129+ }
130+
131+ > .label-open {
132+ grid-column: 3;
133+ }
134+
135+ > .label-edit {
136+ grid-column: 1 / -1;
137+ grid-row: 1 / span 2;
138+ align-self: start;
139+ min-width: 0;
140+
141+ > summary {
142+ width: fit-content;
143+ margin-left: auto;
144+ line-height: 36px;
145+ font-size: 13px;
146+ color: var(--text-2);
147+ cursor: pointer;
148+ list-style: none;
149+ position: relative;
150+ z-index: 1;
151+
152+ &::-webkit-details-marker {
153+ display: none;
154+ }
155+
156+ &:hover {
157+ color: var(--text);
158+ }
159+ }
160+
161+ &[open] > summary {
162+ color: var(--text);
163+ }
164+ }
165+}
166+
167+.label-edit-body {
168+ display: flex;
169+ align-items: flex-end;
170+ gap: 12px;
171+ padding: 4px 0 14px;
172+
173+ .remove-form {
174+ margin: 0 0 0 auto;
175+ }
176+}
177+
178+.label-edit-form {
179+ display: flex;
180+ flex: 1 1 auto;
181+ align-items: flex-end;
182+ gap: 12px;
183+ min-width: 0;
184+
185+ > label {
186+ display: flex;
187+ flex-direction: column;
188+ gap: 4px;
189+ margin: 0;
190+ font-size: 13px;
191+ }
192+
193+ > label:has(> input[type="text"]) {
194+ flex: 1 1 0;
195+ min-width: 0;
196+ }
197+
198+ > label:has(> input[type="color"]) {
199+ flex-direction: column;
200+ align-items: flex-start;
201+ gap: 4px;
202+ }
203+
204+ input[type="color"] {
205+ width: 36px;
206+ height: var(--control-h);
207+ }
208+
209+ > button {
210+ align-self: flex-end;
211+ }
212+}
213+
214+// New label: the colour's label sits at the left, like every other field.
215+.stack > label:has(> input[type="color"]) {
216+ flex-direction: row;
217+ justify-content: flex-start;
218+ text-align: left;
219+}
220+
221+// A chip whose colour is close to the page (white on light, black on dark) keeps a visible edge.
222+.label-chip {
223+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text) 14%, transparent);
224+}
225+
226+// Server settings use the pane's width, in columns wide enough for a label and its two badges on
227+// one line.
228+.srv-page form.srv-form {
229+ max-width: none;
230+ padding-bottom: 20px;
231+}
232+
233+@media (min-width: 900px) {
234+ .srv-page form.srv-form .srv-grid {
235+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
236+ max-width: none;
237+ }
238+}
239+
240+// File pages: the path row has no rules of its own, the tab row's rule is the only one above it.
241+.browse-bar {
242+ border-top: 0;
243+ border-bottom: 0;
244+}
245+
246+// CI list: the log fills its pane to the bottom edge.
247+.ci-tl-panel-log > .ci-log {
248+ flex: 1 1 auto;
249+ height: 100%;
250+ max-height: none;
251+ min-height: 0;
252+}
253+
254+// Commit page: Show checks stays on the facts line and its list opens as a menu.
255+.commit-facts > .checks-summary {
256+ position: relative;
257+ flex-wrap: nowrap;
258+
259+ > .checks-details {
260+ flex-basis: auto;
261+
262+ > .status-list {
263+ position: absolute;
264+ top: 100%;
265+ left: 0;
266+ z-index: 20;
267+ min-width: 320px;
268+ margin-top: 6px;
269+ padding: 8px 12px;
270+ background: var(--surface-2);
271+ border: 1px solid var(--border-strong);
272+ border-radius: var(--radius-md);
273+ }
274+ }
275+}
276+
277+// New repository: the page head runs the full width like every page, the fields stay form wide, and
278+// the head's controls share one height.
279+.newrepo-form {
280+ max-width: none;
281+}
282+
283+.newrepo-form > :not(.page-head) {
284+ max-width: 720px;
285+}
286+
287+.newrepo-head-actions {
288+ --control-h: 32px;
289+}
290+
291+// A side pane matches the pane beside it.
292+@media (min-width: 900px) {
293+ .fit-split > .fit-side {
294+ align-self: stretch;
295+ }
296+}
297+
298+// Blame: a commit takes two lines; going further back is a small mark on the first.
299+.blame-table .blame-top > .blame-prior {
300+ flex: none;
301+ margin: 0 0 0 auto;
302+ text-decoration: none;
303+ color: var(--text-2);
304+
305+ &:hover {
306+ color: var(--accent);
307+ }
308+}
style/_canvas_lists.scssadded+523 -0
@@ -0,0 +1,523 @@
1+// canvas_lists: matches the approved canvases, see memory design/ALIVE.md.
2+// Every list row is one line: 36px high, a hairline under it, 14px side padding, the metadata in
3+// right aligned columns and no second line. Titles clip; nothing wraps.
4+
5+// Toolbar: one 44px row at the top of the pane.
6+.issue-pane > .issue-toolbar {
7+ height: 44px;
8+ margin: 0;
9+ padding: 0 14px;
10+ flex-wrap: nowrap;
11+ gap: 10px;
12+ box-sizing: border-box;
13+ border-bottom: 1px solid var(--border);
14+}
15+
16+.issue-pane > .issue-list {
17+ border: 0;
18+ border-radius: 0;
19+}
20+
21+// Issue and pull rows: state dot, title, labels, then #n, author, age, milestone and tasks on the
22+// right, then assignee avatars and the comment count at the far end.
23+.issue-pane .issue-list > .issue-row {
24+ display: flex;
25+ align-items: center;
26+ gap: 12px;
27+ height: 36px;
28+ min-width: 0;
29+ padding: 0 14px;
30+ overflow: hidden;
31+ border-top: 0;
32+ border-bottom: 1px solid var(--border);
33+ background: var(--surface);
34+
35+ &:hover {
36+ background: var(--surface-2);
37+ }
38+
39+ > .issue-state {
40+ flex: none;
41+ width: 8px;
42+ height: 8px;
43+ margin: 0;
44+ border-width: 0;
45+ border-radius: 50%;
46+ background: var(--muted);
47+ }
48+
49+ > .issue-state-open {
50+ background: var(--ok);
51+ }
52+
53+ > .issue-main {
54+ display: flex;
55+ flex: 1 1 auto;
56+ align-items: center;
57+ gap: 12px;
58+ min-width: 0;
59+ overflow: hidden;
60+ }
61+
62+ .issue-title-line {
63+ display: flex;
64+ flex: 0 1 auto;
65+ flex-wrap: nowrap;
66+ align-items: center;
67+ gap: 8px;
68+ min-width: 0;
69+ overflow: hidden;
70+ }
71+
72+ .issue-title {
73+ min-width: 0;
74+ overflow: hidden;
75+ font-size: 14px;
76+ font-weight: 500;
77+ text-overflow: ellipsis;
78+ white-space: nowrap;
79+ }
80+
81+ .issue-title-line > :not(.issue-title) {
82+ flex: none;
83+ white-space: nowrap;
84+ }
85+
86+ > .issue-main > .issue-meta {
87+ display: flex;
88+ flex: none;
89+ flex-wrap: nowrap;
90+ align-items: center;
91+ gap: 12px;
92+ margin: 0 0 0 auto;
93+ font-size: 13px;
94+ white-space: nowrap;
95+ }
96+
97+ > .issue-aside {
98+ flex: none;
99+ gap: 8px;
100+ }
101+}
102+
103+// Panes: the list sits in one pane with a 1px border, 10px radius and no shadow.
104+.lang-list,
105+.list-pane,
106+.explore {
107+ box-shadow: none;
108+ border: 1px solid var(--border);
109+ border-radius: 10px;
110+ background: var(--surface);
111+ overflow: hidden;
112+}
113+
114+// Toolbars: one 44px row at the top of the pane (branches, tags and releases).
115+.lang-list > .list-bar {
116+ height: 44px;
117+ min-height: 0;
118+ flex-wrap: nowrap;
119+ gap: 10px;
120+ padding: 0 14px;
121+ box-sizing: border-box;
122+ overflow: hidden;
123+}
124+
125+// Explore: the search and the sort bar share one 44px toolbar.
126+.explore > .explore-toolbar {
127+ display: flex;
128+ align-items: center;
129+ gap: 10px;
130+ height: 44px;
131+ padding: 0 14px;
132+ box-sizing: border-box;
133+ border-bottom: 1px solid var(--border);
134+ min-width: 0;
135+
136+ > .explore-search {
137+ flex: 0 1 20rem;
138+ min-width: 0;
139+ margin: 0;
140+ }
141+
142+ > .repo-subbar {
143+ flex: 1 1 auto;
144+ min-width: 0;
145+ margin: 0;
146+ flex-wrap: nowrap;
147+ overflow: hidden;
148+ }
149+}
150+
151+// Table rows (branches and tags): 36px, one line, a hairline under each row.
152+.refs-table {
153+ tbody > tr {
154+ height: 36px;
155+ }
156+
157+ th,
158+ td {
159+ height: 36px;
160+ padding: 0 14px;
161+ vertical-align: middle;
162+ white-space: nowrap;
163+ border-bottom: 1px solid var(--border);
164+ }
165+
166+ // Cells shrink to the table width so the commit subject clips instead of widening the row.
167+ td.tree-commit {
168+ width: 100%;
169+ max-width: 0;
170+ overflow: hidden;
171+ }
172+
173+ .tree-commit .commit-line {
174+ display: block;
175+ overflow: hidden;
176+ text-overflow: ellipsis;
177+ white-space: nowrap;
178+ }
179+
180+ .tree-name {
181+ font-family: var(--mono);
182+ font-size: 13px;
183+ }
184+
185+ .tree-label {
186+ display: inline-flex;
187+ align-items: center;
188+ gap: 8px;
189+ max-width: 100%;
190+ overflow: hidden;
191+ }
192+
193+ .tree-label > a {
194+ overflow: hidden;
195+ text-overflow: ellipsis;
196+ }
197+}
198+
199+// Releases: one row per release, the tag in mono, the title clipped, age and author, the asset
200+// list in a popover and Edit at the end.
201+.lang-list .release-card {
202+ display: flex;
203+ flex-wrap: nowrap;
204+ align-items: center;
205+ gap: 12px;
206+ height: 36px;
207+ min-width: 0;
208+ margin: 0;
209+ padding: 0 14px;
210+ overflow: hidden;
211+ border-bottom: 1px solid var(--border);
212+
213+ &:hover {
214+ background: var(--surface-2);
215+ }
216+
217+ > h3 {
218+ flex: 0 1 auto;
219+ min-width: 0;
220+ margin: 0;
221+ overflow: hidden;
222+ font-size: 14px;
223+ font-weight: 500;
224+ white-space: nowrap;
225+ text-overflow: ellipsis;
226+ }
227+
228+ > .release-tag {
229+ flex: none;
230+ font-family: var(--mono);
231+ font-size: 12px;
232+ color: var(--text-2);
233+ }
234+
235+ > .release-meta {
236+ flex: none;
237+ margin-left: auto;
238+ white-space: nowrap;
239+ }
240+
241+ > .release-edit {
242+ flex: none;
243+ }
244+
245+ > .release-assets-pop {
246+ position: relative;
247+ flex: none;
248+
249+ > summary {
250+ cursor: pointer;
251+ white-space: nowrap;
252+ }
253+
254+ &[open] > .release-asset-list {
255+ position: absolute;
256+ right: 0;
257+ top: 100%;
258+ z-index: 5;
259+ min-width: 18rem;
260+ margin: 4px 0 0;
261+ padding: 8px 12px;
262+ list-style: none;
263+ background: var(--surface);
264+ border: 1px solid var(--border);
265+ border-radius: 8px;
266+ }
267+ }
268+}
269+
270+// Repo rows (Explore and the profile tabs): mono name, visibility, the description clipped in
271+// --text-2, then stars and the update age on the right.
272+.repo-list > .repo-item {
273+ display: flex;
274+ flex-wrap: nowrap;
275+ align-items: center;
276+ gap: 12px;
277+ height: 36px;
278+ min-width: 0;
279+ padding: 0 14px;
280+ overflow: hidden;
281+ border-bottom: 1px solid var(--border);
282+
283+ > .repo-name {
284+ flex: 0 1 auto;
285+ max-width: 40%;
286+ min-width: 0;
287+ overflow: hidden;
288+ font-family: var(--mono);
289+ font-size: 13px;
290+ font-weight: 500;
291+ text-overflow: ellipsis;
292+ white-space: nowrap;
293+ }
294+
295+ > .badge {
296+ flex: none;
297+ }
298+
299+ > .repo-desc {
300+ flex: 1 1 auto;
301+ min-width: 0;
302+ overflow: hidden;
303+ color: var(--text-2);
304+ font-size: 13px;
305+ text-overflow: ellipsis;
306+ white-space: nowrap;
307+ }
308+
309+ > .repo-stats {
310+ flex: none;
311+ margin-left: auto;
312+ white-space: nowrap;
313+ }
314+}
315+
316+// Notification, Needs you and review request rows: reason as a small mono tag, the title, the
317+// repo or detail, the age and the row's own actions.
318+.notif-group .notif-list > li,
319+.needs-section .notif-list > li.notif-row,
320+.review-request-list > li {
321+ display: flex;
322+ flex-wrap: nowrap;
323+ align-items: center;
324+ gap: 12px;
325+ height: 36px;
326+ min-width: 0;
327+ padding: 0 14px;
328+ overflow: hidden;
329+ border-bottom: 1px solid var(--border);
330+
331+ > .notif-title {
332+ flex: 0 1 auto;
333+ min-width: 0;
334+ overflow: hidden;
335+ font-size: 14px;
336+ text-overflow: ellipsis;
337+ white-space: nowrap;
338+ overflow-wrap: normal;
339+ }
340+
341+ > .badge {
342+ flex: none;
343+ font-family: var(--mono);
344+ font-size: 11px;
345+ }
346+
347+ > .muted,
348+ > time,
349+ > .notif-inline-form {
350+ flex: none;
351+ white-space: nowrap;
352+ }
353+
354+ > .notif-inline-form {
355+ display: inline-flex;
356+ }
357+}
358+
359+.notif-group .notif-list > li > .notif-title {
360+ flex: 1 1 auto;
361+}
362+
363+.notif-group-head {
364+ display: flex;
365+ align-items: center;
366+ gap: 12px;
367+ height: 36px;
368+ padding: 0 14px;
369+ border-bottom: 1px solid var(--border);
370+}
371+
372+// Issue rows: the assignee sits in a fixed 24px slot at the right, so the columns line up whether
373+// or not a row has an assignee.
374+.issue-pane .issue-list > .issue-row > .issue-aside {
375+ display: flex;
376+ align-items: center;
377+ justify-content: flex-start;
378+ min-width: 30px;
379+ height: 24px;
380+
381+ > .avatar {
382+ flex: none;
383+ width: 24px;
384+ height: 24px;
385+ }
386+}
387+
388+// The #n is a right aligned column of fixed width, so the numbers line up down the list.
389+.issue-pane .issue-list > .issue-row > .issue-main > .issue-meta > span:first-child {
390+ flex: none;
391+ width: 5ch;
392+ text-align: right;
393+ font-variant-numeric: tabular-nums;
394+}
395+
396+// Toolbar controls share one 32px height, centred in the 44px toolbar.
397+.issue-pane > .issue-toolbar {
398+ align-items: center;
399+
400+ > input,
401+ > select,
402+ > button,
403+ > .button,
404+ > details > summary {
405+ height: 32px;
406+ box-sizing: border-box;
407+ }
408+
409+ > details > summary {
410+ display: inline-flex;
411+ align-items: center;
412+ }
413+}
414+
415+// Milestones: the Open and Closed filter sits at the right of the pane's toolbar, apart from the
416+// Issues, Labels and Milestones tabs.
417+.lang-list > .list-bar > .subnav + .subnav {
418+ margin-left: auto;
419+}
420+
421+// Releases: the New release button is centred in the 44px band.
422+.lang-list > .release-list-head {
423+ height: 44px;
424+ align-items: center;
425+
426+ > .button {
427+ height: 32px;
428+ display: inline-flex;
429+ align-items: center;
430+ align-self: center;
431+ }
432+}
433+
434+// Lists share a 14px inset. Empty states sit on that inset, not inside a second one.
435+.lang-list > .list-scroll,
436+.lang-list > .fit-scroll {
437+ padding: 0 14px;
438+}
439+
440+.lang-list > .empty-state {
441+ padding: 16px 14px;
442+}
443+
444+.lang-list > .list-scroll > .empty-state,
445+.lang-list > .fit-scroll > .empty-state {
446+ padding: 16px 0;
447+}
448+
449+// Table rows (tags and branches) start and end on the 14px inset.
450+.lang-list .refs-table th:first-child,
451+.lang-list .refs-table td:first-child,
452+.lang-list .branch-table th:first-child,
453+.lang-list .branch-table td:first-child {
454+ padding-left: 0;
455+}
456+
457+.lang-list .refs-table th:last-child,
458+.lang-list .refs-table td:last-child,
459+.lang-list .branch-table th:last-child,
460+.lang-list .branch-table td:last-child {
461+ padding-right: 0;
462+}
463+
464+// Labels: the colour is a 32px swatch with its label to the left and a border, like the inputs.
465+label:has(> input[type="color"]) {
466+ display: flex;
467+ align-items: center;
468+ gap: 10px;
469+}
470+
471+input[type="color"] {
472+ flex: none;
473+ width: 32px;
474+ height: 32px;
475+ box-sizing: border-box;
476+ padding: 3px;
477+ border: 1px solid var(--border-strong);
478+ border-radius: var(--radius-md);
479+ background: var(--surface);
480+ cursor: pointer;
481+
482+ &::-webkit-color-swatch-wrapper {
483+ padding: 0;
484+ }
485+
486+ &::-webkit-color-swatch {
487+ border: 0;
488+ border-radius: 3px;
489+ }
490+
491+ &::-moz-color-swatch {
492+ border: 0;
493+ border-radius: 3px;
494+ }
495+}
496+
497+// Pull Commits: rows keep a 14px side padding and Browse files stays inside the pane.
498+.issue-pane > .commit-list > .commit-row {
499+ flex-wrap: nowrap;
500+ padding: 12px 14px;
501+
502+ > .commit-actions {
503+ flex: none;
504+ }
505+}
506+
507+// Pull Files: long diff lines scroll inside their file's body; the file header stays put.
508+.pull-diff-scroll {
509+ min-width: 0;
510+ overflow-x: hidden;
511+
512+ .diff-section,
513+ .diff-file {
514+ min-width: 0;
515+ max-width: 100%;
516+ }
517+
518+ .diff-file-body {
519+ min-width: 0;
520+ max-width: 100%;
521+ overflow-x: auto;
522+ }
523+}
style/_canvas_pull.scssadded+402 -0
@@ -0,0 +1,402 @@
1+// canvas_pull: the pull request head and its Files view, matched to the One Lit Thing canvas
2+// (Pull.dc.html). Imported after _pull.scss and _review_flow.scss, so it wins by order. Sizes are
3+// the canvas's own: a 24px title, 36px rows and panes, a 260px file column, and a diff pane that
4+// scrolls inside itself. The page never scrolls: .pull-page takes the rest of the window.
5+
6+// Head: the title with the review buttons on one row, the state and branches on the next.
7+.pull-head {
8+ display: flex;
9+ flex-direction: column;
10+ gap: 6px;
11+ flex: none;
12+ margin: 0;
13+}
14+
15+.pull-line1 {
16+ display: flex;
17+ align-items: center;
18+ justify-content: space-between;
19+ gap: 12px;
20+ min-height: 32px;
21+
22+ .issue-heading {
23+ min-width: 0;
24+ margin: 0;
25+ overflow: hidden;
26+ text-overflow: ellipsis;
27+ white-space: nowrap;
28+ font-family: var(--display);
29+ font-size: 24px;
30+ font-weight: 700;
31+ line-height: 1.2;
32+ letter-spacing: -0.005em;
33+ }
34+}
35+
36+.pull-actions {
37+ display: flex;
38+ align-items: center;
39+ gap: 8px;
40+ flex: none;
41+
42+ .btn {
43+ height: 32px;
44+ padding: 0 12px;
45+ border-radius: 7px;
46+ font-size: 13px;
47+ font-weight: 600;
48+ background: var(--surface-2);
49+ box-shadow: inset 0 0 0 1px var(--border);
50+ cursor: pointer;
51+ }
52+
53+ .btn.main {
54+ background: var(--accent);
55+ color: var(--accent-ink);
56+ box-shadow: none;
57+ }
58+}
59+
60+.pull-line2 {
61+ display: flex;
62+ align-items: center;
63+ gap: 8px;
64+ margin: 0;
65+ min-width: 0;
66+ font-size: 13px;
67+ white-space: nowrap;
68+
69+ code {
70+ font-family: var(--mono);
71+ font-size: 12px;
72+ }
73+}
74+
75+.pull-totals {
76+ margin-left: auto;
77+ font-family: var(--mono);
78+ font-size: 12px;
79+ color: var(--muted);
80+}
81+
82+// The page: the two columns fill what the window leaves under the head.
83+@media (min-width: 900px) {
84+ .fit-pane.pull-page {
85+ display: flex;
86+ flex-direction: column;
87+ height: max(420px, calc(100dvh - var(--pull-top, 262px)));
88+ padding: 0;
89+ overflow: hidden;
90+ }
91+
92+ .pull-cols {
93+ flex: 1 1 auto;
94+ min-height: 0;
95+ display: grid;
96+ grid-template-columns: 260px minmax(0, 1fr);
97+ gap: 16px;
98+ }
99+
100+ // The profile corner floats over the left of the page's foot: the panes stop above it.
101+ .pull-left {
102+ display: flex;
103+ flex-direction: column;
104+ gap: 12px;
105+ min-height: 0;
106+ margin-bottom: 64px;
107+ }
108+
109+ // Panes: 36px heads with a hairline, 36px rows with a hairline, 10px corners, no shadow.
110+ .pull-left > .pane,
111+ .pull-diff {
112+ border-radius: 10px;
113+ background: var(--surface);
114+ box-shadow: inset 0 0 0 1px var(--border);
115+ }
116+
117+ .pull-cap {
118+ display: flex;
119+ align-items: center;
120+ gap: 8px;
121+ flex: none;
122+ height: 36px;
123+ padding: 0 14px;
124+ box-shadow: inset 0 -1px var(--border);
125+ }
126+
127+ .pull-count {
128+ margin-left: auto;
129+ font-family: var(--mono);
130+ font-size: 12px;
131+ color: var(--muted);
132+ white-space: nowrap;
133+ }
134+
135+ .pull-files {
136+ flex: 1 1 auto;
137+ min-height: 0;
138+ display: flex;
139+ flex-direction: column;
140+ overflow: hidden;
141+ }
142+
143+ .pull-file-list {
144+ flex: 1 1 auto;
145+ min-height: 0;
146+ margin: 0;
147+ padding: 0;
148+ list-style: none;
149+ overflow: auto;
150+ }
151+
152+ .pull-file {
153+ display: flex;
154+ align-items: center;
155+ gap: 8px;
156+ height: 36px;
157+ padding: 0 14px;
158+ box-shadow: inset 0 -1px var(--border);
159+ font-size: 13px;
160+ }
161+
162+ .pull-file.current {
163+ background: var(--surface-2);
164+ }
165+
166+ .pull-file-link {
167+ flex: 1 1 auto;
168+ min-width: 0;
169+ height: 100%;
170+ display: flex;
171+ align-items: center;
172+ gap: 8px;
173+ color: inherit;
174+ text-decoration: none;
175+
176+ .clip {
177+ flex: 1 1 auto;
178+ min-width: 0;
179+ }
180+ }
181+
182+ .pull-file-ico {
183+ flex: none;
184+ color: var(--muted);
185+ }
186+
187+ .pull-counts {
188+ flex: none;
189+ font-family: var(--mono);
190+ font-size: 12px;
191+ white-space: nowrap;
192+ }
193+
194+ .pull-file input[type="checkbox"] {
195+ flex: none;
196+ width: 14px;
197+ height: 14px;
198+ margin: 0;
199+ }
200+
201+ .pull-file .viewed-note {
202+ flex: none;
203+ font-family: var(--mono);
204+ font-size: 11px;
205+ color: var(--muted);
206+ }
207+
208+ .pull-checks {
209+ flex: 0 1 auto;
210+ max-height: 40%;
211+ min-height: 0;
212+ overflow: auto;
213+ }
214+
215+ .pull-check {
216+ display: flex;
217+ align-items: center;
218+ gap: 10px;
219+ height: 36px;
220+ padding: 0 14px;
221+ box-shadow: inset 0 -1px var(--border);
222+ font-size: 13px;
223+
224+ .clip {
225+ flex: 1 1 auto;
226+ min-width: 0;
227+ }
228+ }
229+
230+ .pull-check .pull-time {
231+ flex: none;
232+ font-family: var(--mono);
233+ font-size: 12px;
234+ color: var(--muted);
235+ white-space: nowrap;
236+ }
237+
238+ .pull-check > span:first-child {
239+ flex: none;
240+ width: 8px;
241+ height: 8px;
242+ border-radius: 50%;
243+ background: var(--muted);
244+ }
245+
246+ .pull-check > .ok {
247+ background: var(--ok);
248+ }
249+
250+ .pull-check > .bad {
251+ background: var(--bad);
252+ }
253+
254+ .pull-check > .live {
255+ background: var(--accent);
256+ animation: pull-beat 1.6s ease-in-out infinite;
257+ }
258+
259+ // The diff pane: a 36px top row, then one scroller holding every file, then the compose line.
260+ .pull-diff {
261+ min-height: 0;
262+ display: flex;
263+ flex-direction: column;
264+ overflow: hidden;
265+ }
266+
267+ .pull-diff-top {
268+ flex: none;
269+ display: flex;
270+ align-items: center;
271+ gap: 10px;
272+ height: 36px;
273+ padding: 0 14px;
274+ box-shadow: inset 0 -1px var(--border);
275+ }
276+
277+ .pull-diff-scroll {
278+ flex: 1 1 auto;
279+ min-height: 0;
280+ overflow: auto;
281+ }
282+
283+ // The section's own heading and file index repeat the head and the Files pane, so they are left out.
284+ .pull-diff-scroll > .diff-section > h2,
285+ .pull-diff-scroll > .diff-section > .diff-index {
286+ display: none;
287+ }
288+
289+ .pull-diff-scroll .diff-section {
290+ margin: 0;
291+ }
292+
293+ .pull-diff-scroll .diff-file {
294+ margin: 0;
295+ border-radius: 0;
296+ background: transparent;
297+ }
298+
299+ // The file header sticks to the top of the pane, over the pane's own scroll, never over code.
300+ .pull-diff-scroll .diff-file-header {
301+ top: 0;
302+ border-radius: 0;
303+ }
304+
305+ // Inline notes sit in an inset surface under their line.
306+ .pull-diff-scroll .review-thread {
307+ margin: 6px 12px 6px 96px;
308+ padding: 12px;
309+ border-radius: 8px;
310+ background: var(--surface-2);
311+ }
312+
313+ // The compose line: one input and Comment, pinned at the pane's foot. Focus opens the rest.
314+ .pull-compose {
315+ flex: none;
316+ display: flex;
317+ flex-direction: column;
318+ gap: 8px;
319+ margin: 0;
320+ padding: 10px 14px;
321+ border-radius: 0;
322+ box-shadow: inset 0 1px var(--border);
323+ background: var(--surface);
324+ }
325+
326+ .pull-more {
327+ display: none;
328+ align-items: center;
329+ gap: 12px;
330+ font-size: 13px;
331+
332+ h2 {
333+ margin: 0;
334+ font-size: 13px;
335+ font-weight: 600;
336+ }
337+
338+ p {
339+ margin: 0;
340+ }
341+
342+ .review-inline {
343+ margin-left: auto;
344+ }
345+ }
346+
347+ .pull-compose:focus-within .pull-more {
348+ display: flex;
349+ }
350+
351+ .pull-compose-form {
352+ display: flex;
353+ align-items: center;
354+ gap: 8px;
355+ margin: 0;
356+ }
357+
358+ .pull-compose .pull-input {
359+ flex: 1 1 auto;
360+ min-width: 0;
361+ height: 36px;
362+ padding: 0 12px;
363+ border: 0;
364+ border-radius: 7px;
365+ background: var(--bg);
366+ color: var(--text);
367+ box-shadow: inset 0 0 0 1px var(--border);
368+ font: inherit;
369+ font-size: 13px;
370+ outline: none;
371+ }
372+
373+ .pull-compose .btn {
374+ flex: none;
375+ height: 36px;
376+ padding: 0 14px;
377+ border-radius: 7px;
378+ font-size: 13px;
379+ font-weight: 600;
380+ background: var(--surface-2);
381+ box-shadow: inset 0 0 0 1px var(--border);
382+ cursor: pointer;
383+ }
384+
385+ .pull-compose .btn.primary {
386+ background: var(--accent);
387+ color: var(--accent-text);
388+ box-shadow: none;
389+ }
390+}
391+
392+@keyframes pull-beat {
393+ 50% {
394+ opacity: 0.4;
395+ }
396+}
397+
398+@media (min-width: 900px) and (prefers-reduced-motion: reduce) {
399+ .pull-check > .live {
400+ animation: none;
401+ }
402+}
style/_canvas_repo.scssadded+661 -0
@@ -0,0 +1,661 @@
1+// canvas_repo: the repo home and the tree pages, matched to the approved layout study
2+// (TimelineRepo.dc.html, see memory design/ALIVE.md). Two panes over one dock: the tree (340px) and
3+// the README (the rest), then the dock (156px). Tokens only. Selectors carry .repo-home.canvas-repo so
4+// they outrank the older repo home rules in _repo.scss, which are not repeated here.
5+
6+// Desktop: the panes fill the window above the dock. nav.js measures the top of .repo-home and the
7+// footer (--pane-top, --pane-foot); the dock and its 12px gap come off the height.
8+@media (min-width: 900px) {
9+ .repo-home.canvas-repo {
10+ --repo-home-h: max(360px, calc(100dvh - var(--pane-top, 288px) - var(--pane-foot, 78px) - 168px));
11+ grid-template-columns: var(--tree-w, 340px) 12px minmax(0, 1fr);
12+ grid-template-rows: minmax(0, 1fr);
13+ gap: 0;
14+ height: var(--repo-home-h);
15+ margin-top: 12px;
16+
17+ .repo-main,
18+ .repo-readme {
19+ height: auto;
20+ min-height: 0;
21+ }
22+ }
23+}
24+
25+// The panes: surface, a 1px border, 10px radius, no shadow. Popovers drop out of the head, so the
26+// panes do not clip; the scrolling parts are the tree rows and the README body.
27+.repo-home.canvas-repo {
28+ .canvas-files,
29+ .canvas-readme {
30+ display: flex;
31+ flex-direction: column;
32+ min-width: 0;
33+ min-height: 0;
34+ overflow: visible;
35+ background: var(--surface);
36+ border: 1px solid var(--border);
37+ border-radius: 10px;
38+ }
39+
40+ // Head row: 36px, one hairline under it, 14px side padding. Also the toolbar of the tree pane.
41+ .canvas-head {
42+ display: flex;
43+ align-items: center;
44+ gap: 12px;
45+ flex: none;
46+ height: 36px;
47+ min-width: 0;
48+ margin: 0;
49+ padding: 0 14px;
50+ border: 0;
51+ border-bottom: 1px solid var(--border);
52+ font-size: 13px;
53+ color: var(--text-2);
54+ }
55+
56+ // Tree pane: the branch selector and the go-to-file tag share the head; the rows scroll below.
57+ .canvas-files {
58+ .canvas-head {
59+ padding-right: 10px;
60+ }
61+
62+ .ref-select {
63+ position: relative;
64+ flex: none;
65+ z-index: 6;
66+ }
67+
68+ // The branch is a mono label, not a pill or a button.
69+ .ref-select > summary {
70+ display: inline-flex;
71+ align-items: center;
72+ gap: 6px;
73+ height: 36px;
74+ padding: 0;
75+ background: none;
76+ border: 0;
77+ box-shadow: none;
78+ font-family: var(--mono);
79+ font-size: 11px;
80+ font-weight: 500;
81+ letter-spacing: 0.12em;
82+ text-transform: uppercase;
83+ color: var(--muted);
84+ cursor: pointer;
85+ list-style: none;
86+ }
87+
88+ .ref-select > summary::-webkit-details-marker {
89+ display: none;
90+ }
91+
92+ .ref-select .ref-icon {
93+ display: none;
94+ }
95+
96+ .ref-select .ref-name {
97+ padding: 0;
98+ background: none;
99+ border: 0;
100+ font: inherit;
101+ letter-spacing: inherit;
102+ text-transform: inherit;
103+ color: inherit;
104+ }
105+
106+ .ref-select .ref-caret svg {
107+ width: 10px;
108+ height: 10px;
109+ }
110+
111+ .crumbs {
112+ flex: 1 1 auto;
113+ min-width: 0;
114+ overflow: hidden;
115+ font-family: var(--mono);
116+ font-size: 12px;
117+ }
118+
119+ .crumbs ol {
120+ display: flex;
121+ margin: 0;
122+ padding: 0;
123+ list-style: none;
124+ overflow: hidden;
125+ white-space: nowrap;
126+ }
127+
128+ // The go-to-file control is the small `t` tag at the right end; the words are for screen readers.
129+ .finder-open {
130+ position: relative;
131+ align-self: center;
132+ display: inline-flex;
133+ align-items: center;
134+ flex: none;
135+ height: 20px;
136+ margin: 0 0 0 auto;
137+ padding: 0 7px;
138+ border: 0;
139+ border-radius: 5px;
140+ background: var(--surface-2);
141+ box-shadow: none;
142+ font-family: var(--mono);
143+ font-size: 11px;
144+ color: var(--text-2);
145+ }
146+
147+ .finder-open .finder-label {
148+ position: absolute;
149+ width: 1px;
150+ height: 1px;
151+ overflow: hidden;
152+ clip-path: inset(50%);
153+ white-space: nowrap;
154+ }
155+
156+ .finder-open kbd {
157+ padding: 0;
158+ border: 0;
159+ background: none;
160+ font: inherit;
161+ color: inherit;
162+ }
163+
164+ // Rows: 30px, one line. The whole row is the target (the name link stretches over it).
165+ .table-wrap.tree-list {
166+ flex: 1 1 auto;
167+ min-height: 0;
168+ overflow-y: auto;
169+ padding: 4px 0;
170+ border: 0;
171+ border-radius: 0;
172+ background: none;
173+ box-shadow: none;
174+ }
175+
176+ .tree-entry {
177+ position: relative;
178+ display: flex;
179+ align-items: center;
180+ gap: 10px;
181+ height: 30px;
182+ min-width: 0;
183+ padding: 0 14px;
184+ }
185+
186+ .tree-entry:hover {
187+ background: var(--surface-2);
188+ }
189+
190+ .tree-kind {
191+ display: inline-flex;
192+ flex: none;
193+ color: var(--muted);
194+ }
195+
196+ .tree-kind .kind-icon {
197+ width: 14px;
198+ height: 14px;
199+ }
200+
201+ .tree-entry-name {
202+ flex: 1 1 auto;
203+ min-width: 0;
204+ overflow: hidden;
205+ font-family: var(--mono);
206+ font-size: 13px;
207+ white-space: nowrap;
208+ text-overflow: ellipsis;
209+ color: var(--text);
210+ text-decoration: none;
211+ }
212+
213+ a.tree-entry-name::after {
214+ content: "";
215+ position: absolute;
216+ inset: 0;
217+ }
218+
219+ .tree-entry-sha {
220+ flex: none;
221+ font-size: 12px;
222+ color: var(--muted);
223+ }
224+
225+ .tree-entry-age {
226+ flex: none;
227+ margin-left: auto;
228+ font-size: 12px;
229+ text-align: right;
230+ white-space: nowrap;
231+ color: var(--muted);
232+ }
233+ }
234+
235+ // README pane: the file name at the left, the facts and Clone at the right.
236+ .canvas-readme {
237+ .canvas-head {
238+ justify-content: space-between;
239+ }
240+
241+ .canvas-facts {
242+ display: flex;
243+ align-items: center;
244+ gap: 14px;
245+ min-width: 0;
246+ margin-left: auto;
247+ font-family: var(--mono);
248+ font-size: 12px;
249+ color: var(--muted);
250+ white-space: nowrap;
251+ }
252+
253+ .readme-meta {
254+ overflow: hidden;
255+ text-overflow: ellipsis;
256+ }
257+
258+ // Clone is a plain button, not the filled one. The popover drops over the body.
259+ .clone {
260+ position: relative;
261+ z-index: 6;
262+ }
263+
264+ .clone > summary.button {
265+ height: 28px;
266+ padding: 0 10px;
267+ border: 0;
268+ background: none;
269+ box-shadow: inset 0 0 0 1px var(--border);
270+ font-family: var(--font);
271+ font-size: 12px;
272+ font-weight: 500;
273+ color: var(--text);
274+ }
275+
276+ // The body scrolls; padding 24px; prose left aligned, 760px, 14.5px over 1.6.
277+ .canvas-body {
278+ flex: 1 1 auto;
279+ min-height: 0;
280+ padding: 24px;
281+ overflow-y: auto;
282+ text-align: left;
283+ }
284+
285+ .canvas-body .repo-strip {
286+ margin: 0 0 16px;
287+ max-width: 760px;
288+ }
289+
290+ .canvas-body .readme {
291+ max-width: 760px;
292+ margin: 0;
293+ padding: 0;
294+ background: none;
295+ border: 0;
296+ box-shadow: none;
297+ }
298+
299+ .canvas-body .markdown-body {
300+ flex: none;
301+ max-width: 760px;
302+ overflow: visible;
303+ font-size: 14.5px;
304+ line-height: 1.6;
305+ color: var(--text-2);
306+ }
307+
308+ .canvas-body .markdown-body > * {
309+ max-width: 760px;
310+ margin-left: 0;
311+ margin-right: 0;
312+ }
313+
314+ .canvas-body .markdown-body h1,
315+ .canvas-body .markdown-body h2,
316+ .canvas-body .markdown-body h3 {
317+ color: var(--text);
318+ }
319+
320+ .canvas-body .readme-text {
321+ font-family: var(--mono);
322+ font-size: 13px;
323+ white-space: pre-wrap;
324+ color: var(--text-2);
325+ }
326+
327+ .canvas-body .empty-state {
328+ text-align: left;
329+ }
330+ }
331+}
332+
333+// The dock: one pane under the panes, the full width. Its info row is 40px, its strip row 60px, with
334+// 20px between; the padding is 20px 16px 0. It has no overflow clip, so the message expander can
335+// open above it over the panes.
336+.canvas-dock {
337+ position: relative;
338+ z-index: 2;
339+ box-sizing: border-box;
340+ display: grid;
341+ grid-template-rows: 40px 60px;
342+ row-gap: 20px;
343+ height: 156px;
344+ min-width: 0;
345+ margin-top: 12px;
346+ padding: 20px 16px 0;
347+ background: var(--surface);
348+ border: 1px solid var(--border);
349+ border-radius: 10px;
350+ font-size: 13px;
351+}
352+
353+.canvas-dock .dock-info {
354+ display: flex;
355+ align-items: center;
356+ gap: 12px;
357+ height: 40px;
358+ min-width: 0;
359+
360+ > * {
361+ flex: none;
362+ white-space: nowrap;
363+ }
364+
365+ .dock-run {
366+ display: inline-flex;
367+ align-items: center;
368+ gap: 8px;
369+ font-weight: 600;
370+ color: var(--text);
371+ text-decoration: none;
372+ }
373+
374+ // The state word is accent only while the run goes.
375+ .dock-state {
376+ color: var(--text-2);
377+ }
378+
379+ .dock-state.is-live {
380+ color: var(--accent);
381+ }
382+
383+ .sha {
384+ font-family: var(--mono);
385+ font-size: 12px;
386+ color: var(--text-2);
387+ }
388+
389+ .dock-avatar {
390+ width: 20px;
391+ height: 20px;
392+ }
393+
394+ // The subject takes the rest of the row and clips, one line.
395+ .dock-subject {
396+ flex: 1 1 auto;
397+ min-width: 0;
398+ overflow: hidden;
399+ white-space: nowrap;
400+ text-overflow: ellipsis;
401+ color: var(--text);
402+ text-decoration: none;
403+ }
404+
405+ .dock-subject .commit-line {
406+ display: block;
407+ overflow: hidden;
408+ text-overflow: ellipsis;
409+ white-space: nowrap;
410+ }
411+
412+ .dock-expand {
413+ position: relative;
414+ }
415+
416+ .dock-expand > summary {
417+ display: inline-flex;
418+ align-items: center;
419+ justify-content: center;
420+ width: 24px;
421+ height: 24px;
422+ border-radius: 6px;
423+ color: var(--muted);
424+ cursor: pointer;
425+ list-style: none;
426+ }
427+
428+ .dock-expand > summary::-webkit-details-marker {
429+ display: none;
430+ }
431+
432+ .dock-expand > summary:hover,
433+ .dock-expand[open] > summary {
434+ background: var(--surface-2);
435+ color: var(--text);
436+ }
437+
438+ // The full message opens above the dock: body included, scrolling inside its own box.
439+ .dock-message {
440+ position: absolute;
441+ bottom: calc(100% + 8px);
442+ left: 0;
443+ z-index: 10;
444+ width: min(640px, 80vw);
445+ max-height: 60vh;
446+ overflow-y: auto;
447+ box-sizing: border-box;
448+ padding: 14px 16px;
449+ background: var(--surface);
450+ border: 1px solid var(--border);
451+ border-radius: 10px;
452+ white-space: normal;
453+ }
454+
455+ .dock-message-by {
456+ margin: 0;
457+ }
458+
459+ .dock-message-text {
460+ margin: 8px 0 0;
461+ font-family: var(--mono);
462+ font-size: 12.5px;
463+ line-height: 1.5;
464+ white-space: pre-wrap;
465+ color: var(--text);
466+ }
467+
468+ .dock-count {
469+ color: var(--muted);
470+ }
471+
472+ .dock-all {
473+ font-weight: 600;
474+ color: var(--text);
475+ text-decoration: none;
476+ }
477+}
478+
479+// The strip row: the label in a 254px column, then the bars of the last 48 commits, 60px tall.
480+.canvas-dock .dock-history {
481+ display: grid;
482+ grid-template-columns: 254px minmax(0, 1fr);
483+ height: 60px;
484+ min-width: 0;
485+ order: 0;
486+}
487+
488+.canvas-dock .history-strip {
489+ display: contents;
490+}
491+
492+.canvas-dock .history-label {
493+ position: static;
494+ align-self: start;
495+ width: auto;
496+ height: auto;
497+ overflow: visible;
498+ clip-path: none;
499+ margin: 0;
500+ padding-top: 2px;
501+ font-family: var(--mono);
502+ font-size: 11px;
503+ font-weight: 500;
504+ letter-spacing: 0.12em;
505+ text-transform: uppercase;
506+ color: var(--muted);
507+}
508+
509+.canvas-dock .history-bars {
510+ gap: 3px;
511+ height: 60px;
512+ min-width: 0;
513+ align-items: flex-end;
514+
515+ > a {
516+ flex: 1 1 0;
517+ min-width: 2px;
518+ border-radius: 2px;
519+ background: var(--muted);
520+ opacity: 0.55;
521+ }
522+
523+ > a.hs-bad {
524+ background: var(--bad);
525+ opacity: 1;
526+ }
527+
528+ // The newest commit is the accent, at full strength, whether or not its run goes.
529+ > a.hs-live,
530+ > a:last-child:not(.hs-bad) {
531+ background: var(--accent);
532+ opacity: 1;
533+ }
534+}
535+
536+// Narrow windows: the panes stack and the page grows; the strip, which needs the width, is left out.
537+@media (max-width: 899px) {
538+ .repo-home.canvas-repo {
539+ grid-template-columns: minmax(0, 1fr);
540+ grid-template-rows: auto;
541+ height: auto;
542+ margin-top: 12px;
543+ }
544+
545+ .repo-home.canvas-repo .canvas-files .table-wrap.tree-list {
546+ overflow: visible;
547+ }
548+
549+ .repo-home.canvas-repo .canvas-readme .canvas-body {
550+ overflow: visible;
551+ }
552+
553+ .canvas-dock {
554+ height: auto;
555+ grid-template-rows: auto;
556+ }
557+
558+ .canvas-dock .dock-info {
559+ flex-wrap: wrap;
560+ height: auto;
561+ row-gap: 8px;
562+ }
563+
564+ .canvas-dock .dock-subject {
565+ flex: 1 1 100%;
566+ order: 1;
567+ }
568+}
569+
570+@media (prefers-reduced-motion: reduce) {
571+ .canvas-dock .health-dot.ember {
572+ animation: none;
573+ }
574+}
575+
576+// Fixes from the 1440px review (2026-11-01). Each rule is named by the screen it fixes.
577+
578+// Clone popover: the SSH hint wraps inside the 420px panel instead of running past its right edge.
579+.repo-home.canvas-repo .canvas-readme .clone .pop-panel > .small {
580+ max-width: 100%;
581+ white-space: normal;
582+ overflow-wrap: anywhere;
583+}
584+
585+// Dock: the full message opens from the expander's right edge, and never wider than the window.
586+.canvas-dock .dock-info .dock-expand .dock-message {
587+ left: auto;
588+ right: 0;
589+ width: 640px;
590+ max-width: calc(100vw - 48px);
591+}
592+
593+// Dock: the expander is a 20px square with a down chevron, the same as the tab-more toggle.
594+.canvas-dock .dock-info .dock-expand > summary {
595+ width: 20px;
596+ height: 20px;
597+ border-radius: 5px;
598+}
599+
600+.canvas-dock .dock-info .dock-expand > summary svg {
601+ width: 14px;
602+ height: 14px;
603+ fill: none;
604+ stroke: currentColor;
605+ stroke-width: 2;
606+ stroke-linecap: round;
607+ stroke-linejoin: round;
608+}
609+
610+// Code tab menu: its left edge sits on the Code tab's left edge, 4px under the 36px tab row. The
611+// head is the containing block, outside the tab bar's scroll clip.
612+.page-head.repo-head-code {
613+ position: relative;
614+}
615+
616+.page-head.repo-head-code .tab-more-list {
617+ top: 40px;
618+ left: 0;
619+ margin-top: 0;
620+}
621+
622+// Tree pane with no README: the message sits on the pane head's 14px inset, not the body's 24px.
623+.repo-home.canvas-repo .canvas-readme .canvas-body:has(> .empty-state) {
624+ padding: 14px;
625+}
626+
627+.repo-home.canvas-repo .canvas-readme .canvas-body > .empty-state {
628+ padding: 0;
629+}
630+
631+// Blob page: the rendered Markdown starts 24px under the file bar.
632+.file > .markdown-body {
633+ padding-top: 24px;
634+}
635+
636+// Blame: the table is wider than the pane, so the pane scrolls both ways (the scrollbar shows at the
637+// foot of the pane) and the file bar stays at the top. Long lines are never cut at the edge.
638+.file.fit-pane:has(> .blame-table) {
639+ overflow: auto;
640+}
641+
642+.file.fit-pane:has(> .blame-table) > .file-head {
643+ position: sticky;
644+ top: 0;
645+ z-index: 2;
646+}
647+
648+.file > .file-view {
649+ overflow: auto;
650+}
651+
652+// Finder: the input's text sits on the same 10px inset as the result rows (1px border included).
653+dialog.finder .finder-input {
654+ padding-left: 9px;
655+ padding-right: 9px;
656+}
657+
658+.repo-home.canvas-repo .canvas-readme .canvas-head .label {
659+ margin: 0;
660+ align-self: center;
661+}
style/_commit_line.scssmodified+2 -15
@@ -1,5 +1,5 @@
1-// One-line commit subjects (views/commit_line.rs). The tag and the count are neutral; the text1+// One-line commit subjects (views/commit_line.rs): the text truncates with an ellipsis and the full
2-// truncates with an ellipsis and the full subject is the element's title.2+// subject is the element's title.
3 3
4 .commit-line {4 .commit-line {
5 display: flex;5 display: flex;
@@ -9,13 +9,6 @@
9 max-width: 100%;9 max-width: 100%;
10 }10 }
11 11
12-.commit-line-kind {
13- flex: none;
14- font-family: var(--mono);
15- font-size: 12px;
16- color: var(--muted);
17-}
18-
19 .commit-line-text {12 .commit-line-text {
20 min-width: 0;13 min-width: 0;
21 overflow: hidden;14 overflow: hidden;
@@ -23,12 +16,6 @@
23 white-space: nowrap;16 white-space: nowrap;
24 }17 }
25 18
26-.commit-line-extra {
27- flex: none;
28- font-size: 12px;
29- color: var(--muted);
30-}
31-
32 .ci-run-message {19 .ci-run-message {
33 margin: 4px 0 8px;20 margin: 4px 0 8px;
34 21
style/_commit_page.scssmodified+1 -14
@@ -1,19 +1,6 @@
1-// Commit page: a typed subject's groups as a compact list under the commit card. The list caps1+// Commit page: a typed subject's groups as a compact list under the commit line. The list caps
2 // its own height and scrolls, so the diff below keeps its place on one screen.2 // its own height and scrolls, so the diff below keeps its place on one screen.
3 3
4-// The commit card flows its rows (oid, checks, author, committer, parent, browse) side by side and
5-// wraps, so the header is as short as its content allows and the diff pane gets the rest.
6-.commit-info {
7- flex-direction: row;
8- flex-wrap: wrap;
9- align-items: center;
10- gap: 4px 16px;
11-
12- > .commit-full-oid {
13- margin: 0;
14- }
15-}
16-
17 .commit-groups {4 .commit-groups {
18 list-style: none;5 list-style: none;
19 margin: 8px 0 0;6 margin: 8px 0 0;
style/_continuity.scssdeleted+0 -77
@@ -1,77 +0,0 @@
1-// Continuity: every navigation is the same calm transition (nav.js sets `html.is-navigating` for it).
2-// The top bar, the profile corner and the repo head stay where they are, the active tab slides to its
3-// new place, and the page body fades in with a small rise. A link from a row also grows into the new
4-// page's title (`forge-row`). Reduced motion turns all of it off.
5-html.is-navigating {
6- .topbar {
7- view-transition-name: forge-top;
8- }
9-
10- .repo-head-code {
11- view-transition-name: forge-head;
12- }
13-
14- .repo-tabs .tab.active {
15- view-transition-name: forge-tab;
16- }
17-
18- .shell-body > main {
19- view-transition-name: forge-main;
20- }
21-}
22-
23-::view-transition-group(forge-row),
24-::view-transition-group(forge-tab) {
25- animation-duration: 220ms;
26- animation-timing-function: ease-out;
27-}
28-
29-::view-transition-old(forge-row),
30-::view-transition-new(forge-row),
31-::view-transition-old(forge-tab),
32-::view-transition-new(forge-tab) {
33- animation-duration: 220ms;
34- animation-timing-function: ease-out;
35-}
36-
37-// The chrome does not fade: the same bar is on both pages.
38-::view-transition-old(forge-top),
39-::view-transition-new(forge-top),
40-::view-transition-old(root),
41-::view-transition-new(root) {
42- animation: none;
43-}
44-
45-::view-transition-old(forge-top),
46-::view-transition-old(root) {
47- display: none;
48-}
49-
50-::view-transition-old(forge-main) {
51- animation: forge-main-out 90ms ease-in both;
52-}
53-
54-::view-transition-new(forge-main) {
55- animation: forge-main-in 200ms ease-out both;
56-}
57-
58-@keyframes forge-main-out {
59- to {
60- opacity: 0;
61- }
62-}
63-
64-@keyframes forge-main-in {
65- from {
66- opacity: 0;
67- transform: translateY(6px);
68- }
69-}
70-
71-@media (prefers-reduced-motion: reduce) {
72- ::view-transition-group(*),
73- ::view-transition-old(*),
74- ::view-transition-new(*) {
75- animation: none;
76- }
77-}
style/_fit_admin.scssmodified+8 -1
@@ -96,8 +96,15 @@
96 }96 }
97 }97 }
98 98
99-// From 1200px the settings take four across, so the card has fewer rows and less hidden height.99+// From 1200px the settings take three across, wide enough for a label and its two badges; from
100+// 1680px four.
100 @media (min-width: 1200px) {101 @media (min-width: 1200px) {
102+ .srv-form .srv-grid {
103+ grid-template-columns: repeat(3, minmax(0, 1fr));
104+ }
105+}
106+
107+@media (min-width: 1680px) {
101 .srv-form .srv-grid {108 .srv-form .srv-grid {
102 grid-template-columns: repeat(4, minmax(0, 1fr));109 grid-template-columns: repeat(4, minmax(0, 1fr));
103 }110 }
style/_fit_settings.scssmodified+0 -17
@@ -21,23 +21,6 @@
21 }21 }
22 }22 }
23 23
24-// A column of the general settings: its cards stack with the same gap as the row.
25-.settings-col {
26- display: flex;
27- flex-direction: column;
28- gap: 16px;
29- min-width: 0;
30-
31- > .card {
32- margin-bottom: 0;
33- }
34-}
35-
36-// The branch rule form is narrower in a column, so its pushes and merging switches stack.
37-.settings-col .rule-pair {
38- grid-template-columns: minmax(0, 1fr);
39-}
40-
41 // The new webhook form: the fields in the left column, the event list in the right one.24 // The new webhook form: the fields in the left column, the event list in the right one.
42 @media (min-width: 900px) {25 @media (min-width: 900px) {
43 .settings-split .webhook-form {26 .settings-split .webhook-form {
style/_fit_tables.scssmodified+0 -7
@@ -46,13 +46,6 @@
46 padding: 0 12px;46 padding: 0 12px;
47 }47 }
48 48
49-// Labels fill the card in columns, so twelve of them take three or four rows, not twelve.
50-.fit-card .label-list {
51- display: grid;
52- grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
53- column-gap: 24px;
54-}
55-
56 @media (max-width: 899px) {49 @media (max-width: 899px) {
57 .fit-split {50 .fit-split {
58 flex-direction: column;51 flex-direction: column;
style/_lang_admin.scssmodified+52 -2
@@ -34,8 +34,8 @@ $page-column: ".shell-site > .shell-body > main, .shell-site > .shell-body > mai
34 34
35 // A form in a pane is a column of its own: 720px at most, left aligned. The mail form keeps its35 // A form in a pane is a column of its own: 720px at most, left aligned. The mail form keeps its
36 // three-field row.36 // three-field row.
37-.shell-site main .card > form:not(.inline-form):not([action="/admin/mail"]),37+.shell-site main .card > form:not(.inline-form):not(.srv-form):not([action="/admin/mail"]),
38-.shell-site main .card > form.stack:not([action="/admin/mail"]) {38+.shell-site main .card > form.stack:not(.srv-form):not([action="/admin/mail"]) {
39 max-width: 720px;39 max-width: 720px;
40 }40 }
41 41
@@ -88,3 +88,53 @@ $page-column: ".shell-site > .shell-body > main, .shell-site > .shell-body > mai
88 .user-page > .card {88 .user-page > .card {
89 margin-bottom: 0;89 margin-bottom: 0;
90 }90 }
91+
92+// Server settings: every field's head is one 24px line, so the controls of a row sit on one line. A
93+// label that does not fit is clipped with its full text in `title`; the badges keep their place.
94+.srv-form .srv-field .srv-head {
95+ height: 24px;
96+ flex-wrap: nowrap;
97+ gap: 6px;
98+}
99+
100+.srv-form .srv-field .srv-label {
101+ min-width: 0;
102+ margin-right: 0;
103+ overflow: hidden;
104+ text-overflow: ellipsis;
105+ white-space: nowrap;
106+}
107+
108+.srv-form .srv-field .srv-head > .badge {
109+ flex: none;
110+ white-space: nowrap;
111+}
112+
113+// Paths and other fixed values: one mono line, the same height as the inputs, scrolled sideways
114+// rather than broken mid-word.
115+.srv-form .srv-field .srv-fixed {
116+ display: block;
117+ box-sizing: border-box;
118+ height: var(--control-h);
119+ min-height: 0;
120+ padding: 0 12px;
121+ font-size: 13px;
122+ line-height: calc(var(--control-h) - 2px);
123+ white-space: nowrap;
124+ overflow-x: auto;
125+ overflow-y: hidden;
126+ overflow-wrap: normal;
127+ word-break: normal;
128+ scrollbar-width: thin;
129+}
130+
131+// The settings card and the restart card start on one line.
132+@media (min-width: 900px) {
133+ .srv-page > .card {
134+ margin-top: 0;
135+ }
136+
137+ .srv-page > .card.fit-pane {
138+ align-self: start;
139+ }
140+}
style/_lang_ci.scssmodified+2 -2
@@ -8,10 +8,10 @@
8 overflow: visible;8 overflow: visible;
9 }9 }
10 10
11-// The runs list (about 380px) and the selected run fill the window down to the footer.11+// The runs list (480px, as the canvas) and the selected run fill the window down to the footer.
12 @media (min-width: 900px) {12 @media (min-width: 900px) {
13 .ci-split.fit-pane {13 .ci-split.fit-pane {
14- grid-template-columns: minmax(0, 380px) minmax(0, 1fr);14+ grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
15 align-items: stretch;15 align-items: stretch;
16 gap: 12px;16 gap: 12px;
17 padding: 0;17 padding: 0;
style/_lang_lists.scssmodified+2 -1
@@ -15,7 +15,8 @@
15 padding: 0;15 padding: 0;
16 background: var(--surface);16 background: var(--surface);
17 border-radius: var(--radius-lg);17 border-radius: var(--radius-lg);
18- box-shadow: inset 0 0 0 1px var(--border);18+ border: 1px solid var(--border);
19+ box-shadow: none;
19 }20 }
20 }21 }
21 22
style/_look.scssmodified+3 -3
@@ -86,12 +86,12 @@ th,
86 86
87 // Only floating things (popovers, menus, dialogs, the palette, the profile panel) keep --shadow.87 // Only floating things (popovers, menus, dialogs, the palette, the profile panel) keep --shadow.
88 88
89-// A faint accent wash at the top of the page, fading out by about 300px.89+// A faint accent wash at the top of the page, as on the canvases, centred left of the middle.
90 body {90 body {
91 background-color: var(--bg);91 background-color: var(--bg);
92 background-image: radial-gradient(92 background-image: radial-gradient(
93- 120% 300px at 50% 0,93+ ellipse 1000px 300px at 26% -120px,
94- color-mix(in srgb, var(--accent) 6%, transparent),94+ color-mix(in srgb, var(--accent) 9%, transparent),
95 transparent95 transparent
96 );96 );
97 background-repeat: no-repeat;97 background-repeat: no-repeat;
style/_repo.scssmodified+25 -211
@@ -299,22 +299,6 @@
299 overflow-y: auto;299 overflow-y: auto;
300 }300 }
301 301
302- // The newest commit as a two-line header over the tree: its subject on the first line, then the
303- // author, hash, age and commit count, so the narrow column does not cut both down to a few letters.
304- .latest-commit {
305- gap: 6px 12px;
306-
307- .latest-subject {
308- order: -1;
309- flex: 1 1 100%;
310- font-weight: 500;
311- }
312-
313- .latest-author {
314- max-width: 12rem;
315- }
316- }
317-
318 // The README column is the frame: the card inside loses its own border and fills it, the file302 // The README column is the frame: the card inside loses its own border and fills it, the file
319 // name strip stays at the top and only the text under it scrolls, so the scrollbar sits inside303 // name strip stays at the top and only the text under it scrolls, so the scrollbar sits inside
320 // the frame. (A sticky strip in a rounded scroller leaves its corners unclipped in Chrome.)304 // the frame. (A sticky strip in a rounded scroller leaves its corners unclipped in Chrome.)
@@ -706,17 +690,6 @@ html.tree-resizing .repo-split::before {
706 background: var(--surface-2);690 background: var(--surface-2);
707 }691 }
708 692
709-// Commit header card: paragraphs spaced evenly, no extra gap above the first line.
710-.commit-info {
711- > p {
712- margin: 0 0 10px;
713- }
714-
715- > p:last-child {
716- margin-bottom: 0;
717- }
718-}
719-
720 // Settings sub-navigation: a horizontal row of links; the current one is underlined in the accent.693 // Settings sub-navigation: a horizontal row of links; the current one is underlined in the accent.
721 .settings-nav {694 .settings-nav {
722 display: flex;695 display: flex;
@@ -1217,72 +1190,11 @@ html.tree-resizing .repo-split::before {
1217 margin-bottom: 0;1190 margin-bottom: 0;
1218 }1191 }
1219 1192
1220-.commit-info {
1221- display: flex;
1222- flex-direction: column;
1223- gap: 8px;
1224-
1225- > p,
1226- > details {
1227- margin: 0;
1228- }
1229-}
1230-
1231-// Co-authors on the author line: small avatars, and the "+N others" disclosure inline.
1232-.commit-author-line {
1233- .coauthor-avatar {
1234- width: 16px;
1235- height: 16px;
1236- margin-right: 0.3em;
1237- vertical-align: -3px;
1238- }
1239-
1240- .coauthors-more {
1241- display: inline;
1242-
1243- > summary {
1244- display: inline;
1245- cursor: pointer;
1246- color: var(--muted);
1247- text-decoration: underline dotted;
1248- }
1249-
1250- .coauthors-list {
1251- margin: 6px 0 0;
1252- padding-left: 1.2em;
1253- }
1254- }
1255-}
1256-
1257 .commit-email {1193 .commit-email {
1258 overflow-wrap: anywhere;1194 overflow-wrap: anywhere;
1259 font-size: 0.9em;1195 font-size: 0.9em;
1260 }1196 }
1261 1197
1262-// The full commit hash in its copy box: one line, truncated with an ellipsis when the screen is
1263-// narrow, so the hash never breaks in the middle. The Copy button always copies the whole hash.
1264-.commit-info .commit-full-oid {
1265- display: flex;
1266- flex-wrap: wrap;
1267- align-items: center;
1268- gap: 10px;
1269- min-width: 0;
1270-
1271- .copy-box {
1272- flex: 1 1 auto;
1273- min-width: 0;
1274- margin: 0;
1275- align-items: center;
1276- }
1277-
1278- code {
1279- overflow: hidden;
1280- text-overflow: ellipsis;
1281- white-space: nowrap;
1282- overflow-wrap: normal;
1283- }
1284-}
1285-
1286 // Settings forms: every field in a form shares the form width (urls and secrets no longer stop short).1198 // Settings forms: every field in a form shares the form width (urls and secrets no longer stop short).
1287 .mirror-form,1199 .mirror-form,
1288 .webhook-form {1200 .webhook-form {
@@ -1333,130 +1245,7 @@ html.tree-resizing .repo-split::before {
1333 }1245 }
1334 }1246 }
1335 1247
1336-// Latest commit bar: the first row of the listing box (repo home and tree views). Its padding
1337-// matches the table cells, so the author sits over the Name column and the age over the Age
1338-// column. The subject takes the slack and ellipsizes; on phones it drops to its own line.
1339-.latest-commit {
1340- display: flex;
1341- flex-wrap: wrap;
1342- align-items: center;
1343- gap: 12px;
1344- min-width: 0;
1345- padding: 10px 0;
1346- font-size: 13.5px;
1347- color: var(--text);
1348- border-bottom: 1px solid var(--border);
1349-
1350- .latest-author {
1351- display: inline-flex;
1352- flex: 0 1 auto;
1353- align-items: center;
1354- gap: 8px;
1355- min-width: 0;
1356- max-width: 14rem;
1357- white-space: nowrap;
1358-
1359- .avatar {
1360- flex: none;
1361- width: 20px;
1362- height: 20px;
1363- margin-right: 0;
1364- }
1365-
1366- // Plain-text authors have no avatar: a neutral disc with the author's initial.
1367- .avatar-blank {
1368- display: inline-flex;
1369- align-items: center;
1370- justify-content: center;
1371- box-sizing: border-box;
1372- border: 1px solid var(--border);
1373- font-size: 11px;
1374- font-weight: 600;
1375- line-height: 1;
1376- color: var(--muted);
1377- }
1378-
1379- a,
1380- span:not(.avatar) {
1381- min-width: 0;
1382- overflow: hidden;
1383- text-overflow: ellipsis;
1384- font-weight: 600;
1385- color: var(--text);
1386- }
1387-
1388- a:hover {
1389- color: var(--text);
1390- text-decoration: none;
1391- }
1392- }
1393-
1394- .latest-subject {
1395- flex: 1 1 0;
1396- min-width: 0;
1397- overflow: hidden;
1398- text-overflow: ellipsis;
1399- white-space: nowrap;
1400- color: var(--text);
1401-
1402- &:hover {
1403- color: var(--text);
1404- text-decoration: none;
1405- }
1406- }
1407-
1408- .latest-meta {
1409- display: inline-flex;
1410- flex: none;
1411- align-items: center;
1412- gap: 14px;
1413- white-space: nowrap;
1414- font-size: 13px;
1415- color: var(--muted);
1416- }
1417-
1418- .latest-sha {
1419- font-size: 12.5px;
1420- color: var(--muted);
1421-
1422- &:hover {
1423- color: var(--text);
1424- text-decoration: none;
1425- }
1426- }
1427-
1428- .latest-count {
1429- display: inline-flex;
1430- align-items: center;
1431- gap: 5px;
1432- color: var(--muted);
1433-
1434- &:hover {
1435- color: var(--text);
1436- text-decoration: none;
1437- }
1438-
1439- .ico {
1440- width: 15px;
1441- height: 15px;
1442- }
1443- }
1444-}
1445-
1446 @media (max-width: 600px) {1248 @media (max-width: 600px) {
1447- .latest-commit {
1448- row-gap: 6px;
1449-
1450- .latest-subject {
1451- order: 3;
1452- flex: 1 1 100%;
1453- }
1454-
1455- .latest-meta {
1456- gap: 10px;
1457- margin-left: auto;
1458- }
1459- }
1460 }1249 }
1461 1250
1462 // A CI badge on forge's own pages (syncBadges in nav.js): the two halves of the SVG, in theme colours.1251 // A CI badge on forge's own pages (syncBadges in nav.js): the two halves of the SVG, in theme colours.
@@ -1504,3 +1293,28 @@ img.badge-wait {
1504 --chip: var(--heat-3);1293 --chip: var(--heat-3);
1505 }1294 }
1506 }1295 }
1296+
1297+.commit-author-line {
1298+ .coauthor-avatar {
1299+ width: 16px;
1300+ height: 16px;
1301+ margin-right: 0.3em;
1302+ vertical-align: -3px;
1303+ }
1304+
1305+ .coauthors-more {
1306+ display: inline;
1307+
1308+ > summary {
1309+ display: inline;
1310+ cursor: pointer;
1311+ color: var(--muted);
1312+ text-decoration: underline dotted;
1313+ }
1314+
1315+ .coauthors-list {
1316+ margin: 6px 0 0;
1317+ padding-left: 1.2em;
1318+ }
1319+ }
1320+}
style/_shell.scssmodified+2 -2
@@ -910,7 +910,7 @@ a.chip {
910 910
911 .corner-menu {911 .corner-menu {
912 position: absolute;912 position: absolute;
913- bottom: calc(100% + 6px);913+ bottom: calc(100% + 8px);
914 z-index: 40;914 z-index: 40;
915 display: grid;915 display: grid;
916 gap: 2px;916 gap: 2px;
@@ -959,7 +959,7 @@ a.chip {
959 // Placed in the top half of the window: the menu opens below the panel. In the right half it anchors959 // Placed in the top half of the window: the menu opens below the panel. In the right half it anchors
960 // to the panel's right edge instead of the left one. The default corner keeps the upward menu.960 // to the panel's right edge instead of the left one. The default corner keeps the upward menu.
961 .corner-float[data-open="down"] .corner-menu {961 .corner-float[data-open="down"] .corner-menu {
962- top: calc(100% + 6px);962+ top: calc(100% + 8px);
963 bottom: auto;963 bottom: auto;
964 }964 }
965 965
style/_timeline.scssmodified+8 -137
@@ -1,17 +1,5 @@
1-// The repo page's bottom dock (the newest CI run in one line, then the history strip) and the1+// The history strip (one bar per recent commit) and the dock's shared parts. The repo home's panes
2-// history strip itself. The dock is always shown under the panes; the panes give it room.2+// and dock are in _canvas_repo.scss; the run page keeps its thin dock here.
3-
4-:root {
5- --dock-h: 52px;
6-}
7-
8-// The panes fill the window above the dock: the dock's height comes off the pane height that
9-// _repo.scss sets (nav.js measures the top and the footer). Declared after _repo.scss on purpose.
10-@media (min-width: 900px) {
11- .repo-home {
12- --repo-home-h: max(360px, calc(100dvh - var(--pane-top, 288px) - var(--pane-foot, 78px) - var(--dock-h) - 12px));
13- }
14-}
15 3
16 // With no footer on this page, the dock sits close to the window's bottom edge.4 // With no footer on this page, the dock sits close to the window's bottom edge.
17 .shell-body > main:has(.repo-home) {5 .shell-body > main:has(.repo-home) {
@@ -82,99 +70,15 @@ body:has(.repo-home) .site-footer {
82 display: none;70 display: none;
83 }71 }
84 72
85-// The tree column's narrow toolbar: the branch icon and the Go to file key hint give way so that73+// The run page's dock: one thin row, the strip after the CI words. The repo home has its own dock.
86-// Clone stays inside the column. (The t key still works.)74+.repo-dock:not(.canvas-dock) {
87-.repo-home .browse-bar {
88- align-items: center;
89- gap: 8px;
90-
91- .finder-open kbd,
92- .ref-icon {
93- display: none;
94- }
95-}
96-
97-// Search code is in the palette and the path bar's search; the toolbar keeps the branch, Go to file
98-// and Clone.
99-.repo-home .repo-search-link {
100- display: none;
101-}
102-
103-// The tree column is name and age; the commit subject column comes back when the pane is dragged
104-// wide enough to read it.
105-.repo-home .repo-main {
106- container-type: inline-size;
107-}
108-
109-@container (max-width: 639px) {
110- .tree-table th:nth-child(2),
111- .tree-table .tree-commit {
112- display: none;
113- }
114-}
115-
116-// The README pane has one header row: its file name, with the licence, size and top language laid
117-// over the right end of that row.
118-.repo-readme {
119- position: relative;
120-}
121-
122-.readme-head {
123- position: absolute;
124- top: 0;
125- right: 0;
126- z-index: 1;
127- display: flex;
128- align-items: center;
129- height: 36px;
130- padding: 0 14px;
131- font-family: var(--mono);
132- font-size: 12px;
133- color: var(--muted);
134- white-space: nowrap;
135-}
136-
137-// The tree pane's latest commit: one line, the subject first, then the short sha and the age.
138-.repo-home .latest-commit {
139- flex-wrap: nowrap;
140- align-items: center;
141- gap: 4px 10px;
142- min-width: 0;
143-
144- .latest-subject {
145- order: 0;
146- flex: 1 1 auto;
147- min-width: 0;
148- overflow: hidden;
149- white-space: nowrap;
150- text-overflow: ellipsis;
151- }
152-
153- .latest-count {
154- display: none;
155- }
156-
157- // Only the avatar: the column has no room for the name beside the subject.
158- .latest-author {
159- flex: none;
160-
161- > a,
162- > span:not(.avatar) {
163- display: none;
164- }
165- }
166-}
167-
168-// One thin row at the foot of the page: the newest CI run at the left, clear of the floating profile
169-// panel, then the commit strip, then the commit count and All runs.
170-.repo-dock {
171 display: flex;75 display: flex;
172 align-items: center;76 align-items: center;
173 gap: 16px;77 gap: 16px;
174 box-sizing: border-box;78 box-sizing: border-box;
175- height: var(--dock-h);79+ height: 52px;
176 margin-top: 12px;80 margin-top: 12px;
177- padding: 0 16px 0 260px;81+ padding: 0 16px;
178 min-width: 0;82 min-width: 0;
179 overflow: hidden;83 overflow: hidden;
180 background: var(--surface);84 background: var(--surface);
@@ -183,40 +87,6 @@ body:has(.repo-home) .site-footer {
183 font-size: 13px;87 font-size: 13px;
184 }88 }
185 89
186-// The CI words: the run's dot, number, state and sha, then the strip, then the count and All runs.
187-.dock-info {
188- display: contents;
189-
190- > * {
191- flex: none;
192- white-space: nowrap;
193- }
194-
195- .dock-run {
196- display: inline-flex;
197- align-items: center;
198- gap: 6px;
199- font-weight: 600;
200- color: var(--text);
201- text-decoration: none;
202- }
203-
204- .dock-state {
205- color: var(--text-2);
206- }
207-
208- .dock-count,
209- .dock-all {
210- order: 2;
211- }
212-
213- .dock-all {
214- font-weight: 600;
215- color: var(--text);
216- }
217-}
218-
219-// The strip takes the rest of the row; its label is for screen readers.
220 .dock-history {90 .dock-history {
221 order: 1;91 order: 1;
222 display: flex;92 display: flex;
@@ -231,6 +101,7 @@ body:has(.repo-home) .site-footer {
231 min-width: 0;101 min-width: 0;
232 }102 }
233 103
104+// Visually hidden on the run page; the repo home shows it as the strip's column label.
234 .history-label {105 .history-label {
235 position: absolute;106 position: absolute;
236 width: 1px;107 width: 1px;
@@ -288,7 +159,7 @@ body:has(.repo-home) .site-footer {
288 // Below 900px the panes stack and the page scrolls: the dock becomes the one-line CI row, and the159 // Below 900px the panes stack and the page scrolls: the dock becomes the one-line CI row, and the
289 // strip, which needs the width, is left out.160 // strip, which needs the width, is left out.
290 @media (max-width: 899px) {161 @media (max-width: 899px) {
291- .repo-dock {162+ .repo-dock:not(.canvas-dock) {
292 height: auto;163 height: auto;
293 }164 }
294 165
style/_timeline_ci.scssmodified+330 -124
@@ -1,24 +1,43 @@
1-// The CI run page (B Timeline) and the commits page's fitting list. The run page's classes are `ci-tl-*`;1+// The CI run and job pages, as TimelineCi in the Layout Study: a 64 px head, a 300 px jobs pane beside
2-// the shared CI rules (the log bar, its search, the fail-first block, the artifact list) stay in main.scss.2+// the log pane, and the history dock under them. The panes fill the window and scroll inside
3-// This partial comes last, so its rules win over the older split view where both apply.3+// themselves; the page does not scroll. Panes are --surface with a 1 px --border, no shadow.
4 4
5-// Desktop: the run page fills the window. Its panes scroll inside, the page itself does not.5+.ci-run.fit-pane,
6-@media (min-width: 900px) {6+.ci-job.fit-pane {
7- .ci-run.fit-pane {7+ box-sizing: border-box;
8- display: flex;8+ display: flex;
9- flex-direction: column;9+ flex-direction: column;
10- gap: 12px;10+ gap: 12px;
11- overflow: hidden;11+ height: max(480px, calc(100dvh - 190px));
12- }12+ padding: 0;
13+ overflow: hidden;
14+}
15+
16+.ci-pane {
17+ display: flex;
18+ flex-direction: column;
19+ min-width: 0;
20+ min-height: 0;
21+ overflow: hidden;
22+ padding: 0;
23+ background: var(--surface);
24+ border: 1px solid var(--border);
25+ border-radius: 10px;
26+ box-shadow: none;
13 }27 }
14 28
29+// Head: `Run #N` in mono, the title in Archivo at 24 px at most, the full message on demand; the meta
30+// line below it; one or two actions at the right.
15 .ci-tl-head {31 .ci-tl-head {
32+ position: relative;
16 flex: none;33 flex: none;
34+ height: 64px;
17 display: flex;35 display: flex;
18- align-items: flex-start;36+ align-items: center;
19 justify-content: space-between;37 justify-content: space-between;
20 gap: 16px;38 gap: 16px;
21 min-width: 0;39 min-width: 0;
40+ margin: 0;
22 }41 }
23 42
24 .ci-tl-headmain {43 .ci-tl-headmain {
@@ -29,7 +48,6 @@
29 gap: 4px;48 gap: 4px;
30 }49 }
31 50
32-// The one-line header: `Run #N`, the commit title, and the full message on demand.
33 .ci-tl-line {51 .ci-tl-line {
34 display: flex;52 display: flex;
35 align-items: baseline;53 align-items: baseline;
@@ -40,87 +58,101 @@
40 .ci-tl-no {58 .ci-tl-no {
41 flex: none;59 flex: none;
42 font-family: var(--mono);60 font-family: var(--mono);
43- font-size: 12px;61+ font-size: 11px;
44- letter-spacing: 0.06em;62+ font-weight: 500;
63+ letter-spacing: 0.12em;
45 text-transform: uppercase;64 text-transform: uppercase;
46 color: var(--muted);65 color: var(--muted);
66+ white-space: nowrap;
67+
68+ a {
69+ color: inherit;
70+ }
47 }71 }
48 72
49 .ci-tl-title {73 .ci-tl-title {
50 flex: 0 1 auto;74 flex: 0 1 auto;
51 min-width: 0;75 min-width: 0;
52 margin: 0;76 margin: 0;
53- font-size: 18px;77+ font-family: var(--display, var(--font));
54- font-weight: 600;78+ font-size: 24px;
79+ font-weight: 700;
80+ line-height: 1.2;
55 white-space: nowrap;81 white-space: nowrap;
56 overflow: hidden;82 overflow: hidden;
57 text-overflow: ellipsis;83 text-overflow: ellipsis;
58 }84 }
59 85
60-// The full message opens as a floating note, so the header keeps its height.
61 .ci-tl-more {86 .ci-tl-more {
62 flex: none;87 flex: none;
63- position: relative;88+ font-size: 13px;
89+ color: var(--text-2);
64 90
65 summary {91 summary {
66 cursor: pointer;92 cursor: pointer;
67- font-size: 13px;
68- color: var(--muted);
69 text-decoration: underline;93 text-decoration: underline;
94+ text-underline-offset: 3px;
70 }95 }
71 96
72 p {97 p {
73- display: none;
74- }
75-
76- &[open] p {
77- display: block;
78 position: absolute;98 position: absolute;
79- top: calc(100% + 6px);
80- left: 0;
81 z-index: 5;99 z-index: 5;
82- width: min(640px, 80vw);100+ margin-top: 6px;
83- margin: 0;101+ max-width: 560px;
84 padding: 10px 12px;102 padding: 10px 12px;
85- background: var(--surface);103+ background: var(--surface-2);
86 border: 1px solid var(--border);104 border: 1px solid var(--border);
87- border-radius: var(--radius-md);105+ border-radius: 8px;
88- box-shadow: var(--shadow);
89- white-space: pre-wrap;
90 }106 }
91 }107 }
92 108
93 .ci-tl-meta {109 .ci-tl-meta {
94 display: flex;110 display: flex;
95- flex-wrap: wrap;
96 align-items: center;111 align-items: center;
97- gap: 4px 12px;112+ gap: 12px;
98 min-width: 0;113 min-width: 0;
99 font-size: 13px;114 font-size: 13px;
100-}115+ white-space: nowrap;
116+ overflow: hidden;
101 117
102-.ci-tl-dur {118+ .ci-state {
103- font-family: var(--mono);119+ color: var(--text-2);
104- color: var(--muted);120+ }
121+
122+ // The state is accent only while the run is live.
123+ .ci-state.ci-running,
124+ .ci-state.ci-queued,
125+ .ci-state.ci-waiting_approval {
126+ color: var(--accent);
127+ font-weight: 600;
128+ }
129+
130+ .ci-tl-dur {
131+ font-family: var(--mono);
132+ font-size: 12px;
133+ color: var(--text-2);
134+ }
105 }135 }
106 136
107 .ci-tl-actions {137 .ci-tl-actions {
108 flex: none;138 flex: none;
109 display: flex;139 display: flex;
110- flex-wrap: wrap;140+ align-items: center;
111 gap: 8px;141 gap: 8px;
142+ margin: 0;
112 }143 }
113 144
114-.ci-tl-label {145+// The progress of a running run: a hairline at the foot of the head.
115- margin: 0 0 8px;146+.ci-tl-head .ci-est-run {
116- font-size: 12px;147+ position: absolute;
117- font-weight: 600;148+ left: 0;
118- letter-spacing: 0.06em;149+ right: 0;
119- text-transform: uppercase;150+ bottom: 0;
120- color: var(--muted);151+ width: 100%;
152+ height: 2px;
121 }153 }
122 154
123-// The jobs (left) and the log (right) fill what is left of the window.155+// Main: the jobs (300 px) and the log, both the height the page leaves them.
124 .ci-tl-main {156 .ci-tl-main {
125 flex: 1 1 0;157 flex: 1 1 0;
126 min-height: 0;158 min-height: 0;
@@ -129,45 +161,80 @@
129 gap: 12px;161 gap: 12px;
130 }162 }
131 163
132-.ci-tl-jobs,164+.ci-tl-label {
133-.ci-tl-log {165+ display: block;
134- min-width: 0;166+ flex: none;
135- min-height: 0;
136 margin: 0;167 margin: 0;
137- display: flex;168+ font-family: var(--mono);
138- flex-direction: column;169+ font-size: 11px;
170+ font-weight: 500;
171+ letter-spacing: 0.12em;
172+ text-transform: uppercase;
173+ color: var(--muted);
174+}
175+
176+.ci-tl-pad {
177+ padding: 0 14px;
139 }178 }
140 179
180+// Jobs pane: a 36 px title row, then one 36 px row per job.
141 .ci-tl-jobs {181 .ci-tl-jobs {
142- padding: 12px 12px 10px;
143 overflow-y: auto;182 overflow-y: auto;
144 overscroll-behavior: contain;183 overscroll-behavior: contain;
184+
185+ > .ci-tl-label {
186+ height: 36px;
187+ line-height: 36px;
188+ padding: 0 14px;
189+ box-shadow: inset 0 -1px var(--border);
190+ }
191+
192+ .ci-tl-facts {
193+ padding-top: 12px;
194+ padding-bottom: 8px;
195+ font-size: 13px;
196+
197+ p {
198+ margin: 0 0 4px;
199+ }
200+ }
201+
202+ .ci-art-list,
203+ .ci-artifacts {
204+ margin: 0;
205+ padding: 0 14px 12px;
206+ list-style: none;
207+ font-size: 13px;
208+ }
145 }209 }
146 210
147 .ci-tl-list {211 .ci-tl-list {
148- display: flex;212+ flex: none;
149- flex-direction: column;
150- gap: 2px;
151 margin: 0;213 margin: 0;
152 padding: 0;214 padding: 0;
153 list-style: none;215 list-style: none;
154 }216 }
155 217
156 .ci-tl-group {218 .ci-tl-group {
157- margin-top: 8px;219+ height: 26px;
158- font-size: 12px;220+ line-height: 26px;
221+ padding: 0 14px;
222+ font-family: var(--mono);
223+ font-size: 11px;
159 color: var(--muted);224 color: var(--muted);
160 }225 }
161 226
162 .ci-tl-job {227 .ci-tl-job {
163 display: flex;228 display: flex;
164 align-items: center;229 align-items: center;
165- gap: 8px;230+ gap: 10px;
231+ height: 36px;
166 min-width: 0;232 min-width: 0;
167- padding: 7px 8px;233+ padding: 0 14px;
168- border-radius: var(--radius-sm);234+ box-shadow: inset 0 -1px var(--border);
169 color: var(--text);235 color: var(--text);
170 text-decoration: none;236 text-decoration: none;
237+ font-size: 13px;
171 238
172 &:hover {239 &:hover {
173 background: var(--surface-2);240 background: var(--surface-2);
@@ -175,18 +242,19 @@
175 242
176 &[aria-current="true"] {243 &[aria-current="true"] {
177 background: var(--surface-2);244 background: var(--surface-2);
178- box-shadow: inset 2px 0 0 var(--accent);
179 }245 }
180 246
181 .ci-tl-dur {247 .ci-tl-dur {
182- flex: none;
183 margin-left: auto;248 margin-left: auto;
249+ flex: none;
250+ font-family: var(--mono);
184 font-size: 12px;251 font-size: 12px;
252+ color: var(--text-2);
185 }253 }
186 }254 }
187 255
188 .ci-tl-sub .ci-tl-job {256 .ci-tl-sub .ci-tl-job {
189- padding-left: 18px;257+ padding-left: 28px;
190 }258 }
191 259
192 .ci-tl-name {260 .ci-tl-name {
@@ -197,26 +265,31 @@
197 white-space: nowrap;265 white-space: nowrap;
198 }266 }
199 267
268+// The image, as a mono tag.
200 .ci-tl-tag {269 .ci-tl-tag {
201 flex: none;270 flex: none;
202- padding: 0 6px;
203- border: 1px solid var(--border);
204- border-radius: var(--radius-sm);
205 font-family: var(--mono);271 font-family: var(--mono);
206 font-size: 11px;272 font-size: 11px;
207- color: var(--muted);273+ padding: 1px 7px;
274+ border-radius: 5px;
275+ background: var(--surface-2);
276+ color: var(--text-2);
208 }277 }
209 278
210-.ci-tl-jobs .ci-art-list {279+.ci-tl-artline {
211- margin-top: 6px;280+ display: flex;
281+ align-items: center;
282+ justify-content: space-between;
283+ gap: 8px;
284+ height: 36px;
285+ padding: 0 14px;
286+ margin-top: 8px;
287+ box-shadow: inset 0 -1px var(--border);
212 }288 }
213 289
214-// The right pane: a Log and a Timeline tab. Both panels are in the HTML; a radio pair (no script)290+// Log pane: the 48 px bar (the tabs, then the log's tools), the code area, and the timeline tab.
215-// shows one. The radios sit before the tabs and panels, so `~` reaches them.
216 .ci-tl-log {291 .ci-tl-log {
217 position: relative;292 position: relative;
218- padding: 0;
219- overflow: hidden;
220 }293 }
221 294
222 .ci-tl-radio {295 .ci-tl-radio {
@@ -227,101 +300,230 @@
227 pointer-events: none;300 pointer-events: none;
228 }301 }
229 302
303+.ci-tl-logbar {
304+ flex: none;
305+ height: 48px;
306+ margin: 0;
307+ display: flex;
308+ align-items: center;
309+ gap: 12px;
310+ padding: 0 14px;
311+ min-width: 0;
312+ background: transparent;
313+ box-shadow: inset 0 -1px var(--border);
314+ border: 0;
315+ border-radius: 0;
316+}
317+
230 .ci-tl-tabs {318 .ci-tl-tabs {
231 flex: none;319 flex: none;
232 display: flex;320 display: flex;
233- gap: 4px;321+ align-items: stretch;
234- padding: 6px 12px;322+ gap: 18px;
235- border-bottom: 1px solid var(--border);323+ height: 100%;
236 }324 }
237 325
238 .ci-tl-tab {326 .ci-tl-tab {
239- padding: 4px 10px;327+ display: flex;
240- border-radius: var(--radius-sm);328+ align-items: center;
241- font-size: 13px;329+ padding: 0;
330+ font-family: var(--mono);
331+ font-size: 11px;
332+ font-weight: 500;
333+ letter-spacing: 0.12em;
334+ text-transform: uppercase;
242 color: var(--muted);335 color: var(--muted);
243 cursor: pointer;336 cursor: pointer;
337+ box-shadow: inset 0 0 0 0 transparent;
244 }338 }
245 339
246-#ci-view-log:checked ~ .ci-tl-tabs .ci-tl-tab-log,340+#ci-view-log:checked ~ .ci-tl-logbar .ci-tl-tab-log,
247-#ci-view-timeline:checked ~ .ci-tl-tabs .ci-tl-tab-timeline {341+#ci-view-timeline:checked ~ .ci-tl-logbar .ci-tl-tab-timeline {
248 color: var(--text);342 color: var(--text);
249- background: var(--surface-2);343+ box-shadow: inset 0 -2px var(--accent);
250 }344 }
251 345
252-#ci-view-log:checked ~ .ci-tl-panel-timeline,346+// The log's tools share the bar's right side; they scroll sideways rather than wrap.
253-#ci-view-timeline:checked ~ .ci-tl-panel-log {347+.ci-tl-tools {
348+ margin-left: auto;
349+ min-width: 0;
350+ display: flex;
351+ align-items: center;
352+ gap: 6px;
353+ overflow-x: auto;
354+ scrollbar-width: none;
355+ white-space: nowrap;
356+
357+ .ci-logsearch {
358+ width: 140px;
359+ flex: none;
360+ height: 30px;
361+ }
362+
363+ .ci-job-rerun {
364+ display: inline-flex;
365+ }
366+}
367+
368+#ci-view-timeline:checked ~ .ci-tl-logbar .ci-tl-tools {
254 display: none;369 display: none;
255 }370 }
256 371
257-.ci-tl-log > .ci-tl-panel {372+.ci-tl-panel-log {
258- flex: 1 1 auto;373+ flex: 1 1 0;
259 min-height: 0;374 min-height: 0;
260 display: flex;375 display: flex;
261 flex-direction: column;376 flex-direction: column;
262 overflow: hidden;377 overflow: hidden;
378+
379+ > :not(.ci-tl-code) {
380+ flex: none;
381+ }
382+
383+ .ci-warnings,
384+ .ci-config-error {
385+ max-height: 30%;
386+ overflow: auto;
387+ margin: 0;
388+ }
263 }389 }
264 390
265-.ci-tl-panel-log > * {391+.ci-tl-panel-timeline {
266- flex: none;392+ display: none;
267- margin-left: 0;393+ flex: 1 1 0;
268- margin-right: 0;394+ min-height: 0;
395+ padding: 12px 14px;
396+ overflow: auto;
397+ overscroll-behavior: contain;
269 }398 }
270 399
271-.ci-tl-panel-log > .ci-config-error,400+#ci-view-timeline:checked ~ .ci-tl-panel-log {
272-.ci-tl-panel-log > .ci-warnings {401+ display: none;
273- margin: 10px 12px 0;
274 }402 }
275 403
276-.ci-tl-panel-log > .ci-tl-code {404+#ci-view-timeline:checked ~ .ci-tl-panel-timeline {
277- flex: 1 1 auto;405+ display: block;
278 }406 }
279 407
280-.ci-tl-panel-timeline {408+// The code area: --bg, mono 12.5 px on a 1.7 line, numbers right aligned in their own column.
281- padding: 12px;409+.ci-tl-code {
410+ flex: 1 1 0;
411+ min-height: 0;
412+ margin: 0;
413+ padding: 14px 16px;
282 overflow: auto;414 overflow: auto;
283 overscroll-behavior: contain;415 overscroll-behavior: contain;
284-}416+ background: var(--bg);
417+ border-radius: 0 0 10px 10px;
418+ font-family: var(--mono);
419+ font-size: 12.5px;
420+ line-height: 1.7;
421+ color: var(--text);
285 422
286-.ci-tl-logbar {423+ .ll {
287- margin: 0;424+ display: flex;
288- padding: 8px 12px;425+ gap: 14px;
289- border-bottom: 1px solid var(--border);426+ white-space: pre;
427+ }
290 428
291- .ci-tl-label {429+ .ln {
292- flex: 0 1 auto;430+ flex: none;
431+ width: 2.6em;
432+ text-align: right;
433+ color: var(--muted);
434+ text-decoration: none;
435+ }
436+
437+ .lt {
293 min-width: 0;438 min-width: 0;
294- margin: 0;
295- overflow: hidden;
296- text-overflow: ellipsis;
297- white-space: nowrap;
298 }439 }
299 }440 }
300 441
301-.ci-tl-code {442+// The dock: the last commits as bars, their height the lines changed. The note sits at the top right.
443+.ci-dock {
444+ position: relative;
445+ flex: none;
446+ height: 184px;
447+ box-sizing: border-box;
448+ padding: 12px 14px;
449+}
450+
451+.ci-dock-note {
452+ position: absolute;
453+ top: 12px;
454+ right: 14px;
455+ margin: 0;
456+ font-size: 12px;
457+ color: var(--muted);
458+}
459+
460+.ci-dock .dock-history {
461+ flex: 1 1 0;
462+ min-height: 0;
463+ height: auto;
464+ display: flex;
465+ order: 0;
466+}
467+
468+.ci-dock .history-strip {
302 flex: 1 1 auto;469 flex: 1 1 auto;
470+ height: 100%;
471+ min-width: 0;
472+ display: grid;
473+ grid-template-columns: 254px minmax(0, 1fr);
474+}
475+
476+.ci-dock .history-label {
477+ position: static;
478+ width: auto;
479+ height: 18px;
480+ overflow: visible;
481+ clip-path: none;
482+ font-family: var(--mono);
483+ font-size: 11px;
484+ font-weight: 500;
485+ letter-spacing: 0.12em;
486+ text-transform: uppercase;
487+ line-height: 18px;
488+ color: var(--muted);
489+}
490+
491+.ci-dock .history-bars {
492+ flex: 1 1 0;
303 min-height: 0;493 min-height: 0;
304- max-height: none;494+ height: auto;
305- margin: 0;495+ align-items: flex-end;
306- overflow: auto;496+ gap: 3px;
307- overscroll-behavior: contain;497+ padding-bottom: 0;
308 }498 }
309 499
310-// The dock is the repo page's `.repo-dock` pane (_timeline.scss), without its CI words: the run page500+@media (prefers-reduced-motion: reduce) {
311-// already says that.501+ .ci-tl-job,
312-@media (min-width: 900px) {502+ .ci-tl-tab {
313- .ci-run .repo-dock {503+ transition: none;
314- margin-top: 0;
315 }504 }
316 }505 }
317 506
318-// Phone and narrow windows: the panes stack and the page grows, as the rest of the site does.507+// Below 900 px the panes stack and the page scrolls, as the rest of the site does.
319 @media (max-width: 899px) {508 @media (max-width: 899px) {
509+ .ci-run.fit-pane,
510+ .ci-job.fit-pane {
511+ height: auto;
512+ overflow: visible;
513+ }
514+
320 .ci-tl-main {515 .ci-tl-main {
321 grid-template-columns: minmax(0, 1fr);516 grid-template-columns: minmax(0, 1fr);
322 }517 }
323 518
324- .ci-tl-jobs {519+ .ci-tl-head {
520+ height: auto;
521+ flex-wrap: wrap;
522+ }
523+
524+ .ci-tl-jobs,
525+ .ci-tl-log,
526+ .ci-tl-panel-timeline {
325 overflow: visible;527 overflow: visible;
326 }528 }
327 529
@@ -329,6 +531,10 @@
329 max-height: 60vh;531 max-height: 60vh;
330 }532 }
331 533
534+ .ci-dock {
535+ height: auto;
536+ min-height: 140px;
537+ }
332 }538 }
333 539
334 // The commits page: the list scrolls inside a pane that fills the window under the tabs, and the pager540 // The commits page: the list scrolls inside a pane that fills the window under the tabs, and the pager
style/main.scssmodified+19 -5
@@ -112,7 +112,7 @@
112 --important: #6A4BB0;112 --important: #6A4BB0;
113 // Heat: the live strip and the profile ring (0 is the empty track, 4 the hottest), shades of the113 // Heat: the live strip and the profile ring (0 is the empty track, 4 the hottest), shades of the
114 // accent so they follow the chosen colour. Chips never use the accent.114 // accent so they follow the chosen colour. Chips never use the accent.
115- --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface));115+ --heat-0: color-mix(in srgb, var(--accent) 16%, var(--surface));
116 --heat-1: color-mix(in srgb, var(--accent) 35%, var(--surface));116 --heat-1: color-mix(in srgb, var(--accent) 35%, var(--surface));
117 --heat-2: color-mix(in srgb, var(--accent) 65%, var(--surface));117 --heat-2: color-mix(in srgb, var(--accent) 65%, var(--surface));
118 --heat-3: var(--accent);118 --heat-3: var(--accent);
@@ -159,7 +159,7 @@
159 --note: #8AB4F0;159 --note: #8AB4F0;
160 --tip: #7CCBAE;160 --tip: #7CCBAE;
161 --important: #C4A7FF;161 --important: #C4A7FF;
162- --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface));162+ --heat-0: color-mix(in srgb, var(--accent) 16%, var(--surface));
163 --heat-1: color-mix(in srgb, var(--accent) 30%, var(--surface));163 --heat-1: color-mix(in srgb, var(--accent) 30%, var(--surface));
164 --heat-2: color-mix(in srgb, var(--accent) 60%, var(--surface));164 --heat-2: color-mix(in srgb, var(--accent) 60%, var(--surface));
165 --heat-3: var(--accent);165 --heat-3: var(--accent);
@@ -195,7 +195,7 @@
195 --note: #8AB4F0;195 --note: #8AB4F0;
196 --tip: #7CCBAE;196 --tip: #7CCBAE;
197 --important: #C4A7FF;197 --important: #C4A7FF;
198- --heat-0: color-mix(in srgb, var(--accent) 10%, var(--surface));198+ --heat-0: color-mix(in srgb, var(--accent) 16%, var(--surface));
199 --heat-1: color-mix(in srgb, var(--accent) 30%, var(--surface));199 --heat-1: color-mix(in srgb, var(--accent) 30%, var(--surface));
200 --heat-2: color-mix(in srgb, var(--accent) 60%, var(--surface));200 --heat-2: color-mix(in srgb, var(--accent) 60%, var(--surface));
201 --heat-3: var(--accent);201 --heat-3: var(--accent);
@@ -3135,7 +3135,7 @@ code {
3135 margin: 0;3135 margin: 0;
3136 padding: 0;3136 padding: 0;
3137 border-radius: var(--radius-full);3137 border-radius: var(--radius-full);
3138- background: var(--border-strong);3138+ background: color-mix(in oklab, var(--text) 32%, var(--surface));
3139 cursor: pointer;3139 cursor: pointer;
3140 transition: background 0.15s ease;3140 transition: background 0.15s ease;
3141 3141
@@ -8056,7 +8056,6 @@ button.ci-job-last {
8056 @import "commit_page";8056 @import "commit_page";
8057 @import "commit_line";8057 @import "commit_line";
8058 @import "timeline_ci";8058 @import "timeline_ci";
8059-@import "continuity";
8060 // Last on purpose: the look pass (Archivo titles, mono labels, tone depth, page wash) restyles8059 // Last on purpose: the look pass (Archivo titles, mono labels, tone depth, page wash) restyles
8061 // shared classes above it.8060 // shared classes above it.
8062 @import "look";8061 @import "look";
@@ -8067,3 +8066,18 @@ button.ci-job-last {
8067 @import "lang_ci";8066 @import "lang_ci";
8068 @import "lang_admin";8067 @import "lang_admin";
8069 @import "lang_lists";8068 @import "lang_lists";
8069+@import "alive_head";
8070+@import "alive_issue";
8071+@import "alive_lists";
8072+@import "alive_settings";
8073+@import "alive_heat";
8074+@import "alive_motion";
8075+@import "alive_scrub";
8076+@import "canvas";
8077+@import "canvas_repo";
8078+@import "canvas_commits";
8079+@import "canvas_lists";
8080+@import "canvas_ci";
8081+@import "canvas_pull";
8082+@import "canvas_detail";
8083+@import "canvas_account";