diff --git a/app/static/builder/command-builder.css b/app/static/builder/command-builder.css index dcffd1c10..a275c8381 100644 --- a/app/static/builder/command-builder.css +++ b/app/static/builder/command-builder.css @@ -150,7 +150,7 @@ #nullius-builder .nb-tile-head .nb-mark { flex: none; width: 26px; height: 26px; display: grid; place-items: center; color: var(--nb-blue); font-size: 15px; font-weight: 500; } #nullius-builder .nb-tile-head .nb-mark svg { width: var(--ic-lg); height: var(--ic-lg); } /* the marks; an icon here is .ic-lg */ #nullius-builder .nb-nullius-mark { width: 26px; height: 26px; color: var(--nb-text); } -#nullius-builder .nb-tile-head strong { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +#nullius-builder .nb-tile-head strong { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; white-space: normal; overflow-wrap: anywhere; } #nullius-builder .nb-tile-check { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: var(--nb-bg); } #nullius-builder .nb-tile:is([aria-pressed=true], [aria-checked=true]) .nb-tile-check { background: var(--nb-blue); } #nullius-builder .nb-tile-line { font-size: 12.5px; line-height: 1.5; color: var(--nb-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } @@ -195,7 +195,6 @@ #nullius-builder .nb-prereq-fix { display: block; margin-top: 4px; font: 12px/1.6 var(--mono); background: var(--nb-soft); border: 1px solid var(--nb-line); border-radius: 5px; padding: 4px 8px; overflow-wrap: anywhere; } #nullius-builder .nb-tile-foot:has(> .nb-hoststate:empty:only-child) { display: none; } #nullius-builder .nb-pick-grid + .nb-field { margin-top: 18px; } -#nullius-builder .nb-tile-head strong { white-space: normal; overflow-wrap: anywhere; } /* Dataset counts and proof badges occupy separate, consistent rows. */ #nullius-builder .std-optgrid:has(> [data-std-dataset]) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); } diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index 96f98aea8..120294a76 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -520,7 +520,7 @@ if (failed) return {state: 'no', text: '✕ not proven', title: (failed.problems || []).join(' · ')}; return {state: 'none', text: 'not run'}; } - const proofSpan = p => `${esc(p.text)}`; + const proofSpan = p => `${esc(p.text)}`; // A control or a check as a plain chip: its name and its proof; where the control comes from is in its title. const controlChip = (c, proof = true, of = '') => `${esc(c.key)}${of ? `${esc(of)}` : ''}` + (proof ? proofSpan(proofOf(c.proven, c.failed, c.expect, c.short)) : '') + ''; @@ -735,7 +735,7 @@ // and state in a group that holds one value, radioOf; else a toggle)} const tile = t => `'; // A group that holds one value, as radios: radioOf(values, on)(v) is v's role and state. Its one tab stop is the first // checked, else the first (two are checked where each participant keeps its own default); the arrows choose (keydown below). diff --git a/app/static/builder/recipes.css b/app/static/builder/recipes.css index f6a1ab9c6..b5a5a8e80 100644 --- a/app/static/builder/recipes.css +++ b/app/static/builder/recipes.css @@ -1,7 +1,7 @@ /* The Recipes page: one row per saved recipe; Info and Delete in one dialog (the Launches page's, runs/launches.css). */ .rcp-name { overflow-wrap: anywhere; } /* a name wraps, never cut */ .rcp-warn { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12.5px; color: var(--patch_failed_tests); cursor: help; } -.rcp-val { display: block; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* the whole value is its tooltip */ +.rcp-val { display: block; width: max-content; max-width: 10rem; white-space: normal; overflow-wrap: anywhere; } #recipes td[data-col="name"] { white-space: normal; } dialog.std-how.launch-delete.wide { width: min(56rem, calc(100vw - 32px)); } .launch-delete .rcp-problems { list-style: none; padding: 0; margin: 12px 0 0; } diff --git a/app/static/compare/comparison.css b/app/static/compare/comparison.css index a8f2a5595..8a550bd74 100644 --- a/app/static/compare/comparison.css +++ b/app/static/compare/comparison.css @@ -68,7 +68,7 @@ .grid.compare.tasks .compare-task-head > th { color: var(--text-dim); font-weight: 500; font-size: .78rem; border-bottom-color: var(--border); } .compare-task-name { display: flex; align-items: center; gap: .4rem; min-width: 0; } .compare-task-name .disclose { flex: none; margin: 0; min-height: 1.8rem; } -.compare-task-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; overflow: hidden; overflow-wrap: anywhere; font-size: .82rem; } +.compare-task-label { display: block; min-width: 0; overflow-wrap: anywhere; font-size: .82rem; } .compare-run-cell { container-type: inline-size; } .compare-cell-summary { display: grid; grid-template-columns: minmax(0, 1fr) 4rem 5rem; align-items: center; gap: .75rem; } .compare-cell-outcome { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; } diff --git a/app/static/runs/board.css b/app/static/runs/board.css index cac543768..357670203 100644 --- a/app/static/runs/board.css +++ b/app/static/runs/board.css @@ -68,8 +68,8 @@ .rp .key .op { stroke-width: 1.5; } /* ---- the scoreboard: rate | outcomes → judge (lanes · flags), and run totals as its footer line. - Outcomes and lanes keep one row pitch (label 44 · slot 30 · outcome rows 45, +30 per extra reading · total 34), - so an outcome, its readings and the tally share a line. ---- */ + Outcomes start at 45px, +30 per extra reading; wrapped labels grow their rows. + board.js keeps each lane row as tall as its outcome. ---- */ .rp .rp-card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); } .rp .bw { container: board / inline-size; } .rp .board { display: grid; grid-template-columns: 150px minmax(0, 2fr) minmax(0, 3fr); grid-template-areas: "rate out judge" "tot tot tot"; } @@ -121,9 +121,9 @@ .rp .mseg::after { content: ""; position: absolute; inset: -7px 0; } .rp .mseg:first-child { border-radius: 4px 0 0 4px; } .rp .mseg:last-child { border-radius: 0 4px 4px 0; } .rp .mseg:only-child { border-radius: 4px; } .rp .mseg:hover, .rp .mseg.hot { filter: brightness(1.18); } -.rp .lg { height: 45px; grid-template-columns: 10px 2.2em minmax(0, 1fr); column-gap: 10px; align-content: start; padding-top: 12px; font-size: 13px; color: var(--text); } +.rp .lg { height: auto; min-height: 45px; grid-template-columns: 10px 2.2em minmax(0, 1fr); column-gap: 10px; align-content: start; padding-top: 12px; font-size: 13px; color: var(--text); } .rp .lg b, .rp .tot b { font: 500 13px/20px var(--sans); color: var(--text); font-variant-numeric: tabular-nums; text-align: right; } -.rp .lg > span { overflow: hidden; text-overflow: ellipsis; line-height: 20px; } +.rp .lg > span { white-space: normal; overflow-wrap: anywhere; line-height: 20px; } .rp .lg > .sw { align-self: start; margin-top: 5px; } .rp .tot { grid-template-columns: 10px 2.2em minmax(0, 1fr); column-gap: 10px; font-size: 12px; color: var(--text-faint); } .rp .lg > b, .rp .tot > b { grid-row: 1; grid-column: 2; } .rp .lg > span, .rp .tot > span { grid-row: 1; grid-column: 3; } @@ -196,7 +196,7 @@ align-content: start; column-gap: 10px; padding: 0 14px 6px; } .rp .b-flags .slot { grid-column: 1 / -1; padding: 0; } .rp .fr { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; min-height: 28px; margin: 0 -14px; padding: 0 14px; font: 11px/1 var(--mono); } -.rp .fr .fn { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.rp .fr .fn { color: var(--text-dim); white-space: normal; overflow-wrap: anywhere; } .rp .fr.lit .key-n::before, .rp .fr:hover .key-n::before, .rp .fr.hot .key-n::before, .rp .fr.on .key-n::before { background: var(--text); } .rp .fr:hover .fn, .rp .fr.on .fn, .rp .fr.hot .fn, .rp .fr.lit .fn { color: var(--text); } .rp .fb { position: relative; height: 6px; background: var(--ftrack); } @@ -310,11 +310,11 @@ .rp .tt td:first-child { min-width: 150px; } .rp tr:hover .task { text-decoration: underline; text-decoration-color: var(--hush); text-underline-offset: 4px; } .rp .tt .badge { margin-left: 6px; } -.rp .exd summary { display: flex; align-items: center; min-height: 20px; font: 11px/20px var(--mono); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.rp .exd summary { display: flex; align-items: center; min-height: 20px; font: 11px/20px var(--mono); color: var(--text-faint); white-space: normal; overflow-wrap: anywhere; } .rp .exd summary .tw { width: 12px; flex: none; } .rp .exd summary:hover { color: var(--text-dim); } .rp .exd code { display: block; margin: 2px 0 2px 12px; font: 11px/16px var(--mono); color: var(--text-dim); overflow-wrap: anywhere; white-space: normal; } -.rp .exn { display: block; font: 11px/20px var(--mono); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.rp .exn { display: block; font: 11px/20px var(--mono); color: var(--text-faint); white-space: normal; overflow-wrap: anywhere; } /* the Cause cell: the board's connector in miniature, straight or jogged, ending in the judge's ring */ .rp .rc { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; vertical-align: top; } .rp .kg { width: 22px; height: 14px; flex: none; overflow: visible; } @@ -322,7 +322,7 @@ .rp .kg circle { stroke-width: 1.5; } .rp .kg .dt { stroke-dasharray: .1 3.5; } .rp tr:hover .kg path, .rp tr.lit .kg path, .rp tr:hover .kg circle, .rp tr.lit .kg circle { stroke: var(--text-dim); } -.rp .rc .ctag { font: 11px/20px var(--mono); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.rp .rc .ctag { font: 11px/20px var(--mono); color: var(--text-dim); min-width: 0; white-space: normal; overflow-wrap: anywhere; } .rp .rc .na { padding: 0; font-size: 12px; } .rp .ins { color: var(--text-dim); } .rp .ins small { color: var(--hush); font-size: 11px; } diff --git a/app/static/runs/board.js b/app/static/runs/board.js index ba0e8de71..3c3767c5f 100644 --- a/app/static/runs/board.js +++ b/app/static/runs/board.js @@ -7,6 +7,18 @@ const $ = (s, r = document) => r.querySelector(s), $$ = (s, r = document) => [...r.querySelectorAll(s)]; const page = $('#run-page'); if (!page) return; const board = $('#board'), tbody = $('#trial-rows'), empty = $('#no-trial-matches'); + // A wrapped outcome can be taller than its judge lanes. Keep their row boundaries aligned. + const legends = $$('.run-outcome-filters .lg', page); + const laneRows = new Map($$('.lanes > .lr', page).map(r => [r.dataset.o, r])); + if (laneRows.size) { + const alignLanes = () => legends.forEach(row => { + const lane = laneRows.get(row.dataset.o); + if (lane) lane.style.height = row.getBoundingClientRect().height + 'px'; + }); + alignLanes(); + const resize = new ResizeObserver(alignLanes); + legends.forEach(row => resize.observe(row)); + } const rows = $$('#trial-rows tr[data-outcome]'), N = rows.length; const count = $('#trial-count'), clear = $('#clear-filters'), liveEl = $('#trials-live'), heading = $('#trials-heading'); const KEYS = ['o', 'c', 's', 'f']; diff --git a/app/static/runs/live-board.css b/app/static/runs/live-board.css index e5547da15..d1ac6cb16 100644 --- a/app/static/runs/live-board.css +++ b/app/static/runs/live-board.css @@ -67,7 +67,7 @@ .lb-winners th { text-align: left; font: 400 11.5px var(--sans); color: var(--text-dim); padding: 4px 14px 4px 0; border-bottom: 1px solid var(--lb-hair); white-space: nowrap; } .lb-winners td { padding: 4px 14px 4px 0; border-bottom: 1px solid var(--lb-hair); white-space: nowrap; } .lb-winners .num { text-align: right; font: 12px var(--mono); } -.lb-winners .task { font: 12px var(--mono); max-width: 22rem; overflow: hidden; text-overflow: ellipsis; } +.lb-winners .task { font: 12px var(--mono); max-width: 22rem; white-space: normal; overflow-wrap: anywhere; } .lb-win { font-weight: 500; font-family: var(--mono); } .lb-open { color: var(--patch_failed_tests); } .lb-note { margin: 6px 0 0; font-size: 12px; color: var(--text-faint); } diff --git a/app/static/runs/live-board.js b/app/static/runs/live-board.js index 4a3d30cba..c00e9b0df 100644 --- a/app/static/runs/live-board.js +++ b/app/static/runs/live-board.js @@ -294,7 +294,7 @@ ${t.state !== 'running' && (t.activity || t.last_line) ? `

