Skip to content

Add permission mode dropdown for view/edit mode switch #13843

Merged
pedropintosilva merged 3 commits intomainfrom
private/darshan/add-new-permission-mode-dropdown
Jan 21, 2026
Merged

Add permission mode dropdown for view/edit mode switch #13843
pedropintosilva merged 3 commits intomainfrom
private/darshan/add-new-permission-mode-dropdown

Conversation

@Darshan-upadhyay1110
Copy link
Copy Markdown
Contributor

  • Resolves: #
  • Target version: master

Summary

TODO

  • ...

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

@Darshan-upadhyay1110 Darshan-upadhyay1110 marked this pull request as ready for review December 18, 2025 10:37
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/add-new-permission-mode-dropdown branch 15 times, most recently from e8a88b9 to 8153eac Compare December 29, 2025 07:25
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/add-new-permission-mode-dropdown branch from 8153eac to e4e2aa6 Compare December 29, 2025 07:58
Comment thread browser/src/control/Control.SidebarBase.ts Outdated
Comment thread browser/src/control/Control.Menubar.ts Outdated
Comment thread browser/src/control/Control.UIManager.ts Outdated
Comment thread browser/src/control/PermissionMode.ts Outdated
@eszkadev eszkadev added the draft label Dec 30, 2025
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/add-new-permission-mode-dropdown branch from e4e2aa6 to 97d2414 Compare January 6, 2026 10:04
Comment thread browser/src/control/Control.SidebarBase.ts Outdated
Comment thread browser/src/control/PermissionMode.ts Outdated
Comment thread browser/src/control/PermissionMode.ts Outdated
Comment thread browser/src/control/PermissionMode.ts Outdated
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/add-new-permission-mode-dropdown branch 5 times, most recently from 3fbffd8 to 6554b03 Compare January 7, 2026 15:05
@Darshan-upadhyay1110 Darshan-upadhyay1110 changed the title Add permission mode dropdown for view/edit mode switching Add permission mode dropdown for view/edit mode switch Jan 20, 2026
@pedropintosilva
Copy link
Copy Markdown
Contributor

what is blocking this? or what is missing?

@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/add-new-permission-mode-dropdown branch from 6554b03 to 41457dd Compare January 20, 2026 09:11
@Darshan-upadhyay1110
Copy link
Copy Markdown
Contributor Author

what is blocking this? or what is missing?

This part i need to resolve for better state management #13843 (comment)

@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/add-new-permission-mode-dropdown branch from 41457dd to 39e5ba9 Compare January 20, 2026 09:37
Comment thread browser/src/control/Control.UIManager.ts Outdated
Comment thread browser/src/control/PermissionMode.ts
}

private _buildUI(): void {
if (!this.viewModeDropdown) return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we want to clear it before build?

}

updateReadonlyIndicator(): void {
// Safety check for map methods which might be missing in some contexts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(split UI code from app "logic")

Copy link
Copy Markdown
Contributor

@eszkadev eszkadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, looks nice

@github-project-automation github-project-automation Bot moved this from To Review to To Test in Collabora Online Jan 20, 2026
Comment thread browser/src/control/Control.UIManager.ts Outdated
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/add-new-permission-mode-dropdown branch 3 times, most recently from 59bfec2 to 8026c12 Compare January 20, 2026 12:21
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
@Darshan-upadhyay1110 Darshan-upadhyay1110 force-pushed the private/darshan/add-new-permission-mode-dropdown branch from 8026c12 to d48c375 Compare January 21, 2026 06:53
@pedropintosilva pedropintosilva merged commit e897b81 into main Jan 21, 2026
15 checks passed
@pedropintosilva pedropintosilva deleted the private/darshan/add-new-permission-mode-dropdown branch January 21, 2026 08:07
@github-project-automation github-project-automation Bot moved this from To Test to Done in Collabora Online Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants