- rpa-dashboard-no-ai/SKILL.md: trigger description and the workflow in spec order (scan, report/keep-or-restyle, colours, stack, sections, build, wire, verify). - templates/themes.md: Tebra Sky and Superbill Ember, light and dark blocks. - templates/palette.py: derives a custom palette from one brand hex and checks text contrast in light and dark. - dashboard.html: built-in sample data so a page with no bot works on first open; cleared batches in the donut; component tokens so Ember is a token-only swap; accessible names for KPI cards, nav, steps, log, search and the dark toggle. - bridge.py: placeholders inside string literals, so it passes the lint hook unfilled. - tests/page_check: Seam 1 harness (fake Qt bridge, light/dark/narrow). - tests/evals: Seam 2 runner and fixture a-empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
2.1 KiB
Markdown
33 lines
2.1 KiB
Markdown
# Dashboard data contract (no-AI)
|
|
|
|
All updates use one envelope: `{"event": "<name>", "data": {...}}`.
|
|
- **Desktop (PyQt):** Python calls `window.__pyMsg(json)` via `runJavaScript` (see `bridge.py`).
|
|
- **Web:** the page polls `GET {API_BASE}/dashboard` (returns `dashboard_data`) and
|
|
`GET {API_BASE}/run/status` → `{"running": bool, "events": [envelope, ...]}`. Poll fast (2s) only while running.
|
|
- **No bot yet:** with `SAMPLE_DATA = true`, the page answers its own data actions with sample envelopes.
|
|
|
|
## Bot/backend → page
|
|
|
|
| event | data |
|
|
|---|---|
|
|
| `status` | `{state: "ready"\|"running"\|"done"\|"error", msg}` |
|
|
| `step` | `{label: <one of STEPS>, pct: 0-100}` |
|
|
| `log` | `{msg: <plain English>, type: "info"\|"success"\|"warn"\|"error"}` |
|
|
| `dashboard_data` | `{batches: [{batch_id, date, state: "completed"\|"inprogress"\|"notcompleted"\|"cleared", items_total, items_done, ...}]}` |
|
|
| `report_data` | `{rows: [{...REPORT_COLUMNS keys, status, bucket: "success"\|"attention"\|"failed"}]}` |
|
|
| `set_user` | `{username, emp_id, role}` |
|
|
| `apply_dark` | `{on: bool}` |
|
|
|
|
Optional (only if the section was chosen): `cpstate {kind: pending|active|done|stuck, cp: int}`, `admin_data`, `batch_detail`.
|
|
|
|
## Page → bot/backend (Qt `@pyqtSlot` names / web `POST {API_BASE}/<slot-with-dashes>`)
|
|
|
|
`load_dashboard`, `start_automation`, `request_stop`, `load_latest_report`, `download_report`, `set_dark(on)`, `logout`.
|
|
|
|
## Rules (learned on Tebra)
|
|
- Log the raw bot line to a file/DB; show only **friendly** text on screen. Never hide an error line.
|
|
- Step markers: match the bot's printed lines by **specific** substring (e.g. `[step 3]`), not a bare word. A bare word matches unrelated lines.
|
|
- Derive `state`: Pending + today = `inprogress`; Pending + older day = `notcompleted`.
|
|
- Report `bucket`: success = {processed successfully, posted, completed}; failed = {error, failed}; everything else = attention.
|
|
- Run the bot in a **separate process** that writes to a log file, and have the UI tail that file. When pywinauto/UIA runs inside a Qt worker thread, its reads are unreliable (Tebra bug-094).
|