Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 61 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,14 @@
.dark { background: var(--ink); color: var(--bg); padding: clamp(110px, 20vh, 220px) 0; }
.dark h2 { color: var(--bg); }
.dark .big { max-width: 19em; margin-top: 30px; font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.15; letter-spacing: -.035em; font-weight: 500; }
.dark .measures { max-width: 19em; margin-top: 56px; color: var(--inv-accent); font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.15; letter-spacing: -.035em; font-weight: 500; }
.dark .fine { margin-top: 44px; opacity: .72; font-size: 17px; max-width: 34em; }
.dark code { font-size: .92em; }

.one { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 56px; align-items: center; padding: clamp(110px, 20vh, 220px) 0 0; }
.one.gate { padding-bottom: clamp(110px, 20vh, 220px); }
.one.gate .out p { max-width: none; margin-top: 0; color: #d6dbe5; font-size: 15px; line-height: 1.6; letter-spacing: 0; }
.one.gate .out .head { margin-top: 10px; color: #fff; }
.one.gate .out .why { padding-left: 2ch; }
.one p { max-width: 22em; margin-top: 26px; color: var(--ink); font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.3; letter-spacing: -.02em; }
.one p + p { margin-top: 14px; color: var(--muted); font-size: 17px; letter-spacing: 0; }
.one code { font-size: .9em; }
Expand All @@ -189,6 +192,22 @@
.one .add p { max-width: none; margin-top: 12px; color: var(--muted); font-size: 15px; letter-spacing: 0; line-height: 1.45; }
.add .link { padding: 0; border: 0; background: none; color: var(--pink-text); font: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; cursor: pointer; }
.code { position: relative; }
.pop { width: min(100% - 32px, 640px); max-height: calc(100% - 32px); padding: 40px 40px 36px; border: 0; border-radius: 28px; background: var(--bg); color: var(--body); box-shadow: 0 40px 80px -30px rgba(13,17,23,.5); overflow-y: auto; }
.pop::backdrop { background: rgba(13,17,23,.55); backdrop-filter: blur(4px); }
.pop[open] { animation: pop .25s cubic-bezier(.3,1.4,.5,1); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .pop[open] { animation: none; } }
.pop h3 { margin: 0 0 14px; color: var(--ink); font-size: 1.9rem; font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.pop p { margin: 0 0 20px; font-size: 16px; line-height: 1.5; }
.pop p.small { margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.pop code { color: var(--ink); font-size: .9em; }
.pop a { color: var(--pink-text); }
.pop pre { padding: 24px 24px 24px 24px; padding-right: 96px; border-radius: 20px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pop .code { margin-bottom: 20px; }
.pop .code button { top: 12px; right: 12px; }
.pop .close { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--muted); font: 28px/1 var(--sans); cursor: pointer; }
.pop .close:hover { background: var(--soft); color: var(--ink); }
@media (max-width: 480px) { .pop { padding: 32px 20px 24px; } .pop pre { padding: 20px; padding-top: 56px; } }
.code button { position: absolute; top: 14px; right: 14px; }
pre { margin: 0; padding: 30px 32px; overflow-x: auto; background: var(--soft); border-radius: 28px; color: var(--body); font-size: 14px; line-height: 1.7; }
pre b { color: var(--pink-text); font-weight: 500; }
Expand Down Expand Up @@ -308,11 +327,29 @@ <h2>How long do you have?</h2>
</section>
</div>


<div class="wrap">
<section class="one gate rise" id="agents">
<div>
<h2>Hold your agent to thirty minutes.</h2>
<p>One hook, and it cannot open a pull request you have no time to read.</p>
<p><a href="https://github.com/cribelo/cribelo/blob/main/docs/agents.md">How to set it up.</a></p>
</div>
<div class="term">
<div class="bar" aria-hidden="true"><i></i><i></i><i></i><span>~/your-repo</span></div>
<div class="cmd"><code><span class="ps">$ </span>cribelo --fail-over 30m</code></div>
<div class="out">
<p class="head">Gate: failed</p>
<p class="why">reading time 44 min, over the 30 min allowed</p>
</div>
</div>
</section>
</div>

<section class="dark">
<div class="wrap rise">
<h2>No AI. No guessing.</h2>
<p class="big">Same pull request, same answer, on every machine. Every line of the plan is true by construction, or checkable in the repository in a minute.</p>
<p class="measures">Moves. Renames. Cycles. Signatures. Clones. Fix history. Test coverage.</p>
<p class="fine">Real parsers and your git history. <code>cribelo backtest</code> replays your past changes and says how many lines a reviewer would have skipped. <a href="how-it-works.html">How it works.</a></p>
</div>
</section>
Expand All @@ -333,6 +370,7 @@ <h2>On your repo in one click.</h2>
</span>
</div>
<p>Pull requests from forks or Dependabot cannot comment on their own: <button type="submit" class="link" name="file" value="comment">add the second workflow</button> that posts for them.</p>
<p>On GitLab? <button type="button" class="link" data-open="gitlab">One line in <code>.gitlab-ci.yml</code></button>.</p>
</form>
</div>
<div class="code">
Expand All @@ -352,14 +390,26 @@ <h2>On your repo in one click.</h2>
</div>
</section>

<dialog class="pop" id="gitlab" aria-labelledby="gitlab-title">
<button type="button" class="close" aria-label="Close">&times;</button>
<h3 id="gitlab-title">Cribelo on GitLab</h3>
<p>Add this to your <code>.gitlab-ci.yml</code>. Every merge request then gets its reading plan, in the job log and as an artifact linked from the merge request.</p>
<div class="code">
<pre tabindex="0" aria-label="GitLab CI include">include:
- remote: <b>https://raw.githubusercontent.com/cribelo/cribelo/v2/ci/gitlab-ci.yml</b></pre>
<button type="button" hidden>Copy</button>
</div>
<p>Want the plan as a comment, updated on each push? Store a token with the <code>api</code> scope in a masked <code>CRIBELO_TOKEN</code> variable. A project access token with the Reporter role is best; on GitLab.com Free, use a personal access token.</p>
<p class="small">Merge requests from forks run without your variables, so their plan stays in the artifact. Budget, gates and the rest are in <a href="https://github.com/cribelo/cribelo#in-a-gitlab-merge-request">the README</a>.</p>
</dialog>

<section class="end rise">
<p>It won't find your bugs. <span>It tells you what to read.</span></p>
<div class="install"><code>curl -fsSL https://cribelo.github.io/install.sh | sh</code><button type="button" hidden>Copy</button></div>
<p class="then">Then run <code>cribelo</code> on the branch you want reviewed.</p>
</section>

<footer>
<p><strong>Moves</strong> are matched the way RefDiff does (<a href="https://doi.org/10.1109/MSR.2017.14">Silva and Valente, 2017</a>), <strong>the reading order</strong> follows <a href="https://doi.org/10.1109/ICSME.2017.28">Baum, Schneider and Bacchelli, 2017</a>. <strong>The parsers</strong>, the complexity model and the dependency graph come from <a href="https://github.com/ast-metrics/ast-metrics">AST Metrics</a>. <a href="how-it-works.html">How it works</a>, <a href="https://github.com/cribelo/cribelo/blob/main/docs/how-it-is-computed.md">every rule and weight</a>.</p>
<p>MIT license. Made by Jean-François Lépine, author of <a href="https://github.com/ast-metrics/ast-metrics">AST Metrics</a>. <em>Cribellum</em> is Latin for a small sieve.</p>
</footer>
</div>
Expand Down Expand Up @@ -659,6 +709,14 @@ <h2>On your repo in one click.</h2>
document.addEventListener('keydown', function (e) { if (e.key === 'Escape') go.classList.add('quiet'); });
go.addEventListener('mouseleave', function () { go.classList.remove('quiet'); });
go.addEventListener('focusout', function () { go.classList.remove('quiet'); });
// Popins: a native <dialog>, closed by its button, Escape or a click outside.
document.querySelectorAll('[data-open]').forEach(function (b) {
var d = document.getElementById(b.getAttribute('data-open'));
if (!d || !d.showModal) { b.closest('p').hidden = true; return; }
b.addEventListener('click', function () { d.showModal(); });
d.querySelector('.close').addEventListener('click', function () { d.close(); });
d.addEventListener('click', function (e) { if (e.target === d) d.close(); });
});
add.addEventListener('submit', function (e) {
e.preventDefault();
var repo = slug(repoIn.value), branch = branchIn.value.trim();
Expand Down
14 changes: 14 additions & 0 deletions tests/add-to-github.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ await page.fill('#repo', 'not a repo');
await page.getByRole('button', { name: 'Add to GitHub' }).click();
ok((await page.evaluate(() => window.__opened.length)) === 0, 'invalid repository opens nothing');

// The GitLab popin opens, shows the include line, and closes on Escape.
await page.reload();
const opener = page.getByRole('button', { name: 'One line in .gitlab-ci.yml' });
await opener.click();
const dialog = page.getByRole('dialog', { name: 'Cribelo on GitLab' });
ok(await dialog.isVisible(), 'GitLab popin opens');
ok((await dialog.locator('pre').textContent()).includes('remote: https://raw.githubusercontent.com/cribelo/cribelo/v2/ci/gitlab-ci.yml'), 'popin holds the include line');
await page.keyboard.press('Escape');
ok(!(await dialog.isVisible()), 'Escape closes the popin');
ok(await opener.evaluate(b => document.activeElement === b), 'focus returns to the opener');
await opener.click();
await dialog.getByRole('button', { name: 'Close' }).click();
ok(!(await dialog.isVisible()), 'the close button closes the popin');

console.log(`ok add-to-github, ${checks} checks`);
await browser.close();
server.close();
Loading