Skip to content
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 collapse button to devtools #3241

Merged
merged 11 commits into from
Mar 26, 2025
Merged

Add collapse button to devtools #3241

merged 11 commits into from
Mar 26, 2025

Conversation

marthacryan
Copy link
Contributor

@marthacryan marthacryan commented Mar 24, 2025

User facing changes

  • Adds a collapse / expand button that uses local storage for collapse state. It has the same little rotating animation as the old dev tools!
    devtools-collapse

Code changes

  • Changes the DebugMenu from a class component to functional component (it made using state easier and we're trying to move components to that anyway).

@marthacryan marthacryan changed the title Add collapse button devtools Add collapse button to devtools Mar 24, 2025
@BSd3v
Copy link
Contributor

BSd3v commented Mar 25, 2025

What happens if there are errors when it is collapsed?

@marthacryan
Copy link
Contributor Author

@BSd3v Good question! Currently what happens is the list of errors pop up either way, and it doesn't affect the collapse state of the devtools menu. So if it's collapsed and there's an error, you see this at the bottom right:
image
@ndrezn Any thoughts on this? I know we discussed having a little red error count over the collapse button but I didn't remember if we had a decision there.

This did actually help me catch an edge case though where if you dismiss the error dialog and the devtools are collapsed, nothing happens when you get an error.

@BSd3v
Copy link
Contributor

BSd3v commented Mar 25, 2025

This is where this would be handy. 😉

#2337

@BSd3v
Copy link
Contributor

BSd3v commented Mar 25, 2025

While at it, could you also make it so we can download the errors. XD

@ndrezn
Copy link
Member

ndrezn commented Mar 25, 2025

Good ideas, but let's not let scope creep here! We came up with plenty of others during the devtools redesign 😉 When there is an error/version update but the devtools are minimized it will show a red notification dot with no number. @jeromevaldez is on design for that.

Comment on lines 140 to 143
max-width: 50px;
}
.dash-debug-menu__outer.dash-debug-menu__outer--expanded {
width: 682px;
max-width: 682px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you try fit-content? It might work as long as the internal components use a width pre-defined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just tried that and it didn't work. It's tricky to add the sliding behavior! Looks like there's this experimental css feature that could be good once it has higher adoption, but from what I've seen there aren't amazing options other than the max-width hard-coding for now.

Copy link
Contributor

@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

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

Looks good, nice refactor to a functional component 💃

@marthacryan marthacryan reopened this Mar 26, 2025
@marthacryan marthacryan merged commit ecc2e03 into dev Mar 26, 2025
3 checks passed
@marthacryan marthacryan deleted the collapse-devtools branch March 26, 2025 20:14
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.

5 participants