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 undercounts lines in paragraphs with hard breaks — jump lands on the wrong line · Issue #1406 · developing-today/code

id(web): Go to Line undercounts lines in paragraphs with hard breaks — jump lands on the wrong line #1406

New issue
Copy link
New issue
Copy link
Closed
Closed
id(web): Go to Line undercounts lines in paragraphs with hard breaks — jump lands on the wrong line#1406
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/protocol-gapAn agent touched this without the required agent-note comment or labels; needs review of whypriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsuser/reviewNeeds a user-look: Muse reviews first and handles what it can

Description

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

id(web): Go to Line undercounts lines in paragraphs with hard breaks — jump lands on the wrong line

Evidence (verified this run, main 37418e5)

Vitest probe against the real goto-line dialog (real EditorView, richSchema; probe removed after the run):

Document (3 markdown source lines):

foo\
bar

baz

i.e. PM doc = paragraph[text "foo", hard_break, text "bar"] + paragraph[text "baz"].

  • Open Go to Line (Mod-g): the dialog reports "Line # (1–2)", max=2 — expected 3 lines.
  • Consequently "go to line 2" targets the baz paragraph, not the bar segment after the hard break; every line after the first hard break in a document is off by the number of hard breaks above it.

Root cause

pkgs/id/web/src/goto-line.ts, getLineStarts (lines 34–49): line starts inside a textblock are derived from node.textContent, scanning for "\n" characters. A hard_break is an inline node, not a character — ProseMirror's textContent for foo<hard_break>bar is "foobar", so the break contributes no line start. Code blocks work because their breaks are literal \n text; rich paragraphs/headings/list items with Shift+Enter hard breaks are silently merged into one "line".

The fix must walk the textblock's inline content (text nodes and hard_break nodes) accumulating positions — a hard_break node has size 1, so the segment after it starts at contentStart + offsetBeforeBreak + 1.

Why it matters

Go to Line exists to jump to a line the user knows from outside the editor — a compiler/linter message, a diff, the raw file. Hard breaks are common in pasted/poetry/address/verse content and in any paragraph where someone pressed Shift+Enter. Every such break silently shifts all subsequent line numbers, so the feature lands the user on the wrong line with no indication anything is off.

Acceptance criteria

  • A textblock containing N hard_break nodes contributes N+1 lines (plus its \n segments for code blocks, unchanged); the dialog's reported line count (placeholder/max) matches the markdown source line count for hard-broken documents.
  • Go to Line for a line after a hard break places the cursor at the start of that segment (position accounts for the hard_break node's size), including breaks inside headings and list items.
  • Regression tests in pkgs/id/web/src/goto-line.test.ts: hard-broken paragraph counts 2 lines and line 2 jumps to the post-break segment; a doc mixing hard breaks and plain paragraphs counts and jumps correctly.
  • Existing goto-line tests (raw code_block counting, id(web): Go to Line accepts 0/negatives as line 1, truncates fractions, and silently closes on out-of-range lines #712 validation, id(web): Go to Line miscounts and cannot navigate outside a single raw code_block — textContent has no block separators and position mapping hard-codes +2 #745 semantics) still pass.

Activity

  1. developing-today commented on Oct 27, 2026

    @developing-today
    developing-todayBot
    on Oct 27, 2026 – with developing.today
    Contributor
    More actions

    CODE-497

  2. github-actions
    assigned
    dezren39
    on Oct 27, 2026
  3. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 27, 2026
  4. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane B, new-issue-creator-code-b)
    • Session / ID: new-issue-creator-code-b run 2026-10-27 06:20 CDT
    • Found via: filed this run
    • Task: Filed after verifying with a vitest probe on main 37418e5: Go to Line reports max=2 for a 3-line document whose first paragraph contains a hard_break — getLineStarts (goto-line.ts) scans textContent for "\n" and hard_break is an inline node, not a character.
    • Expectation: effort/s — done when getLineStarts walks inline content counting hard_break nodes (accounting for their size-1 position), with regression tests for count and jump target.
    • Links: packet enqueued to repo-health-code-pilot (small_fix)
  5. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    🤖 Agent note · bound

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: queue task 1395 (repo-health-code-pilot) · monitor run 2026-10-28 16:19 CDT
    • Found via: monitor reconciliation (Duty 1B, PR↔queue)
    • Task: Binding verified open PR id(web): Fix Go to Line undercounting lines due to hard breaks #1410 to queued fix task 1395 for this issue. PR id(web): Fix Go to Line undercounting lines due to hard breaks #1410 (branch fix-goto-line-hard-break-14095642245151866672, files pkgs/id/web/src/goto-line.ts + tests) implements this issue's Go-to-Line hard-break fix. The pickup was an out-of-band GitHub session (Jules-style branch): the picker never labelled this issue and never posted an agent note naming the PR — recorded as a protocol gap (Duty 4). The queue has no targeted claim/park verb (binding gap owed on Dispatcher v1 live: scheduled launches of OpenCode/OpenChamber sessions for queued issues #1337), so the task cannot be parked on the PR from the monitor; this note is the binding record — the next lane/shift that claims task 1395 must shepherd PR id(web): Fix Go to Line undercounting lines due to hard breaks #1410 (review CI, merge when green), NOT re-implement.
    • Expectation: effort/s; done = PR id(web): Fix Go to Line undercounting lines due to hard breaks #1410 merged and this issue closed via the queue task.
    • Links: PR id(web): Fix Go to Line undercounting lines due to hard breaks #1410 · task 1395
  6. dezren39
    added
    meta/protocol-gapAn agent touched this without the required agent-note comment or labels; needs review of why
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    on Oct 28, 2026
  7. dezren39
    closed this as completedin e7997dbon Oct 29, 2026
  8. developing-today
    added
    status:done
    on Oct 29, 2026
  9. dezren39
    removed
    queue/queuedHas a queued queue task
    status/needs-triageNot yet triaged; needs a first look
    on Oct 29, 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)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/protocol-gapAn agent touched this without the required agent-note comment or labels; needs review of whypriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsuser/reviewNeeds a user-look: Muse reviews first and handles what it can

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.