0
0
Fork 0
Codesys-MCP-SP21-plus/tests/tui
Karstein Phobic Nyvold Kvistad a1bcf5cbfe tui(v0.3): useLiveValues hook + wire into Browser/Viewer
Task 4 of v0.3 plan.

useLiveValues(filePath, pouName, intervalMs=500) sets up a recursive
setTimeout poll. Returns the values map iff readLiveValues returns
ok AND the snapshot's pou_name matches the requested pouName;
returns null otherwise (cursor not on a POU, file missing/stale,
wrong POU snapshot).

Cancelled flag + setTimeout (not setInterval) so the cleanup is
race-free: if the file read takes longer than intervalMs, the next
tick won't pile up.

Browser computes the live-values file path once via
liveValuesFilePath() (catches Windows LOCALAPPDATA-missing -> null
so we don't crash; pump just won't be able to write either) and
passes the resulting map down to <Viewer liveValues={...}/>.
2026-04-29 09:49:15 +02:00
..
fixtures/mini-mirror/mcp-mirror/CodesysRpi/Plc Logic/Application tui: add mirror scanner with classification + LOC 2026-04-28 21:49:02 +02:00
Approve.test.tsx tui(approve): v toggles unified <-> side-by-side diff 2026-04-29 08:22:09 +02:00
Browser.test.tsx tui(browser): d opens cross-device diff for highlighted POU 2026-04-29 08:22:09 +02:00
diff.test.ts tui: add line-based diff hunk computation 2026-04-28 21:54:20 +02:00
discover.test.ts tui: add mcp-mirror auto-discovery 2026-04-28 21:55:32 +02:00
highlight.test.ts tui(viewer): join multi-line (* ... *) comments across line boundaries 2026-04-29 09:02:09 +02:00
index.integration.test.ts tui: wire approve dispatch in bin entry 2026-04-28 22:19:51 +02:00
live-values-read.test.ts tui(v0.3): add readLiveValues() with 5s freshness window 2026-04-29 09:42:06 +02:00
scan.test.ts tui: add mirror scanner with classification + LOC 2026-04-28 21:49:02 +02:00
state-paths.test.ts tui(v0.3): add LiveValuesPayload type + liveValuesFilePath() 2026-04-29 09:40:54 +02:00
state-write.test.ts tui: add atomic Selection JSON writer 2026-04-28 21:52:07 +02:00
Statusbar.test.tsx tui(browser): add stale-mirror indicator + resize warning 2026-04-29 08:22:09 +02:00
Tree.test.tsx tui: add Tree component (collapsible device/POU listing) 2026-04-28 22:21:05 +02:00
useLiveValues.test.tsx tui(v0.3): useLiveValues hook + wire into Browser/Viewer 2026-04-29 09:49:15 +02:00
Viewer.test.tsx tui(v0.3): Viewer overlays inline live values when liveValues prop set 2026-04-29 09:45:49 +02:00