Skip to content

Make Settings window resizable, responsive scroll area, and add sizing tests#898

Merged
multiplex55 merged 2 commits intomasterfrom
codex/update-settingseditor-ui-and-tests
Feb 20, 2026
Merged

Make Settings window resizable, responsive scroll area, and add sizing tests#898
multiplex55 merged 2 commits intomasterfrom
codex/update-settingseditor-ui-and-tests

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Improve usability of the Settings dialog so it can be resized taller and not collapse to an unusable height.
  • Remove the hard-coded 300px scroll cap so window stretching increases visible settings content.
  • Keep footer actions (Save) accessible regardless of scrollable content height.
  • Add unit tests to guard sizing behavior and preserve existing static-position normalization invariants.

Description

  • Added sizing constants and helpers: SETTINGS_WINDOW_DEFAULT_SIZE, SETTINGS_WINDOW_MIN_HEIGHT, SETTINGS_CONTENT_MIN_HEIGHT, and helper functions settings_window_default_size, settings_window_min_height, and settings_content_height.
  • Made the settings window explicitly resizable and larger by default via .resizable(true), .default_size(...), and .min_height(...) on egui::Window::new("Settings").
  • Replaced the fixed egui::ScrollArea::vertical().max_height(300.0) with a responsive cap based on ui.available_height() and clamped via settings_content_height(...) so the scroll area grows with the window while preserving scrolling.
  • Kept the Save action reachable by moving the Save button outside the ScrollArea into a fixed footer row and extracted the save flow into a new save_settings function to preserve original save behavior while simplifying the UI code.
  • Added unit tests in the #[cfg(test)] module to validate sizing defaults (settings_window_sizing_policy_uses_expected_defaults), the content-height floor (settings_content_height_has_sane_floor), and that to_settings preserves static-position behavior when follow_mouse is disabled (to_settings_preserves_static_values_when_follow_mouse_disabled).

Testing

  • Ran code formatting with cargo fmt -- src/settings_editor.rs, which completed successfully.
  • Attempted to run cargo test -q settings_editor to execute the new sizing tests, but the test run failed in this environment due to a transitive dependency (alsa-sys) requiring the system alsa pkg-config file (alsa.pc) which is not available, preventing the build and test execution.
  • The new unit tests are present and designed to run in CI or a local environment with standard system dependencies installed.

Codex Task

@multiplex55 multiplex55 merged commit a5346db into master Feb 20, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/update-settingseditor-ui-and-tests branch February 20, 2026 14:48
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