Commit Graph

1112 Commits

Author SHA1 Message Date
Isaiah Odhner
f5074d836f Link to nodes in DOMTree from NodeInfo panel 2023-06-04 02:28:42 -04:00
Isaiah Odhner
0c05e17223 Move expansion of nested nodes to method of DOMTree 2023-06-04 02:28:42 -04:00
Isaiah Odhner
e7d0d7280a Clean up 2023-06-04 01:06:44 -04:00
Isaiah Odhner
1c1fb8994e Hide inspector highlight when closing the inspector 2023-06-03 23:38:23 -04:00
Isaiah Odhner
fc279f0574 Fix type checker errors and ignore one 2023-06-03 20:08:27 -04:00
Isaiah Odhner
62fb218a1a Remove obsolete visibility reset
I made sure to leave a comment here because I thought I might leave this in by accident.
I changed how it works in 79ae7e1b7b.
2023-06-03 19:50:57 -04:00
Isaiah Odhner
336414d786 Prevent highlights from overlapping the inspector panel 2023-06-03 19:30:27 -04:00
Isaiah Odhner
545642f5d5 Prevent lingering highlight after picking with Inspect Element 2023-06-03 18:57:55 -04:00
Isaiah Odhner
8e930030c2 Make DOM tree hovering behavior more robust
Regarding "it seems to be reset anyways": I believe it was simply
highlighting an incorrect node, often, by chance, an invisible one.
`self._get_node(-1)` doesn't return None.
2023-06-03 18:00:22 -04:00
Isaiah Odhner
8acc079faa Clean up empty lists of highlight boxes 2023-06-03 16:14:06 -04:00
Isaiah Odhner
c2ddf4b88e Fix removing old highlight boxes
It was clearning (replacing) the dictionary, and thus losing track
of old highlights that should be removed.
2023-06-03 16:14:06 -04:00
Isaiah Odhner
79ae7e1b7b Fix ignoring of inspector highlight boxes when picking 2023-06-03 15:49:53 -04:00
Isaiah Odhner
89ff582c3d Remove highlight boxes associated with an old DOM node 2023-06-03 15:32:10 -04:00
Isaiah Odhner
377a883d3b Handle NoWidget
Why did this get dom_node = Container(classes={'inspector_highlight'}, pseudo_classes={'enabled'})?
2023-06-03 15:24:57 -04:00
Isaiah Odhner
892d12e8fb Add a worse option for the Polygon tool icon (a hieroglyph) 2023-06-03 15:24:56 -04:00
Isaiah Odhner
beaccf1be8 Optimize highlighting clipped region by reusing widgets 2023-06-03 15:24:56 -04:00
Isaiah Odhner
6e3bb4167e Highlight clipped region when hovering a DOM node 2023-06-03 15:04:12 -04:00
Isaiah Odhner
55c495ffa5 Cancel highlight when mouse leaves DOM tree view 2023-06-03 15:04:12 -04:00
Isaiah Odhner
bab98d051c Remove unused import 2023-05-29 23:52:08 -04:00
Isaiah Odhner
247f78d657 Ignore two type checker errors 2023-05-29 23:50:19 -04:00
Isaiah Odhner
f9cceefcdd Improve display of callables (which are filtered out currently) 2023-05-29 23:44:00 -04:00
Isaiah Odhner
a3e05ff5d8 Move filtering to a method 2023-05-29 23:20:03 -04:00
Isaiah Odhner
63f36037ac Inline add_node_with_limit function for clarity
I forgot I don't need this as a separate function now that I'm keeping
the code paths DRY with iterators. It's really just part of this loop.
2023-05-29 20:36:35 -04:00
Isaiah Odhner
4a479dc93e Perf: don't call getattr while continuing iteration for counting 2023-05-29 19:56:14 -04:00
Isaiah Odhner
faccf33d5c Show count of additional keys after the ellipsis 2023-05-29 18:37:26 -04:00
Isaiah Odhner
efc7130fca Fix doubling number of nodes added when clicking "..."
- Fix bug where the number of nodes added when clicking the ellipsis
  node would double each time.
- Fix duplicate ellipsis nodes when collapsing and expanding.
- Fix other nodes being added when collapsing and expanding.
  New nodes should only be added when initially expanding, or when
  clicking the ellipsis node.
