Gate all disconnect rules on PTW70 product line

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Michael-A-SloanandCursor committed 2026-05-05 15:31:40 -04:00
1 parent f350c5ba7d
commit cc8f3ecf5f
10 files changed
+31 -19

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ Short reference so an AI or new dev can understand and modify this project witho
- **Electron** desktop app (Windows). One window; no browser opened.
- Connects to **localhost:1947** sessions/config pages in a **hidden webview**.
- **On startup:** Loads config page → ensures “Table Rows per Page” = 100 → submits if changed → loads sessions page.
- **When Monitor ON:** Every 60s reloads sessions page; scans table rows; **clicks Disconnect** on rows whose text contains any of the **target keywords**.
- **When Monitor ON:** Every 60s reloads sessions page; scans table rows; **clicks Disconnect** when **Product** contains **PTW70** and **Feature** matches **TARGET_KEYWORDS** (substring) or modules **19**/**9** (exact).
- **UI:** Left = “Logged in” (by user); Right = “Activity log”; bottom = Monitor ON/OFF + Clear. Uses **powerSaveBlocker** so Windows/display don’t sleep while the app runs.
## Tech stack
@@ -30,7 +30,7 @@ Short reference so an AI or new dev can understand and modify this project witho
## Important conventions
- **Keywords:** Edit **inject.js** only — array `TARGET_KEYWORDS`. Row is disconnected if `row.innerText` contains any keyword.
- **Keywords:** Edit **inject.js** — `TARGET_KEYWORDS` (Feature substring) and `TARGET_FEATURE_IDS`. Disconnect only if Product contains `PTW70` and Feature matches (see `matchesPtw70FeatureKeyword` / `matchesFeatureId`).
- **Config check:** In **renderer.js**, `ensureConfigThenSessions()` runs on config.html load; sets `#linesperpage` to 100 and clicks Submit if needed, then navigates webview to sessions.
- **URLs:** Config = `http://localhost:1947/_int_/config.html`, Sessions = `http://localhost:1947/_int_/sessions.html`. Defined in renderer.js.
- **Log/sessions bridge:** Inject script pushes to `__ptw_logQueue` and exposes `__ptw_flushLogs()` / `__ptw_getSessions()`. Renderer polls via `webview.executeJavaScript()` and updates DOM.