Merged
Conversation
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.
💡 Change Scope
📝 What Does This PR Do?
This PR fixes the menu offset drift affecting task prompt templates, task agent sessions, and other shared menu surfaces by converging them on a reusable viewport menu primitive.
Instead of letting each feature compute fixed positioning inside whatever transformed container it lives in, menus that should anchor to viewport coordinates now render through a shared surface portaled to
document.body, with shared placement, clamping, and flip behavior. The canvas context menu family stays compatible and reuses the shared placement helpers where it made sense without forcing oversized file churn.Regression coverage was added for the shared placement helper and the affected user flows.
🏗️ Large Change Spec (Required if "Large Change" is checked)
1. Context & Business Logic
The bug class was structural: several menus were mixing viewport-based coordinates with local/transformed render trees, so their overlays drifted away from the trigger location. The desired business behavior is consistent menu placement regardless of the local container transform or scroll state.
2. State Ownership & Invariants
3. Verification Plan & Regression Layer
pnpm pre-commit.✅ Delivery & Compliance Checklist
pnpm pre-commitis completely green.DEVELOPMENT.mdarchitectural boundaries.📸 Screenshots / Visual Evidence
Per repo convention, PR screenshots should be uploaded directly in the GitHub PR UI rather than committed into the repository. Visual regression coverage is provided by the added Playwright flows for prompt templates, task agent session menus, and related shared menu surfaces.