Add permission mode dropdown for view/edit mode switch #13843
Merged
pedropintosilva merged 3 commits intomainfrom Jan 21, 2026
Merged
Add permission mode dropdown for view/edit mode switch #13843pedropintosilva merged 3 commits intomainfrom
pedropintosilva merged 3 commits intomainfrom
Conversation
e8a88b9 to
8153eac
Compare
8153eac to
e4e2aa6
Compare
eszkadev
reviewed
Dec 29, 2025
eszkadev
reviewed
Dec 29, 2025
eszkadev
reviewed
Dec 29, 2025
eszkadev
reviewed
Dec 29, 2025
e4e2aa6 to
97d2414
Compare
eszkadev
reviewed
Jan 6, 2026
eszkadev
reviewed
Jan 6, 2026
eszkadev
reviewed
Jan 6, 2026
eszkadev
reviewed
Jan 6, 2026
3fbffd8 to
6554b03
Compare
Contributor
|
what is blocking this? or what is missing? |
6554b03 to
41457dd
Compare
Contributor
Author
This part i need to resolve for better state management #13843 (comment) |
41457dd to
39e5ba9
Compare
eszkadev
reviewed
Jan 20, 2026
eszkadev
reviewed
Jan 20, 2026
eszkadev
reviewed
Jan 20, 2026
| } | ||
|
|
||
| private _buildUI(): void { | ||
| if (!this.viewModeDropdown) return; |
Contributor
There was a problem hiding this comment.
don't we want to clear it before build?
eszkadev
reviewed
Jan 20, 2026
| } | ||
|
|
||
| updateReadonlyIndicator(): void { | ||
| // Safety check for map methods which might be missing in some contexts |
Contributor
There was a problem hiding this comment.
We should have single place where it is decided, like app.someFunction().
With every new code depending on permissions we wouldn't need then to repeat the logic.
We can move it in the followup.
Contributor
There was a problem hiding this comment.
(split UI code from app "logic")
eszkadev
reviewed
Jan 20, 2026
59bfec2 to
8026c12
Compare
Adds a new dropdown widget in the notebookbar that allows users to switch between Viewing and Editing modes. This provides a user-friendly way to toggle document permissions without using the external share dialog. - Dropdown button showing current mode (Viewing/Editing) - Menu with two options: Viewing Mode and Editing Mode - Automatically shows/hides based on user permissions - Integrates with existing permission system Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com> Change-Id: I9e27314adf55ffee4b0b71b74719b893f04fc3ee
Implements logic to hide unnecessary menu separators that appear when menu items are hidden due to permission restrictions in view mode. - Hides leading separators at the start of menus - Collapses adjacent/double separators into single ones - Hides trailing separators at the end of menus This ensures menus look clean even when many edit options are hidden in view-only mode. Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com> Change-Id: Ic83c476d988f0ed543430bf346d06b70b37c5f45
Refactors the permission-based UI switching to use existing robust methods (addClassicUI/addNotebookbarUI) and adds sidebar visibility state management across mode switches. UIManager: - Refactored onUpdatePermission to use addClassicUI/addNotebookbarUI - Added safety checks to prevent duplicate component creation - Added sidebar visibility management (show in edit, hide in view mode) This ensures: - Consistent UI initialization (fixes TopToolbar and style dropdowns) - Robust handling of duplicate calls and edge cases Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com> Change-Id: I61b71cc4c3a68cce77dc198631fb6600dbb6a0de
8026c12 to
d48c375
Compare
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.
Summary
TODO
Checklist
make prettier-writeand formatted the code.make checkmake runand manually verified that everything looks okay