Skip to content

State panel#73

Merged
jordalgo merged 3 commits intolibbpf:masterfrom
jordalgo:state_panel
Sep 3, 2025
Merged

State panel#73
jordalgo merged 3 commits intolibbpf:masterfrom
jordalgo:state_panel

Conversation

@jordalgo
Copy link
Copy Markdown
Collaborator

@jordalgo jordalgo commented Sep 1, 2025

Combination of two commits to make the state panel interactive and fix c source line scrollTo

Copy link
Copy Markdown
Collaborator

@theihor theihor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great feature, it should've been there from the start.

I am thinking the UI of the state panel needs to entice user to click, because right know it's not as obvious as with mem slots in the main view. Maybe we could add a hover hint "click to jump to the relevant write ins"? Or some visual indicator? Any ideas?

Also maybe we should switch the selected line too after a click on state panel? Because it is likely that the selected line is "far away" and there is no UI to "go back".

Screencast.From.2025-09-02.14-27-28.mp4

@theihor
Copy link
Copy Markdown
Collaborator

theihor commented Sep 2, 2025

One more thing: when you click on a state row without a value, we still put the slot id in focus, even though there is nowhere to jump to. Maybe just ignore such slots?

@theihor
Copy link
Copy Markdown
Collaborator

theihor commented Sep 2, 2025

This PR closes #9

@jordalgo
Copy link
Copy Markdown
Collaborator Author

jordalgo commented Sep 3, 2025

Maybe we could add a hover hint "click to jump to the relevant write ins"? Or some visual indicator? Any ideas?

Let me look at improving the UI a bit.

Also maybe we should switch the selected line too after a click on state panel? Because it is likely that the selected line is "far away" and there is no UI to "go back".

Yeah, I was thinking about this too but I didn't like how the state panel changes if you click something in it. I do agree that it's a bit awkward to try to return to the selected line. What if we just made the "Log Line" part of the State Panel header, clickable?

One more thing: when you click on a state row without a value, we still put the slot id in focus, even though there is nowhere to jump to. Maybe just ignore such slots?

Yeah, good idea. Will fix.

Clicking on a row will update the selected
state with the clicked mem slot.
And scroll to the appropriate log line.
Allow clicking on Log Line and C Line
which will scroll to the selected log
or C line in their respective panels.
@jordalgo
Copy link
Copy Markdown
Collaborator Author

jordalgo commented Sep 3, 2025

@theihor I added an additional commit to make the State Panel header interactive which should help with the need to return to the selected log line or c line.

Copy link
Copy Markdown
Collaborator

@theihor theihor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

I think sticking to selected line is actually good, because otherwise the state panel would change. Good idea adding "jump to line" click. We'll have to describe all this UI in the HOWTO doc.

@jordalgo
Copy link
Copy Markdown
Collaborator Author

jordalgo commented Sep 3, 2025

We'll have to describe all this UI in the HOWTO doc.

Good call. I'll make a PR to update this.

@jordalgo jordalgo merged commit b99be69 into libbpf:master Sep 3, 2025
1 check passed
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.

2 participants