fix(admin-web): measure which table columns fit instead of guessing breakpoints

Long translations (German row actions) overflowed fixed container
breakpoints; tables now drop secondary columns level by level until their
rows fit the panel. Charts set direction in CSS, which SVG honours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-06 21:08:30 +00:00
1 parent a2713ab08b
commit e75dcdb486
6 files changed
+51 -35

No files matched your search

+4 -3
View File
@@ -1,6 +1,6 @@
// Jobs (BRIEF §14.8): queue and history with cancel/pause/resume/retry/priority, log tails, render nodes.
import { t, plural, applyStrings } from "../i18n.js";
import { escapeHtml, attr, formatTime, formatDateTime, toast, errorText, confirmDialog, emptyState, redraw } from "../ui.js";
import { escapeHtml, attr, formatTime, formatDateTime, toast, errorText, confirmDialog, emptyState, redraw, fitColumns } from "../ui.js";
import { kindLabel, nodeLabel, progressCell, stateCell, stateLabel, encoders, logText } from "../jobs.js";
const FILTERS = ["all", "running", "queued", "paused", "failed", "done", "cancelled"];
@@ -18,7 +18,7 @@ export async function render(root, { api, setMeta, onEvent }) {
root.innerHTML = `
<div class="chips" role="group" aria-label="${attr(t("Admin.Jobs.State"))}">${FILTERS.map((f) => `<button class="chip" data-filter="${f}" aria-pressed="${f === filter}" data-i18n="Admin.Jobs.Filter.${cap(f)}" data-i18n-title="Admin.Jobs.Filter.Tip"></button>`).join("")}</div>
<section class="panel flush">
<div class="table jobs" role="table" aria-label="${attr(t("Admin.Nav.Jobs"))}">
<div class="table jobs" data-levels="1" role="table" aria-label="${attr(t("Admin.Nav.Jobs"))}">
<div class="thead" role="row"><span role="columnheader" data-i18n="Admin.Jobs.Kind"></span><span role="columnheader" data-i18n="Admin.Jobs.Target"></span>
<span role="columnheader" class="col-node" data-i18n="Admin.Jobs.Node"></span><span role="columnheader" data-i18n="Admin.Jobs.Progress"></span>
<span role="columnheader" data-i18n="Admin.Jobs.State"></span><span role="columnheader" class="col-created" data-i18n="Admin.Jobs.Created"></span>
@@ -29,7 +29,7 @@ export async function render(root, { api, setMeta, onEvent }) {
</section>
<section class="panel flush" aria-labelledby="nodes-title">
<div class="panel-head padded"><h2 id="nodes-title" data-i18n="Admin.Jobs.Nodes"></h2></div>
<div class="table nodes" role="table" aria-labelledby="nodes-title">
<div class="table nodes" data-levels="1" role="table" aria-labelledby="nodes-title">
<div class="thead" role="row"><span role="columnheader" data-i18n="Admin.Jobs.NodeName"></span><span role="columnheader" class="col-owner" data-i18n="Admin.Jobs.Owner"></span>
<span role="columnheader" data-i18n="Admin.Jobs.Encoders"></span><span role="columnheader" class="col-heartbeat" data-i18n="Admin.Jobs.Heartbeat"></span>
<span role="columnheader" data-i18n="Admin.Jobs.State"></span><span role="columnheader"><span class="sr-only" data-i18n="Admin.Common.Actions"></span></span></div>
@@ -113,6 +113,7 @@ export async function render(root, { api, setMeta, onEvent }) {
applyStrings(nodeHost);
});
nodeHost.querySelectorAll("[data-forget]").forEach((b) => b.addEventListener("click", () => forget(nodes.find((n) => n.id === b.dataset.forget))));
root.querySelectorAll(".table[data-levels]").forEach(fitColumns);
}
function buttons(job) {