SIGN IN SIGN UP

fix(traces): hide expand/collapse all when there is nothing to toggle (#4737)

## Description

- I was feeling a little baited when I clicked the expand button on a
run and nothing expanded. There were simply no nested items to display
- Let's show the icons only when they will actually expand or contract
- Users get more information with less visual noise!
- Retain our current behavior of not expanding the "Inngest (i)" trees
- also ran this by design!


https://github.com/user-attachments/assets/5fdc92e4-d1a9-4ee4-ac21-bf64ce2cbba8



## Release note

<!-- User-facing release note. Use "None" if this does not need release
notes. -->
Expand and contract buttons in the trace viewer are hidden when they
will not change what's displayed

## Migration note

<!-- Upgrade, deployment, config, schema, or compatibility notes. Use
"None" if none. -->
None.

*[Check our Pull Request
Guidelines](https://github.com/inngest/inngest/blob/main/docs/PULL_REQUEST_GUIDELINES.md)*

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
S
Scott Numamoto committed
68cfdf47cf897dff3589fd893779fcff44e20bb3
Parent: a5133b0
Committed by GitHub <noreply@github.com> on 8/14/2026, 7:52:28 PM