From ffdd5d801a7ee637ab0c4cbe89af006ad5c3d85d Mon Sep 17 00:00:00 2001 From: Levi Neuwirth Date: Thu, 28 May 2026 14:57:26 -0400 Subject: [PATCH] =?UTF-8?q?9.3=20follow-up=20=E2=80=94=20make=20CurrentLin?= =?UTF-8?q?e=20wash=20visible=20+=20presence=20debug=20aid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manual retest still showed nothing. Two changes to localize and fix: 1. CurrentLine alpha 0.08 → 0.22. The original value computed to only ~10/255 above the dark clear color and was swamped by glyphs on any text line — effectively invisible even when the wash was being drawn correctly. 0.22 reads as a current-line band while staying below Selection's 0.30. Static analysis of the full wire path (daemon sweep → multi_frontend broadcast → reader → apply_attach_ message → peer_background_rects) found no break, so faint alpha is the leading explanation for "still nothing." 2. Env-gated diagnostic in the PresenceUpdate arm. Running with `PMACS_GPU_DEBUG_PRESENCE=1` prints each received presence (frontend, buffer, current buffer, cursor, selection). If presence lines appear, the wash geometry/alpha was the issue; if none appear, the broadcast isn't reaching the mirror and the next step moves to the daemon side. Off by default — no effect on normal runs. Gates: fmt clean; clippy -p pmacs-gpu -D warnings clean; pmacs-gpu unit 15. Co-Authored-By: Claude Opus 4.8 (1M context) --- pmacs-gpu/src/main.rs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pmacs-gpu/src/main.rs b/pmacs-gpu/src/main.rs index 1e9bc10..610cbf8 100644 --- a/pmacs-gpu/src/main.rs +++ b/pmacs-gpu/src/main.rs @@ -772,6 +772,18 @@ impl State { cursor, selection, } => { + // Run with `PMACS_GPU_DEBUG_PRESENCE=1` to confirm peer + // presence is arriving and routed to the right buffer. + // A `buf != current` line means the peer is on a buffer + // this mirror isn't displaying (no wash expected); no + // line at all means the message isn't reaching us. + if std::env::var_os("PMACS_GPU_DEBUG_PRESENCE").is_some() { + eprintln!( + "pmacs-gpu presence: fid={frontend_id:?} buf={buffer_id:?} \ + current={:?} cursor={cursor} sel={selection:?}", + self.current_buffer_id + ); + } self.peer_presences.insert( frontend_id, PeerPresence { @@ -1798,12 +1810,13 @@ fn decoration_kind_to_bg_color(kind: DecorationKind) -> Option<[f32; 4]> { // because the text render pass runs after this one in the same // render pass (Q#2 stance α). DecorationKind::Selection => Some([0.31, 0.42, 0.82, 0.30]), - // Very subtle blue-grey wash. CurrentLine is always on, so it - // wants to be visually quietest of the four background kinds: - // just enough tint to track which line carries the cursor, - // not enough to compete with Selection or syntax color when - // both cover the same bytes (bet #2 overlap surface). - DecorationKind::CurrentLine => Some([0.55, 0.60, 0.75, 0.08]), + // Blue-grey wash, quietest of the background kinds (it's always + // on) but still visible. The first 9.2/9.3 value (alpha 0.08) + // computed to ~10/255 above the dark clear color and was + // swamped by glyphs on a text line — invisible in practice. + // 0.22 keeps it subtle vs Selection's 0.30 while actually + // reading as a current-line band. + DecorationKind::CurrentLine => Some([0.55, 0.60, 0.75, 0.22]), // Deferred to the search-feature arc. DecorationKind::SearchMatch | DecorationKind::SearchMatchActive => None, // Foreground-only — handled by [`decoration_kind_to_color`].