Skip to content

Stabilize note panel window identity#1049

Merged
multiplex55 merged 2 commits into
note2from
codex/update-notepanel-ui-with-stable-id
Jun 27, 2026
Merged

Stabilize note panel window identity#1049
multiplex55 merged 2 commits into
note2from
codex/update-notepanel-ui-with-stable-id

Conversation

@multiplex55

Copy link
Copy Markdown
Owner

Motivation

  • Prevent note window remembered size/position from resetting when the Markdown-derived note title changes.
  • Keep the visible window title driven by the note (self.note.title.clone()) and preserve .resizable(true) behavior.

Description

  • Create a stable slug-derived window id with let window_id = egui::Id::new(("note_panel_window", self.note.slug.clone())); before building the window.
  • Attach the stable id to the window builder via .id(window_id) while still calling egui::Window::new(self.note.title.clone()) and keeping .resizable(true).
  • Add a unit test markdown_title_change_keeps_note_window_rect that renders the panel, mutates the note title/content, and asserts the remembered rect from ctx.memory(|m| m.area_rect(window_id)) remains unchanged.
  • Run rustfmt with edition 2024 on the modified file.

Testing

  • Ran rustfmt --edition 2024 src/gui/note_panel.rs which completed successfully.
  • Ran cargo test markdown_title_change_keeps_note_window_rect --lib, which initially failed due to missing system pkg-config dependencies for alsa during the build.
  • After installing the required native packages (libasound2-dev and X11 development libs) and re-running the test, the build failed due to unrelated platform-specific compile errors (windows::Win32 / windows::core and other OS-specific bindings) when compiling the full crate on Linux, preventing end-to-end validation of the test in this environment.

Codex Task

@multiplex55 multiplex55 merged commit 2876213 into note2 Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant