Skip to content

fix(track): Discord no longer jumps the view to the end of the line (#552) - #553

Merged
Maxaubert merged 1 commit into
mainfrom
fix/discord-ghost-learned
Nov 6, 2026
Merged

Maxaubert merged 1 commit into
mainfrom
fix/discord-ghost-learned

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

Fixes #552.

Recorded live with trackLog and an MSAA caret recorder (2026-11-06). Discord's UIA selection puts the caret at the text box's right end (2921,y, 45-46 px tall in 48-49 px lines) after a trailing space and for most letters in the last ~380 px of a line. Once the message wraps, the ghost sits one or two lines up. Chromium's MSAA system caret had every letter right, with no ghost.

  • MSAA second opinion: a UIA report that looks like a line-end ghost, or whose height is off the line's (IsOffLineHeight), asks MsaaCaret. If MSAA has a caret, it is followed instead, and a far-right UIA report it contradicts is remembered (NoteKnownGhost).
  • Known ghosts: matched by x and height (within 1 px) on any line, and skipped. A held ghost that a real caret replaces is learned too.
  • No time confirmation: the 300 ms "held ghost becomes the caret" rule (review docs: forbid em-dashes everywhere (CLAUDE.md style rule) #56) is removed. Discord keeps reporting the ghost for as long as you pause after a space, so every pause jumped the view.
  • The adjacent-line case needs a different height (Up/Down keep the caret's height).

Tests: 5 new caret_rect cases from the field rects; build.bat test 681/681. The signed UIAccess build was deployed through five rounds; the owner confirmed the last one on a 3-line wrapped Discord message.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kg7JN6HgdB9FaHJsgLxovP

…r confirm it by time (#552)

Discord's UIA selection reports the caret at the text box's right end after
a trailing space and for most letters near a wrap, 45-46 px tall in 48-49 px
lines, and one or two lines up once the message wraps. Wind confirmed a held
ghost after 300 ms (each pause after a space jumped the view), missed it on
other lines, and followed the right zone once per word.

- A UIA report that looks like a ghost or has an off-line height asks MSAA,
  whose system caret was right for every letter; it is followed instead and
  a far-right UIA report it contradicts is remembered as a known ghost.
- Known ghosts (x and height) are skipped on any line; a held ghost replaced
  by a real caret is learned too.
- No time-based confirmation of a held ghost (review #56 was hypothetical).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kg7JN6HgdB9FaHJsgLxovP
@Maxaubert
Maxaubert merged commit 0c77f43 into main Nov 6, 2026
1 check failed
@Maxaubert
Maxaubert deleted the fix/discord-ghost-learned branch November 6, 2026 08:38
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.

Discord: view jumps to the end of the line while typing

1 participant