- `count` now includes filtered out keys.
2023-05-29 18:28:59 -04:00
Isaiah Odhner
03020d767a Include private method event listeners 2023-05-29 15:50:13 -04:00
Isaiah Odhner
fb4ff044ea Fix broken (escaped) markup, and add more styling
- Fix accidentally escaped `[link]` markup
  (broken in 1dbf02e941)
- Using Text type will help avoid this problem in the future.
  Don't just make it work, make it so it must work!
  Make it strongly typed, not stringly typed.
- Use `css_identifier_styled` instead of `css_identifier`
- Add colors to exceptional case handling
2023-05-29 15:48:05 -04:00
Isaiah Odhner
75c15b97b5 Fix order of CSS path shown for event listener nodes
I just came across this `css_path_nodes` property and realized my path
was probably in the wrong order.

Also, this gives a clear option for naming the variable,
although I feel I should point out it's not a different type of node.
2023-05-29 15:48:05 -04:00
Isaiah Odhner
1dbf02e941 Use inspect.getdoc, which handles indentation, rather than raw __doc__
This inspect module sure is coming in handy for this inspector, who knew!
2023-05-29 14:18:08 -04:00
Isaiah Odhner
3bcc7eeb70 Rename index to count since some indices may be skipped 2023-05-29 13:43:57 -04:00
Isaiah Odhner
5d3383d960 Use a unique sentinel value instead of Ellipsis for the ellipsis node
This fixes the expansion logic applying to ellipsis objects in arbitrary places.
2023-05-29 13:40:40 -04:00
Isaiah Odhner
b52c1b93e9 Fix frozenset expansion 2023-05-29 03:00:18 -04:00
Isaiah Odhner
dc2714f9ff Fix dict expansion 2023-05-29 03:00:18 -04:00
Isaiah Odhner
840d6a53d5 DEAL WITH IT 😎 2023-05-29 03:00:18 -04:00
Isaiah Odhner
7d71484102 Unify "Nothing selected" message for properties tab (don't use Tree) 2023-05-29 02:03:16 -04:00
Isaiah Odhner
9b4a5ed1a2 Unify property display in inspector
- Include bytes as one of the basic types.
- Use ReprHighlighter everywhere repr is used.
- Show length for sets and tuples as well as lists.
- Show repr for lists.
- Bold key and show "=" for lists/dicts and other objects.
- Allow expanding tuples and sets.
- Remove "{}" and "[]" markers for easier scanning.
2023-05-29 02:03:16 -04:00
Isaiah Odhner
8f4703f79c Remove falsy name case 2023-05-29 01:24:44 -04:00
Isaiah Odhner
fe443f4c07 Refactor to one isinstance() call 2023-05-29 00:58:41 -04:00
Isaiah Odhner
fab2791fc6 Also highlight None with ReprHighlighter 2023-05-29 00:58:07 -04:00
Isaiah Odhner
f6983ea5f7 Fix and ignore type checking errors in inspector module
Also, object | None is redundant.
2023-05-29 00:08:50 -04:00
Isaiah Odhner
40b725f06b Mark as generic to all objects
(I briefly used `root.css_identifier` instead of taking a `label` param)
2023-05-28 23:36:34 -04:00
Isaiah Odhner
4d87e8913c Escape property name in Rich markup 2023-05-28 23:15:41 -04:00
Isaiah Odhner
177cae974c DRY and improve error handling for getters
- DRY adding nodes with enumerate() vs dir()
- Don't show the error message as a quoted string value
  (This was super simple, but ambiguous and potentially confusing.)
- Make the error handling look nice with colors
2023-05-28 23:12:16 -04:00
Isaiah Odhner
ffbe362fe4 Show picking state with accent color on Inspect Element button 2023-05-28 21:51:41 -04:00
Isaiah Odhner
92788eaeba Load more items when clicking ellipsis in properties tree 2023-05-28 21:11:48 -04:00
Isaiah Odhner
6a0187a709 Fix cut off bottom of scrolling panes in inspector 2023-05-28 20:40:08 -04:00
Isaiah Odhner
559da0ca12 DRY adding nodes with enumerate() vs dir()
Could go further, with the key_filter/self._already_loaded bits...
2023-05-28 20:25:35 -04:00
Isaiah Odhner
32c334ff62 Fix list handling in properties tree
Also, show length, and for misc. types, show type.
2023-05-28 20:25:35 -04:00
Isaiah Odhner
cbbe87295c Tweak inspector layout 2023-05-28 19:22:29 -04:00