Skip to content

Devtools cell inspector extention #139

Closed
dkrasner wants to merge 16 commits intodevfrom
daniel-devtools
Closed

Devtools cell inspector extention #139
dkrasner wants to merge 16 commits intodevfrom
daniel-devtools

Conversation

@dkrasner
Copy link
Contributor

Motivation and Context

This PR is an initial pass at a (chrome) devtools extension to inspect the cells directly in the browser. It allows us to traverse the cells tree, see the corresponding displays, and inspect the individual cell properties.

At the moment the functionality is limited (the focus of this PR was the setting up of the extension and integration with cells framework), but you are able to click on any tree node and see a short description (currently name and id) in the side panel, double-click to expand and collapse the tree at a specific node, and hover over a node to see the corresponding cell-ui highlight (although this is a big buggy, see below).

image

Devtool extension development is a touchy. I have tried to add the critical elements to the README. Please go through this as it explain how to load the extension as well as how to understand the various components of the code (some of which don't seem to do anything at first glance other than route messages from one place to another...).

Approach

The bulk of the extension if the d3 js code found in tree.js, with the other files mostly dealing with target window, background, and devtools context communication. Otherwise, I have added two small methods to CellHandler which send over cell tree data to devtools as needed.

How Has This Been Tested?

In the browser.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Limitations and Issues:

There is no filtering on cell types in the tree. For example, a Button and a Subscribed cell are treated the same way, even though the former has a ui equivalent whereas the latter truly does not. This also leads to issues when trying to hover over tree nodes, since DOM elements corresponding to "non-view" cells have css which becomes difficult to overwrite dynamically. This is not impossible, but we need to think about how we want to treat cell types.

The current info panel displays very little, so we should do more. For this we need to think about roles of different types of cells (Subscribed, Padding, Views, etc).

Sometimes the initial position of the d3 svg div is a bit off center. In general, the entire d3 part of the CellTree JS should be cleaned up.

Filtering on updates to the cells tree happens on the devtools panel like so, but might be better handled in the CellHandler itself.

Personally, I would like to see the underlying python code for a specific cell appearing in an editor next to the info panel, in spirit similar to ODB webtest, but we'd need to think about the best way to make that happen.

@dkrasner dkrasner requested a review from braxtonmckee October 17, 2022 14:14
@dkrasner dkrasner mentioned this pull request Jun 19, 2023
5 tasks
@dkrasner
Copy link
Contributor Author

closing with #145

@dkrasner dkrasner closed this Jun 19, 2023
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