-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Collapsible flamegraph toggle in TraceDetailV2 #7173
base: main
Are you sure you want to change the base?
Collapsible flamegraph toggle in TraceDetailV2 #7173
Conversation
Welcome to the SigNoz community! Thank you for your first pull request and making this project better. 🤗 |
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.
❌ Changes requested. Reviewed everything up to 1152be2 in 1 minute and 39 seconds
More details
- Looked at
59
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. frontend/src/pages/TraceDetailV2/TraceDetailV2.tsx:50
- Draft comment:
Consider extracting the icon size (currently hardcoded as 14) into a design token or a constant to maintain consistency across the app. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
While using design tokens for consistent values is generally good practice, this is a very minor UI detail. The size 14 appears to be used only once in this component for these specific icons. Without seeing the broader design system or other icon usages, we can't be certain this needs to be standardized. The comment feels overly nitpicky for the scope of this change.
The suggestion could improve design consistency if there are other icons in the system that should share the same size. However, not every numeric value needs to be a constant - sometimes a one-off value is fine.
Given that this is a minor UI detail and we don't have evidence that this size needs to be standardized across components, the comment adds unnecessary complexity for minimal benefit.
Delete the comment as it suggests a potentially unnecessary abstraction for a minor UI detail without clear evidence that standardization is needed here.
2. frontend/src/pages/TraceDetailV2/TraceDetailV2.tsx:50
- Draft comment:
⚠️ Avoid magic numbers: The toggle icon size is hardcoded as 14 in getFlamegraphButtonIcon. Consider extracting this value as a constant or using design tokens for consistency. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
3. frontend/src/pages/TraceDetailV2/TraceDetailV2.tsx:97
- Draft comment:
🔎 For better accessibility, consider adding an aria-label to the flamegraph toggle button to clearly indicate its purpose. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_YijOBAlBWtrX1WI5
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -89,20 +98,24 @@ function TraceDetailsV2(): JSX.Element { | |||
type="text" |
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.
For accessibility, consider adding an 'aria-expanded' attribute to the button (e.g. aria-expanded={!isFlamegraphCollapsed}) to clearly indicate its state.
type="text" | |
type="text" aria-expanded={!isFlamegraphCollapsed} |
traceFlamegraphStatsWidth={traceFlamegraphStatsWidth} | ||
selectedSpan={selectedSpan} | ||
/> | ||
{!isFlamegraphCollapsed && ( |
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.
I had some doubts about this approach. I also explored passing the property directly to TraceFlamegraph
(which would keep it mounted but not visible, I presume). If you think that's a better direction, please advise. Open to suggestions, thanks!
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.
Also, from a UI/UX perspective, I don't know if it is clear to the user when the flamegraph is collpased that there is something hidden or ready to expand at all (See the 2nd screenshot). If you guys would like me to address that somehow, just let me know.
1152be2
to
a4e939e
Compare
a4e939e
to
4a7fbb8
Compare
Summary
This PR allows the user to collapse and uncollapse the flamegraph in the Trace Detail page.
Related Issues / PR's
This change is related to issue #7146
Screenshots
This is now the appearence of the page (a toggle button was inserted) without collapsing the flamegraph.
This is a screenshot of the page with the flamegraph collapsed.
Affected Areas and Manually Tested Areas
I tested the page manually and it works properly.
Important
Add toggle functionality to collapse and expand the flamegraph in
TraceDetailV2
.isFlamegraphCollapsed
state andtoggleFlamegraph
function inTraceDetailV2.tsx
to manage flamegraph visibility.ChevronDown
andChevronRight
.TraceFlamegraph
based onisFlamegraphCollapsed
state.TraceDetailV2.tsx
.ChevronDown
when expanded andChevronRight
when collapsed.This description was created by
for 1152be2. It will automatically update as commits are pushed.