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
8 changes: 8 additions & 0 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,14 @@ principles named were durable, accurate and reactive. Found in rally 0x7 by plus
and each fair pool's queue by owner (RAL-188), with a one-line summary; an unreadable projects list, no
project naming a lock, an unreadable lock or an unseen queue is named in `blind`, never shown as nothing
running; with unit tests and a CLI test with real `flock` holders (docs/brief.md).
- [ ] **RAL-193: The operator inbox folds away.** From Josh (2026-11-14, the lamplighter's record 4311): "Lets give it
an arrow that allows us to make it hidden". Done when: an arrow beside the "Operator inbox" heading, a button with
`aria-expanded` and `aria-controls`, folds the panel and its line away and back, by mouse or keyboard; folded, the
heading still gives the open count and the urgent count, in the urgent colour, so nothing urgent hides; it's
remembered per browser across reloads and viewer restarts (localStorage, every access in try/catch, open when
storage fails); it looks like the "Past rallies" disclosure marker; web assets only; with a browser test that
folds, reloads (tests/browser/sign-in.mjs's new `RALLY_BROWSER_RELOAD_PROBE`), finds it still folded with its
counts, and unfolds it.
- [ ] **RAL-192: Lock holders found by open descriptor when the locking pid is gone.** From RAL-191's first live
run (2026-11-14, issues log 1.86): every dsm-heavy slot's holder by `/proc/locks` was a pid that had exited
(dsm-heavy's bash, gone once it execs `systemd-run --scope`), while its job held the lock by the inherited
Expand Down
13 changes: 12 additions & 1 deletion tests/browser/sign-in.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,16 @@ if (process.env.RALLY_BROWSER_PROBE) {
}
}
}
// RAL-193: what a page keeps across a reload, such as a folded panel: RALLY_BROWSER_RELOAD_PROBE names a
// file holding one more expression, evaluated after the page is reloaded, printed as `reloaded`.
let reloaded;
if (process.env.RALLY_BROWSER_RELOAD_PROBE) {
const { readFileSync } = await import("node:fs");
const expression = readFileSync(process.env.RALLY_BROWSER_RELOAD_PROBE, "utf8");
const reload = loaded();
await send("Page.reload", { ignoreCache: true });
await reload;
reloaded = await evaluate(expression);
}
clearTimeout(timer);
finish(0, { codePage, after, probe, probes });
finish(0, { codePage, after, probe, probes, reloaded });
91 changes: 91 additions & 0 deletions tests/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3517,3 +3517,94 @@ fn ticking_an_item_in_the_browser_takes_it_off_the_list() {
);
inbox_status(&viewer, 2);
}

