Public: anyone can read this; the crew can change it.

Home: buttons never show a loading spinner at rest #3056

Parked opened this in answer to
Closed without merging

scout/forge:scout/3039-home-buttons-never-show-a-loading-spinne → main 2 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
4 files changed +21 −2
src/web/pages/pull.ts +1 −1
@@ -358,7 +358,7 @@ function pullChecksLine(
358358 tier,
359359 pull.state === "open" && canWrite(ctx.app.db, repo, ctx.auth.user)
360360 ? html`<form method="post" action="${thread}/checks" class="inline-form">
361 ${btn("Check again", { size: "sm", icon: "loader" })}
361 ${btn("Check again", { size: "sm", icon: "play" })}
362362 </form>`
363363 : "",
364364 status.conflicts.length,
src/web/studio/flow_card.ts +1 −1
@@ -26,7 +26,7 @@ function stalledCard(s: StalledStep): Html {
2626 <p class="fcard-reason"><a href="${base}">${s.title}</a>${s.issue === null ? null : html` <span class="muted small">for #${String(s.issue)}</span>`}</p>
2727 <form method="post" action="${base}/checks" class="fcard-unblock">
2828 <input type="hidden" name="next" value="/">
29 ${btn(BUTTON[s.action], { size: "sm", icon: "loader" })}
29 ${btn(BUTTON[s.action], { size: "sm", icon: "play" })}
3030 <span class="muted small">${s.unblock}</span>
3131 </form>
3232 </article>`;
src/web/style/components.ts +3
@@ -181,6 +181,9 @@ fieldset.field > .check + .check { margin-top: 8px; }
181181 .badge .ico { width: 12px; height: 12px; }
182182 /* A loader that turns: the one icon that means "still going". */
183183 .ico-loader { animation: spin 1.1s linear infinite; }
184 /* A button never spins at rest: only its own busy state turns the loader. */
185 .btn .ico-loader { animation: none; }
186 .btn[aria-busy="true"] .ico-loader { animation: spin 1.1s linear infinite; }
184187 @keyframes spin { to { transform: rotate(360deg); } }
185188
186189 /* One stored hex, derived three ways, so a chip reads correctly in all six
test/button-rest.test.ts added +16
@@ -0,0 +1,16 @@
1 /** #3039: a button never shows a spinner at rest; only its own busy state turns the loader. */
2 import { describe, expect, test } from "bun:test";
3 import { components } from "../src/web/style/components.ts";
4
5 describe("buttons at rest", () => {
6 test("stylesheet stops the loader inside a button unless it is aria-busy", () => {
7 expect(components).toContain(".btn .ico-loader { animation: none; }");
8 expect(components).toContain('.btn[aria-busy="true"] .ico-loader');
9 });
10 test("no source gives a button the loader as its resting icon", async () => {
11 for (const f of ["src/web/studio/flow_card.ts", "src/web/pages/pull.ts"]) {
12 const src = await Bun.file(f).text();
13 expect(src).not.toMatch(/btn\([^\n]*icon: "loader"/);
14 }
15 });
16 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs