The GPU resolves pixels to source bytes entirely locally (Q#M2) and
ships byte-position gestures (Q#M1, protocol v5):
- Hit chain: pixel − TEXT_LEFT/TOP → cosmic_text::Buffer::hit
(shaped line + byte-within-line) → projected byte via the
projected text's line table → source byte via the run map.
- The run map is built by reshape from the SAME RichChunks that feed
glyphon (each chunk now tags its origin: verbatim source run vs
injected adornment), so the map and the shaped buffer cannot
disagree; hits inside inlay-hint text snap to the hint's source
anchor.
- Gestures: left Down (with frontend-side double-click detection →
DoubleDown — only the frontend knows pixel proximity), Drag
coalesced on hit-byte change (predicted finding #4), Up. Sends are
gated on the daemon's Hello.protocol_version >= 5; an outgoing
pointer supersedes any unconfirmed optimistic-cursor floor (the
daemon's CursorByte answer is the click, not the typing
prediction).
- Wheel scroll: new local handler (no wire — the GPU owns the
viewport): LineDelta×3 / PixelDelta÷line-height, clamped scroll_top
adjust → reshape → scoped viewport re-declaration.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>