Stabilize note panel window identity#1049
Merged
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
self.note.title.clone()) and preserve.resizable(true)behavior.Description
let window_id = egui::Id::new(("note_panel_window", self.note.slug.clone()));before building the window..id(window_id)while still callingegui::Window::new(self.note.title.clone())and keeping.resizable(true).markdown_title_change_keeps_note_window_rectthat renders the panel, mutates the note title/content, and asserts the remembered rect fromctx.memory(|m| m.area_rect(window_id))remains unchanged.rustfmtwith edition 2024 on the modified file.Testing
rustfmt --edition 2024 src/gui/note_panel.rswhich completed successfully.cargo test markdown_title_change_keeps_note_window_rect --lib, which initially failed due to missing system pkg-config dependencies foralsaduring the build.libasound2-devand X11 development libs) and re-running the test, the build failed due to unrelated platform-specific compile errors (windows::Win32/windows::coreand other OS-specific bindings) when compiling the full crate on Linux, preventing end-to-end validation of the test in this environment.Codex Task