From ac60fb060414261935ac5e158b26b34e211e1e06 Mon Sep 17 00:00:00 2001 From: cirakg Date: Sun, 18 Oct 2026 23:44:18 +0200 Subject: feat(spike): add the M1 settings spike app and make targets A separate throwaway app (own app ID, no permissions) that shows what the Garmin Connect app delivers per settings field and writes values back, to measure the undocumented settings limits on the real phone and watch. Includes length-marked test strings, `make spike` / `make spike-sim`, `make vectors`, and step-by-step instructions in docs/SETTINGS_SPIKE.md. Co-Authored-By: Claude Opus 5.5 --- spike/settings/source/DebugSelfTest.mc | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 spike/settings/source/DebugSelfTest.mc (limited to 'spike/settings/source/DebugSelfTest.mc') diff --git a/spike/settings/source/DebugSelfTest.mc b/spike/settings/source/DebugSelfTest.mc new file mode 100644 index 0000000..ef50148 --- /dev/null +++ b/spike/settings/source/DebugSelfTest.mc @@ -0,0 +1,35 @@ +// Author: cirakg & claude ai +// Summary: Debug-only self-test: fills one field and runs the settings-change path once, so the simulator shows real output. +// +// The simulator has no phone, so this stands in for one save from Garmin +// Connect: if Text 1 is empty it receives a fake 100-character test string, +// then the normal onSettingsChanged path runs (analysis plus write-back). +// It prints a "SPIKE ready" line that build-spike.sh waits for. Release +// builds compile the empty (:release) version, so the beta you upload never +// changes your settings by itself. + +import Toybox.Application.Properties; +import Toybox.Lang; +import Toybox.System; + +module DebugSelfTest { + + // Fake 100-character test string in the same format as the phone tests. + (:debug) + const SAMPLE = "N=100|abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrP0050stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghEND"; + + (:debug) + function run(app as SpikeApp) as Void { + var current = Properties.getValue("text1"); + if (current == null || (current instanceof String && current.length() == 0)) { + Properties.setValue("text1", SAMPLE); + app.onSettingsChanged(); + } + System.println("SPIKE ready total_chars=" + app.report.totalChars + " changes=" + app.report.changeCount + + " status='" + Properties.getValue("statusField") + "'"); + } + + (:release) + function run(app as SpikeApp) as Void { + } +} -- cgit v1.2.3