Skip to content

Fix /reflect --max parsing broken by macOS auto-substitution#138

Merged
PureWeen merged 2 commits intomainfrom
fix/reflect-max-parsing
Feb 17, 2026
Merged

Fix /reflect --max parsing broken by macOS auto-substitution#138
PureWeen merged 2 commits intomainfrom
fix/reflect-max-parsing

Conversation

@PureWeen
Copy link
Owner

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 to

Additionally, the --max flag was capped at 100, which unnecessarily limited longer reflection cycles.

Changes

  • Regex fix: Updated the --max pattern to accept both -- and em-/\u2014) before maxdash (
  • Remove cap: Removed the Math.Min(parsed, 100) upper any positive integer is now acceptedbound
  • Disable autocorrect: Added autocorrect="off", autocapitalize="off", spellcheck="false" to the textarea (ExpandedSessionView) and input (SessionCard) elements to prevent future macOS auto-substitution
  • Updated help text: Changed (1-100) to (default 5) in /reflect help output
  • Tests: Added 11 test cases covering em-dash, double-hyphen, zero, minimum, unlimited, and mid-goal placement

Testing

  • All 607 tests pass
  • Verified regex handles both --max 10 max 10correctlyand
  • Edge cases: --max 0 keeps default 5, --max 1 works, --max 9999 works

PureWeen and others added 2 commits February 17, 2026 17:38
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>
@PureWeen PureWeen merged commit c285b12 into main Feb 17, 2026
@PureWeen PureWeen deleted the fix/reflect-max-parsing branch February 22, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant