fix(chat): chat-debug right-dock self-feedback (peer-only claim reads)#359
Merged
Merged
Conversation
PR #346's edge-claim primitive had a self-feedback bug: when chat-debug docked right, it wrote --ngaf-chat-occupy-right AND read --ngaf-chat-occupy-right, so the panel offset itself by its own width (420px) instead of anchoring at right: 0. The result was a broken right-docked debug panel floating in the middle of the viewport whenever no sidebar was open. Fix: split the edge-claim primitive into two layers. 1. Per-component claim vars — only the OWNER writes them, only PEERS read them. Eliminates self-feedback by construction: --ngaf-chat-sidebar-claim-right (chat-sidebar writes, chat-debug reads) --ngaf-chat-debug-claim-{top,right,bottom,left} (chat-debug writes, chat-sidebar reads) 2. Aggregate --ngaf-chat-occupy-* vars stay as a convenience read for external consumers ("is anything on this edge?") but internal lib panels reference the peer-specific claims instead. Consumer-side changes: - chat-sidebar.__panel + .__launcher now read --ngaf-chat-debug- claim-bottom (was: --ngaf-chat-occupy-bottom) - chat-debug.panel--right + .panel--bottom now read --ngaf-chat- sidebar-claim-right (was: --ngaf-chat-occupy-right) Tests: 12 new cases in chat-tokens.spec lock the per-component vars and attribute mappings. Existing component specs updated to assert the peer-specific reads (catches the regression directly). Verified live: right-dock anchors at right: 0 with no sidebar present; auto-dock to bottom still works when chat-sidebar exists; manual right-dock-over-sidebar correctly stacks at right: 28rem. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a regression I introduced in PR #346: when chat-debug docks right, the panel offsets itself by its own width (420px) instead of anchoring at `right: 0`. The right-docked debug panel floats in the middle of the viewport whenever no sidebar is open — visible in any consumer of @ngaf/chat@0.0.32 that uses `` in its default right-dock state.
Root cause
The edge-claim primitive in PR #346 set both write and read on the same aggregate var:
```css
:root[data-ngaf-chat-debug="right"] {
--ngaf-chat-occupy-right: 420px; /* debug WRITES /
}
.panel--right {
right: var(--ngaf-chat-occupy-right, 0); / debug READS — self-feedback! */
}
```
When debug docked right, it pushed itself 420px off the right edge.
Fix
Split the primitive into two layers:
Per-component claim vars — only the OWNER writes, only PEERS read:
Aggregate `--ngaf-chat-occupy-*` stays as a convenience read for external consumers ("is anything on this edge?"), but internal lib panels reference peer-specific claims.
Verified live
Test plan
Notes
🤖 Generated with Claude Code