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

Collapsable warnings #1497

Merged
merged 13 commits into from
Feb 3, 2025
Merged

Collapsable warnings #1497

merged 13 commits into from
Feb 3, 2025

Conversation

ngafar
Copy link
Collaborator

@ngafar ngafar commented Jan 31, 2025

Description

Addresses #1453

Testing

Run code that creates warning, some examples:

import warnings
warnings.warn("This is a warning message.")
import numpy as np
data = np.random.random(100000).reshape(10, 100, 100) * np.nan
np.seterr(all="ignore")
np.nanmedian(data, axis=[1, 2])

Documentation

No

Copy link

vercel bot commented Jan 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 3, 2025 9:07pm

@ngafar ngafar changed the title [WIP] Collapsing warnings Collapsable warnings Jan 31, 2025
Copy link
Member

@aarondr77 aarondr77 left a comment

Choose a reason for hiding this comment

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

Nice work! Just a little bit of polish and then LGTM

mito-ai/style/ErrorMimeRendererPlugin.css Show resolved Hide resolved
mito-ai/src/Extensions/ErrorMimeRenderer/OutputBlock.tsx Outdated Show resolved Hide resolved
mito-ai/src/Extensions/ErrorMimeRenderer/OutputBlock.tsx Outdated Show resolved Hide resolved
mito-ai/src/Extensions/ErrorMimeRenderer/OutputBlock.tsx Outdated Show resolved Hide resolved
Comment on lines 102 to 104
createRoot(originalNode).render(
<OutputBlock message={String(model.data['application/vnd.jupyter.stderr'] || '')} />
);
Copy link
Member

Choose a reason for hiding this comment

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

I'm seeing this flash occur where the original warning message is displayed first and then it's replaced with this collapsed view I guess.
Screenshot 2025-01-31 at 4 15 32 PM

If you scrub to about here in the video, you can see it.
Screenshot 2025-01-31 at 4 15 47 PM

Screen.Recording.2025-01-31.at.4.12.25.PM.mov

@ngafar ngafar merged commit d784cb4 into dev Feb 3, 2025
8 checks 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