Last line, redacted${redacted(t.activity || t.last_line)}

` : ''} ${facts.length ? `
${facts.map(([k, v, f]) => `
${k}
${f(v)}
`).join('')}
` : ''}
events.jsonl, latest${events.length} in the tail
-
${events.length ? events.map(e => `
${hms(e.ts)}${esc(e.event)}${redacted(e.phase || e.outcome || e.activity || e.line || '')}
`).join('') : '
—
'}
+
${events.length ? events.map(e => `
${hms(e.ts)}${esc(e.event)}${redacted(e.phase || e.outcome || e.activity || e.line || '')}
`).join('') : '
—
'}
${href ? `Open the trial →` : ''}`; } diff --git a/app/static/style.css b/app/static/style.css index 02fa3c601..fa5b1f88a 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -615,17 +615,17 @@ button.seg:hover { filter: brightness(1.25); } .pane-title { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; } .pane-id { display: block; font-size: .74rem; max-width: 100%; - overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + white-space: normal; overflow-wrap: anywhere; } -/* Run id and trial link share the card's last row. The id takes the slack and - truncates, so a long job name can't push the link out of a narrow column. */ +/* Run id and trial link share the card's last row. The id wraps within + the available space, keeping the link in a narrow column. */ .pane-links { display: flex; align-items: baseline; gap: .6rem; min-width: 0; } .pane-links .pane-id { flex: 1 1 auto; min-width: 0; } .pane-open { flex: none; font-size: .74rem; white-space: nowrap; } .pane-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; margin: 0; } .pane-stats dt { color: var(--text-dim); font-size: .68rem; text-transform: uppercase; - letter-spacing: .08em; font-weight: 500; white-space: nowrap; - overflow: hidden; text-overflow: ellipsis; } + letter-spacing: .08em; font-weight: 500; + white-space: normal; overflow-wrap: anywhere; } .pane-stats dd { margin: .15rem 0 0; font-size: 1.1rem; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; } /* drag-to-reorder columns */ @@ -783,13 +783,13 @@ button.seg:hover { filter: brightness(1.25); } .wf-tick:not(:first-child):not(:last-child) { display: none; } } -.wf-row { height: 24px; position: relative; } +.wf-row { min-height: 24px; position: relative; } .wf-row:hover { background: var(--surface-2); } .wf-row.selected { background: var(--accent-soft); } .wf-gutter { display: flex; align-items: center; gap: .3rem; min-width: 0; - padding-left: calc(var(--depth, 0) * 14px); + padding-left: min(calc(var(--depth, 0) * 14px), 25%); } .wf-chev, .wf-chev-gap { width: 14px; flex: none; } .wf-chev { @@ -802,7 +802,7 @@ button.seg:hover { filter: brightness(1.25); } .wf-label { border: none; background: none; padding: 0; cursor: pointer; color: var(--text); font: inherit; text-align: left; - overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + min-width: 0; white-space: normal; overflow-wrap: anywhere; } .wf-row.selected .wf-label { font-weight: 500; } @@ -1222,7 +1222,7 @@ pre.msg { color: var(--text); max-height: 220px; } background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px; padding: .45rem .5rem .45rem .7rem; font-size: .86rem; } -.staged-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.staged-name { flex: 1; min-width: 0; color: var(--text); overflow-wrap: anywhere; } .staged-count { font-size: .78rem; white-space: nowrap; } input[type=text] { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; diff --git a/app/templates/_cards.html b/app/templates/_cards.html index 50e02a071..c63e82555 100644 --- a/app/templates/_cards.html +++ b/app/templates/_cards.html @@ -24,7 +24,7 @@ {%- for x in ([v] if v is string or v is mapping or v is number else v or []) if x is not none and x != '' %}{{ caller(f, x if x is mapping else {'text': x}) }}{% endfor %}{% endfor %}{% endmacro %} {#- A value as a pill: its field's class and its own, its tooltip. #} -{% macro pill(f, v) %}{% set cls = [f.class, v.class]|select|join(' ') %}{{ v.text }}{% endmacro %} +{% macro pill(f, v) %}{% set cls = [f.class, v.class]|select|join(' ') %}{{ v.text }}{% endmacro %} {# A collection of cards (NulliusTable.cards): its controls row, its cards, the note when none passes. `id` names it; `search`, `choices`, `only`, `layout` and each field's `filter` as the table's controls; `sort` the Sort by menu, over @@ -98,7 +98,7 @@ {%- call(f, v) each(item, by.delete) %}{% endcall %}{% endset %} {%- if corner %}{{ corner }}{% endif %} {%- call(f, v) each(item, by.text) %} -
{% if f.style == 'code' %}{{ v.text }}{% else %}{{ v.text }}{% endif %}
{% endcall %} +
{% if f.style == 'code' %}{{ v.text }}{% else %}{{ v.text }}{% endif %}
{% endcall %} {%- set badges %}{% call(f, v) each(item, by.badge) %}{{ pill(f, v) }}{% endcall %}{% endset %}{% if badges %}
{{ badges }}
{% endif %} {%- call(f, v) each(item, by.note) %} diff --git a/app/templates/catalogue/benchmark.html b/app/templates/catalogue/benchmark.html index 90ba1f7e9..e6ab7507f 100644 --- a/app/templates/catalogue/benchmark.html +++ b/app/templates/catalogue/benchmark.html @@ -59,10 +59,10 @@

Overview

{% if std %} {#- The standard's proofs of it, per dataset (standard/proofs/prove.py): its controls as chips, their source in the title, then its units and leak checks; and Prove it, cli prove as a run. -#} {% macro proof(rec, failed, expect, short='') -%} - {%- if rec %}{% set notes = [short, ('over the first ' ~ rec.limit) if rec.limit, ('shard ' ~ rec.shard) if rec.shard]|select|list %}✓ {{ rec.passed }}{% if rec.limit %} · first {{ rec.limit }}{% endif %} + {%- if rec %}{% set notes = [short, ('over the first ' ~ rec.limit) if rec.limit, ('shard ' ~ rec.shard) if rec.shard]|select|list %}✓ {{ rec.passed }}{% if rec.limit %} · first {{ rec.limit }}{% endif %} {%- elif failed and failed.value is defined %}{% set e = (failed.expect or expect or {'at_least': 1}) %}{% set k = e|list|first %}✕ {{ failed.value }} {{ '>' if k == 'at_most' else '<' }} {{ e[k] }} - {%- elif failed %}✕ not proven - {%- else %}not run{% endif -%} + {%- elif failed %}✕ not proven + {%- else %}not run{% endif -%} {%- endmacro %} {% macro chip(c) -%} {{ c.key }}{{ proof(c.proven, c.failed, c.expect, c.short) }} diff --git a/app/templates/runs/job.html b/app/templates/runs/job.html index 7db61cf51..2ae2b893f 100644 --- a/app/templates/runs/job.html +++ b/app/templates/runs/job.html @@ -288,7 +288,7 @@
{% for k in ORDER %}{% if oc[k] %}{% set h = 45 + 30 * ((nlines.get(k) or 1) - 1) %} - {{ oc[k] }}{{ LABELS[k] }}{% if k in INFRA %}infra{% endif %} {% endif %}{% endfor %}
diff --git a/app/templates/traces/trial.html b/app/templates/traces/trial.html index 9242d2228..3c8927c8f 100644 --- a/app/templates/traces/trial.html +++ b/app/templates/traces/trial.html @@ -126,7 +126,7 @@

Tool calls

{% for cat, n in traj.category_freq.most_common() %} {{ cat }} {{ n }} + title="{{ cat }}: {% for name, k in traj.names_of(cat) %}{{ name }} ×{{ k }}{{ ', ' if not loop.last }}{% endfor %}">{{ cat }} {{ n }} {% endfor %} {% if traj.n_failed_calls %}failed {{ traj.n_failed_calls }}{% endif %}
@@ -138,7 +138,7 @@

Tool calls

{% for t in traj.tools %} {% if t.server and (loop.first or traj.tools[loop.index0 - 1].server != t.server) %}{{ t.server }}{% endif %} - {{ t.name[:80] }}{% if t.name|length > 80 %}…{% endif %} + {{ t.name }} {{ t.category }} {{ t.calls }} {{ t.failed or '—' }} diff --git a/app/ui_tests/browser/outcome_wrapping.py b/app/ui_tests/browser/outcome_wrapping.py new file mode 100644 index 000000000..eb73f805b --- /dev/null +++ b/app/ui_tests/browser/outcome_wrapping.py @@ -0,0 +1,90 @@ +"""Wrapped outcome labels keep their judge lanes aligned as the board resizes. + +Run with app/ui_tests/browser/requirements.txt and app/requirements.txt. +""" +import os +from pathlib import Path +import sys +import tempfile +import unittest +from unittest.mock import patch +from urllib.parse import urlsplit + +sys.path.insert(0, str(Path(__file__).resolve().parents[2])) +from playwright.sync_api import sync_playwright +from ui_tests import test_reconcile_routes + + +class OutcomeWrapping(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.playwright = sync_playwright().start() + options = {"executable_path": os.environ["NULLIUS_TEST_CHROMIUM"]} if os.environ.get("NULLIUS_TEST_CHROMIUM") else {} + cls.browser = cls.playwright.chromium.launch(**options) + + @classmethod + def tearDownClass(cls): + cls.browser.close() + cls.playwright.stop() + + def setUp(self): + home = tempfile.TemporaryDirectory() + self.addCleanup(home.cleanup) + env = patch.dict(os.environ, NULLIUS_HOME=home.name) + env.start() + self.addCleanup(env.stop) + self.fixture = test_reconcile_routes.ReconcilePage() + self.fixture.setUp() + self.fixture.seed() + self.addCleanup(self.fixture.doCleanups) + context = self.browser.new_context(viewport={"width": 1280, "height": 900}) + self.addCleanup(context.close) + self.page = context.new_page() + self.errors = [] + self.page.on("pageerror", lambda e: self.errors.append(str(e))) + + def route(r): + u = urlsplit(r.request.url) + if u.hostname != "localhost": + r.abort() + return + response = self.fixture.client.get(u.path + ("?" + u.query if u.query else "")) + try: + headers = dict(response.headers) + headers.pop("Content-Length", None) + r.fulfill(status=response.status_code, headers=headers, body=response.get_data()) + finally: + response.close() + self.page.route("**/*", route) + self.page.add_init_script("localStorage.setItem('nullius-onboarding', JSON.stringify({asked:true,dismissed:true}))") + self.page.set_default_timeout(5000) + + def test_long_outcome_keeps_each_lane_aligned_after_resizing(self): + page = self.page + page.goto("http://localhost/job/r-agent") + page.evaluate("document.fonts.ready") + self.assertGreater(page.locator(".lanes > .lr").count(), 1) + page.locator(".run-outcome-filters .lg > span").first.evaluate( + "e => e.textContent = 'AnUnbrokenOutcomeName'.repeat(8)") + for width in (1280, 900, 390, 1280): + with self.subTest(width=width): + page.set_viewport_size({"width": width, "height": 900}) + page.wait_for_function("""() => [...document.querySelectorAll('.run-outcome-filters .lg')].every(row => { + const lane = document.querySelector('.lanes > .lr[data-o="' + row.dataset.o + '"]'); + return lane && Math.abs(row.getBoundingClientRect().height - lane.getBoundingClientRect().height) < 1; + })""") + rows = page.locator(".run-outcome-filters .lg").evaluate_all("""es => es.map(row => { + const text = row.querySelector('span'), rect = row.getBoundingClientRect(); + const lane = document.querySelector('.lanes > .lr[data-o="' + row.dataset.o + '"]').getBoundingClientRect(); + return {top: rect.top, bottom: rect.bottom, laneTop: lane.top, + clipped: text.scrollWidth > text.clientWidth + 1 || text.scrollHeight > text.clientHeight + 1}; + })""") + self.assertFalse(any(row["clipped"] for row in rows), rows) + for prior, row in zip(rows, rows[1:]): + self.assertGreaterEqual(row["top"], prior["bottom"] - 1) + self.assertAlmostEqual(row["top"] - rows[0]["top"], row["laneTop"] - rows[0]["laneTop"], delta=1) + self.assertFalse(self.errors, self.errors) + + +if __name__ == "__main__": + unittest.main() diff --git a/app/ui_tests/evidence/issue-406/compare-panes-after-1280-light.png b/app/ui_tests/evidence/issue-406/compare-panes-after-1280-light.png new file mode 100644 index 000000000..9a671c9d3 Binary files /dev/null and b/app/ui_tests/evidence/issue-406/compare-panes-after-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/compare-panes-before-1280-light.png b/app/ui_tests/evidence/issue-406/compare-panes-before-1280-light.png new file mode 100644 index 000000000..ff3645407 Binary files /dev/null and b/app/ui_tests/evidence/issue-406/compare-panes-before-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/compare-tasks-after-1280-light.png b/app/ui_tests/evidence/issue-406/compare-tasks-after-1280-light.png new file mode 100644 index 000000000..6728b6e0a Binary files /dev/null and b/app/ui_tests/evidence/issue-406/compare-tasks-after-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/compare-tasks-before-1280-light.png b/app/ui_tests/evidence/issue-406/compare-tasks-before-1280-light.png new file mode 100644 index 000000000..3c9aa823e Binary files /dev/null and b/app/ui_tests/evidence/issue-406/compare-tasks-before-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/live-events-after-1280-light.png b/app/ui_tests/evidence/issue-406/live-events-after-1280-light.png new file mode 100644 index 000000000..259b56778 Binary files /dev/null and b/app/ui_tests/evidence/issue-406/live-events-after-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/live-events-before-1280-light.png b/app/ui_tests/evidence/issue-406/live-events-before-1280-light.png new file mode 100644 index 000000000..b8f7212c1 Binary files /dev/null and b/app/ui_tests/evidence/issue-406/live-events-before-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/live-winners-after-1280-light.png b/app/ui_tests/evidence/issue-406/live-winners-after-1280-light.png new file mode 100644 index 000000000..16be0f52b Binary files /dev/null and b/app/ui_tests/evidence/issue-406/live-winners-after-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/live-winners-before-1280-light.png b/app/ui_tests/evidence/issue-406/live-winners-before-1280-light.png new file mode 100644 index 000000000..d04cabbf0 Binary files /dev/null and b/app/ui_tests/evidence/issue-406/live-winners-before-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/outcomes-after-1280-light.png b/app/ui_tests/evidence/issue-406/outcomes-after-1280-light.png new file mode 100644 index 000000000..0156419b3 Binary files /dev/null and b/app/ui_tests/evidence/issue-406/outcomes-after-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/outcomes-before-1280-light.png b/app/ui_tests/evidence/issue-406/outcomes-before-1280-light.png new file mode 100644 index 000000000..c9a23444f Binary files /dev/null and b/app/ui_tests/evidence/issue-406/outcomes-before-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/recipes-after-1280-light.png b/app/ui_tests/evidence/issue-406/recipes-after-1280-light.png new file mode 100644 index 000000000..be7b5c38e Binary files /dev/null and b/app/ui_tests/evidence/issue-406/recipes-after-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/recipes-before-1280-light.png b/app/ui_tests/evidence/issue-406/recipes-before-1280-light.png new file mode 100644 index 000000000..1d67b103c Binary files /dev/null and b/app/ui_tests/evidence/issue-406/recipes-before-1280-light.png differ diff --git a/app/ui_tests/evidence/issue-406/staged-folder-after-390-light.png b/app/ui_tests/evidence/issue-406/staged-folder-after-390-light.png new file mode 100644 index 000000000..38763b0ac Binary files /dev/null and b/app/ui_tests/evidence/issue-406/staged-folder-after-390-light.png differ diff --git a/app/ui_tests/evidence/issue-406/staged-folder-before-390-light.png b/app/ui_tests/evidence/issue-406/staged-folder-before-390-light.png new file mode 100644 index 000000000..f594a1b5c Binary files /dev/null and b/app/ui_tests/evidence/issue-406/staged-folder-before-390-light.png differ diff --git a/app/ui_tests/evidence/issue-406/trace-after-390-light.png b/app/ui_tests/evidence/issue-406/trace-after-390-light.png new file mode 100644 index 000000000..d57b99477 Binary files /dev/null and b/app/ui_tests/evidence/issue-406/trace-after-390-light.png differ diff --git a/app/ui_tests/evidence/issue-406/trace-before-390-light.png b/app/ui_tests/evidence/issue-406/trace-before-390-light.png new file mode 100644 index 000000000..425ed18a2 Binary files /dev/null and b/app/ui_tests/evidence/issue-406/trace-before-390-light.png differ diff --git a/app/ui_tests/test_catalogue_routes.py b/app/ui_tests/test_catalogue_routes.py index 71c548b74..643305100 100644 --- a/app/ui_tests/test_catalogue_routes.py +++ b/app/ui_tests/test_catalogue_routes.py @@ -224,7 +224,7 @@ def test_a_proof_short_of_the_full_mark_has_no_green_tick_and_says_its_bound(sel self.assertIn("✓ 1871/2000", row("3GPP TSG · Full")) self.assertIn('', row("3GPP TSG · Lite")) self.assertIn("the reference answers: must score at least 93% - made by Nullius", row("3GPP TSG · Lite")) - self.assertIn('✓', row("TeleQnA · Lite")) # every unit: green + self.assertIn('✓ 1000/1000', row("TeleQnA · Lite")) # every unit: green self.assertNotIn("std-proof-part", row("TeleQnA · Lite")) self.assertIn("no answer at all: must score nothing", row("TeleQnA · Lite")) diff --git a/app/ui_tests/test_tool_categories.py b/app/ui_tests/test_tool_categories.py index 7e254157f..6e2487739 100644 --- a/app/ui_tests/test_tool_categories.py +++ b/app/ui_tests/test_tool_categories.py @@ -116,6 +116,20 @@ def test_names_are_evidence_behind_the_chips_never_a_chip(self): for _, _, sentence, _ in SAME_WORK: self.assertNotIn(f'data-category="{sentence}"', verbose) + def test_long_tool_names_are_complete_in_the_table_and_category_help(self): + name = 'Read_' + 'conversation_history_' * 6 + '' + steps = two_agent_steps()['short'][:1] + steps[0]['tool_calls'][0]['function_name'] = name + with tempfile.TemporaryDirectory(prefix="nullius-long-tool-") as tmp: + record = _job(Path(tmp), "long-tool", "fixture", steps) + with patch.object(workspace, "load_jobs", return_value=[record]): + html = self.trial_page(record) + from html import escape, unescape + table = re.search(r'', html, re.S).group(0) + cells = re.findall(r']*>(.*?)', table, re.S) + self.assertIn(name, [unescape(re.sub(r'<[^>]+>', '', cell)) for cell in cells]) + self.assertIn(escape(name) + ' ×1', html) + def test_a_trial_without_a_trajectory_shows_no_summary(self): with tempfile.TemporaryDirectory(prefix="nullius-no-traj-") as tmp: bare = _job(Path(tmp), "bare", "none", [])