AI desktop page: strip unpicked optional sections like the skill does

The merged AI desktop page check filled the no-AI template directly and hit
{{CHECKPOINTS_JSON}}. It now runs sections.py with none picked first. No-AI step 6
names the sections.py run, and the AI skill says how its desktop and web paths get
the checkpoint, admin and login sections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
VasanthandClaude Opus 5.5 committed 2026-10-16 15:39:53 +05:30
1 parent 73adc74637
commit 61f7896442
3 files changed
+12 -2

No files matched your search

+7 -2
View File
@@ -3,7 +3,8 @@ AI sections (rpa-dashboard-ai/templates/desktop/ai_sections.html) pasted in befo
Page under test: set PAGE_CHECK_AI_DESKTOP_DIR to a generated dashboard folder (the one with
dashboard.html and server_stub.py). Without it, the no-AI template is filled with the no-AI
check's TEST_FILL and the AI sections are pasted in, the way the skill does it.
check's TEST_FILL with no optional sections (sections.py) and the AI sections are pasted in,
the way the skill does it.
The page sees a fake Qt bridge, as in the no-AI check: each slot call lands in window.__calls.
The AI slot, ai_request(id, method, path, body), goes to the review backend's dispatch() in
@@ -57,7 +58,11 @@ def site(tmp_path_factory):
"""The dashboard folder under test: dashboard.html, server_stub.py and bands.py."""
if os.environ.get("PAGE_CHECK_AI_DESKTOP_DIR"):
return Path(os.environ["PAGE_CHECK_AI_DESKTOP_DIR"]).resolve()
html = re.sub(r"\{\{(\w+)\}\}", lambda m: TEST_FILL[m[1]], NO_AI.read_text(encoding="utf-8"))
spec = importlib.util.spec_from_file_location("sections", NO_AI.with_name("sections.py"))
sections = importlib.util.module_from_spec(spec)
spec.loader.exec_module(sections)
html = sections.keep(NO_AI.read_text(encoding="utf-8"), []) # no optional sections picked
html = re.sub(r"\{\{(\w+)\}\}", lambda m: TEST_FILL[m[1]], html)
if WIRED:
html = html.replace("const SAMPLE_DATA = true", "const SAMPLE_DATA = false")
sections = (AI / "desktop" / "ai_sections.html").read_text(encoding="utf-8")