Skip to content

fix(id/web): Go to Line accepts only decimal digits (#2776) - #2777

Merged
dezren39 merged 2 commits into
mainfrom
creator-a/2776-gotoline-decimal
Oct 30, 2026
Merged

dezren39 merged 2 commits into
mainfrom
creator-a/2776-gotoline-decimal

Conversation

@dezren39

@dezren39 dezren39 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Fixes #2776.

Go to Line's #712 strict validation still passed its value through bare Number(), which silently reinterprets non-decimal spellings: 0x10 jumped to line 16, 1e2 to line 100, 0b11 to line 3, 2.0 to line 2 — the #832 residual pattern. Now only a run of decimal digits counts (the parseWorldSeed rule); anything else keeps the dialog open with the input selected and does not move the cursor.

Verification (laptop, real source):

  • Probe before the fix (copy of pkgs/id/web/src, happy-dom harness over a 120-line doc): 0x10→pos 46 (line 16), 1e2→pos 298 (line 100), 0b11→pos 7 (line 3), 2.0→pos 4 (line 2), all with the dialog closed; controls 10 and 2.9 behaved correctly.
  • After the fix: vitest run src/goto-line.test.ts — 31/31 pass, including four new invalid-input cases (0x2, 0b10, 2.0, +2) chosen because they reinterpret to the in-range line 2 on the 3-line fixture, so they fail on the old code. tsc --noEmit clean.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner October 30, 2026 15:14
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T15:16:24.800220Z 0a315ec PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

id(web): Go to Line still silently reinterprets non-decimal input — '0x10' jumps to line 16, '1e2' to line 100, '2.0' to line 2

1 participant