chatbot: !skip and !back UX improvements#446
Draft
dmerrick wants to merge 2 commits into
Draft
Conversation
`!skip -3` is now equivalent to `!back 3`, and `!back -3` is equivalent to `!skip 3`. Previously the underlying vlc-client dropped any non-positive offset before forwarding, so negative inputs silently collapsed to a single-step skip — surprising behaviour for anyone typing the more natural `!skip -N` to rewind. Negatives are routed through the opposite client call rather than relying on the VLC server's modular wrap-around, so the request shape on the wire matches the user's intent and the existing client API keeps its non-negative contract. The shared parameter parsing is lifted into `parseSkipParams` to keep the two handlers aligned and to give the new behaviour a unit-testable seam (no chatbot tests existed previously). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Both commands were silent: viewers had no chat-side confirmation that the playhead had actually moved. Now they reply with a one-line summary naming the magnitude (videos, with proper singular/plural) and the direction the playhead moved. The reply uses the post-negative-routing values, so `!skip 3` and `!back -3` both render as "Skipped 3 videos forward!" — consistent with the unified mental model the previous commit established. Reply length stays well under Twitch IRC's 500-char limit (a test asserts <100 chars to leave headroom). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collaborator
Author
|
Attempted automated conflict resolution; bailed due to non-mechanical conflicts in: pkg/chatbot/playback.go. Needs manual merge — likely affected by command-registry refactor on develop. |
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.
Summary
!skipand!backnow accept negative numbers —!skip -30is equivalent to!back 30, and!back -3is equivalent to!skip 3.parseSkipParams), seedingpkg/chatbot/'s previously-empty test set.A couple of notes on the unit chosen for the reply:
!skip N/!back Noperate on videos (N entries forward/back in the playlist), not seconds — the reply uses "videos" as the unit accordingly. The TODO copy said "amount of time skipped", but no per-video duration is stored in the project, so summing real durations would have meant new infra (a video-length helper or constant) and pulled the change out of "easy". Happy to re-scope to durations in a follow-up if you want; lmk.n=0is normalised to 1 (matching today's silent behaviour: the underlying client drops 0 and the server defaults to 1) so the reply is never "Skipped 0 videos".Test plan
go build ./pkg/chatbot/...andgo vet ./pkg/chatbot/...passtask testpasses (full repo suite, run viabin/devenv)!skip 3in chat and confirm bot replies "Skipped 3 videos forward!"!skip -3and confirm same effect as!back 3(reply: "Skipped 3 videos back!")!back -2and confirm same effect as!skip 2(reply: "Skipped 2 videos forward!")!skip 1and confirm singular form ("1 video forward")