Fix /reflect --max parsing broken by macOS auto-substitution#138
Merged
Fix /reflect --max parsing broken by macOS auto-substitution#138
Conversation
macOS automatically converts '--' to an em-' in text inputs,dash ' so '/reflect fix bug --max 10' becomes '/reflect fix max 10'bug which didn't match the regex, causing maxIterations to always be 5. - Update regex to accept both '--' and em-' before 'max'dash ' - Add autocorrect=off, autocapitalize=off, spellcheck=false to all input elements to prevent future auto-substitution issues - Add test cases covering em-dash, double-hyphen, and clamping Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The --max flag was clamped to 100, preventing users from running longer reflection cycles. Remove the cap so any positive integer is accepted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
macOS automatically converts
--(double hyphen)(em-dash) in text inputs. When a user types/reflect fix the bug --max 10, macOS converts it to/reflect fix the max 10, which did not match the--maxregex pattern. This causedmaxIterationsto always fall back to the default of 5.bug toAdditionally, the
--maxflag was capped at 100, which unnecessarily limited longer reflection cycles.Changes
--maxpattern to accept both--and em-/\u2014) beforemaxdash (Math.Min(parsed, 100)upper any positive integer is now acceptedboundautocorrect="off",autocapitalize="off",spellcheck="false"to the textarea (ExpandedSessionView) and input (SessionCard) elements to prevent future macOS auto-substitution(1-100)to(default 5)in/reflect helpoutputTesting
--max 10max 10correctlyand--max 0keeps default 5,--max 1works,--max 9999works