feat(automations): richer Test-panel dry-run inputs & output (#3653)#3675
Conversation
…itutions help, expanded output (#3653) - Message Test inputs gain SNR, RSSI and a "Via MQTT" toggle (forwarded to the simulator as rxSnr/rxRssi/viaMqtt), so {{ trigger.snr }}/{{ trigger.rssi }} can be exercised in a dry-run. - New "?" icon opens a Substitutions drawer listing every {{ trigger.* }} token per trigger type plus {{ var.* }} and {{ NOW }}. - Test results now render the expanded "what would be sent" per action (the interpolated message text / tapback emoji / notify title+body+urls), with the raw resolved params behind a details toggle — instead of only a JSON blob. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VBLhGGNh35oMwTL53va1Y5
…just the Test panel (#3653) The "all substitutions" help was only reachable from inside the ▶ Test panel. Move the drawer + token tables into a shared SubstitutionsHelp component and add a "?" affordance (with a one-line tip) at the top of the AutomationBuilder, where authors actually write {{ trigger.* }} / {{ var.* }} in message/notify fields. The Test panel reuses the same shared drawer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VBLhGGNh35oMwTL53va1Y5
…rer "no actions" note (#3653) Subject-node facts now include hopsAway, channelUtilization, airUtilTx, node SNR and altitude (was missing hopsAway, so node.hopsAway conditions couldn't be exercised in a dry-run). When a run matches but no action fires, the panel now explains every condition went false and points at the inputs/facts to change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VBLhGGNh35oMwTL53va1Y5
|
Claude finished @Yeraze's task —— View job PR Review: feat(automations): richer Test-panel dry-run inputs & output (#3653)Tasks:
Overall this is clean, well-scoped frontend work. A few things worth noting: Potential Bugs
if (facts.latitude) out.latitude = Number(facts.latitude);
if (facts.longitude) out.longitude = Number(facts.longitude);If the user types a non-numeric string (e.g. Also,
case 'geofence':
return { ...base, nodeNum: numOrUndef(ev.nodeNum) };The
viaMqtt: ev.viaMqtt === 'true' ? true : undefined
Code Quality / Maintainability
} catch (e: any) {The project's TypeScript is otherwise strict. Consider Array index keys on rendered lists ( key={i}Used throughout PerformanceNo concerns — this is all local state manipulation and a single API call. The render paths are straightforward. SecurityNo concerns. The Test panel sends to The Test CoverageNo tests for the new components. Given that
Minor Nits
|
Automation Test panel — richer dry-run inputs & output (#3653)
Follow-up polish to the in-app Test / dry-run for automations (the
POST /api/automations/testsubstrate shipped in #3668), driven by real-world use.What's new
rxSnr/rxRssi/viaMqtt), so{{ trigger.snr }}/{{ trigger.rssi }}can actually be exercised in a dry-run — including the MQTT case where signal metrics are absent.node.hopsAway(and othernode.*) conditions couldn't be made true in a dry-run because there was no input for them.?substitutions reference, where you author: extracted a sharedSubstitutionsHelpdrawer listing every{{ trigger.* }}token per trigger type plus{{ var.* }}and{{ NOW }}, and surfaced a?at the top of the builder (next to a one-line tip) — not just inside the Test panel.Notes
AutomationTester.tsx,AutomationBuilder.tsx, newSubstitutionsHelp.tsx, CSS) — no engine/API changes; the simulator already accepted these fields.node.hopsAwayworkflow (DM branch on== 0, tapback on> 0, ANY-collapse Finally tapback).🤖 Generated with Claude Code