Repository navigation
Conversation
Contributor
Author
|
Base note: this targets Note on size: 656/590 lines look large, but 584/590 of those are the #[cfg(test)] mod tests\ block moved verbatim from |
Sakyvo
force-pushed
the
administrator-shield-official
branch
from
November 21, 2026 09:33
37abe3b to
8484c07
Compare
…ion badge An elevated Windows session marks every local tab with a shield before the program icon, and the badge could not be turned off. Add a `administrator_shield` preference (default on, current behaviour unchanged) and surface it as "Show administrator shield" in Appearance -> Interface, right after the tab close button. The badge decision now lives in one pure function, `shows_administrator_badge(enabled, elevated, inherits_host_token)`, so the switch, the elevation query and the per-pane host-token inheritance are all checked in one place; sidebar rows and top tabs reuse that computation through `TabPresentation.local_administrator`. Turning the switch off hides the marker only: the session keeps its rights. Move the `nebula_settings` unit tests into `src/tests.rs` so `lib.rs` stays under the 2000-line budget; no test body changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
An elevated Windows session marks every local tab with a shield in front of the program icon (from #436). The marker is useful when you launch Pebrel as administrator on purpose, but there is no way to turn it off — a user who always runs elevated sees the shield on every tab, forever, with no setting to hide it.
What it does
Adds a Show administrator shield switch to Settings → Appearance → Interface, directly after Show tab close buttons.
administrator_shieldis a new preference innebula_settings, default on, so nothing changes for anyone who does not touch it.shows_administrator_badge(enabled, elevated, inherits_host_token), so the switch, the elevation query and the per-pane host-token inheritance are checked in one place. Sidebar rows and top tabs both read the result throughTabPresentation.local_administrator, so one switch hides the marker everywhere.cfgwould make the settings page differ between platforms for no gain.UI strings were added to
en-USandzh-CNonly; the other catalogs keep falling back to English.Verification
cargo check -p nebula --bin pebrel --features gpui-shellpasses on this branch.cargo test -p nebula-settingspasses (114 tests), including a newadministrator_shield_defaults_to_shown_and_round_tripscovering the default,=0,=1, invalid input, and reset-to-default.python scripts/check_architecture.pypasses with no errors on this branch.Notes
nebula_settings/src/lib.rswas at 1998 lines and the new field would cross the 2000-line budget, so its unit tests move tonebula_settings/src/tests.rsin the same commit. No test body changed;lib.rsdrops to 1416 lines. Happy to split this differently if you would rather see a separate commit for the move.