Skip to content

SettingsProtectionHelper: support always-hidden controls#1522

Open
imnasnainaec wants to merge 9 commits into
masterfrom
fix/1134-always-hidden-controls
Open

SettingsProtectionHelper: support always-hidden controls#1522
imnasnainaec wants to merge 9 commits into
masterfrom
fix/1134-always-hidden-controls

Conversation

@imnasnainaec

@imnasnainaec imnasnainaec commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add SetSettingsProtection(Control, bool, bool keepHidden) and SetSettingsProtection(ToolStripItem, bool, bool keepHidden) overloads so controls/items can be marked always-hidden, remaining hidden even when Ctrl+Shift reveals protected controls; the original 2-parameter overloads are preserved for WinForms designer extender-property discovery and binary compatibility
  • Track always-hidden components in a separate _alwaysHiddenComponents set; UpdateDisplay() unconditionally hides them after the normal pass
  • Fix GetSettingsProtection to return true for always-hidden controls (previously only checked the normal set)
  • Fix Dispose(bool) — managed cleanup moved inside the if (disposing) guard; redundant explicit timer disposal removed (timer is owned by the components container and already disposed by it)
  • Add XML doc on keepHidden parameter clarifying it has no effect when isProtected is false (component is shown and removed from all tracking sets)

Test plan

  • Verify existing callers using SetSettingsProtection(control, isProtected) are unaffected

Fixes #1134

Devin review: https://app.devin.ai/review/sillsdev/libpalaso/pull/1522


This change is Reviewable

…ontrols (#1134)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imnasnainaec imnasnainaec changed the title SettingsProtectionHelper: support always-hidden controls (#1134) SettingsProtectionHelper: support always-hidden controls Jun 30, 2026
@imnasnainaec imnasnainaec self-assigned this Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Palaso Tests

     4 files  ± 0       4 suites  ±0   10m 52s ⏱️ -52s
 5 110 tests + 7   4 877 ✅ + 7  233 💤 ±0  0 ❌ ±0 
16 642 runs  +21  15 921 ✅ +21  721 💤 ±0  0 ❌ ±0 

Results for commit da28f02. ± Comparison against base commit fad75f9.

♻️ This comment has been updated with latest results.

imnasnainaec and others added 5 commits June 30, 2026 15:47
- Restore CHANGELOG from base commit to fix double-encoded UTF-8
  (Chinese characters and curly apostrophe were corrupted by PowerShell
  Get-Content/Set-Content mishandling UTF-8-without-BOM)
- Re-apply keepHidden entry in the correct ### Added section
- Add XML doc to 3-param SetSettingsProtection overloads clarifying that
  keepHidden has no effect when isProtected is false

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Timer is owned by the components container, so components.Dispose()
already disposes it; the explicit _checkForCtrlKeyTimer.Dispose() call
was a no-op double-dispose.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The keepHidden feature entry didn't cover the separate Dispose(bool)
fix that moves managed-resource cleanup inside the disposing guard
and removes the redundant explicit timer disposal.
@imnasnainaec imnasnainaec marked this pull request as ready for review July 8, 2026 21:37
@imnasnainaec imnasnainaec requested a review from tombogle July 8, 2026 21:37
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.

When Settings protections is turned on with password protection, need a way to keep protected controls hidden

1 participant