/// RAL-193, in the browser: the arrow beside the operator inbox's heading folds its panel away, by
/// a button that says whether it's open; folded, the heading still gives the counts, the urgent one
/// too, in the urgent colour; it stays folded across a reload, and unfolds again.
#[test]
fn the_operator_inbox_folds_away_and_stays_folded_across_a_reload() {
let Some(chrome) = browser() else { return };
let viewer = start_ticking();
inbox_status(&viewer, 3);
// Each read waits on what it reads: the board's first draw, then the inbox's rows.
let state = r##"
const wait = async (test) => {
for (let i = 0; i < 200 && !test(); i++) await new Promise((r) => setTimeout(r, 100));
return test();
};
const button = () => document.getElementById("inbox-fold");
const body = () => document.getElementById("inbox-body");
const state = () => ({
expanded: button().getAttribute("aria-expanded"),
controls: button().getAttribute("aria-controls"),
tag: button().tagName,
bodyHidden: body().hidden,
panelShown: document.getElementById("inbox").getBoundingClientRect().height > 0,
heading: document.getElementById("inbox-title").textContent,
urgent: document.getElementById("inbox-title").dataset.urgent,
stored: (() => { try { return localStorage.getItem("rally-inbox-folded"); } catch (e) { return "unreadable"; } })(),
});
await wait(() => document.querySelectorAll("#inbox .inbox-item").length === 3);
"##;
let probe = format!(
r##"(async () => {{ {state}
const open = state();
button().focus();
button().click();
const folded = state();
return {{ open, folded, focused: document.activeElement === button() }};
}})()"##
);
let reload = format!(
r##"(async () => {{ {state}
const afterReload = state();
button().click();
const unfolded = state();
return {{ afterReload, unfolded }};
}})()"##
);
let reload_file = tempfile::NamedTempFile::new().unwrap();
std::fs::write(reload_file.path(), &reload).unwrap();
let (ok, seen, stderr) = run_browser_env(
&viewer,
&chrome,
Some(&probe),
None,
None,
&[(
"RALLY_BROWSER_RELOAD_PROBE",
reload_file.path().to_str().unwrap(),
)],
);
assert!(ok, "{seen}\n{stderr}");
nothing_of_the_browser_survives(&seen);
let (first, again) = (&seen["probe"], &seen["reloaded"]);
// Open by default, through a button that says so and names what it controls.
let open = &first["open"];
assert_eq!(open["tag"], "BUTTON", "{seen}");
assert_eq!(open["expanded"], "true", "{seen}");
assert_eq!(open["controls"], "inbox-body", "{seen}");
assert_eq!(open["panelShown"], true, "{seen}");
assert!(open["stored"].is_null(), "{seen}");
// Folded: the panel is gone, the heading keeps every count and the urgent colour.
for folded in [&first["folded"], &again["afterReload"]] {
assert_eq!(folded["expanded"], "false", "{seen}");
assert_eq!(folded["bodyHidden"], true, "{seen}");
assert_eq!(folded["panelShown"], false, "{seen}");
assert!(
folded["heading"]
.as_str()
.unwrap_or_default()
.contains("3 items open, 1 urgent"),
"{seen}"
);
assert_eq!(folded["urgent"], "yes", "{seen}");
assert_eq!(folded["stored"], "yes", "{seen}");
}
assert_eq!(first["focused"], true, "{seen}");
// And unfolded again, forgotten.
let unfolded = &again["unfolded"];
assert_eq!(unfolded["expanded"], "true", "{seen}");
assert_eq!(unfolded["panelShown"], true, "{seen}");
assert!(unfolded["stored"].is_null(), "{seen}");
}
9 changes: 9 additions & 0 deletions web/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,15 @@ tbody tr.cue-activity, .activity li.cue-activity { animation: cue-trace 2.4s eas

/* The operator's inbox (RAL-146): a quest log, urgent items first and marked. */
#inbox-title[data-urgent="yes"] { color: var(--bad); }
/* RAL-193: the fold arrow, as the "Past rallies" disclosure marker looks: a small triangle in the
secondary colour, pointing down when open, right when folded; the heading's own type and colour. */
.fold { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none;
font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; text-align: left; }
.fold-arrow { flex: none; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px;
border-color: transparent transparent transparent var(--text-2); transform: rotate(90deg); transition: transform 0.15s ease; }
.fold[aria-expanded="false"] .fold-arrow { transform: none; }
.fold:hover .fold-arrow { border-left-color: var(--arc-1); }
.fold:focus-visible { outline: 2px solid var(--arc-1); outline-offset: 3px; border-radius: 2px; }
.inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.inbox-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px;
border: 1px solid color-mix(in srgb, var(--text-2) 30%, transparent); border-radius: 6px; }
Expand Down
29 changes: 28 additions & 1 deletion web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,10 @@ function renderInbox(inbox, tickInfo, now) {
const heading = document.getElementById("inbox-title");
const title = inboxCount(inbox).replace(/^Operator inbox: /, "");
if (heading) {
// RAL-193: the text sits beside the fold arrow, inside its button, so writing it keeps the button.
const label = document.getElementById("inbox-title-text") || heading;
const text = "Operator inbox · " + title;
if (heading.textContent !== text) heading.textContent = text;
if (label.textContent !== text) label.textContent = text;
heading.dataset.urgent = inbox && inbox.urgent ? "yes" : "no";
}
if (!inbox || inbox.available === false) {
Expand Down Expand Up @@ -1889,6 +1891,31 @@ async function refresh() {
showFreshness(Date.now());
}

// RAL-193: the operator inbox folds away with the arrow beside its heading, remembered by this browser
// across reloads and restarts of the viewer. Storage that can't be read leaves it open. Folded, the
// heading still gives the counts, urgent included, so an urgent item is never silently hidden.
const INBOX_FOLDED = "rally-inbox-folded";
function foldInbox(folded, remember) {
const button = document.getElementById("inbox-fold");
const body = document.getElementById("inbox-body");
if (!button || !body) return;
body.hidden = folded;
button.setAttribute("aria-expanded", String(!folded));
button.title = folded ? "Show the operator inbox" : "Hide the operator inbox";
if (!remember) return;
try {
if (folded) localStorage.setItem(INBOX_FOLDED, "yes");
else localStorage.removeItem(INBOX_FOLDED);
} catch (error) { /* not remembered; it still folds for now */ }
}
(() => {
let folded = false;
try { folded = localStorage.getItem(INBOX_FOLDED) === "yes"; } catch (error) { folded = false; }
foldInbox(folded, false);
const button = document.getElementById("inbox-fold");
if (button) button.addEventListener("click", () => foldInbox(button.getAttribute("aria-expanded") === "true", true));
})();

refresh();
setInterval(refresh, 30000);
setInterval(tick, 1000);
9 changes: 6 additions & 3 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ <h1>Rally</h1>
<main id="past-page" hidden></main>
<main id="overview">
<section id="inbox-section" aria-labelledby="inbox-title">
<h2 id="inbox-title">Operator inbox</h2>
<p class="muted">Everything waiting on the operator, urgent first, then oldest first. Tick an item off when it's done or seen.</p>
<div id="inbox" class="panel"></div>
<!-- RAL-193: the arrow folds the panel away; the heading keeps its counts, so nothing urgent hides. -->
<h2 id="inbox-title"><button type="button" id="inbox-fold" class="fold" aria-expanded="true" aria-controls="inbox-body"><span class="fold-arrow" aria-hidden="true"></span><span id="inbox-title-text">Operator inbox</span></button></h2>
<div id="inbox-body">
<p class="muted">Everything waiting on the operator, urgent first, then oldest first. Tick an item off when it's done or seen.</p>
<div id="inbox" class="panel"></div>
</div>
</section>
<section aria-labelledby="ledger-title">
<h2 id="ledger-title">Rally status</h2>
Expand Down
Loading