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

🧾 Stack traces: code preview, URL, truncated, design #2813

Merged
merged 9 commits into from
Feb 19, 2024

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Feb 15, 2024

image

In the REPL:

image

New design

New design makes the stack trace look more inviting! It also adds more visual variety. There is also a title and some text to explain what it is.

Code previews

The most relevant frames are (often) those from your own code. In this PR, you get a small preview of the code from your notebook that made the call. You can click to jump to the line.

This is implemented without CodeMirror, but just with a <pre> and highlight.js to keep things simple :)

URLs

You can now click on file locations from Julia Base, and it will send you to the source code on github :) Adding this functionality for stdlibs and remote packages would be nice! Working on this with @adrhill

Truncated stack trace

We search for the first frame that comes from this notebook, and all frames that came before it are hidden behind a More... button. This makes the stack trace less intimidating, and it is hopefully a good heuristic for "which frames are more useful?". It would be nice to add more heuristics.

Remove "top-level-scope"

Pretty technical, just removed the whole phrase, showing only the file:line.

TODO

  • Dark mode tweaks
  • More experimentation!
  • Make the error message stand out more, especially when it is a single line.

More pictures

image image image

@fonsp fonsp added the frontend Concerning the HTML editor label Feb 15, 2024
Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="stacktraces-prettier")
julia> using Pluto

@adrhill
Copy link

adrhill commented Feb 16, 2024

Yay! 😃

@fonsp fonsp changed the title Stacktraces: code preview and more friendly styling Stack traces: code preview, URL, truncated, design Feb 16, 2024
@fonsp fonsp changed the title Stack traces: code preview, URL, truncated, design 🧾 Stack traces: code preview, URL, truncated, design Feb 19, 2024
@fonsp fonsp merged commit afbf52e into main Feb 19, 2024
13 of 16 checks passed
@fonsp fonsp deleted the stacktraces-prettier branch February 19, 2024 12:57
@fonsp fonsp added the error display How errors and stack traces are presented label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error display How errors and stack traces are presented frontend Concerning the HTML editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants