Backport: cool#15364 wsd, kit, browser: honour the Viewing/Editing toggle acros…#15764
Merged
eszkadev merged 1 commit intoMay 15, 2026
Merged
Conversation
Contributor
Author
|
fails on known to fail cases (I will fix in other PR -> #15758) |
Contributor
Author
|
merged in gerrit |
…s the session Problem: switching to Viewing mode only updated the browser UI. The view stayed editable in core, so shape drags and arrow-key shape moves still went through, and per-comment Edit/Reply/Delete controls were only hidden at comment-render time so existing comments kept showing them until reloaded. Solution: when a WOPI-writable user toggles between Viewing and Editing, send a new setviewreadonly message to core so the view is marked read-only there too, and flip the client-side comment/redline flags so the UI reacts immediately. Build the comment menu once and show or hide it reactively on updatepermission, instead of tying its creation to the initial permission. Code pointers: - Permission.js: sends setviewreadonly and updates app.file flags (gated on wopi.UserCanWrite to avoid breaking comment-only PDFs). - ClientSession.cpp / ChildSession.cpp: forward and handle the new message; kit calls setViewReadOnly + setAllowChangeComments + setAllowManageRedlines for the current view. - CommentSection.ts: updateEditability() listens on updatepermission and toggles menuBarCell / edit / reply panels; cleaned up in onRemove. Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com> Change-Id: I4f57a4efc08d163930cdf1716bf836dce3f620cb Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1252 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com>
bca709d to
ac362ea
Compare
Contributor
Author
|
@timar can we merge now? |
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.
…s the session
Problem: switching to Viewing mode only updated the browser UI. The view stayed editable in core, so shape drags and arrow-key shape moves still went through, and per-comment Edit/Reply/Delete controls were only hidden at comment-render time so existing comments kept showing them until reloaded.
Solution: when a WOPI-writable user toggles between Viewing and Editing, send a new setviewreadonly message to core so the view is marked read-only there too, and flip the client-side comment/redline flags so the UI reacts immediately. Build the comment menu once and show or hide it reactively on updatepermission, instead of tying its creation to the initial permission.
Code pointers:
requires: https://gerrit.collaboraoffice.com/c/core/+/2530
copy of: https://gerrit.collaboraoffice.com/c/online/+/2531