Refresh plots once when the Manage cells modal closes (#184) - #190
Merged
Merged
Conversation
The per-panel y-range lookup reads the summary column id out of each trace's hovertemplate (variable=<id>). With Spread on, the app's hover rewrite from #40 had already replaced that id with the pretty axis title by the time the ranges were applied, so none of them matched a facet axis and every panel stayed autoscaled. figure_json now resolves the variable -> axis map straight after collection.plot and passes it to _apply_y_ranges. Adds regression tests for both-ends and one-sided ranges on the spread path. Co-authored-by: Jan Petter Maehlen <jepe@ife.no>
Edits made inside the Manage cells dialog used to fire one plot round-trip each, and every response redrew the chart on arrival, so after a burst of edits the figure kept re-rendering long after the dialog had closed. Edits now route through _replotAfterEdit(), which only flags a pending redraw while the modal is open; closing it redraws the current tab once. Every plot fetch also carries a per-chart sequence number, and a response overtaken by a newer request is dropped rather than drawn, with the busy spinner held until the last in-flight request settles. The modal footer says when the refresh happens. Adds a Playwright e2e test counting /api/plots requests. Co-authored-by: Jan Petter Maehlen <jepe@ife.no>
This was referenced Oct 3, 2026
Merged
Base automatically changed from
cursor/186-y-ranges-group-avg-spread-713a
to
main
October 4, 2026 06:06
…ot-cells-modal-713a Co-authored-by: Jan Petter Maehlen <jepe@ife.no>
Co-authored-by: Jan Petter Maehlen <jepe@ife.no>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #184
Problem
Every edit in the Manage cells dialog fired a plot round-trip, and each response redrew the chart on arrival. After a burst of edits the figure kept re-rendering one intermediate state after another, long after the dialog was closed — while the modal was covering the chart in the first place.
Changes (front-end only)
updateCell/selectAll/selectGroup/removeCellnow go through_replotAfterEdit(), which only flags a pending redraw while the modal is open.closeCellsManager()redraws the current tab once. Sidebar edits still redraw immediately.summary/cycles/cell, incl. compare) carries a request sequence number;_fetchFigurereturnsnullfor a response overtaken by a newer request, so it is never drawn.plotBusyis backed by an in-flight counter, so the spinner stays until the last request settles instead of vanishing when the first one comes back.Tests
test_cells_modal_defers_plot_refresh_until_close: label + group + none/all edits inside the modal issue 0/api/plots/*requests, Close issues exactly 1, reopen/close without edits issues none. Fails on the previous JS, passes now. (Skips without Playwright, as the rest of the e2e module; CI runs-m essential.)uv run pytestgreen.Manual walkthrough (server mode, demo cells)
Group/label edits and none/all inside the modal → no redraw; Close → one redraw with the new grouping; rapid checkbox toggling in the sidebar ends in a consistent figure.
cells_modal_deferred_replot_184.mp4
Also
.issueflows/04-designs-and-guides/manage-cells-modal.md;.issueflows/tracking files; graphify artifacts refreshed.To show artifacts inline, enable in settings.