Skip to content

Sheet tabs: show a padlock on protected sheets - #1222

Open
richard1912 wants to merge 1 commit into
storytold:mainfrom
richard1912:fix/protected-tab-lock
Open

richard1912 wants to merge 1 commit into
storytold:mainfrom
richard1912:fix/protected-tab-lock

Conversation

@richard1912

Copy link
Copy Markdown
Contributor

Fixes #1183.

A protected sheet's tab looked exactly like any other, so the first hint that a sheet was protected was an edit being refused. Now its tab carries a small padlock before the name, and hovering the tab shows "Protected sheet". Unprotected tabs are unchanged. Thanks to @dfgodvan for pointing at sheet_tabs and Icon::Lock.

Excel itself shows nothing on the tab, so this is a small improvement on Excel rather than a parity fix (Google Sheets shows a padlock the same way).

Change

  • crates/ui-egui/src/tabs.rs, sheet_tabs: the tab list now carries Sheet::is_protected(). A protected tab reserves 16 px (12 px padlock + 4 px gap), and the padlock and name are centred together as one group. The padlock uses text_dim, or the accent colour on the active tab to match its name. The rename field is untouched.

Tests

  • protected_sheet_tabs_carry_a_padlock_before_the_name in crates/ui-egui/tests/sheet_tabs.rs: protects a sheet through review.protectSheet and checks the name moves right, the tab grows by up to the padlock's room, and a padlock is painted just left of the name. It fails on main and passes here.
  • cargo xtask ci: fmt, clippy, test, assets, layers and wasm pass. parity fails the same way on unmodified main on Windows (the checklist regenerates with different line endings).
  • Tried on Windows 11 at 150% scaling with a workbook holding two protected sheets, one with a tab colour.

A protected sheet's tab now carries a padlock before its name, centred with
the name as one group, and a "Protected sheet" hover tip. Unprotected tabs
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2bJ3LxrZ6YnmppgrfwHwr

This branch has not been deployed

No deployments
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.

Sheet tabs don't show that a sheet is protected

1 participant