From ac467e2dfb66f85a02350dc61a1268d96b599abc Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 14 Oct 2026 15:50:30 +0100 Subject: [PATCH] feat: simplify Memory board and catch-up tab --- scripts/board.py | 54 ++++++++++++++++++--------------------------- tests/test_board.py | 42 ++++++++++++++++++++++------------- 2 files changed, 49 insertions(+), 47 deletions(-) diff --git a/scripts/board.py b/scripts/board.py index 1f94735..7fc17cb 100644 --- a/scripts/board.py +++ b/scripts/board.py @@ -92,7 +92,6 @@ #: holds everything that was missed — git history does, which is exactly what #: ``scripts/catch_up.py`` reads back. CATCH_UP_DAYS = 7 -CATCH_UP_LYRIC = "…so… I've been lost for a while" # Fred again.. CATCH_UP_CMD = "Read PyAutoMemory/skills/catch_up/SKILL.md and follow the catch_up skill with arguments: lensing." # The family look lives once, in the Brain (``board/_theme.py``): the @@ -701,27 +700,23 @@ def _catch_up_due(snapshot: dict) -> int | None: return model["age_days"] if model["state"] == "stale" else None -def _catch_up_md(snapshot: dict) -> list[str]: +def _catch_up_summary(snapshot: dict) -> str: model = _lensing_catch_up(snapshot) - if model["state"] == "healthy": - return [] - title = "Strong-lensing catch-up due" if model["state"] == "stale" else "Strong-lensing freshness unknown" - return [f"> **{title}**", f"> {model['reason']}", - f"> Next: `{CATCH_UP_CMD}` — human-reviewed paper selection.", ""] + if model["state"] == "unknown": + return "Catch-up start date unknown." + due = model["due_at"][:10] + status = "due" if model["state"] == "stale" else "next due" + return f"Catch up from {model['last_activity']} · {status} {due}." + + +def _catch_up_md(snapshot: dict) -> list[str]: + return ["## Catch up", "", _catch_up_summary(snapshot), "", + f"`{CATCH_UP_CMD}`", ""] def _catch_up_html(snapshot: dict) -> str: - model = _lensing_catch_up(snapshot) - if model["state"] == "healthy": - return "" - title = "Strong-lensing catch-up due" if model["state"] == "stale" else "Strong-lensing freshness unknown" - lyric = (f"

{_html.escape(CATCH_UP_LYRIC)}

" - if model["state"] == "stale" else "") - return (f"
{lyric}

{title}

" - f"

{_html.escape(model['reason'])}

" - f"

{_html.escape(CATCH_UP_CMD)} " - f"{_copy_btn(CATCH_UP_CMD, 'copy: catch up on strong lensing')} " - "Human-reviewed paper selection

") + return (f"

{_html.escape(_catch_up_summary(snapshot))}

" + f"{_copy_btn(CATCH_UP_CMD, 'Copy catch-up prompt')}") def _totals(snapshot: dict) -> dict: @@ -1163,9 +1158,6 @@ def _bar(statuses: dict) -> str: color:var(--bg);opacity:0;transition:opacity .2s;pointer-events:none;z-index:9} #toast.show{opacity:1} #toast.bad{background:var(--warn)} -.catchup{border-left:3px solid var(--warn);padding:.4em .9em;margin:0 0 1em} -.catchup p{margin:.25em 0} -.catchup .lyric{color:var(--warn)} """ # The shared copy handler is delegated, so a chip inside a would @@ -1592,9 +1584,7 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str, filing_items.append( f"
  • {issue_link} " f"{_html.escape(f['branch'])}{pr}
  • ") - # Above everything else when present, absent otherwise: it is the one - # section that is a human's merge, and an empty "nothing waiting" line - # would only teach the eye to skip it. + # Keep pending filings in their own navigable section when present. filings_block = ( f"

    Filings awaiting merge ({len(filing_items)} " f"on a branch, not yet in memory — merge the PR to finish the " @@ -1608,10 +1598,9 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str, {"href": "#citation-work", "label": "To cite", "count": t["todo"]}, {"href": "#sub-wikis", "label": "Pages", "count": t["pages"], "context": f"{pct}% cited"}, ] - if _catch_up_html(snapshot): - navigation.insert(0, {"href": "#catch-up", "label": "Catch up"}) + navigation.append({"href": "#catch-up", "label": "Catch up"}) if filing_items: - navigation.insert(0, {"href": "#filings", "label": "Filings awaiting merge", "count": len(filing_items)}) + navigation.append({"href": "#filings", "label": "Filings awaiting merge", "count": len(filing_items)}) hero = t_.hero(BOARD_KEY, "Dashboard", _LEDE, navigation=navigation) repo_url = _repo_url(snapshot) panel = t_.orchestration_panel( @@ -1637,12 +1626,9 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str, {hero} {panel} -
    {_catch_up_html(snapshot)}
    -

    markdown version{onetap}

    -
    -{filings_block}

    arXiv inbox (suggested overnight — un-acted papers lapse after {inbox_actions.INBOX_WINDOW_DAYS} days)

    +
    {onetap.removeprefix(" · ")}
    {inbox_block}

    arXiv interests (everything that is not strong lensing — one day's ten at a time; \U0001f9f9 clears the day and shows the @@ -1658,8 +1644,12 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str,

    Sub-wikis ({snapshot.get('bib_entries', 0)} bibliography entries · {snapshot.get('links', {}).get('wanted', 0)} wanted pages)

    {''.join(wiki_rows)}
    +

    Catch up

    +{_catch_up_html(snapshot)} +{filings_block} {_boards_nav(snapshot)} -