Fix dropped reason field in actionability check results#69
Open
evanniedojadlo wants to merge 1 commit intoVibiumDev:mainfrom
Open
Fix dropped reason field in actionability check results#69evanniedojadlo wants to merge 1 commit intoVibiumDev:mainfrom
evanniedojadlo wants to merge 1 commit intoVibiumDev:mainfrom
Conversation
The JSON reason field from JavaScript check functions was silently dropped during unmarshalling because the Go structs lacked a Reason field. Now all four check functions (CheckVisible, CheckReceivesEvents, CheckEnabled, CheckEditable) preserve the reason and include it in error messages. Fixes #2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
The naming itself needs to be reviewed and approved as it's subjective: All four affected functions in clicker/internal/features/actionability.go:
|
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
Fixes #2 - The
reasonfield returned by JavaScript actionability checks (visible, receivesEvents, enabled, editable) was silently dropped during JSON unmarshalling because the Go structs did not include aReasonfield. This meant callers only knew that a check failed, but not why.In Vibium fashion, I leveraged Claude Code to identify and address this issue, then personally tested and verified the fixes on macOS 26.1.
The Fix
The JavaScript check functions return JSON with a
reasonfield when a check fails (e.g.,{"visible": false, "reason": "zero size"}), but the Go structs used to unmarshal these results only had the boolean and error fields —reasonwas never captured.Solution: Add a
Reasonfield to each check function's unmarshal struct and include it in the returned error message when a check fails.All four affected functions in
clicker/internal/features/actionability.go:CheckVisible— now returns"element not visible: zero size"instead of justfalse, nilCheckReceivesEvents— now returns"element does not receive events: obscured by div"CheckEnabled— now returns"element not enabled: disabled attribute"CheckEditable— now returns"element not editable: readonly attribute"This reason info propagates through
WaitForActionableinto timeout error messages, so users now see:Instead of:
Test Plan
reasonfield from JS responsesgo test ./...Testing with Claude Code
Files Changed
clicker/internal/features/actionability.go- AddedReasonfield to all four check function unmarshal structs and included reason in error messages🤖 Generated with Claude Code