From 1895074b8fbdb5cc969e40ed5ebeed9e3a4c54bc Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 8 Jun 2026 17:11:02 +0000 Subject: [PATCH] test+fix(gui): retire the now-empty "analysis" nav section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The journey-level nav restructure moved Home to a standalone "Start here" entry and Reconcile into the "Finance" group, leaving the "analysis" section with zero tools. Two registry tests encoded the old layout and failed: - test_every_section_has_at_least_one_tool[analysis] (empty section) - test_reconciler_present (asserted section == "analysis") Drop "analysis" from the Section literal, SECTION_LABELS, and app.py's by_section bucket — it's genuinely dead now (home isn't a registry Tool). Update the presence tests to assert Reconcile + PDF to CSV live in "finance". The section-invariant tests (every section non-empty, has a label, no orphan labels) are preserved and pass. Full suite: 2441 passed, 91 skipped, 0 failed. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/gui/app.py | 1 - src/gui/tools_registry.py | 3 +-- tests/test_tools_registry.py | 9 ++++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/app.py b/src/gui/app.py index 28c33e3..2ffb4df 100644 --- a/src/gui/app.py +++ b/src/gui/app.py @@ -78,7 +78,6 @@ def _page_for(tool_id: str, *, page_slug: str, icon: str, title: str) -> "st.Pag def _build_navigation() -> dict[str, list]: by_section: dict[str, list] = { - "analysis": [], "cleaners": [], "transformations": [], "automations": [], diff --git a/src/gui/tools_registry.py b/src/gui/tools_registry.py index 615ebc3..e501386 100644 --- a/src/gui/tools_registry.py +++ b/src/gui/tools_registry.py @@ -25,7 +25,7 @@ Status = Literal["Ready", "Coming Soon"] # Sidebar grouping. Tools are bucketed by what the user is trying to # accomplish rather than by implementation detail. Section = Literal[ - "analysis", "cleaners", "transformations", "automations", + "cleaners", "transformations", "automations", "finance", "coming_soon", ] @@ -189,7 +189,6 @@ TOOLS: list[Tool] = [ # Display labels for each sidebar section. Kept here so i18n falls back # to a sensible English string if a translation pack is missing the key. SECTION_LABELS: dict[Section, str] = { - "analysis": "Analysis", "cleaners": "Data Cleaners", "transformations": "Transformations", "automations": "Automations", diff --git a/tests/test_tools_registry.py b/tests/test_tools_registry.py index 87e2c0b..5ca5f82 100644 --- a/tests/test_tools_registry.py +++ b/tests/test_tools_registry.py @@ -239,12 +239,15 @@ class TestReconcilerAndPdfArePresent: assert tool is not None assert tool.page_slug == "10_PDF_Extractor" assert tool.status == "Ready" + # PDF to CSV + Reconcile live in the "Finance" group (outside the + # cleaning flow) per DECISIONS.md 2026-06-08. + assert tool.section == "finance" def test_reconciler_present(self): tool = tool_by_id("11_reconciler") assert tool is not None assert tool.page_slug == "11_Reconciler" assert tool.status == "Ready" - # The new "analysis" section was introduced with this tool; - # if the section disappears, the sidebar group goes empty. - assert tool.section == "analysis" + # Reconcile sits in the "Finance" group (see DECISIONS.md + # 2026-06-08); if that section disappears the sidebar goes empty. + assert tool.section == "finance"