Skip to content

feat: a Settings switch for the screen code on Admin and Settings - #88

Merged
crazeydave merged 1 commit into
mainfrom
feat/screen-code-switch
Oct 28, 2026
Merged

crazeydave merged 1 commit into
mainfrom
feat/screen-code-switch

Conversation

@crazeydave

Copy link
Copy Markdown
Contributor

A per-tablet switch, Screen Code for Admin and Settings, beside Sound on Button Tap in Settings and built the same way.

  • On by default, and on if Preferences cannot be read or hold something unreadable: off is the one that lets the room into Administration.
  • Off, OperatorLock.Guards returns false for every route, so Administration and Settings open without the prompt and nothing is closed on the way out.
  • Read at each navigation through a required callback on OperatorLock, so it takes effect at once with no restart. Without the callback the lock always asks, as before.
  • Turning it off needs the code, since the switch is on Settings, which is behind it.
  • Stored in Preferences as screen_code_required; the tablet's own, not Freedom's.

Tests: three new OperatorLockTests (off guards nothing; the switch read live; no switch means always). 330 tests and the specs pass; both heads build.

On by default. Off, OperatorLock guards nothing, so Administration and
Settings open without asking. Read at each navigation, so it takes
effect at once; switching it off is behind the code, as Settings is.
Comment on lines +174 to +178
catch (Exception ex)
{
Logger.Warning(ex, "Failed to read screen-code switch — defaulting to on");
return true;
}
Comment on lines +189 to +192
catch (Exception ex)
{
Logger.Warning(ex, "Failed to save screen-code switch");
}
@crazeydave
crazeydave merged commit 47e1ecc into main Oct 28, 2026
8 checks passed
@crazeydave
crazeydave deleted the feat/screen-code-switch branch October 28, 2026 18:35
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