feat: element refs in dump ui, tap by @ref - #378
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe ChangesElement-reference tapping
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR adds element references for UI dumps and allows tapping by reference or coordinates; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant CLI as io tap
participant TapCommand
participant UIDump as structured UI dump
participant Device
CLI->>TapCommand: pass Ref or coordinates
TapCommand->>UIDump: fetch current elements
UIDump-->>TapCommand: return referenced elements
TapCommand->>TapCommand: resolve Ref and calculate center
TapCommand->>Device: tap coordinates
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
dump ui now assigns each element a ref (e1..eN) in depth-first pre-order, and io tap accepts either x,y coordinates or an element ref (@E5), resolving the ref against a fresh dump and tapping the element's center.
4ebb1a9 to
988258c
Compare
Summary
dump uinow assigns each element aref(e1..eN, depth-first pre-order — the element's position in the printed tree).io tapaccepts eitherx,ycoordinates or an element ref (@e5). A ref is resolved against a fresh dump at tap time and taps the element's rect center. JSON-RPCdevice.io.tapaccepts the newreffield as well.--format raw) are unchanged.Refs are positional against the latest dump, so they are only valid until the screen changes; no staleness tracking yet.
Test plan
go test ./types ./commands(new tests for ref numbering and nested ref lookup)mobilecli dump uithenmobilecli io tap @e3io tap e15suggests both formatsSummary by CodeRabbit
New Features
io tapnow supports tapping UI elements by reference, such as@e5, in addition to screen coordinates.Bug Fixes
Tests