René's URL Explorer Experiment


Title: id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lines · Issue #712 · developing-today/code · GitHub

Open Graph Title: id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lines · Issue #712 · developing-today/code

X Title: id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lines · Issue #712 · developing-today/code

Description: Problem The Go to Line dialog in the pkgs/id web editor (pkgs/id/web/src/goto-line.ts) does not validate the entered line number on Enter. The attributes are never enforced, because the keydown handler reads...

Open Graph Description: Problem The Go to Line dialog in the pkgs/id web editor (pkgs/id/web/src/goto-line.ts) does not validate the entered line number on Enter. The attributes are never enf...

X Description: Problem The Go to Line dialog in the pkgs/id web editor (pkgs/id/web/src/goto-line.ts) does not validate the entered line number on Enter. The <input type="number" min="1">...

Opengraph URL: https://github.com/developing-today/code/issues/712

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lines","articleBody":"## Problem\n\nThe Go to Line dialog in the `pkgs/id` web editor (`pkgs/id/web/src/goto-line.ts`) does not validate the entered line number on Enter. The `\u003cinput type=\"number\" min=\"1\">` attributes are never enforced, because the `keydown` handler reads the raw value and acts on it directly — there is no `\u003cform>` / constraint-validation step.\n\nVerified on main `d495a5cd` with a temporary vitest probe driving the real dialog (probe since removed; the three cases below reproduce with the existing `goto-line.test.ts` harness):\n\n1. **Line `0` (and negatives) are treated as line 1 — and create an invalid selection.** `goto-line.ts:88` does `parseInt(dialogInput?.value ?? \"\", 10)`; the only check is `Number.isNaN`. `getLineStartPos` (`goto-line.ts:36`) returns `0` for any `targetLine \u003c= 1`, so `0` and `-3` both dispatch `TextSelection.create(doc, 0)`. ProseMirror logs `TextSelection endpoint not pointing into a node with inline content (doc)` and the selection lands at doc position `0`, outside the `code_block`. Typing `0` should be rejected, not silently reinterpreted as the top of the file.\n2. **Fractional input is silently truncated.** `2.9` moves the cursor to line 2 (doc position `8` in a `first\\nsecond\\nthird` doc) because `parseInt` drops the fraction. A line number is an integer; `2.9` is invalid input, not line 2.\n3. **Out-of-range input closes the dialog with no feedback.** `999` in a 3-line document: `getLineStartPos` returns `null`, nothing moves, and `closeGotoLine()` runs unconditionally (`goto-line.ts:100`) — the dialog disappears and the user cannot tell whether the jump happened, failed, or the line does not exist. The dialog already knows the line count (it renders `Line # (1–N)` and sets `input.max`), but the handler never compares against it.\n\nExisting tests (`pkgs/id/web/src/goto-line.test.ts`) cover only valid inputs (`1`, `2`), Escape, and dialog lifecycle — none of these invalid cases.\n\n## Why it matters\n\nGo to Line is a primary navigation affordance in the editor. Silently treating `0`/negatives as line 1, truncating fractions, and swallowing out-of-range jumps with no feedback makes navigation unpredictable, and the `0` case additionally constructs a selection ProseMirror itself warns is not inside inline content.\n\n## Acceptance criteria\n\n- Entering `0`, a negative number, a fractional number (e.g. `2.9`), a non-numeric value, or a line greater than the document's line count does **not** move the cursor and does **not** silently close-and-forget: the dialog stays open (or reopens/focuses the input) with the invalid value visible/selectable so the user can correct it. A brief inline hint is welcome but not required.\n- Valid integers in `[1, lineCount]` keep working exactly as today (line 1 → start of the code block content, line N → start of line N).\n- New tests in `goto-line.test.ts` cover at least: `0`, a negative, a fraction, and a value greater than the line count — each asserting the selection did not move and the dialog did not silently succeed.\n- The valid-path tests already in `goto-line.test.ts` continue to pass.\n\n## Suggested fix\n\nIn the Enter handler, parse strictly (reject anything that is not a base-10 integer string, e.g. via a `Number` + `Number.isInteger` check on the trimmed value rather than bare `parseInt`), compare against `getLineCount(activeView)`, and only dispatch + `closeGotoLine()` on success; on failure, keep the dialog open and select the input text.\n\nSingle-repo: `getLineStartPos` / the goto-line dialog exist only in `developing-today/code` (`pkgs/id/web`); no copy exists in opencode, openchamber, or dezren39/nix.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-24T03:38:03Z","url":"https://github.com/developing-today/code/issues/712"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2d61cee1-3e27-db7b-c714-895282f9b3ec
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDB4A:2E4E6F:767888:9E40CF:6B062F2A
html-safe-nonce693213215e1edecd230882ee8c4c390094a6e6ea9033f2de8cfd9eb0261dc8fa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjRBOjJFNEU2Rjo3Njc4ODg6OUU0MENGOjZCMDYyRjJBIiwidmlzaXRvcl9pZCI6IjM0NDA4MTg3MDM0MzkzNzYxNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc75e281b074c3490428847897b954aa1c70bff2190b36a08121bf72543ca9e29
hovercard-subject-tagissue:6008965311
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/712/issue_layout
twitter:imagehttps://opengraph.githubassets.com/272df2bae45e733c4f0dbc6048bef4e265648f955fa44ab46705852bda812080/developing-today/code/issues/712
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/272df2bae45e733c4f0dbc6048bef4e265648f955fa44ab46705852bda812080/developing-today/code/issues/712
og:image:altProblem The Go to Line dialog in the pkgs/id web editor (pkgs/id/web/src/goto-line.ts) does not validate the entered line number on Enter. The attributes are never enf...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedezren39
hostnamegithub.com
expected-hostnamegithub.com
None7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3
turbo-cache-controlno-preview
go-importgithub.com/developing-today/code git https://github.com/developing-today/code.git
octolytics-dimension-user_id26439447
octolytics-dimension-user_logindeveloping-today
octolytics-dimension-repository_id627308783
octolytics-dimension-repository_nwodeveloping-today/code
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627308783
octolytics-dimension-repository_network_root_nwodeveloping-today/code
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release494ea0bb1e0feef734a83e2628697647755e8864
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/developing-today/code/issues/712#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F712
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F712
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=developing-today%2Fcode
Reloadhttps://github.com/developing-today/code/issues/712
Reloadhttps://github.com/developing-today/code/issues/712
Reloadhttps://github.com/developing-today/code/issues/712
developing-todayhttps://github.com/developing-today
codehttps://github.com/developing-today/code
Codehttps://github.com/developing-today/code
Issues1.1k (1.1k)https://github.com/developing-today/code/issues
Pull requests151 (151)https://github.com/developing-today/code/pulls
Discussionshttps://github.com/developing-today/code/discussions
Actionshttps://github.com/developing-today/code/actions
Projectshttps://github.com/developing-today/code/projects
Wikihttps://github.com/developing-today/code/wiki
Security and qualityhttps://github.com/developing-today/code/security
Insightshttps://github.com/developing-today/code/insights
https://github.com/developing-today/code
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/712
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/712
#713https://github.com/developing-today/code/pull/713
id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lineshttps://github.com/developing-today/code/issues/712#top
#713https://github.com/developing-today/code/pull/713
https://github.com/dezren39
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 24, 2026https://github.com/developing-today/code/issues/712#issue-6008965311
github-actionshttps://github.com/apps/github-actions
dezren39https://github.com/dezren39
on Oct 24, 2026https://github.com/developing-today/code/issues/712#event-34109171429
dezren39https://github.com/dezren39
completedhttps://github.com/developing-today/code/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#713https://github.com/developing-today/code/pull/713
on Oct 24, 2026https://github.com/developing-today/code/issues/712#event-34111701592
https://github.com/apps/developing-today-fleet
developing-today-fleethttps://github.com/apps/developing-today-fleet
on Nov 24, 2026https://github.com/developing-today/code/issues/712#issuecomment-7124558437
developing.today fleethttps://kaneo.security.cab
PR #713 — fix(id): validate the Go to Line number before jumpinghttps://github.com/developing-today/code/pull/713
Sign up for freehttps://github.com/signup?return_to=https://github.com/developing-today/code/issues/712
Sign in to commenthttps://github.com/login?return_to=https://github.com/developing-today/code/issues/712
dezren39https://github.com/dezren39
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.