Ios Sim Inspect Stays Active#667
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Owner
Author
|
@copilot review but do not make fixes |
Copilot stopped work on behalf of
arul28 due to an error
June 29, 2026 21:40
📝 WalkthroughWalkthrough
ChangesInspect hover priority fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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
Describe the change.
What Changed
Key files and behaviors.
Validation
How you tested.
Risks
Anything to watch.
Summary by CodeRabbit
Greptile Summary
This PR fixes a bug in the iOS Simulator inspect overlay where the highlight box stayed locked to the most recently clicked element instead of following the pointer as the user hovered over different elements. The fix is a single one-line change that reverses operator precedence between
hoveredElementandselectedElement.ChatIosSimulatorPanel.tsxline 2357): flipsselectedElement ?? hoveredElementtohoveredElement ?? selectedElement, so the inspect overlay follows the live hover target and falls back to the selected element only when the pointer leaves the snapshot area.ChatIosSimulatorPanel.test.tsx): adds a scenario that attaches a simulator context, clicks one element, then moves the pointer to a different element and verifies the overlay label updates and the subsequent click targets the new element correctly.Confidence Score: 5/5
Safe to merge — the change is isolated to a single derived-value computation, pointer-leave events still clear hoveredElement so the fallback to selectedElement works correctly, and the new test directly exercises the fixed scenario end-to-end.
The one-line swap is mechanically correct: hoveredElement is already set to null on every onPointerLeave handler, so the fallback to selectedElement is preserved when the cursor leaves the snapshot area. The alt-click parent-selection path in handleInspectClick continues to reference selectedElement directly and is unaffected. The new test confirms both the overlay label update and the pixel coordinates sent to selectPoint after switching hover targets.
No files require special attention.
Important Files Changed
hoveredElement ?? selectedElementreplacesselectedElement ?? hoveredElement— so the inspect highlight follows the pointer while hovering and falls back to the last clicked element when the pointer leaves the surface.selectPoint.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[User moves pointer over snapshot] --> B{hoveredElement set?} B -- Yes --> C[activeInspectElement = hoveredElement] B -- No: pointer left surface --> D{selectedElement set?} D -- Yes --> E[activeInspectElement = selectedElement] D -- No --> F[activeInspectElement = null\noverlay hidden] C --> G[Overlay highlight + label\nfollows pointer] E --> H[Overlay stays on\nlast clicked element] A2[User clicks on element] --> I[selectElementAt called\nsets selectedElement] I --> J[hoveredElement still set\noverlay continues following pointer]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[User moves pointer over snapshot] --> B{hoveredElement set?} B -- Yes --> C[activeInspectElement = hoveredElement] B -- No: pointer left surface --> D{selectedElement set?} D -- Yes --> E[activeInspectElement = selectedElement] D -- No --> F[activeInspectElement = null\noverlay hidden] C --> G[Overlay highlight + label\nfollows pointer] E --> H[Overlay stays on\nlast clicked element] A2[User clicks on element] --> I[selectElementAt called\nsets selectedElement] I --> J[hoveredElement still set\noverlay continues following pointer]Reviews (1): Last reviewed commit: "Fix iOS simulator inspect hover after at..." | Re-trigger Greptile