GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 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

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

New issue
Copy link
New issue
Copy link
Closed
#713
Closed
id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lines#712
#713
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Description

@dezren39
dezren39
opened on Oct 24, 2026
Issue body actions

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"> attributes are never enforced, because the keydown handler reads the raw value and acts on it directly — there is no <form> / constraint-validation step.

Verified 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):

  1. 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 <= 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.
  2. 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.
  3. 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.

Existing tests (pkgs/id/web/src/goto-line.test.ts) cover only valid inputs (1, 2), Escape, and dialog lifecycle — none of these invalid cases.

Why it matters

Go 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.

Acceptance criteria

  • 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.
  • Valid integers in [1, lineCount] keep working exactly as today (line 1 → start of the code block content, line N → start of line 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.
  • The valid-path tests already in goto-line.test.ts continue to pass.

Suggested fix

In 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.

Single-repo: getLineStartPos / the goto-line dialog exist only in developing-today/code (pkgs/id/web); no copy exists in opencode, openchamber, or dezren39/nix.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 24, 2026
  2. dezren39
    closed this as completedin #713on Oct 24, 2026
  3. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 24, 2026 – with developing.today fleet
    Contributor
    More actions

    AUDIT-7 Lane 2 slice 3 — closing evidence. Verified against the issue body and merged implementation PR(s):

    • PR #713 — fix(id): validate the Go to Line number before jumping (merged 2026-10-24)

    The issue had zero comments in the fresh pre-action read; this comment records the missing close evidence.

  4. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.