From 4e879031cabacd0b2955e7b1dbe020ea714b7083 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Thu, 1 Oct 2026 09:40:38 +0100 Subject: [PATCH] feat: simplify Heart score and repair sections --- heart/dashboard.py | 43 ++++++++++++++----------- tests/test_dashboard.py | 3 +- tests/test_dashboard_disclosures.py | 49 ++++++++++++++++++++++++++++- tests/test_fix.py | 2 +- 4 files changed, 76 insertions(+), 21 deletions(-) diff --git a/heart/dashboard.py b/heart/dashboard.py index b7485d23..23880dbe 100644 --- a/heart/dashboard.py +++ b/heart/dashboard.py @@ -1923,11 +1923,6 @@ def _html_reason(item: dict) -> str: return f"
  • {text}
  • " -# The Heart's verdict in the theme's tone vocabulary. The board's own -# `_VERDICT_STATE` stays the internal truth; this is only how it is painted. -_VERDICT_TONE = {"red": "bad", "yellow": "warn", "stale": "warn", - "green": "ok"} - _LEDE = ('Is it safe to release? See what needs attention, then copy a prompt ' 'to work through it in your coding chat.') @@ -2006,8 +2001,11 @@ def _html_reason(item: dict) -> str: body button.copy{min-width:44px;min-height:44px; width:auto;height:auto;padding:.55rem .8rem;white-space:normal;font-size:1rem; overflow:visible;text-overflow:clip} -.actions{display:flex;gap:.65rem;flex-wrap:wrap;margin:1rem 0} -.actions button{font-weight:650} +.score-value{display:flex;align-items:baseline;gap:.8rem;flex-wrap:wrap} +.score-value strong{font-size:1.5rem;font-variant-numeric:tabular-nums} +.repair{margin:0;min-width:0} +.repair > summary{padding:.85rem 7rem .85rem 1rem;min-height:3.3rem;box-sizing:border-box} +.repair pre{padding:0 1rem 1rem;margin:0} .prompt-fallback pre,#copy-fallback{white-space:pre-wrap;overflow-wrap:anywhere; max-height:24rem;overflow:auto;font-size:1rem;line-height:1.5;user-select:text} .duration{font-weight:750;font-variant-numeric:tabular-nums;color:var(--fg)} @@ -2113,15 +2111,17 @@ def _html_actions(board: Board) -> str: plans = [("Fix Heart systematically", board.fix_plan or build_fix_plan(board))] if board.stale_plan: plans.append(("Refresh all missing evidence", board.stale_plan)) - buttons = " ".join(_copy_btn(p["prompt"], f"copy prompt: {label}", label) - for label, p in plans) - fallbacks = "".join( - f'
    {label} — view / select prompt' - f'
    {_html.escape(plan["prompt"])}
    ' - for label, plan in plans) - return (f'
    {buttons}
    ' + rows = [] + for label, plan in plans: + button = _copy_btn(plan["prompt"], label, icon=True) + rows.append( + '
    ' + f'
    {_html.escape(label)}' + f'
    {_html.escape(plan["prompt"])}
    ' + f'
    {button}
    ') + return ('
    ' + ''.join(rows) + '
    ' '

    ' - '' + fallbacks) + '') def _render_html(board: Board) -> str: @@ -2225,16 +2225,23 @@ def _render_html(board: Board) -> str:

    Observed checks

    Expand a check to see its entries. Colours describe observations; the release verdict below determines readiness.

    {''.join(rows)}
    -

    {word} · score - {board.score}snapshot {_html.escape(board.ts)} · - {age} · markdown version{github_link}

    +
    +

    Score

    +

    {board.score}/100 +Release readiness: {word}

    +

    snapshot {_html.escape(board.ts)} · + {age} · markdown version{github_link}

    {stale_html}

    {_html.escape(board.vantage)} · {_html.escape(board.devbox_observed or ('no dev-box observation attached' if board.vantage == 'cloud snapshot' else 'observed on this dev box'))}

    {_html_score(board)}

    {len(board.red_reasons)} release blockers · {len(board.yellow_reasons)} warnings · {len(board.stale_reasons)} evidence gaps

    +
    +
    +

    Resusitate

    {_html_actions(board)} +
    {reasons_html} {_boards_nav_html()}