Add a pointer hover marker line to the rulers#4088
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a flip state for document rulers and a cursor position indicator that tracks the mouse on the ruler bars. The changes involve updating the frontend message protocol, managing cursor state in the document panel, and refactoring the ruler widget to handle flipped orientations and dynamic indicator rendering. Feedback was provided regarding a performance bottleneck caused by calling getBoundingClientRect() on every pointer move, suggesting that the bounding rectangle should be cached to avoid layout thrashing.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/components/panels/Document.svelte">
<violation number="1" location="frontend/src/components/panels/Document.svelte:304">
P2: Using cached `viewportBounds` for pointer math can produce incorrect ruler hover coordinates when the viewport moves without a resize. Compute the rect at pointer time (or refresh bounds on every position change) to keep the marker aligned.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Closes #1482.