-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add search capabilities to Peripheral Inspector view #25
base: main
Are you sure you want to change the base?
Add search capabilities to Peripheral Inspector view #25
Conversation
- Provide custom SearchOverlay component - Add search overlay to filter tree and tree table - Move custom data into the 'data' for filtering in tree table Closes eclipse-cdt-cloud#23
1cb8105
to
0fb6d4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some functional findings
- Nit: If the search filter causes the vertical scrollbar to disappear, then the find field "jumps" to the right. Feels a little noisy, but maybe something users can live with for now.
- Nit: When I expand/collapse a group, then I see a progress line at the top of the view. But no DAP requests (I assume it's supposed to cover delays caused by target accesses). Need to double-check if that was there before this PR/the PrimeReact introduction.
- Search only searches through visible items (and presumably previously expanded children). But we may also want to search through not yet visited items. Exploring the register tree by "random" keywords could be a powerful side effect of this feature. Is this where you hit performance issues?
@@ -25,12 +27,14 @@ export type ComponentTreeProps = { | |||
|
|||
const PROGRESS_BAR_HIDE_DELAY = 200; | |||
|
|||
export const ComponentTree = (props: ComponentTreeProps) => { | |||
export const ComponentTree = ({ nodes, selectedNode, isLoading }: ComponentTreeProps) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: expanding the properties here is inconsistent with other components in this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I prefer deconstructing properties as it makes the code more readable in my opinion. I agree, however, that we should stay consistent and for the purpose of this PR I changed it back to accessing props directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, @martin-fleck-at !
Thanks for fixing the find box behavior. I still do see a minimal jump of the box by one or two pixels to the left if the scrollbar disappears. That is on Windows. Not overly concerned about that one though.
I can confirm the progress line is gone. Thanks!
I checked again the last item in the list. I have to rephrase the report:
I does find registers by names even if they are invisible due to collapsed groups. However, for bit fields, the behavior is as described.
An example is for the NXP FRDM-K32L3A6 board/SVD file (Cortex-M4):
- Unfold:
CoreDebug
->DHCSR_Read
. You can see for exampleC_HALT
.
- Search for
C_HALT
. You can see it appearing in the filtered tree.
- Now collapse any of the two parent groups. The filtered list empties.
I don't know exactly what's involved to change this. Probably worth to address in a separate PR. If fixable with the chosen GUI library.
@jreineckearm I pushed an update that should address your comments. The only thing I couldn't reproduce was the filtering purely based on visible items. Could you provide an example of where that is happening? |
@martin-fleck-at , thanks for the updates! I have provided a reproducer for the "invisible items" issue. |
@jreineckearm I investigated the issue and from what I can see the problem occurs when the respective node has never been resolved as part of the children, i.e., the tree does not know about the node since we populate the model lazily on expansion: vscode-peripheral-inspector/src/plugin/peripheral/tree/provider/peripheral-cdt-tree-data-provider.ts Lines 55 to 66 in 61550b2
If I resolve all children of all nodes by default, the search works as expected. However, this is where we hit performance issues and everything else becomes quite slow since we do re-generate the model very often. Unfortunately, I'm not sure what the best way forward is. We could introduce a dedicated option in the search to also search "hidden" nodes. However, if we are lucky, maybe switching to Ant Design (#27) is a solution here as well. Please let me know how you would like to proceed with this PR. |
Closes #23