Skip to content

Ios Sim Inspect Stays Active#667

Merged
arul28 merged 1 commit into
mainfrom
ade/teh-ade-ios-sim-thing-344ce49a
Jun 29, 2026
Merged

Ios Sim Inspect Stays Active#667
arul28 merged 1 commit into
mainfrom
ade/teh-ade-ios-sim-thing-344ce49a

Conversation

@arul28

@arul28 arul28 commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Describe the change.

What Changed

Key files and behaviors.

Validation

How you tested.

Risks

Anything to watch.

ADE   Open in ADE  ·  ade/teh-ade-ios-sim-thing-344ce49a branch  ·  PR #667

Summary by CodeRabbit

  • Bug Fixes
    • Improved inspect-hover behavior in the desktop chat simulator so the highlighted element stays aligned with what the pointer is currently over.
    • Updated selection behavior in the simulator overlay to prefer the hovered element when both hover and selection are present.
    • Added coverage for switching hover targets after simulator context is attached, helping prevent regressions in inspect interactions.

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 hoveredElement and selectedElement.

  • Core change (ChatIosSimulatorPanel.tsx line 2357): flips selectedElement ?? hoveredElement to hoveredElement ?? 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.
  • New test (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

Filename Overview
apps/desktop/src/renderer/components/chat/ChatIosSimulatorPanel.tsx Single-line operator swap — hoveredElement ?? selectedElement replaces selectedElement ?? hoveredElement — so the inspect highlight follows the pointer while hovering and falls back to the last clicked element when the pointer leaves the surface.
apps/desktop/src/renderer/components/chat/ChatIosSimulatorPanel.test.tsx Adds a new integration-style test that covers the hover-then-click flow after simulator context is attached; verifies both the overlay label update and the correct pixel coordinates passed to 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]
Loading
%%{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]
Loading

Reviews (1): Last reviewed commit: "Fix iOS simulator inspect hover after at..." | Re-trigger Greptile

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Jun 29, 2026 9:40pm

@arul28

arul28 commented Jun 29, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

activeInspectElement in ChatIosSimulatorPanel.tsx is changed to prefer hoveredElement over selectedElement when both exist. A new test verifies that hover targets update correctly after simulator inspect context is attached via a pointer-down event.

Changes

Inspect hover priority fix

Layer / File(s) Summary
Hover-over-selection priority and test
apps/desktop/src/renderer/components/chat/ChatIosSimulatorPanel.tsx, apps/desktop/src/renderer/components/chat/ChatIosSimulatorPanel.test.tsx
activeInspectElement is changed from selectedElement ?? hoveredElement to hoveredElement ?? selectedElement. A new test with two simulator elements ("Continue", "Settings") confirms hover target updates after context attachment and subsequent pointer selection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • arul28/ADE#247: Modifies the same iOS simulator panel's inspect/hover logic and test file.
  • arul28/ADE#526: Touches inspect-mode handling and hover/selection targeting in the same ChatIosSimulatorPanel.tsx.

Suggested labels

desktop

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: keeping iOS simulator inspect behavior active.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/teh-ade-ios-sim-thing-344ce49a

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mintlify

mintlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ade-ac1c6011 🟢 Ready View Preview Jun 29, 2026, 9:41 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@arul28 arul28 merged commit d085d20 into main Jun 29, 2026
47 of 49 checks passed
@arul28 arul28 deleted the ade/teh-ade-ios-sim-thing-344ce49a branch June 29, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant