Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Add clicking on the red/green cell status boxes in the Running code overview

Open LKuhrmann opened this issue 5 months ago • 1 comments

I like that it is possible to click on the "Running code" boxes while the code is running to go to the currently running cell.

I would like it that, once the code has finished running, I can click on individual boxes (especially red ones) to be able to go to them and figure out/fix the error.

I have some rather long Notebooks (>50 cells, some cells quite long), and currently I just need to scroll through the notebook until I see red to find the errored cell/cells.

If it is not possible to implement this, clicking on the boxes bringing you to the first errored cell would also be quite helpful (esp due to the "Another cell defining x contains errors").

Thanks for the great project!

LKuhrmann avatar Jun 26 '25 07:06 LKuhrmann

Yeah that would be nice! If someone wants to take a look at implementing this, feel free! Not an easy issue, but take a look if you're interested in doing a full-stack PR in Pluto (javascript and julia) then this is great!

Implementation

I think it's not super easy because the information behind those boxes (Business) does not currently store the cell ID. That's why you can currently only jump to the running cell – that's something the frontend can do without knowing which box belongs to which cell, just by searching for the first running cell.

First look into the Status (aka "business") system in the Pluto backend. Business with a numeric-only key becomes a progress bar in the frontend. I think we want to add an info::Union{Nothing,Dict} field to status entry. And this code:

	Status.report_business_started!(cell_status)
	for i in eachindex(to_run)
		Status.report_business_planned!(cell_status, Symbol(i))
	end

should be

	Status.report_business_started!(cell_status)
	for (i,cell) in enumerate(to_run)
		Status.report_business_planned!(cell_status, Symbol(i); info=Dict("cell_id" => cell.id)
	end

Then on the frontend you need to link this to the boxes, and have a click handler.

fonsp avatar Jun 26 '25 07:06 fonsp