fix(onlyoffice): always show editor toolbar and remove read-only fab#3939
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (7)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe PR removes editor-mode gating and edit-button functionality from OnlyOffice views. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
BundleMonFiles updated (3)
Unchanged files (17)
Total files change -283B -0.01% Groups updated (1)
Unchanged groups (2)
Final result: ✅ View report in BundleMon website ➡️ |
On touch screens the editor opened in edit mode, which hid the Drive toolbar (file name and back button) and left the read-only fab as the only way out. The fab toggle was also immediately reverted to edit mode by the provider, so it could never restore the toolbar. Always render the editor toolbar so the back-to-Drive control stays available, and drop the now-redundant read-only fab.
c448885 to
d360706
Compare
d360706 to
2878788
Compare
The "Edit" button (next to "Share") was a view->edit toggle, disabled whenever editorMode !== 'view'. Since the provider force-edits as soon as the user has write access on the io.cozy.files document, the button is permanently greyed out wherever it is shown (mobile/desktop, private/public), exactly like the ReadOnlyFab removed previously. Its hidden paywall redirect is also already unreachable (only fires in view mode) and the existing-file paywall is enforced server-side by the stack returning mode: 'view'; document creation keeps its own paywall entry points. So nothing functional is lost. Remove the button, its now-dead helpers and the related i18n keys. NOTE: the OnlyOffice flows need to be clarified again, there are quite a few inconsistencies (force-edit vs paywall vs hasWriteAccess vs stack mode, viewer "open" button without paywall check, etc.).
2878788 to
23c837f
Compare
There was a problem hiding this comment.
Code Health Improved
(4 files improve in Code Health)
Our agent can fix these. Install it.
Gates Passed
3 Quality Gates Passed
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| Editor.spec.jsx | 8.03 → 8.82 | Code Duplication |
| Title.jsx | 9.66 → 9.69 | Complex Method |
| View.jsx | 9.69 → 10.00 | Complex Method |
| index.jsx | 9.29 → 9.50 | Complex Method |
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Summary
OnlyOfficeProvider, so it could never restore the toolbar (it just reloaded the editor).ReadOnlyFaband its tests.Summary by CodeRabbit