Skip to content

index: split webhook into independent per-gesture configs#302

Open
derek-knox wants to merge 2 commits into
coredevices:masterfrom
derek-knox:derek/split-webhook
Open

index: split webhook into independent per-gesture configs#302
derek-knox wants to merge 2 commits into
coredevices:masterfrom
derek-knox:derek/split-webhook

Conversation

@derek-knox

@derek-knox derek-knox commented Jul 19, 2026

Copy link
Copy Markdown

Note

YAGNI, but I started to sense storing multiple (3+) webhook configs being valuable where UX-wise there'd be a mechanism to enable quick swapping or additional gestures (triple click & hold, etc.).

TLDR

  • Update webhooks support so each gesture (singe|double click & hold ) can be routed to a unique webhook url
  • Resolved conflicts with this PR so X-Index-Trigger header is still used resulting in best of both worlds
Settings Single gesture Double gesture
1000008373 1000008371 1000008372

Notes

Since the existing SecondaryMode's webhook entry (legacy id=2) is retired (Preferences.kt#L297-L298) I opted for a path that seemed to best adhere to existing conventions.

As can be seen in the above working app screenshots, the Index 01 > Settings > Advanced refactors the single webhook cta into two ctas so there is now a config per gesture.

Details

Implements the invited split-webhook feature as per-gesture webhook configs on top of the existing decorator model — the lowest-friction path that aligns with current patterns. Merged with master, so #298's X-Index-Trigger header is reconciled here (folded together) rather than reverting either side:

  • IndexWebhookPreferences: independent config (URL / headers / payload mode) per gesture via new IndexWebhookGesture — which also owns the X-Index-Trigger header name + wire values (single-click-hold / double-click-hold); old IndexWebhookTrigger and Add Index trigger gesture to webhook headers #298's duplicate IndexWebhookRecordingTrigger removed
  • Migration: legacy auth token → headers first, then flat config seeded into the gesture(s) the old trigger covered; flat keys removed
  • RecordingOperationFactory: wraps by gesture; upload operation re-reads its gesture's config after the inner operation, so unlinking mid-processing suppresses the upload
  • IndexWebhookApi: uploadIfEnabled()upload(config, …, gesture), now a stateless client that emits X-Index-Trigger (stripping any user-set override); unused isEnabled flow removed
  • Header provenance keeps Add Index trigger gesture to webhook headers #298's omit-when-unknown contract: routing uses a non-null configGesture (single-click slot); the header uses a nullable observedGesture, omitted for local (phone-mic) recordings and unrecoverable legacy retries
  • Settings UI: two entry points (single / double click & hold), each independently configurable; trigger radio group removed; dialog note that X-Index-Trigger disambiguates when both gestures share a URL
  • Tests: IndexWebhookPreferencesTest (12 cases: migrations, round-trips, per-gesture independence) + IndexWebhookGestureTest locks the header wire values
  • Docs: INDEX_WEBHOOK_API.md setup + X-Index-Trigger sections updated

@CLAassistant

CLAassistant commented Jul 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ericmigi

Copy link
Copy Markdown
Contributor

yup we'll definitely be adding this into settings in near future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants