From 43b16a3943c11a1aab164118e9be55b2b993da83 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Mon, 16 Nov 2026 15:40:32 +0000 Subject: [PATCH 1/3] feat(intake): Goals and Queue as collapsible blocks above Start here (#650) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Mind dashboard's read-only Goals and Queue box at the top of the page becomes two plain

sections rendered straight before Start here, so the shared section_layout folds each into the same details.board-section block as every other section: closed by default, a count badge (owner-supplied via section_layout's summaries, since they have no nav card) and the markdown source icon linking goals.md / queue.md. Queue rows keep their star/rank and copy button; nothing interactive is added and the CSP is unchanged. - The old ") - inbox = page.find('", inbox) + len("") box = page[start:end] page = page[:start] + page[end:] return page[:nav] + box + "\n" + page[nav:] @@ -2933,7 +2935,6 @@ def record_row(r): work_links=[{"label": "Open Mind repository", "href": home}] if home else [], organ="mind", refreshed_at=c.get("refreshed_at"), refresh_url=home + "/actions/workflows/dashboard_refresh.yml" if home else None)) - H += _steer_html(c, link) H += _inbox_html(c, link) if c.get("drift"): H += ['

⚠️ Needs lifecycle reconciliation — draft prompts ' @@ -2958,6 +2959,20 @@ def record_row(r): H.append(_html_task(text, _looks_shipped_payload(f))) if c["batch"] is not None: H.append(_status_box_html(c["batch"])) + + def h2(title, src): + # Every section links the markdown file it is rendered from — the + # registry file is the full record, the page is the view. + a = (f' markdown ' + "version") if blob else "" + anchor = {"In flight": "in-flight", + "Planned": "planned", "Backlog": "backlog", + "Epics": "epics", "Goals": "goals", + "Queue": "queue"}.get(title) + prefix = f'' if anchor else "" + return prefix + f"

{title}{a}

" + + H += _steer_html(c, link, h2) H += ['

Start here

'] members = _epic_members(c) @@ -2976,17 +2991,6 @@ def record_row(r): H += [f'

{title} ({note}){more}

'] H += [record_row(r) for r in shown] or ['

(none right now)

'] - def h2(title, src): - # Every section links the markdown file it is rendered from — the - # registry file is the full record, the page is the view. - a = (f' markdown ' - "version") if blob else "" - anchor = {"In flight": "in-flight", - "Planned": "planned", "Backlog": "backlog", - "Epics": "epics"}.get(title) - prefix = f'' if anchor else "" - return prefix + f"

{title}{a}

" - known = {e["slug"] for e in c.get("epics") or []} stray = [s for s in members if s not in known] H += [h2("Epics", "epics.md")] @@ -3133,7 +3137,11 @@ def h2(title, src): if footer: H.append(footer) H += [f"", "", ""] - return _with_csp(_steer_first(section_layout("\n".join(H) + "\n"))) + # Goals and Queue have no navigation card to lend them a count badge, so + # they supply their own through the shared layout's `summaries`. + counts = {"goals": {"count": len(c.get("goals") or [])}, + "queue": {"count": len(c.get("queue_order") or [])}} + return _with_csp(_inbox_first(section_layout("\n".join(H) + "\n", counts))) def _dashboard_body(page: str) -> str: diff --git a/tests/test_intake_dashboard.py b/tests/test_intake_dashboard.py index 0339c8e3..e752217f 100644 --- a/tests/test_intake_dashboard.py +++ b/tests/test_intake_dashboard.py @@ -1419,7 +1419,8 @@ def test_empty_mind_has_seven_zero_count_destinations(tmp_path): assert nav.count('board-nav-count">0') == 7 for target in re.findall(r'href="#([^"]+)"', nav): assert page.count(f'id="{target}"') == 1 - assert page.count('
') == 7 + # The seven destinations plus the Goals and Queue blocks (PyAutoBrain#650). + assert page.count('
') == 9 assert "nothing pending release" in page and "no epics" in page diff --git a/tests/test_intake_dashboard_queue.py b/tests/test_intake_dashboard_queue.py index 88300d6d..72ffecb9 100644 --- a/tests/test_intake_dashboard_queue.py +++ b/tests/test_intake_dashboard_queue.py @@ -1,7 +1,8 @@ """The read-only Mind dashboard (PyAutoBrain#640): a ★ and the planner's rank `#n` on every queued prompt row, a 📋 copy button carrying the task's prompt -text, Goals and Queue at the top — and no network: a CSP that pins the one -inline script and allows no connections. +text, Goals and Queue as collapsible blocks straight above Start here +(PyAutoBrain#650) — and no network: a CSP that pins the one inline script and +allows no connections. Golden-HTML assertions on a fictional Mind. The queue is edited in a `/queue` chat (Brain `skills/queue`, Mind `scripts/queue_edit.py`), never from the page. @@ -83,7 +84,7 @@ def _html(mind: Path) -> str: def _rows(page: str, ref: str) -> list: - """Every task row (section rows and the Queue box) that links `ref`.""" + """Every task row (section rows and the Queue block) that links `ref`.""" rows = re.findall(r'<(?:div|li) class="task"[^>]*>.*?', page, re.S) return [r for r in rows if f'/{ref}"' in r or f'"{ref}"' in r] @@ -133,8 +134,8 @@ def test_every_task_row_copies_its_prompt_text(tmp_path): for row in rows: assert (f'') in row, row - # The Queue box rows carry the same copy text, under their queue.md ref. - box = page[page.index('
", start) + len("
")] + + +def test_goals_then_queue_then_start_here_as_the_shared_blocks(tmp_path): + """PyAutoBrain#650: Goals and Queue are the same `details.board-section` + block as Start here and its siblings, in that order, back to back.""" + page = _html(_mind(tmp_path)) + goals, queue, start = (page.index(BLOCK.format(title=t)) + for t in ("Goals", "Queue", "Start here")) + assert page.index('