Skip to content

fix: preserve custom Zstd level checkbox state in edit dialog - #129

Merged
coldhighsun merged 1 commit into
mainfrom
fix/edit-dialog-custom-zstd-level
Aug 3, 2026
Merged

fix: preserve custom Zstd level checkbox state in edit dialog#129
coldhighsun merged 1 commit into
mainfrom
fix/edit-dialog-custom-zstd-level

Conversation

@coldhighsun

Copy link
Copy Markdown
Owner

Summary

  • Editing a disk with a custom Zstd compression level set showed the checkbox unchecked on reopen, even though DiskOptions.CustomZstdLevel and the compression preset persisted correctly.
  • Root cause: CreateDiskDialog's edit constructor set CustomZstdLevelBox.IsChecked = true before calling UpdateCompressionLevelState(). The Checked handler fires synchronously and immediately unchecked the box because CompressionLevelRow.IsEnabled was still false (stale from the base constructor, before ImagePathBox.Text was populated).
  • Fix: call UpdateCompressionLevelState() right after setting ImagePathBox/CompressionLevelBox, before setting CustomZstdLevelBox.IsChecked, so the row is already enabled when the checkbox event fires.

Test plan

  • dotnet build
  • Manually: create a disk with an image path, edit it, enable custom Zstd level with a value (e.g. 15), save.
  • Reopen edit dialog and confirm the custom checkbox is checked, the value shows 15, and the preset combo box is disabled.
  • Confirm read-only / no-image-path disks still correctly disable/clear the custom checkbox (no regression).

UpdateCompressionLevelState() ran after CustomZstdLevelBox.IsChecked was
set to true, and its Checked handler immediately unchecked the box
because CompressionLevelRow was still disabled from the earlier
no-image-path default. Reordering so the row state is refreshed first
lets the checkbox stick.
@coldhighsun
coldhighsun merged commit 8732771 into main Aug 3, 2026
5 checks passed
@coldhighsun
coldhighsun deleted the fix/edit-dialog-custom-zstd-level branch August 3, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant