Skip to content

fix(bearings): wrap board row text instead of clipping it mid-word - #2

Merged
demy00 merged 9 commits into
mainfrom
fm/fm-board-text-clipped-b8
Sep 22, 2026
Merged

demy00 merged 9 commits into
mainfrom
fm/fm-board-text-clipped-b8

Conversation

@demy00

@demy00 demy00 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Intent

The captain reviewed the interactive fleet board on 2026-09-08 and reported, in his own words: "thanks firstmate this was really helpful. fyi: some text is not visible tho in the lavish document." His screenshot shows the Underway and Recently Landed rows cutting their titles off mid-word with an ellipsis, so a row reading "Backend wave 1 (deliveries 50..." tells the reader nothing about what the work actually is. The board is his main surface for seeing what the fleet is doing, so unreadable rows defeat its purpose.

What Changed

  • Board row titles (Underway, Recently Landed, Charted Next) now wrap to as many lines as they need instead of being cut to one line with an ellipsis; row sub lines and the decision card PR link clamp at two lines, row controls align to the title's first line, and other text (decision card copy, option labels, section head, provenance footer, dispatch bar) wraps or shrinks so narrow windows no longer clip it or scroll sideways.
  • Text that can still be clamped (row text, decision repo name, PR link) gets a full-text tooltip only when it measures as clamped after layout, re-measured on font load, resize and card deal. The stack nav and dispatch bar now actually disappear when hidden ([hidden] was being overridden by display: flex), with the renderer setting their hidden state in both directions.
  • The render harness now reports decisions, landed, per-line tooltips and a controls field (plus a classList.toggle/remove shim), and new tests cover long titles rendering in full in every fleet section without blanket tooltips, the decision card repo name, and controls being withdrawn only when there is nothing to act on.

Risk Assessment

✅ Low: The change is well-bounded CSS wrapping plus guarded, idempotent tooltip measurement and explicit hidden-state handling; row titles now wrap uncapped at every width as the intent requires, the withdrawn source-asserting CSS test and harness stylesheet parsing are fully removed, and the remaining tests assert rendered output only.

Testing

Ran the targeted suite tests/fm-bearings-board-render.test.sh and it passed. Then I built real boards with bin/fm-bearings-board.sh build from a payload with the captain's long "Backend wave 1 ..." title in all three fleet sections plus an unbreakable branch-name title, once with the base-commit template and once with the target template. I rendered both in headless Chrome over CDP at 1280px, 400px and 320px, capturing before/after screenshots and per-title layout measurements (line count, text-overflow, scrollWidth vs clientWidth, document scroll width, computed display of the stack nav and dispatch bar). Base reproduces the mid-word ellipsis at every width; target shows every title in full at every width with no horizontal overflow.

Evidence: Browser layout measurements per title, base vs target, at 1280/400/320px

Source: Browser layout measurements per title, base vs target, at 1280/400/320px

