Refactor note graph dialog to use explicit canvas/details layout sizing#821
Merged
multiplex55 merged 2 commits intomasterfrom Feb 11, 2026
Merged
Conversation
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.
Motivation
available_width()sizing logic.Description
MIN_CANVAS_WIDTH,DETAILS_WIDTH_RATIO,DETAILS_MIN,DETAILS_MAX,MIN_CANVAS_HEIGHT) and a pure helperfn compute_graph_layout(total_width: f32, details_visible: bool) -> (f32, Option<f32>)that returns(canvas_width, details_width)with clamping and minimum-enforcement logic.NoteGraphDialog::uiwith a single computation fromui.available_width()andui.available_height(), then explicitly allocated the canvas and optional details panel withallocate_ui_with_layoutusing the computed sizes so the canvas is the remainder area.main_canvasto accept a precomputedcanvas_size: Vec2and allocate exactly that size; adjustedright_panelto honor the exact allocated width.Testing
cargo fmt -- src/gui/note_graph_dialog.rswhich succeeded.compute_graph_layout(...)(table-driven cases) and a regression testdetails_visible_canvas_only_shrinks_by_computed_details_widthto assert canvas shrinkage equals the computed details width; tests are insrc/gui/note_graph_dialog.rstest module.cargo test compute_graph_layout, but test execution is blocked in this environment due to a Rust toolchain mismatch (rustc 1.87.0vs a dependency requiringrustc 1.88.0).Codex Task