refactor(gui): tool registry + components package for per-tool builds
Two low-risk seam moves to enable selling per-tool subsets without
breaking the existing all-in-one bundle. Behaviour identical; every
existing import still resolves; full pytest suite + every page returns
HTTP 200.
1. **Tool registry** (src/gui/tools_registry.py) — replaces the
inline dict-of-dicts in app.py with a Tool dataclass and a TOOLS
list. Adds a tier field ("core" today, "pro" / "enterprise" later)
and tools_for_tier() / tool_by_id() / display_name() helpers. A
per-tool build slices TOOLS at import time without code changes.
2. **components package** (src/gui/components/) — converts the former
single components.py into a package with:
_legacy.py — original file, unchanged.
__init__.py — re-exports the legacy surface; existing
"from src.gui.components import …" calls
continue to work.
shared.py — hide_streamlit_chrome, pickup_or_upload
(every build needs these).
gate.py — require_normalization_gate (Pro / Suite SKUs).
findings.py — analyzer-finding widgets (drops out of a
standalone-Dedup build).
dedup_review.py — match-group cards + apply pipeline (drops out
of a non-dedup build).
The seam modules are narrow re-exports today. As code migrates out
of _legacy.py into the focused modules, the public import path
stays stable via the shim.
E2E: 765 passed, 17 xfailed (unchanged); home page + all 9 tool pages
+ Review page render HTTP 200; full pipeline (analyze → auto_fix →
apply_decisions → output bytes) round-trips on the kitchen-sink
fixture with zero high-confidence findings remaining post-fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
24
src/gui/components/dedup_review.py
Normal file
24
src/gui/components/dedup_review.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""Dedup match-group cards and review pipeline.
|
||||
|
||||
The interactive dedup-review surface — config panel, match-group cards,
|
||||
results summary, and apply-decisions glue. This is the largest single
|
||||
chunk of the GUI by line count; isolating it in a seam module means a
|
||||
non-dedup SKU never has to import it (and never has to drag in
|
||||
``src.core.dedup`` along the way).
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ._legacy import (
|
||||
apply_review_decisions,
|
||||
config_panel,
|
||||
match_group_card,
|
||||
results_summary,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"apply_review_decisions",
|
||||
"config_panel",
|
||||
"match_group_card",
|
||||
"results_summary",
|
||||
]
|
||||
Reference in New Issue
Block a user