{
  "base-wide": {
    "innerWidth": 1280,
    "docScrollWidth": 1280,
    "titles": [
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 397,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 1095
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 418,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 610
      },
      {
        "text": "feature/settlement-ledger-wr...",
        "clientWidth": 418,
        "scrollWidth": 708,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 610
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 475,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 1183
      }
    ],
    "stacknavDisplay": "flex",
    "dispatchDisplay": "flex"
  },
  "base-narrow": {
    "innerWidth": 400,
    "docScrollWidth": 464,
    "titles": [
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 190,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 265
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 211,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 353
      },
      {
        "text": "feature/settlement-ledger-wr...",
        "clientWidth": 211,
        "scrollWidth": 708,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 353
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 268,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 353
      }
    ],
    "stacknavDisplay": "flex",
    "dispatchDisplay": "flex"
  },
  "base-phone": {
    "innerWidth": 320,
    "docScrollWidth": 464,
    "titles": [
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 110,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 185
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 131,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 273
      },
      {
        "text": "feature/settlement-ledger-wr...",
        "clientWidth": 131,
        "scrollWidth": 708,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 273
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 188,
        "scrollWidth": 892,
        "clientHeight": 20,
        "scrollHeight": 20,
        "lines": 1,
        "textOverflow": "ellipsis",
        "overflow": "hidden",
        "whiteSpace": "nowrap",
        "tooltip": "",
        "rightEdge": 273
      }
    ],
    "stacknavDisplay": "flex",
    "dispatchDisplay": "flex"
  },
  "target-wide": {
    "innerWidth": 1280,
    "docScrollWidth": 1280,
    "titles": [
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 397,
        "scrollWidth": 397,
        "clientHeight": 59,
        "scrollHeight": 59,
        "lines": 3,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 1095
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 418,
        "scrollWidth": 418,
        "clientHeight": 59,
        "scrollHeight": 59,
        "lines": 3,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 610
      },
      {
        "text": "feature/settlement-ledger-wr...",
        "clientWidth": 418,
        "scrollWidth": 418,
        "clientHeight": 39,
        "scrollHeight": 40,
        "lines": 2,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 610
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 475,
        "scrollWidth": 475,
        "clientHeight": 59,
        "scrollHeight": 59,
        "lines": 3,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 1183
      }
    ],
    "stacknavDisplay": "none",
    "dispatchDisplay": "flex"
  },
  "target-narrow": {
    "innerWidth": 400,
    "docScrollWidth": 400,
    "titles": [
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 190,
        "scrollWidth": 190,
        "clientHeight": 117,
        "scrollHeight": 118,
        "lines": 6,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 265
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 211,
        "scrollWidth": 211,
        "clientHeight": 98,
        "scrollHeight": 98,
        "lines": 5,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 353
      },
      {
        "text": "feature/settlement-ledger-wr...",
        "clientWidth": 211,
        "scrollWidth": 211,
        "clientHeight": 78,
        "scrollHeight": 79,
        "lines": 4,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 353
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 268,
        "scrollWidth": 268,
        "clientHeight": 78,
        "scrollHeight": 79,
        "lines": 4,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 353
      }
    ],
    "stacknavDisplay": "none",
    "dispatchDisplay": "flex"
  },
  "target-phone": {
    "innerWidth": 320,
    "docScrollWidth": 320,
    "titles": [
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 110,
        "scrollWidth": 110,
        "clientHeight": 176,
        "scrollHeight": 176,
        "lines": 9,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 185
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 131,
        "scrollWidth": 131,
        "clientHeight": 176,
        "scrollHeight": 176,
        "lines": 9,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 273
      },
      {
        "text": "feature/settlement-ledger-wr...",
        "clientWidth": 131,
        "scrollWidth": 131,
        "clientHeight": 137,
        "scrollHeight": 137,
        "lines": 7,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 273
      },
      {
        "text": "Backend wave 1 (deliveries 5...",
        "clientWidth": 188,
        "scrollWidth": 188,
        "clientHeight": 117,
        "scrollHeight": 118,
        "lines": 6,
        "textOverflow": "clip",
        "overflow": "visible",
        "whiteSpace": "normal",
        "tooltip": "",
        "rightEdge": 273
      }
    ],
    "stacknavDisplay": "none",
    "dispatchDisplay": "flex"
  }
}
Evidence: Measurement digest (real Chrome layout)
base 1280px: titles 1 line, text-overflow: ellipsis, scrollWidth 892 vs clientWidth 397-475 (clipped); stacknav display: flex
base 400px: titles 1 line, ellipsis, clipped; document scrollWidth 464 > viewport 400 (sideways scroll)
base 320px: titles 1 line, ellipsis, clipped; document scrollWidth 464 > viewport 320
target 1280px: titles 2-3 lines, text-overflow: clip, scrollWidth == clientWidth (nothing hidden), no tooltip; stacknav display: none
target 400px: titles 4-6 lines, nothing hidden; document scrollWidth 400 == viewport
target 320px: titles 6-9 lines, nothing hidden; document scrollWidth 320 == viewport

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ .agents/skills/bearings/assets/board-template.html:740 - After the fix round removed the line ceiling from .bb-row__title, titles can no longer clamp (no overflow: hidden, overflow-wrap: anywhere prevents width overflow), yet all three sections still build them through rowText("bb-row__title", ...), which registers them in clampWatch and re-measures them on every refreshClampTooltips() (initial render, each card flip, fonts ready, resize). Traced: for a title scrollWidth - clientWidth is 0 and scrollHeight - clientHeight is 0, so isClamped is always false and no tooltip is ever set - behaviour is correct, the watch is just dead work. Using plain el(...) for titles would be a small cleanup, but the user's direction for that round was to keep the template fix exactly as is, so no action is needed here.
✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-bearings-board-render.test.sh - all tests ok, including the long-row, decision-card and withdrawn-controls tests
  • Manual: bin/fm-bearings-board.sh build payload.json with a stub lavish-axi, once with FM_BEARINGS_BOARD_TEMPLATE pointing at git show 259a669:.agents/skills/bearings/assets/board-template.html (base) and once with the shipped template (target)
  • Manual: headless Google Chrome over CDP (Emulation.setDeviceMetricsOverride at 1280/400/320px, Page.captureScreenshot full page) for base and target boards
  • Manual: Runtime.evaluate probe of every .bb-row__title (lines, text-overflow, scrollWidth vs clientWidth, tooltip), document scrollWidth vs innerWidth, and computed display of .bb-stacknav / .bb-dispatch
  • Note: plain --headless --screenshot --window-size=400 gave a misleading right-cropped capture, because headless Chrome on macOS laid out wider than 400px; those shots were discarded in favour of CDP device-metrics emulation
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Underway, Landed and Charted Next rows clipped their title and subtitle
to one line with an ellipsis, so a row reading "Backend wave 1
(deliveries 50..." told the reader nothing about the work. The board is
the captain's main surface for seeing what the fleet is doing, so an
unreadable row defeats its purpose.

Row titles now wrap, bounded at four lines, and subtitles at two; the
Captain's Call PR link wraps to two lines instead of losing its tail, so
the full URL is visible. Every wrapping text rule gained
overflow-wrap:anywhere so a long unbroken identifier breaks instead of
pushing the page sideways, and the renderer hands each row's full text
to its own tooltip for the rare line that still hits the clamp.

The section head's muted sub-label ("2 items wait on you, captain") was
nowrap inside a flex head and pushed the page sideways below ~470px;
it now wraps, which was the last horizontal-overflow source. Verified in
Chrome at 320, 500, 900 and 1280 CSS px: document width equals viewport
width at every one, and no element extends past the viewport.

nowrap is kept where it protects short badges, buttons, the eyebrow
labels, the mono task id, the "kunchenguid#1234" PR shorthand, the decision card's
repo name, the context-row keys and the footer provenance line - each is
a short badge, pill or identifier that must not break.
…ed against changes

The clamp verdict decided whether a row carries a tooltip, but it was
taken once, immediately, against a layout the reader never sees. The
board pulls its webfonts with display=swap, so the page lays out in
fallback metrics first and the swap reflows every row afterwards with no
re-measure; the 900px breakpoint collapses the two columns with the same
effect. A title near the four-line boundary could therefore keep a
tooltip repeating fully visible text, or lose one whose tail really was
hidden.

refreshClampTooltips now clears a tooltip whose line no longer measures
as clamped, so no verdict outlives its layout, and it re-runs once fonts
have settled and on a debounced resize. Both are guarded: the DOM shim in
tests/assets/board-render-harness.mjs has neither document.fonts nor a
real window, and an unguarded call would fail the whole render.

The predicate itself was also wrong. These rows have a fractional
19.5px line-height, so a fully visible two-line title measures a
scrollHeight of 40 against a clientHeight of 39 purely from rounding, and
a bare `scrollHeight > clientHeight` tooltipped it - the redundant-tooltip
regression this was meant to remove. Clamping hides whole lines, so the
threshold is half a line: comfortably above the rounding noise, far below
one hidden line.

Verified in Chrome at 320, 500, 900 and 1280 CSS px: no element extends
past the viewport at any of them, only the genuinely clipped row carries
a tooltip, narrowing to 320 correctly adds six more, and widening back
clears them again.
The decision card's repository name is the first thing read when something
needs the captain, but it is a single-line identifier inside a card that clips
with overflow:hidden. Without min-width:0 the flex child refused to shrink, so
the tail was cut at the card edge with no ellipsis to show it happened. It now
shrinks, ellipsises, and carries the full name in a measured tooltip.

Two more rules were hiding real content at narrow widths:

- The footer provenance stamp held one line in a right-aligned footer, so
  instead of ellipsising it overhung to the LEFT and pushed the schema name off
  the viewport below roughly 370px. It now wraps.
- The dispatch row could not fit its fixed button label beside the count, so it
  scrolled sideways with the button cut at the card edge. It now wraps the
  button onto its own line.

isClamped only measured height, so a sideways-truncated identifier never earned
a tooltip; it now counts width overflow too.

Verified in Chrome from 320px to 1600px: no element scrolls sideways and none
sits offscreen at any nesting level.
The dispatch bar and the Captain's Call pager are withdrawn through the
`hidden` attribute, but an author-origin `display: flex` beats the UA
stylesheet's `[hidden] { display: none }`. On a board with nothing
dispatchable the captain therefore saw a "nothing picked" bar carrying a
"Queue dispatch order" button that was neither disabled nor wired to a
click handler, and an empty Captain's Call still showed its pager. One
rule restores the attribute, in the same style the decision card already
uses one section below.

The renderer now states both hidden flags outright instead of setting
only the unhide and leaving the other case to a markup default, so the
invariant lives in one place and is observable without a layout engine.

Measured in Chrome, board with nothing to act on, before and after:
dispatch bar display flex / 58px high with an enabled button, now none /
0px; pager likewise. A board with dispatchable work and one call card
keeps both controls at every width from 320px to 1600px, and no element
scrolls sideways at any of them.
The guard added with the clamp removal asserted that specific declarations
are present in the built board's stylesheet, which is what this repo's
guidelines forbid - a test must exercise behaviour through an executable or
public interface and never assert implementation source, including through a
parser. This suite's own header says it asserts what the page renders and
never the template's source text, so the guard contradicted the file it sat
in, and it bought a guarantee it could not actually provide: it pins what the
rules say, not what the board paints.

So the stylesheet model comes out of the render harness and the guard comes
out of the suite. The CSS that does the actual fixing is unverified by the
suite in this change; verifying it needs browser-render machinery this repo
does not have, which is filed separately rather than introduced here.

The template fix is unchanged: a row title still wraps to as many lines as it
needs at every width, with no ceiling, no clipping and no ellipsis.

Measured in Chrome at a 320px layout viewport: a 106-character title wraps to
10 fully visible lines and a 91-character unbreakable identifier to 8, neither
clipped nor cut sideways, no tooltip needed, and nothing scrolls sideways at
any nesting level. At 1400px the same titles take 3 and 2 lines.
@demy00 demy00 closed this Sep 22, 2026
@demy00 demy00 reopened this Sep 22, 2026
@demy00
demy00 merged commit a08f79c into main Sep 22, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant