appium-inspector
appium-inspector copied to clipboard
feat: add functionality to search through app source tree
Fixes https://github.com/appium/appium-inspector/issues/1004
Demo
https://github.com/appium/appium-inspector/assets/20136913/70ee6680-6504-47ac-83e3-bb1b32c709b1
Thank you! Will test this a bit later. Similarly to your other PR, would it be possible to also update the documentation? I am referring to this page: https://appium.github.io/appium-inspector/latest/session-inspector/source/
- Update the top two images
- Add a new section in Application Source (between Refreshing the Source and Toggle Attributes Button)
Thanks for pointing out to the docs. I have updated all relevant images and added a new section with the gist of search functionality. Do let me know for any improvements.
@sudharsan-selvaraj Would you have some time to finish this PR?
@sudharsan-selvaraj Would you have some time to finish this PR?
@mykola-mokhnach Yup, I will be able to close the pending items.
The good thing is that it does work in the Electron version now :) But I have some issues with the tree node text extraction:
- It uses
renderToStringwhich is imported fromreact-dom/server, and as per React docs, it 'unnecessarily increases your bundle size and should be avoided'. There do seem to be alternatives but I haven't checked them in detail. - The converted node titles have additional wrapper text, which is unfortunately also taken into account when searching. For example, a node
<android.widget.LinearLayout>would be converted to<span><<b class="_sourcetag_zwtnd_433">android.widget.linearlayout</b>></span>. Meaning, if I search forspan, the entire DOM tree will be unwrapped, and potentially not a single node will be highlighted.
I would also suggest exploring the idea of not converting the entire DOM upon every change in the search string. Maybe the raw title of each node can be calculated as part of recursive, or at least the DOM should be converted only once upon starting search.
@sudharsan-selvaraj any updates on this PR ?
@sudharsan-selvaraj I will close this PR as it has been more than a year since its opening, but you are welcome to reopen it after resolving the merge conflicts and addressing the comments.