Don't show the help50 button when a helper already gave advice - #198
Merged
Merged
Conversation
The advice is already on screen, so the button only added a click. Reserve it for failures no helper recognized, where the duck can ask cs50.ai. A recognized failure now clears any stale button like other outcomes do.
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.
Feedback from testing on canary: for a recognized mistake like
1s, the inline hint ("Did you mean to runls...") already answers the question, so the button only added a click to have the duck repeat it._helpfulnow prints the advice and nothing else. The button is reserved for_helpless, where no local helper matched and the duck can ask cs50.ai to explain the output. A recognized failure also clears any button still showing, like a success or a quiet failure does, so the button always refers to the last command.The
sayaction in help50.vsix andrequestDuckSayin ddb50 stay in place; nothing calls them from the shell now, but they are useful hooks to keep.Verified under a pty with a fake
command50:1s-> advice, no call;cat nothere->showButton ask;1s-> advice,hideButton;tests/smoke.shpasses.