Skip to content

Commit 1932c4b

Browse files
author
James Nightingale
authored
Merge pull request #116 from PyAutoLabs/feature/board-navigation-memory
Use shared banner and board section navigation
2 parents 3eb820d + 75521da commit 1932c4b

2 files changed

Lines changed: 21 additions & 13 deletions

File tree

‎scripts/board.py‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,14 +1565,23 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str,
15651565
# section that is a human's merge, and an empty "nothing waiting" line
15661566
# would only teach the eye to skip it.
15671567
filings_block = (
1568-
f"<h2>Filings awaiting merge <span class=\"muted\">({len(filing_items)} "
1568+
f"<h2 id='filings'>Filings awaiting merge <span class=\"muted\">({len(filing_items)} "
15691569
f"on a branch, not yet in memory — merge the PR to finish the "
15701570
f"intake)</span></h2><ul class='papers'>{''.join(filing_items)}</ul>"
15711571
if filing_items else "")
15721572

1573-
hero = t_.hero(BOARD_KEY, "Dashboard", _LEDE)
1574-
stats = t_.stats((t["pages"], "Pages"), (f"{pct}%", "Cited"),
1575-
(t["todo"], "To cite"), (t["queued"], "Queued"))
1573+
navigation = [
1574+
{"href": "#arxiv-inbox", "label": "arXiv inbox"},
1575+
{"href": "#arxiv-interests", "label": "arXiv interests"},
1576+
{"href": "#reading-queue", "label": "Reading queue", "count": t["queued"]},
1577+
{"href": "#citation-work", "label": "To cite", "count": t["todo"]},
1578+
{"href": "#sub-wikis", "label": "Pages", "count": t["pages"], "context": f"{pct}% cited"},
1579+
]
1580+
if _catch_up_html(snapshot):
1581+
navigation.insert(0, {"href": "#catch-up", "label": "Catch up"})
1582+
if filing_items:
1583+
navigation.insert(0, {"href": "#filings", "label": "Filings awaiting merge", "count": len(filing_items)})
1584+
hero = t_.hero(BOARD_KEY, "Dashboard", _LEDE, navigation=navigation)
15761585
# The way back from the Pages board to the repository front door; the
15771586
# segment drops out when the snapshot carries no owner/repo.
15781587
repo_url = _repo_url(snapshot)
@@ -1594,27 +1603,26 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str,
15941603
<style>{t_.css(BOARD_KEY)}{_EXTRA_CSS}</style>
15951604
</head>
15961605
<body{body_attrs}>
1597-
{_catch_up_html(snapshot)}
15981606
{hero}
1599-
{stats}
1607+
<section id="catch-up">{_catch_up_html(snapshot)}</section>
16001608
<p class="muted mdsrc"><a href="dashboard.md">markdown version</a>{github_link}{onetap}</p>
16011609
<div id="toast"></div>
16021610
{filings_block}
1603-
<h2>arXiv inbox <span class="muted">(suggested overnight — un-acted papers
1611+
<h2 id='arxiv-inbox'>arXiv inbox <span class="muted">(suggested overnight — un-acted papers
16041612
lapse after {inbox_actions.INBOX_WINDOW_DAYS} days)</span></h2>
16051613
{inbox_block}
1606-
<h2>arXiv interests <span class="muted">(everything that is not strong
1614+
<h2 id='arxiv-interests'>arXiv interests <span class="muted">(everything that is not strong
16071615
lensing — one day's ten at a time; \U0001f9f9 clears the day and shows the
16081616
next; un-cleared batches lapse after {inbox_actions.INBOX_WINDOW_DAYS} days
16091617
{interests_backlog_note})</span></h2>
16101618
{interests_block}
1611-
<h2>Reading queue <span class="muted">({trend_bits})</span>{spark}</h2>
1619+
<h2 id='reading-queue'>Reading queue <span class="muted">({trend_bits})</span>{spark}</h2>
16121620
{filter_box}
16131621
{''.join(queue_blocks)}
1614-
<h2>Citation work queue <span class="muted">({t['todo']} sections need a
1622+
<h2 id='citation-work'>Citation work queue <span class="muted">({t['todo']} sections need a
16151623
canonical key)</span></h2>
16161624
<table class="recent">{''.join(todo_rows)}</table>
1617-
<h2>Sub-wikis <span class="muted">({snapshot.get('bib_entries', 0)} bibliography
1625+
<h2 id='sub-wikis'>Sub-wikis <span class="muted">({snapshot.get('bib_entries', 0)} bibliography
16181626
entries · {snapshot.get('links', {}).get('wanted', 0)} wanted pages)</span></h2>
16191627
<table class="recent">{''.join(wiki_rows)}</table>
16201628
{_boards_nav(snapshot)}

‎tests/test_board.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,13 +961,13 @@ def test_banner_at_the_threshold_carries_the_day_count(tmp_path):
961961
assert md.index("Strong-lensing catch-up due") < md.index("_Contents")
962962

963963

964-
def test_banner_html_sits_above_the_hero_with_a_copy_button(tmp_path):
964+
def test_catchup_html_follows_banner_and_navigation_with_a_copy_button(tmp_path):
965965
snap = _banner_snap(tmp_path, "2026-09-11")
966966
page = board.render(snap, "html")
967967
assert "<em>…so… I&#x27;ve been lost for a while</em>" in page
968968
assert "2026-09-11 (19 days ago)" in page
969969
assert 'data-cmd="Read PyAutoMemory/skills/catch_up/SKILL.md and follow the catch_up skill with arguments: lensing."' in page
970-
assert page.index("class='catchup'") < page.index('class="hero"')
970+
assert page.index('class="hero"') < page.index('class="board-nav"') < page.index("class='catchup'")
971971
assert board.to_state(snap)["days_since_ingest"] == 19
972972

973973

0 commit comments

Comments
 (0)