index: split webhook into independent per-gesture configs#302
Open
derek-knox wants to merge 2 commits into
Open
index: split webhook into independent per-gesture configs#302derek-knox wants to merge 2 commits into
derek-knox wants to merge 2 commits into
Conversation
Contributor
|
yup we'll definitely be adding this into settings in near future |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
X-Index-Triggerheader is still used resulting in best of both worldsNotes
Since the existing
SecondaryMode's webhook entry (legacyid=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-Triggerheader is reconciled here (folded together) rather than reverting either side:IndexWebhookPreferences: independent config (URL / headers / payload mode) per gesture via newIndexWebhookGesture— which also owns theX-Index-Triggerheader name + wire values (single-click-hold/double-click-hold); oldIndexWebhookTriggerand Add Index trigger gesture to webhook headers #298's duplicateIndexWebhookRecordingTriggerremovedRecordingOperationFactory: wraps by gesture; upload operation re-reads its gesture's config after the inner operation, so unlinking mid-processing suppresses the uploadIndexWebhookApi:uploadIfEnabled()→upload(config, …, gesture), now a stateless client that emitsX-Index-Trigger(stripping any user-set override); unusedisEnabledflow removedconfigGesture(single-click slot); the header uses a nullableobservedGesture, omitted for local (phone-mic) recordings and unrecoverable legacy retriesX-Index-Triggerdisambiguates when both gestures share a URLIndexWebhookPreferencesTest(12 cases: migrations, round-trips, per-gesture independence) +IndexWebhookGestureTestlocks the header wire valuesINDEX_WEBHOOK_API.mdsetup +X-Index-Triggersections updated