Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

feat(view): the view's styles live in their own file [N26]

Corey Olson7d2c2fe68805
diff --git a/src/cockpit.js b/src/cockpit.js
index d2570993..7285a4b1 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -26,260 +26,20 @@ function lifecycle() {
* item lifecycle from src/machine.js with this board's counts. Under 900px wide the sidebar folds
* into a top bar. Forms post actions that the server runs as CLI commands (N27), so the page never
* decides a rule itself, and every field a person types in sits outside what the refresh rebuilds.
+ * Its styles are src/view.css, which it links with the session's secret as every request carries it;
+ * the page itself holds none, so its policy can refuse inline styles.
*
+ * @param {string} [key] - The session's secret.
* @returns {string}
*/
-export function cockpitPage() {
+export function cockpitPage(key = '') {
return `<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pullboard</title>
-<style>
-:root {
- color-scheme: light dark;
- --ground: light-dark(#e9eceb, #0c110f); --surface: light-dark(#fdfefd, #121815); --surface-2: light-dark(#f2f4f1, #171f1b); --line: light-dark(#d3d9d5, #232e29); --line-strong: light-dark(#bcc5bf, #34423b);
- --ink: light-dark(#121a17, #e7ece9); --ink-muted: light-dark(#4c5852, #9caba3); --ink-faint: light-dark(#7a887f, #6a776f);
- --accent: light-dark(#08915f, #34d89e); --accent-strong: light-dark(#067049, #4ee3ac); --accent-soft: light-dark(#dcefe6, #10231c); --on-accent: light-dark(#f4fbf7, #05201a);
- --warn: light-dark(#a2660f, #e4b25a); --warn-soft: light-dark(#f2e6cf, #241d10); --reject: light-dark(#bd4437, #f0776b); --reject-soft: light-dark(#f4e0dc, #271613);
- --blue: light-dark(#3f6f9e, #6ba7d6); --blue-soft: light-dark(#e1eaf3, #142231); --violet: light-dark(#6b4fc8, #ab9cf2); --violet-soft: light-dark(#ebe6fa, #1e1934);
- --shade: light-dark(rgba(18,26,23,.05), rgba(0,0,0,.4)); --shade-far: light-dark(rgba(18,26,23,.28), rgba(0,0,0,.7));
- --shadow: 0 1px 2px var(--shade), 0 12px 34px -18px var(--shade-far);
- --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
- --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
- --top: 56px; --side-w: 236px; --agents-w: clamp(240px, 30%, 306px);
-}
-:root[data-theme="light"] { color-scheme: light; }
-:root[data-theme="dark"] { color-scheme: dark; }
-@media (max-width: 1100px) { :root { --side-w: 208px; } }
-* { box-sizing: border-box; }
-body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 var(--sans); }
-button, input, select, textarea { font: inherit; color: inherit; }
-[hidden] { display: none !important; }
-:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
-
-.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
-.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0 10px 16px; background: var(--surface); border-right: 1px solid var(--line); }
-.side-top { display: flex; align-items: center; gap: 10px; height: var(--top); margin: 0 -10px 6px; padding: 0 16px; border-bottom: 1px solid var(--line); }
-.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
-.brand svg { width: 22px; height: 22px; flex: none; }
-.switch-btn { display: none; align-items: center; gap: 8px; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-weight: 600; }
-.switch-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.switch-btn small { color: var(--ink-faint); font-weight: 400; }
-.theme-btn { flex: none; margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-faint); cursor: pointer; }
-.theme-btn:hover { color: var(--ink); background: var(--surface-2); }
-.theme-btn svg { display: none; width: 16px; height: 16px; }
-:root:not([data-theme]) .theme-btn .sys, :root[data-theme="light"] .theme-btn .sun, :root[data-theme="dark"] .theme-btn .moon { display: block; }
-.side-body { display: grid; gap: 2px; align-content: start; }
-.label { font: 600 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); padding: 8px 8px 6px; }
-.proj { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; align-items: center; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 7px 8px; cursor: pointer; }
-.proj:hover { background: var(--surface-2); }
-.proj.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
-.proj .pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.proj small { grid-column: 1 / -1; color: var(--ink-faint); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
-.proj small.bad { color: var(--reject); }
-.need { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font: 700 11.5px/1.5 var(--mono); text-align: center; }
-.products { padding-top: 6px; }
-.prod { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 6px 8px 8px; font-size: 13px; }
-.prod p { margin: 0; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
-.prod p b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.prod p span { color: var(--ink-faint); font: 11.5px var(--mono); white-space: nowrap; }
-.prod .bar { height: 6px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
-.prod .bar i { display: block; height: 100%; background: var(--accent); }
-.prod small { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--ink-muted); font-size: 12px; }
-.prod small span { display: inline-flex; align-items: center; gap: 5px; }
-.prod small .dot { display: inline-block; width: 7px; height: 7px; }
-.body { min-width: 0; }
-.top { position: sticky; top: 0; z-index: 10; min-height: var(--top); display: flex; align-items: stretch; gap: 12px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
-.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
-.tab { border: 0; background: none; padding: 6px 10px; border-radius: 6px; align-self: center; cursor: pointer; color: var(--ink-muted); white-space: nowrap; }
-.tab:hover { color: var(--ink); }
-.tab.on { color: var(--ink); background: var(--surface-2); font-weight: 600; }
-.tab b { font: 600 11px var(--mono); color: var(--ink-faint); margin-left: 4px; }
-.live { margin-left: auto; align-self: center; font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
-.switching main, .switching .products { opacity: .45; transition: opacity .12s; }
-
-main { padding: 16px 18px 28px; }
-.first { display: none; max-width: 520px; margin: 10vh auto 0; padding: 22px 24px; }
-.first h2 { margin: 0 0 6px; font-size: 18px; }
-.first p { margin: 0; color: var(--ink-muted); }
-.first code { font: 600 13px var(--mono); color: var(--ink); }
-.boardless .first { display: block; }
-.loading .top, .loading [data-pane], .boardless .top, .boardless [data-pane] { display: none; }
-.two { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 42%, 600px); gap: 16px; align-items: start; }
-.two.narrow { grid-template-columns: minmax(0, 1fr) var(--agents-w); }
-@media (max-width: 900px) {
- .shell { display: block; }
- .side { position: static; height: auto; overflow: visible; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
- .side-top { height: auto; margin: 0; padding: 0; border: 0; }
- .brand span { display: none; }
- .switch-btn { display: flex; }
- .side-body { display: none; padding-top: 6px; }
- .side.open .side-body { display: grid; }
- .top { padding: 0 6px; }
- .tab { padding: 6px; }
- .live { display: none; }
- main { padding: 12px 10px 24px; }
- .two, .two.narrow { grid-template-columns: minmax(0, 1fr); }
-}
-@media (width < 480px) {
- .tabs { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
- .tab { display: grid; grid-template-rows: auto 13px; justify-items: center; align-content: center; padding: 7px 2px 5px; font-size: 13.5px; }
- .tab b { margin: 0; line-height: 13px; }
-}
-.primary { display: grid; gap: 12px; min-width: 0; }
-.card-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
-.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; }
-.toolbar input { flex: 1 1 96px; }
-input, select, textarea { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 9px; min-width: 0; }
-input:disabled { background: var(--surface-2); color: var(--ink-muted); }
-.go { border: 0; background: var(--ink); color: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }
-.go:hover { background: var(--accent-strong); color: var(--on-accent); }
-.ghost { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
-
-.needs-you { background: color-mix(in srgb, var(--warn) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 38%, var(--line)); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; display: grid; gap: 4px; }
-.needs-you .head { font-weight: 700; display: flex; gap: 8px; align-items: center; }
-.needs-you .head i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
-.ny { display: grid; grid-template-columns: auto minmax(5em, 1fr) minmax(0, max-content); gap: 10px; align-items: baseline; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: 8px; cursor: pointer; width: 100%; }
-.ny:hover { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
-.ny code { font: 600 12px var(--mono); }
-.ny span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); }
-.ny em { font-style: normal; color: var(--warn); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
-@media (width < 480px) { .ny { grid-template-columns: auto minmax(0, 1fr); row-gap: 1px; } .ny em { grid-column: 2; } }
-.ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 6px 4px; }
-.ask p { margin: 0; overflow-wrap: anywhere; }
-.ask small { color: var(--ink-muted); }
-.ask button { grid-row: 1 / span 2; grid-column: 2; }
-.answering { flex: 1 1 100%; display: flex; gap: 10px; align-items: baseline; justify-content: space-between; margin: 0; font-size: 13px; color: var(--ink-muted); }
-.answering > span { min-width: 0; overflow-wrap: anywhere; }
-.mark { font: 600 11px var(--mono); padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); }
-.mark.ask { display: inline; background: var(--warn-soft); color: var(--warn); }
-.ev { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; width: fit-content; max-width: 100%; margin-top: 4px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 12px; color: var(--ink-muted); }
-.ev b { font: 600 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
-.ev code { font: 12px var(--mono); }
-
-.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px; }
-.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 9px; cursor: pointer; font-size: 13px; }
-.chips button.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
-.chips button b { font: 600 11px var(--mono); color: var(--ink-faint); margin-left: 4px; }
-.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
-.seg button { border: 0; background: none; padding: 4px 8px; border-radius: 6px; color: var(--ink-muted); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
-.seg button:hover { color: var(--ink); }
-.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(18, 26, 23, .08); }
-.seg button b { font: 600 11px var(--mono); color: var(--ink-faint); margin-left: 5px; }
-
-.chain { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; }
-.row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 9px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
-.row:hover { background: var(--surface-2); }
-.row.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
-.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
-.dot.building { background: var(--blue); } .dot.verify { background: var(--warn); } .dot.back { background: var(--reject); } .dot.verified { background: var(--accent); }
-.row .t { font-weight: 600; overflow-wrap: anywhere; }
-.row .t span { color: var(--ink-faint); font: 500 12px var(--mono); margin-right: 5px; }
-.meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--ink-muted); font-size: 12px; margin-top: 2px; }
-.chip { font: 600 10.5px/1 var(--mono); letter-spacing: .03em; padding: 4px 6px; border-radius: 5px; background: var(--surface-2); color: var(--ink-muted); white-space: nowrap; }
-.chip.ok { background: var(--accent-soft); color: var(--accent-strong); }
-.chip.warn { background: var(--warn-soft); color: var(--warn); }
-.chip.no { background: var(--reject-soft); color: var(--reject); }
-.chip.busy { background: var(--blue-soft); color: var(--blue); }
-.chip.free { background: var(--violet-soft); color: var(--violet); }
-.chip.gate { background: none; color: var(--ink-muted); outline: 1px dashed var(--line-strong); outline-offset: -1px; }
-.row.gated { border-color: color-mix(in srgb, var(--reject) 40%, var(--line)); }
-.meta .gate { padding: 0 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--reject) 35%, var(--line)); }
-.meta button.ref { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
-.empty { color: var(--ink-faint); padding: 14px 10px; }
-
-.detail { position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 32px); overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
-@media (max-width: 900px) { .detail { position: static; max-height: none; } #detail { scroll-margin-top: 60px; } }
-.detail h2 { margin: 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
-.detail h2 span { color: var(--ink-faint); font: 600 13px var(--mono); margin-right: 6px; }
-.detail h3 { margin: 0 0 6px; font: 600 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
-.detail .text { white-space: pre-wrap; overflow-wrap: anywhere; }
-.detail .muted, .muted { color: var(--ink-muted); }
-.kv { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 10px; font-size: 13px; margin: 0; }
-.kv dt { color: var(--ink-faint); } .kv dd { margin: 0; overflow-wrap: anywhere; }
-.kv code, .detail code { font: 12px var(--mono); }
-.verdict { display: grid; gap: 3px; margin-bottom: 10px; }
-.verdict.yes b { color: var(--accent-strong); } .verdict.no b { color: var(--reject); }
-.verdict .by { font-size: 12px; color: var(--ink-faint); }
-.verdict .note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
-.sentback { border: 1px solid color-mix(in srgb, var(--reject) 40%, var(--line)); background: color-mix(in srgb, var(--reject) 6%, var(--surface)); border-radius: 10px; padding: 10px 12px; }
-.sentback h3 { color: var(--reject); }
-.sentback .verdict { margin: 0; }
-.meta .why { flex-basis: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--reject); }
-.tl { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
-.tl li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; padding: 0 0 12px 20px; --c: var(--line-strong); }
-.tl li::before { content: ''; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--c); background: var(--c); }
-.tl li.tl-quiet::before { background: var(--surface); }
-.tl li::after { content: ''; position: absolute; left: 4px; top: 16px; bottom: 0; width: 2px; border-radius: 2px; background: var(--c); opacity: .55; }
-.tl li:last-child { padding-bottom: 0; } .tl li:last-child::after { display: none; }
-.tl .tl-claimed { --c: var(--blue); } .tl .tl-submitted { --c: var(--warn); } .tl .tl-verified { --c: var(--accent); } .tl .tl-withdrawn { --c: var(--ink-faint); } .tl .tl-back { --c: var(--reject); }
-.tl b { font-weight: 600; }
-.tl small { grid-column: 2; color: var(--ink-faint); font-size: 12px; }
-.tl time, .feed time { color: var(--ink-faint); font: 12px var(--mono); }
-.rowref { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; font-size: 13px; padding: 3px 0; }
-.rowref code { font-weight: 600; }
-.links { display: flex; flex-wrap: wrap; gap: 6px; }
-.links button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: 12.5px; }
-
-.panel-form { display: grid; gap: 10px; }
-.panel-form label, .inline label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-muted); }
-.panel-form input, .panel-form select, .panel-form textarea, .inline input, .inline select { width: 100%; }
-.panel-form textarea { resize: vertical; }
-.actions { display: flex; gap: 8px; } .actions .go { flex: 1; }
-.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding: 10px; }
-.inline label { flex: 1 1 150px; min-width: 0; }
-.feed { padding: 6px 10px 10px; display: grid; }
-.feed > div { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
-.feed > .empty { display: block; }
-.feed > div:first-child, .feed > .day + div { border-top: 0; }
-.feed .day { margin: 0; padding: 12px 0 4px; font: 600 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
-.feed .day:first-child { padding-top: 6px; }
-.feed button.ref { border: 0; background: none; padding: 0; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
-.code { display: block; margin: 6px 0 2px; padding: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font: 12px/1.55 var(--mono); white-space: pre; overflow-x: auto; overflow-wrap: normal; }
-.code > span { display: block; padding-right: 12px; }
-.code i { display: inline-block; min-width: 3.2em; padding: 0 10px 0 6px; text-align: right; font-style: normal; color: var(--ink-faint); user-select: none; }
-.code .more, .code.no { padding: 2px 10px; white-space: normal; color: var(--ink-muted); }
-.code.no { color: var(--reject); }
-.feed .act { display: flex; gap: 0 5px; align-items: baseline; min-width: 0; }
-.feed .act .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); }
-.agent { display: grid; gap: 2px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
-.agent:first-child { border-top: 0; }
-.agent small { color: var(--ink-faint); font: 11.5px var(--mono); overflow-wrap: anywhere; }
-.agent > div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
-.agent > div > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.agent time { margin-left: auto; color: var(--ink-faint); font: 12px var(--mono); }
-.agent button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; }
-.agent button > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.agent button:hover > span:first-child { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
-.lane { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
-.lane:first-child { border-top: 0; }
-.rows { padding: 4px 10px 10px; }
-.rows h4 { margin: 12px 0 4px; font-size: 12.5px; color: var(--ink-muted); }
-.srow { display: grid; grid-template-columns: 4.4em 6.2em minmax(0, 1fr); gap: 8px; padding: 6px 4px; border-top: 1px solid var(--line); align-items: baseline; cursor: pointer; border-radius: 6px; }
-.srow:hover { background: var(--surface-2); }
-.srow.on { background: var(--accent-soft); }
-.srow code { font: 600 12px var(--mono); }
-@media (width < 480px) { .srow { grid-template-columns: auto minmax(0, 1fr); } .srow > span:last-child { grid-column: 1 / -1; } }
-.flow { margin: 0 0 12px; padding: 10px 12px 8px; overflow-x: auto; }
-.flow svg { display: block; width: 100%; min-width: 680px; max-width: 900px; height: auto; margin: 0 auto; }
-.flow figcaption { color: var(--ink-faint); font-size: 12px; padding: 2px 2px 0; }
-.flow .box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.3; }
-.flow .s-claimed .box { stroke: var(--blue); } .flow .s-submitted .box { stroke: var(--warn); }
-.flow .s-verified .box { stroke: var(--accent); fill: var(--accent-soft); } .flow .s-withdrawn .box { stroke-dasharray: 4 3; }
-.flow .name { font: 600 11px var(--mono); letter-spacing: .06em; fill: var(--ink-faint); }
-.flow .n { font: 800 22px var(--sans); fill: var(--ink); }
-.flow .sub { font: 12px var(--sans); fill: var(--reject); }
-.flow .edge { fill: none; stroke: var(--line-strong); stroke-width: 1.4; }
-.flow .edge.no { stroke: var(--reject); }
-.flow marker path { fill: var(--line-strong); } .flow marker.no path { fill: var(--reject); }
-.flow .tag { font: 12px var(--sans); fill: var(--ink-muted); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
-.flow .tag.idle { fill: var(--ink-faint); } .flow .tag.no { fill: var(--reject); }
-.flow g:hover .box, .flow g:hover .edge { stroke-width: 2.4; }
-.console { position: fixed; right: 16px; bottom: 16px; width: min(560px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 38vh; overflow: auto; z-index: 20; cursor: pointer; }
-.console.ok { border-color: var(--accent); } .console.no { border-color: var(--reject); }
-</style>
+<link rel="stylesheet" href="/view.css?k=${encodeURIComponent(key)}">
</head>
<body class="loading">
<div class="shell">
@@ -333,7 +93,7 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }
<section data-pane="shouts" class="two narrow">
<div class="primary">
<section class="needs-you" id="decisions" aria-label="Decisions needed" hidden></section>
- <form id="shout-form" class="card-panel inline"><p class="answering" id="answering" hidden><span>Answering <b id="answering-who"></b>: <span id="answering-q"></span></span><button class="ghost" id="answer-cancel" type="button">Cancel</button></p><label>To<input id="shout-to" list="shout-targets" required placeholder="all, a lane or an agent"></label><datalist id="shout-targets"></datalist><label style="flex:4 1 260px">Message<input id="shout-text" required></label><button class="go" id="shout-send" type="submit">Shout</button></form>
+ <form id="shout-form" class="card-panel inline"><p class="answering" id="answering" hidden><span>Answering <b id="answering-who"></b>: <span id="answering-q"></span></span><button class="ghost" id="answer-cancel" type="button">Cancel</button></p><label>To<input id="shout-to" list="shout-targets" required placeholder="all, a lane or an agent"></label><datalist id="shout-targets"></datalist><label class="wide">Message<input id="shout-text" required></label><button class="go" id="shout-send" type="submit">Shout</button></form>
<div class="card-panel feed" id="feed"></div>
</div>
<aside class="card-panel detail" aria-label="Agents and lanes">
@@ -634,7 +394,7 @@ function render() {
// Each product's progress (N28): the rows an accepted item cites, and its items by state.
$('prod-list').innerHTML = p.products.map((x) => {
const states = [['open', '', x.items.open], ['building', 'building', x.items.claimed], ['to verify', 'verify', x.items.submitted], ['verified', 'verified', x.items.verified]].filter(([, , n]) => n);
- return '<div class="prod" title="' + x.rows + ' rows in force, ' + x.approved + ' approved, ' + x.proven + ' cited by accepted items"><p><b>' + esc(x.name) + '</b><span>' + x.proven + '/' + x.rows + ' rows met</span></p><div class="bar"><i style="width:' + (x.rows ? Math.round((100 * x.proven) / x.rows) : 0) + '%"></i></div>'
+ return '<div class="prod" title="' + x.rows + ' rows in force, ' + x.approved + ' approved, ' + x.proven + ' cited by accepted items"><p><b>' + esc(x.name) + '</b><span>' + x.proven + '/' + x.rows + ' rows met</span></p><svg class="bar" viewBox="0 0 100 1" preserveAspectRatio="none" aria-hidden="true"><rect width="' + (x.rows ? Math.round((100 * x.proven) / x.rows) : 0) + '" height="1"/></svg>'
+ (states.length ? '<small>' + states.map(([label, dot, n]) => '<span><i class="dot ' + dot + '"></i>' + n + ' ' + label + '</span>').join('') + '</small>' : '') + '</div>';
}).join('');
const items = p.items.filter((i) => i.status !== 'withdrawn');
@@ -655,7 +415,7 @@ function render() {
];
const drafts = p.spec.filter((r) => r.status === 'draft').length;
$('needs').hidden = !needs.length && !drafts;
- $('needs').innerHTML = '<div class="head"><i></i>Needs you</div>' + needs.slice(0, 6).map(([target, ref, text, what, at]) => '<button class="ny" data-go="' + esc(target) + '" type="button"><code>' + esc(ref) + '</code><span>' + esc(text) + '</span><em>' + esc(what) + (at ? ', ' + age(at) : '') + ' →</em></button>').join('') + (needs.length > 6 ? '<div class="muted" style="padding:2px 4px">and ' + (needs.length - 6) + ' more</div>' : '') + (drafts ? '<button class="ny" data-go="tab:spec" type="button"><code>' + drafts + '</code><span>draft spec rows to approve or drop</span><em>review →</em></button>' : '');
+ $('needs').innerHTML = '<div class="head"><i></i>Needs you</div>' + needs.slice(0, 6).map(([target, ref, text, what, at]) => '<button class="ny" data-go="' + esc(target) + '" type="button"><code>' + esc(ref) + '</code><span>' + esc(text) + '</span><em>' + esc(what) + (at ? ', ' + age(at) : '') + ' →</em></button>').join('') + (needs.length > 6 ? '<div class="muted more">and ' + (needs.length - 6) + ' more</div>' : '') + (drafts ? '<button class="ny" data-go="tab:spec" type="button"><code>' + drafts + '</code><span>draft spec rows to approve or drop</span><em>review →</em></button>' : '');
const lanes = p.lanes;
const working = lanes.filter((l) => l !== 'coordinator');
@@ -708,7 +468,7 @@ function render() {
// Why it came back is the first thing the person reads; the verdicts before it stay below.
const back = rejected(item);
const earlier = back ? item.verdicts.slice(0, -1) : item.verdicts;
- $('detail').innerHTML = '<div style="display:grid;gap:14px"><div><h2><span>#' + item.id + '</span>' + esc(item.title) + '</h2><div class="meta" style="margin-top:6px">' + chip(s) + '<span class="chip">' + esc(item.lane) + '</span><span class="chip">' + esc(item.route) + '</span></div></div>'
+ $('detail').innerHTML = '<div class="stack"><div><h2><span>#' + item.id + '</span>' + esc(item.title) + '</h2><div class="meta">' + chip(s) + '<span class="chip">' + esc(item.lane) + '</span><span class="chip">' + esc(item.route) + '</span></div></div>'
+ (back ? '<div class="sentback"><h3>Sent back' + (s === 'building' ? ', being reworked' : s === 'verify' ? ', resubmitted' : s === 'withdrawn' ? ', then withdrawn' : '') + '</h3>' + verdictHtml(item.verdict) + '</div>' : '')
+ (item.criterion ? '<div><h3>Criterion</h3><div class="text">' + esc(item.criterion) + '</div></div>' : '')
+ (cited.length ? '<div><h3>Spec rows it serves</h3>' + cited.map((r) => '<div class="rowref"><code>' + esc(r.id) + '</code><div>' + esc(r.text) + ' <span class="chip ' + tone(r.status) + '">' + esc(r.status) + '</span></div></div>').join('') + '</div>' : '')
@@ -767,7 +527,7 @@ function render() {
}).join('') : '<div class="empty">' + (rows.length ? 'No rows match.' : kind === 'spec' ? 'No spec rows yet. Each requirement is one row in SPEC.md, such as G1 [draft, must] and a line; write them, or ask an agent to, and they show up here.' : 'No practice rows yet: they live in PRACTICE.md.') + '</div>';
const row = rows.find((r) => r.id === view.row[kind]);
const citing = row ? p.items.filter((i) => i.specs.includes(row.id)) : [];
- $(kind + '-detail').innerHTML = row ? '<div style="display:grid;gap:12px"><h2><span>' + esc(row.id) + '</span>' + esc(row.text) + '</h2><div class="meta"><span class="chip ' + tone(row.status) + '">' + esc(row.status) + '</span>' + (row.tier ? '<span class="chip">' + esc(row.tier) + '</span>' : '') + '</div><dl class="kv"><dt>section</dt><dd>' + esc(row.section) + '</dd>' + (row.gate ? '<dt>gate</dt><dd>' + esc(row.gate) + '</dd>' : '') + (row.serves && row.serves.length ? '<dt>serves</dt><dd>' + esc(row.serves.join(', ')) + '</dd>' : '') + '</dl><div><h3>Items that cite it</h3>' + (citing.length ? '<div class="links">' + citing.map((i) => '<button data-go="item:' + i.id + '" type="button">#' + i.id + ' ' + esc(i.title) + '</button>').join('') + '</div>' : '<div class="muted">None yet.</div>') + '</div><div class="muted">Rows change in ' + (kind === 'spec' ? 'SPEC.md' : 'PRACTICE.md') + ', and only you approve them.</div></div>' : '<div class="empty">Pick a row to see it, and the items that cite it.</div>';
+ $(kind + '-detail').innerHTML = row ? '<div class="stack tight"><h2><span>' + esc(row.id) + '</span>' + esc(row.text) + '</h2><div class="meta"><span class="chip ' + tone(row.status) + '">' + esc(row.status) + '</span>' + (row.tier ? '<span class="chip">' + esc(row.tier) + '</span>' : '') + '</div><dl class="kv"><dt>section</dt><dd>' + esc(row.section) + '</dd>' + (row.gate ? '<dt>gate</dt><dd>' + esc(row.gate) + '</dd>' : '') + (row.serves && row.serves.length ? '<dt>serves</dt><dd>' + esc(row.serves.join(', ')) + '</dd>' : '') + '</dl><div><h3>Items that cite it</h3>' + (citing.length ? '<div class="links">' + citing.map((i) => '<button data-go="item:' + i.id + '" type="button">#' + i.id + ' ' + esc(i.title) + '</button>').join('') + '</div>' : '<div class="muted">None yet.</div>') + '</div><div class="muted">Rows change in ' + (kind === 'spec' ? 'SPEC.md' : 'PRACTICE.md') + ', and only you approve them.</div></div>' : '<div class="empty">Pick a row to see it, and the items that cite it.</div>';
}
$('flow').innerHTML = flowSvg(p);
diff --git a/src/serve.js b/src/serve.js
index d2dda6f2..845b0bc1 100644
--- a/src/serve.js
+++ b/src/serve.js
@@ -9,6 +9,7 @@
*/
import { spawn, spawnSync } from 'node:child_process';
import { randomBytes, timingSafeEqual } from 'node:crypto';
+import { readFileSync } from 'node:fs';
import { createServer } from 'node:http';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -22,6 +23,8 @@ import { Refused } from './refused.js';
import { loadSpec } from './spec.js';
const BIN = fileURLToPath(new URL('../bin/pullboard.js', import.meta.url));
+/** The page's styles (N26), read once: the page links them, so it needs no inline style. */
+const VIEW_CSS = readFileSync(new URL('./view.css', import.meta.url), 'utf8');
export const LOOPBACK = '127.0.0.1';
/**
@@ -235,7 +238,7 @@ export function serveView({ port = 0, secret = randomBytes(18).toString('base64u
'cache-control': 'no-store',
'referrer-policy': 'no-referrer',
'x-content-type-options': 'nosniff',
- 'content-security-policy': "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; connect-src 'self'; img-src 'self' data:; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",
+ 'content-security-policy': "default-src 'none'; script-src 'unsafe-inline'; style-src 'self'; connect-src 'self'; img-src 'self' data:; base-uri 'none'; form-action 'none'; frame-ancestors 'none'",
});
res.end(body);
};
@@ -253,7 +256,8 @@ export function serveView({ port = 0, secret = randomBytes(18).toString('base64u
const isOwnHost = req.headers.host === `${LOOPBACK}:${bound}` || req.headers.host === `localhost:${bound}`;
if (!isOwnHost || given.length !== key.length || !timingSafeEqual(given, key)) return json(res, 403, { error: 'this view needs its own address and secret: open the link pullboard view printed' });
try {
- if (req.method === 'GET' && url.pathname === '/') return reply(res, 200, 'text/html; charset=utf-8', cockpitPage());
+ if (req.method === 'GET' && url.pathname === '/') return reply(res, 200, 'text/html; charset=utf-8', cockpitPage(secret));
+ if (req.method === 'GET' && url.pathname === '/view.css') return reply(res, 200, 'text/css; charset=utf-8', VIEW_CSS);
if (req.method === 'GET' && url.pathname === '/api/state') {
const projects = listProjects().map(summary);
const root = url.searchParams.get('root');
diff --git a/src/view.css b/src/view.css
new file mode 100644
index 00000000..d7e111b0
--- /dev/null
+++ b/src/view.css
@@ -0,0 +1,251 @@
+/*
+ * The styles of `pullboard view` (N26), served at /view.css behind the view's secret. Every colour is
+ * a token holding a light and a dark value; the theme button only picks which one the page shows.
+ */
+:root {
+ color-scheme: light dark;
+ --ground: light-dark(#e9eceb, #0c110f); --surface: light-dark(#fdfefd, #121815); --surface-2: light-dark(#f2f4f1, #171f1b); --line: light-dark(#d3d9d5, #232e29); --line-strong: light-dark(#bcc5bf, #34423b);
+ --ink: light-dark(#121a17, #e7ece9); --ink-muted: light-dark(#4c5852, #9caba3); --ink-faint: light-dark(#7a887f, #6a776f);
+ --accent: light-dark(#08915f, #34d89e); --accent-strong: light-dark(#067049, #4ee3ac); --accent-soft: light-dark(#dcefe6, #10231c); --on-accent: light-dark(#f4fbf7, #05201a);
+ --warn: light-dark(#a2660f, #e4b25a); --warn-soft: light-dark(#f2e6cf, #241d10); --reject: light-dark(#bd4437, #f0776b); --reject-soft: light-dark(#f4e0dc, #271613);
+ --blue: light-dark(#3f6f9e, #6ba7d6); --blue-soft: light-dark(#e1eaf3, #142231); --violet: light-dark(#6b4fc8, #ab9cf2); --violet-soft: light-dark(#ebe6fa, #1e1934);
+ --shade: light-dark(rgba(18,26,23,.05), rgba(0,0,0,.4)); --shade-far: light-dark(rgba(18,26,23,.28), rgba(0,0,0,.7));
+ --shadow: 0 1px 2px var(--shade), 0 12px 34px -18px var(--shade-far);
+ --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+ --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
+ --top: 56px; --side-w: 236px; --agents-w: clamp(240px, 30%, 306px);
+}
+:root[data-theme="light"] { color-scheme: light; }
+:root[data-theme="dark"] { color-scheme: dark; }
+@media (max-width: 1100px) { :root { --side-w: 208px; } }
+* { box-sizing: border-box; }
+body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 var(--sans); }
+button, input, select, textarea { font: inherit; color: inherit; }
+[hidden] { display: none !important; }
+:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+
+.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
+.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0 10px 16px; background: var(--surface); border-right: 1px solid var(--line); }
+.side-top { display: flex; align-items: center; gap: 10px; height: var(--top); margin: 0 -10px 6px; padding: 0 16px; border-bottom: 1px solid var(--line); }
+.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
+.brand svg { width: 22px; height: 22px; flex: none; }
+.switch-btn { display: none; align-items: center; gap: 8px; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-weight: 600; }
+.switch-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.switch-btn small { color: var(--ink-faint); font-weight: 400; }
+.theme-btn { flex: none; margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-faint); cursor: pointer; }
+.theme-btn:hover { color: var(--ink); background: var(--surface-2); }
+.theme-btn svg { display: none; width: 16px; height: 16px; }
+:root:not([data-theme]) .theme-btn .sys, :root[data-theme="light"] .theme-btn .sun, :root[data-theme="dark"] .theme-btn .moon { display: block; }
+.side-body { display: grid; gap: 2px; align-content: start; }
+.label { font: 600 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); padding: 8px 8px 6px; }
+.proj { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; align-items: center; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 7px 8px; cursor: pointer; }
+.proj:hover { background: var(--surface-2); }
+.proj.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
+.proj .pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.proj small { grid-column: 1 / -1; color: var(--ink-faint); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
+.proj small.bad { color: var(--reject); }
+.need { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font: 700 11.5px/1.5 var(--mono); text-align: center; }
+.products { padding-top: 6px; }
+.prod { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 6px 8px 8px; font-size: 13px; }
+.prod p { margin: 0; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
+.prod p b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.prod p span { color: var(--ink-faint); font: 11.5px var(--mono); white-space: nowrap; }
+.prod .bar { display: block; width: 100%; height: 6px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
+.prod .bar rect { fill: var(--accent); }
+.prod small { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--ink-muted); font-size: 12px; }
+.prod small span { display: inline-flex; align-items: center; gap: 5px; }
+.prod small .dot { display: inline-block; width: 7px; height: 7px; }
+.body { min-width: 0; }
+.top { position: sticky; top: 0; z-index: 10; min-height: var(--top); display: flex; align-items: stretch; gap: 12px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
+.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
+.tab { border: 0; background: none; padding: 6px 10px; border-radius: 6px; align-self: center; cursor: pointer; color: var(--ink-muted); white-space: nowrap; }
+.tab:hover { color: var(--ink); }
+.tab.on { color: var(--ink); background: var(--surface-2); font-weight: 600; }
+.tab b { font: 600 11px var(--mono); color: var(--ink-faint); margin-left: 4px; }
+.live { margin-left: auto; align-self: center; font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
+.switching main, .switching .products { opacity: .45; transition: opacity .12s; }
+
+main { padding: 16px 18px 28px; }
+.first { display: none; max-width: 520px; margin: 10vh auto 0; padding: 22px 24px; }
+.first h2 { margin: 0 0 6px; font-size: 18px; }
+.first p { margin: 0; color: var(--ink-muted); }
+.first code { font: 600 13px var(--mono); color: var(--ink); }
+.boardless .first { display: block; }
+.loading .top, .loading [data-pane], .boardless .top, .boardless [data-pane] { display: none; }
+.two { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 42%, 600px); gap: 16px; align-items: start; }
+.two.narrow { grid-template-columns: minmax(0, 1fr) var(--agents-w); }
+@media (max-width: 900px) {
+ .shell { display: block; }
+ .side { position: static; height: auto; overflow: visible; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
+ .side-top { height: auto; margin: 0; padding: 0; border: 0; }
+ .brand span { display: none; }
+ .switch-btn { display: flex; }
+ .side-body { display: none; padding-top: 6px; }
+ .side.open .side-body { display: grid; }
+ .top { padding: 0 6px; }
+ .tab { padding: 6px; }
+ .live { display: none; }
+ main { padding: 12px 10px 24px; }
+ .two, .two.narrow { grid-template-columns: minmax(0, 1fr); }
+}
+@media (width < 480px) {
+ .tabs { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
+ .tab { display: grid; grid-template-rows: auto 13px; justify-items: center; align-content: center; padding: 7px 2px 5px; font-size: 13.5px; }
+ .tab b { margin: 0; line-height: 13px; }
+}
+.primary { display: grid; gap: 12px; min-width: 0; }
+.card-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
+.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; }
+.toolbar input { flex: 1 1 96px; }
+input, select, textarea { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 9px; min-width: 0; }
+input:disabled { background: var(--surface-2); color: var(--ink-muted); }
+.go { border: 0; background: var(--ink); color: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }
+.go:hover { background: var(--accent-strong); color: var(--on-accent); }
+.ghost { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
+
+.needs-you { background: color-mix(in srgb, var(--warn) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 38%, var(--line)); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; display: grid; gap: 4px; }
+.needs-you .head { font-weight: 700; display: flex; gap: 8px; align-items: center; }
+.needs-you .head i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
+.needs-you .more { padding: 2px 4px; }
+.ny { display: grid; grid-template-columns: auto minmax(5em, 1fr) minmax(0, max-content); gap: 10px; align-items: baseline; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: 8px; cursor: pointer; width: 100%; }
+.ny:hover { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
+.ny code { font: 600 12px var(--mono); }
+.ny span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); }
+.ny em { font-style: normal; color: var(--warn); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+@media (width < 480px) { .ny { grid-template-columns: auto minmax(0, 1fr); row-gap: 1px; } .ny em { grid-column: 2; } }
+.ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 6px 4px; }
+.ask p { margin: 0; overflow-wrap: anywhere; }
+.ask small { color: var(--ink-muted); }
+.ask button { grid-row: 1 / span 2; grid-column: 2; }
+.answering { flex: 1 1 100%; display: flex; gap: 10px; align-items: baseline; justify-content: space-between; margin: 0; font-size: 13px; color: var(--ink-muted); }
+.answering > span { min-width: 0; overflow-wrap: anywhere; }
+.mark { font: 600 11px var(--mono); padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); }
+.mark.ask { display: inline; background: var(--warn-soft); color: var(--warn); }
+.ev { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; width: fit-content; max-width: 100%; margin-top: 4px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 12px; color: var(--ink-muted); }
+.ev b { font: 600 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
+.ev code { font: 12px var(--mono); }
+
+.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px; }
+.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 9px; cursor: pointer; font-size: 13px; }
+.chips button.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
+.chips button b { font: 600 11px var(--mono); color: var(--ink-faint); margin-left: 4px; }
+.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
+.seg button { border: 0; background: none; padding: 4px 8px; border-radius: 6px; color: var(--ink-muted); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
+.seg button:hover { color: var(--ink); }
+.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(18, 26, 23, .08); }
+.seg button b { font: 600 11px var(--mono); color: var(--ink-faint); margin-left: 5px; }
+
+.chain { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; }
+.row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 9px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
+.row:hover { background: var(--surface-2); }
+.row.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
+.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
+.dot.building { background: var(--blue); } .dot.verify { background: var(--warn); } .dot.back { background: var(--reject); } .dot.verified { background: var(--accent); }
+.row .t { font-weight: 600; overflow-wrap: anywhere; }
+.row .t span { color: var(--ink-faint); font: 500 12px var(--mono); margin-right: 5px; }
+.meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--ink-muted); font-size: 12px; margin-top: 2px; }
+.chip { font: 600 10.5px/1 var(--mono); letter-spacing: .03em; padding: 4px 6px; border-radius: 5px; background: var(--surface-2); color: var(--ink-muted); white-space: nowrap; }
+.chip.ok { background: var(--accent-soft); color: var(--accent-strong); }
+.chip.warn { background: var(--warn-soft); color: var(--warn); }
+.chip.no { background: var(--reject-soft); color: var(--reject); }
+.chip.busy { background: var(--blue-soft); color: var(--blue); }
+.chip.free { background: var(--violet-soft); color: var(--violet); }
+.chip.gate { background: none; color: var(--ink-muted); outline: 1px dashed var(--line-strong); outline-offset: -1px; }
+.row.gated { border-color: color-mix(in srgb, var(--reject) 40%, var(--line)); }
+.meta .gate { padding: 0 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--reject) 35%, var(--line)); }
+.meta button.ref { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
+.empty { color: var(--ink-faint); padding: 14px 10px; }
+
+.stack { display: grid; gap: 14px; }
+.stack.tight { gap: 12px; }
+.stack h2 + .meta { margin-top: 6px; }
+.detail { position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 32px); overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
+@media (max-width: 900px) { .detail { position: static; max-height: none; } #detail { scroll-margin-top: 60px; } }
+.detail h2 { margin: 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
+.detail h2 span { color: var(--ink-faint); font: 600 13px var(--mono); margin-right: 6px; }
+.detail h3 { margin: 0 0 6px; font: 600 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
+.detail .text { white-space: pre-wrap; overflow-wrap: anywhere; }
+.detail .muted, .muted { color: var(--ink-muted); }
+.kv { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 10px; font-size: 13px; margin: 0; }
+.kv dt { color: var(--ink-faint); } .kv dd { margin: 0; overflow-wrap: anywhere; }
+.kv code, .detail code { font: 12px var(--mono); }
+.verdict { display: grid; gap: 3px; margin-bottom: 10px; }
+.verdict.yes b { color: var(--accent-strong); } .verdict.no b { color: var(--reject); }
+.verdict .by { font-size: 12px; color: var(--ink-faint); }
+.verdict .note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
+.sentback { border: 1px solid color-mix(in srgb, var(--reject) 40%, var(--line)); background: color-mix(in srgb, var(--reject) 6%, var(--surface)); border-radius: 10px; padding: 10px 12px; }
+.sentback h3 { color: var(--reject); }
+.sentback .verdict { margin: 0; }
+.meta .why { flex-basis: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--reject); }
+.tl { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
+.tl li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; padding: 0 0 12px 20px; --c: var(--line-strong); }
+.tl li::before { content: ''; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--c); background: var(--c); }
+.tl li.tl-quiet::before { background: var(--surface); }
+.tl li::after { content: ''; position: absolute; left: 4px; top: 16px; bottom: 0; width: 2px; border-radius: 2px; background: var(--c); opacity: .55; }
+.tl li:last-child { padding-bottom: 0; } .tl li:last-child::after { display: none; }
+.tl .tl-claimed { --c: var(--blue); } .tl .tl-submitted { --c: var(--warn); } .tl .tl-verified { --c: var(--accent); } .tl .tl-withdrawn { --c: var(--ink-faint); } .tl .tl-back { --c: var(--reject); }
+.tl b { font-weight: 600; }
+.tl small { grid-column: 2; color: var(--ink-faint); font-size: 12px; }
+.tl time, .feed time { color: var(--ink-faint); font: 12px var(--mono); }
+.rowref { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; font-size: 13px; padding: 3px 0; }
+.rowref code { font-weight: 600; }
+.links { display: flex; flex-wrap: wrap; gap: 6px; }
+.links button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: 12.5px; }
+
+.panel-form { display: grid; gap: 10px; }
+.panel-form label, .inline label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-muted); }
+.panel-form input, .panel-form select, .panel-form textarea, .inline input, .inline select { width: 100%; }
+.panel-form textarea { resize: vertical; }
+.actions { display: flex; gap: 8px; } .actions .go { flex: 1; }
+.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding: 10px; }
+.inline label { flex: 1 1 150px; min-width: 0; }
+.inline label.wide { flex: 4 1 260px; }
+.feed { padding: 6px 10px 10px; display: grid; }
+.feed > div { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
+.feed > .empty { display: block; }
+.feed > div:first-child, .feed > .day + div { border-top: 0; }
+.feed .day { margin: 0; padding: 12px 0 4px; font: 600 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
+.feed .day:first-child { padding-top: 6px; }
+.feed button.ref { border: 0; background: none; padding: 0; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
+.code { display: block; margin: 6px 0 2px; padding: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font: 12px/1.55 var(--mono); white-space: pre; overflow-x: auto; overflow-wrap: normal; }
+.code > span { display: block; padding-right: 12px; }
+.code i { display: inline-block; min-width: 3.2em; padding: 0 10px 0 6px; text-align: right; font-style: normal; color: var(--ink-faint); user-select: none; }
+.code .more, .code.no { padding: 2px 10px; white-space: normal; color: var(--ink-muted); }
+.code.no { color: var(--reject); }
+.feed .act { display: flex; gap: 0 5px; align-items: baseline; min-width: 0; }
+.feed .act .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); }
+.agent { display: grid; gap: 2px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
+.agent:first-child { border-top: 0; }
+.agent small { color: var(--ink-faint); font: 11.5px var(--mono); overflow-wrap: anywhere; }
+.agent > div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
+.agent > div > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.agent time { margin-left: auto; color: var(--ink-faint); font: 12px var(--mono); }
+.agent button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; }
+.agent button > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.agent button:hover > span:first-child { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
+.lane { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
+.lane:first-child { border-top: 0; }
+.rows { padding: 4px 10px 10px; }
+.rows h4 { margin: 12px 0 4px; font-size: 12.5px; color: var(--ink-muted); }
+.srow { display: grid; grid-template-columns: 4.4em 6.2em minmax(0, 1fr); gap: 8px; padding: 6px 4px; border-top: 1px solid var(--line); align-items: baseline; cursor: pointer; border-radius: 6px; }
+.srow:hover { background: var(--surface-2); }
+.srow.on { background: var(--accent-soft); }
+.srow code { font: 600 12px var(--mono); }
+@media (width < 480px) { .srow { grid-template-columns: auto minmax(0, 1fr); } .srow > span:last-child { grid-column: 1 / -1; } }
+.flow { margin: 0 0 12px; padding: 10px 12px 8px; overflow-x: auto; }
+.flow svg { display: block; width: 100%; min-width: 680px; max-width: 900px; height: auto; margin: 0 auto; }
+.flow figcaption { color: var(--ink-faint); font-size: 12px; padding: 2px 2px 0; }
+.flow .box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.3; }
+.flow .s-claimed .box { stroke: var(--blue); } .flow .s-submitted .box { stroke: var(--warn); }
+.flow .s-verified .box { stroke: var(--accent); fill: var(--accent-soft); } .flow .s-withdrawn .box { stroke-dasharray: 4 3; }
+.flow .name { font: 600 11px var(--mono); letter-spacing: .06em; fill: var(--ink-faint); }
+.flow .n { font: 800 22px var(--sans); fill: var(--ink); }
+.flow .sub { font: 12px var(--sans); fill: var(--reject); }
+.flow .edge { fill: none; stroke: var(--line-strong); stroke-width: 1.4; }
+.flow .edge.no { stroke: var(--reject); }
+.flow marker path { fill: var(--line-strong); } .flow marker.no path { fill: var(--reject); }
+.flow .tag { font: 12px var(--sans); fill: var(--ink-muted); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
+.flow .tag.idle { fill: var(--ink-faint); } .flow .tag.no { fill: var(--reject); }
+.flow g:hover .box, .flow g:hover .edge { stroke-width: 2.4; }
+.console { position: fixed; right: 16px; bottom: 16px; width: min(560px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 38vh; overflow: auto; z-index: 20; cursor: pointer; }
+.console.ok { border-color: var(--accent); } .console.no { border-color: var(--reject); }
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index fe97efd1..36363c40 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -6,7 +6,8 @@
*/
import assert from 'node:assert/strict';
import { execFileSync, spawn, spawnSync } from 'node:child_process';
-import { chmodSync, mkdirSync, mkdtempSync, readdirSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
+import { chmodSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
+import { request } from 'node:http';
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
import { after, test } from 'node:test';
@@ -121,6 +122,13 @@ async function startView(box) {
return { link, key: link.searchParams.get('k'), base: `http://127.0.0.1:${link.port}`, stop };
}
+/**
+ * The page's stylesheet as the view serves it, behind its secret.
+ */
+async function styleOf(view) {
+ return (await fetch(`${view.base}/view.css`, { headers: { 'x-pullboard-key': view.key } })).text();
+}
+
/**
* An element as the page's script uses one: what it writes, how often it rewrote its markup, its
* classes and attributes, the listeners it adds, and how often it was scrolled into view.
@@ -345,8 +353,9 @@ test('the sidebar lists every project and what needs the person [N26]', async ()
const side = page.html.slice(page.html.indexOf('<aside class="side"'), page.html.indexOf('</aside>'));
assert.match(side, /<nav id="proj-list"/, 'the project rows sit in the sidebar');
for (const opening of side.match(/<(aside|div|nav)\b[^>]*>/g)) assert.doesNotMatch(opening, /\bhidden\b/, `${opening} shows without opening anything`);
- assert.match(page.html, /\.shell \{ display: grid; grid-template-columns: var\(--side-w\) minmax\(0, 1fr\);/, 'a sidebar column beside the main one');
- assert.match(page.html, /@media \(max-width: 900px\) \{[^@]*\.side-body \{ display: none;[^@]*\.side\.open \.side-body \{ display: grid; \}/, 'under 900px the list folds behind the project button');
+ const style = await styleOf(view);
+ assert.match(style, /\.shell \{ display: grid; grid-template-columns: var\(--side-w\) minmax\(0, 1fr\);/, 'a sidebar column beside the main one');
+ assert.match(style, /@media \(max-width: 900px\) \{[^@]*\.side-body \{ display: none;[^@]*\.side\.open \.side-body \{ display: grid; \}/, 'under 900px the list folds behind the project button');
assert.deepEqual(projectRows(page.show('proj-list')), [
{ root: alpha.repo, name: 'alpha', needs: '2', line: '1 sent back · 1 to verify', current: true },
@@ -376,7 +385,7 @@ test('the tabs fit one row on a phone [N26]', async () => {
const view = await startView(machine());
try {
const html = await (await fetch(view.link)).text();
- const style = html.slice(html.indexOf('<style>'), html.indexOf('</style>'));
+ const style = await styleOf(view);
const phone = /@media \(width < 480px\) \{\n([^@]*?)\n\}/.exec(style)?.[1] ?? '';
assert.doesNotMatch(style, /max-width: 480px/, 'at 480px itself the tabs keep their row');
assert.match(phone, /\.tabs \{ flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax\(0, 1fr\);/, 'under 480px the tabs share the bar in equal columns');
@@ -394,7 +403,7 @@ test('the view has a light and a dark theme to choose [N26]', async () => {
try {
const store = storage();
const page = await openPage(view, { store });
- const style = page.html.slice(page.html.indexOf('<style>'), page.html.indexOf('</style>'));
+ const style = await styleOf(view);
const tokens = /\n:root \{\n([^}]*)\n\}\n/.exec(style)?.[1] ?? '';
// One list of tokens: every colour in it holds a light and a dark value.
const colours = [...tokens.matchAll(/(--[a-z0-9-]+): ([^;]*(?:#[0-9a-f]{3,8}|rgba?\()[^;]*);/g)];
@@ -430,7 +439,7 @@ function productEntries(html) {
return html.split('<div class="prod"').slice(1).map((entry) => ({
name: /<b>([^<]*)<\/b>/.exec(entry)?.[1],
met: /<span>([^<]*) rows met<\/span>/.exec(entry)?.[1],
- bar: Number(/<i style="width:(\d+)%">/.exec(entry)?.[1]),
+ bar: Number(/<rect width="(\d+)" height="1"\/>/.exec(entry)?.[1]),
items: [...entry.matchAll(/<span><i class="dot ([a-z]*)"><\/i>(\d+) ([a-z ]+)<\/span>/g)].map((match) => `${match[2]} ${match[3]} (${match[1] || 'grey'})`),
}));
}
@@ -864,7 +873,7 @@ test('no box carries a coloured edge [N26]', async () => {
const view = await startView(box);
try {
const page = await openPage(view);
- const style = page.html.slice(page.html.indexOf('<style>'), page.html.indexOf('</style>'));
+ const style = await styleOf(view);
// Every border drawn on one side of a box is nothing, or a 1px divider in the neutral line colour.
const sides = [...style.matchAll(/border-(?:top|bottom|left|right|inline|block)[a-z-]*:\s*([^;}]+)/g)].map((match) => match[0].trim());
assert.ok(sides.length > 0);
@@ -878,6 +887,40 @@ test('no box carries a coloured edge [N26]', async () => {
await view.stop();
}
});
+test("the view's styles live in their own file [N26]", async () => {
+ const box = machine();
+ const alpha = project(box, 'alpha', SPEC, { products: { Pages: ['G1', 'G2'] } });
+ box.run(alpha.repo, 'add', 'web', 'Greeting', '--specs', 'G1', '--criterion', 'greets');
+ build(box, alpha, 1, 'greeting.html');
+ accept(box, alpha, 1);
+ const view = await startView(box);
+ try {
+ const page = await openPage(view);
+ assert.doesNotMatch(page.html, /<style|style=/, 'the page holds no styles');
+ assert.match(page.html, new RegExp(`\n<link rel="stylesheet" href="/view\\.css\\?k=${view.key}">\n`), 'it links its own, with the secret');
+ const css = await fetch(`${view.base}/view.css?k=${view.key}`);
+ assert.equal(css.status, 200);
+ assert.equal(css.headers.get('content-type'), 'text/css; charset=utf-8');
+ assert.equal(await css.text(), readFileSync(new URL('../src/view.css', import.meta.url), 'utf8'), 'src/view.css, as it is');
+ assert.equal((await fetch(`${view.base}/view.css`)).status, 403, 'nothing without the secret');
+ const stranger = await new Promise((done, fail) => {
+ request({ host: '127.0.0.1', port: view.link.port, path: `/view.css?k=${view.key}`, headers: { host: 'pullboard.example' } }, (res) => done(res.statusCode)).on('error', fail).end();
+ });
+ assert.equal(stranger, 403, 'nor under another Host');
+ const policy = (await fetch(view.link)).headers.get('content-security-policy');
+ assert.equal(/(?:^|; )style-src ([^;]*)/.exec(policy)?.[1], "'self'", 'styles come from the view alone, never inline');
+
+ // Nothing the script draws carries a style either: products, the list, a picked item, a spec row.
+ await page.click({ go: 'item:1' });
+ await page.click({ row: 'spec:G1' });
+ assert.match(page.show('prod-list'), /<svg class="bar" viewBox="0 0 100 1" preserveAspectRatio="none" aria-hidden="true"><rect width="50" height="1"\/><\/svg>/, 'a product bar is drawn, half full');
+ for (const id of [...page.html.matchAll(/\bid="([^"]+)"/g)].map((match) => match[1])) {
+ assert.doesNotMatch(page.show(id), /style=/, `#${id} holds no style`);
+ }
+ } finally {
+ await view.stop();
+ }
+});
test('a sent-back item shows why first [N26]', async () => {
const box = machine();
const p = project(box, 'shop');
@@ -1289,7 +1332,7 @@ test('a machine with no board says how to start one [N26]', async () => {
const view = await startView(box);
try {
const page = await openPage(view);
- const style = page.html.slice(page.html.indexOf('<style>'), page.html.indexOf('</style>'));
+ const style = await styleOf(view);
// Agents start boards, so the view offers no form for it.
assert.doesNotMatch(page.html, /init-form|init-path|Start a board|<details/, 'no form to start a board');
assert.doesNotMatch(style, /\.start\b/);
@@ -1419,7 +1462,7 @@ test('spec rows read across a phone [N26]', async () => {
const view = await startView(box);
try {
const page = await openPage(view, { width: 375 });
- const style = page.html.slice(page.html.indexOf('<style>'), page.html.indexOf('</style>'));
+ const style = await styleOf(view);
assert.match(style, /\n\.srow \{ display: grid; grid-template-columns: 4\.4em 6\.2em minmax\(0, 1fr\);/, 'wider, a row keeps its three columns');
const phone = /\n@media ([^{]+) \{ \.srow \{ grid-template-columns: auto minmax\(0, 1fr\); \} \.srow > span:last-child \{ grid-column: 1 \/ -1; \} \}\n/.exec(style);
assert.ok(phone, 'on a phone the text takes the full width below the id and status');
@@ -1553,7 +1596,7 @@ test('an empty feed says so on one line [N26]', async () => {
assert.equal(page.show('feed'), '<div class="empty">No shouts yet.</div>');
assert.match(page.html, /<div class="card-panel feed" id="feed"><\/div>/, 'the shouts feed');
assert.match(page.html, /<div class="card-panel feed" id="activity"><\/div>/, 'and the activity feed are both feeds');
- const style = page.html.slice(page.html.indexOf('<style>'), page.html.indexOf('</style>'));
+ const style = await styleOf(view);
assert.match(style, /\n\.feed > div \{ display: grid; grid-template-columns: 4\.6em minmax\(0, 1fr\);[^\n]*\n\.feed > \.empty \{ display: block; \}\n/, 'a feed row has a time column; its empty note takes the whole width');
} finally {
await view.stop();
@@ -1593,7 +1636,7 @@ test('activity names the item each event moved [N26]', async () => {
for (const row of about) assert.match(row, /type="button">#1<\/button> <span class="what">Greeting &lt;b&gt;bold&lt;\/b&gt;<\/span><\/div>/, 'the escaped title follows the link');
const joins = rows.filter((row) => /<\/b> join<\/div>/.test(row));
assert.ok(joins.length > 0 && joins.every((row) => !row.includes('class="what"')), 'an event about no item names none');
- assert.match(page.html, /\.feed \.act \.what \{ min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;/, 'a long title keeps to one line');
+ assert.match(await styleOf(view), /\.feed \.act \.what \{ min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;/, 'a long title keeps to one line');
} finally {
await view.stop();
}
@@ -1609,7 +1652,7 @@ test('needs-you lines keep their titles on a phone [N26]', async () => {
const view = await startView(box);
try {
const page = await openPage(view, { width: 375 });
- const style = page.html.slice(page.html.indexOf('<style>'), page.html.indexOf('</style>'));
+ const style = await styleOf(view);
assert.match(style, /\n\.ny \{ display: grid; grid-template-columns: auto minmax\(5em, 1fr\) minmax\(0, max-content\);/, 'wider, a line keeps its single row');
assert.match(style, /\n@media \(width < 480px\) \{ \.ny \{ grid-template-columns: auto minmax\(0, 1fr\); row-gap: 1px; \} \.ny em \{ grid-column: 2; \} \}\n/, 'under 480px, what it needs moves under the title');
// The rule works because each line is the ref, then the title, then what it needs.