Skip to content

fix(onlyoffice): always show editor toolbar and remove read-only fab#3939

Merged
Crash-- merged 2 commits into
masterfrom
fix/onlyoffice-mobile-toolbar
Jun 22, 2026
Merged

fix(onlyoffice): always show editor toolbar and remove read-only fab#3939
Crash-- merged 2 commits into
masterfrom
fix/onlyoffice-mobile-toolbar

Conversation

@Crash--

@Crash-- Crash-- commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • On touch screens the editor opens in edit mode, which hid the Drive toolbar (file name and back-to-Drive button), leaving the read-only fab as the only exit.
  • The fab toggle to view mode was immediately reverted to edit mode by OnlyOfficeProvider, so it could never restore the toolbar (it just reloaded the editor).
  • Always render the editor toolbar so the back-to-Drive control stays available in every mode.
  • Remove the now-redundant ReadOnlyFab and its tests.

Summary by CodeRabbit

  • Bug Fixes
    • Removed the OnlyOffice floating action button used to toggle between view/edit (including related edit controls).
    • Simplified the OnlyOffice toolbar by removing the dedicated edit action.
    • Updated the OnlyOffice dialog header so key elements are now always displayed.
  • Tests
    • Updated OnlyOffice editor/toolbar tests for the new UI behavior and adjusted mocks/expectations.
    • Removed the obsolete ReadOnlyFab test coverage.
  • Localization
    • Removed the unused OnlyOffice “edit” action label across supported languages (leaving “validate” intact).

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2bf121da-9ef7-4fcd-a8b2-23333e467626

📥 Commits

Reviewing files that changed from the base of the PR and between d360706 and 23c837f.

📒 Files selected for processing (8)
  • src/locales/en.json
  • src/locales/fr.json
  • src/locales/nl_NL.json
  • src/locales/ru.json
  • src/locales/vi.json
  • src/modules/views/OnlyOffice/Toolbar/EditButton.jsx
  • src/modules/views/OnlyOffice/Toolbar/index.jsx
  • src/modules/views/OnlyOffice/Toolbar/index.spec.jsx
💤 Files with no reviewable changes (7)
  • src/locales/ru.json
  • src/locales/en.json
  • src/locales/fr.json
  • src/locales/vi.json
  • src/locales/nl_NL.json
  • src/modules/views/OnlyOffice/Toolbar/EditButton.jsx
  • src/modules/views/OnlyOffice/Toolbar/index.spec.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/modules/views/OnlyOffice/Toolbar/index.jsx

Walkthrough

The PR removes editor-mode gating and edit-button functionality from OnlyOffice views. EditButton.jsx is deleted entirely. View.jsx removes imports of ReadOnlyFab, isOfficeEditingEnabled, and Breakpoints; it narrows useOnlyOfficeContext to only isEditorReady and removes the showReadOnlyFab conditional logic and render. Title.jsx drops isEditorModeView from context and renders DialogTitle and Divider unconditionally. Toolbar/index.jsx removes EditButton usage and canEdit logic, simplifying the sharing-section render to show only when not public and editor is ready, with OpenSharingLinkButton now using a fixed primary variant. Tests and localization are updated: Editor.spec.jsx removes the ReadOnlyFab test suite and updates helpers mock; Toolbar/index.spec.jsx removes isEditorModeView parameters; and the edit action translation is removed across all locales.

Possibly related PRs

  • linagora/twake-drive#3848: Directly modifies the EditButton disabled condition, complementing this PR's deletion of the entire EditButton component.

Suggested reviewers

  • doubleface
  • rezk2ll
  • JF-Cozy
  • lethemanh
  • codescene-delta-analysis
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: always showing the editor toolbar and removing the read-only FAB, which are the core objectives of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/onlyoffice-mobile-toolbar

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@bundlemon

bundlemon Bot commented Jun 20, 2026

Copy link
Copy Markdown

BundleMon

Files updated (3)
Status Path Size Limits
static/js/main.(hash).js
48.25KB (-18B -0.04%) -
static/js/public.(hash).js
19.77KB (-23B -0.11%) -
static/js/intents.(hash).js
8.96KB (-241B -2.56%) -
Unchanged files (17)
Status Path Size Limits
static/js/cozy.(hash).js
928.16KB -
static/resource/(hash).js
336.09KB -
services/qualificationMigration.js
283.39KB -
services/dacc.js
263.13KB -
static/js/lib-react.(hash).js
43.88KB -
static/css/cozy.(hash).css
30.13KB -
static/js/lib-polyfill.(hash).js
22.77KB -
static/js/lib-router.(hash).js
21.86KB -
static/css/main.(hash).css
13.57KB -
static/js/(chunkId).(hash).js
8.6KB -
static/js/async/(chunkId).(hash).js
7.5KB -
manifest.webapp
3.09KB -
static/css/public.(hash).css
2.34KB -
index.html
771B -
public/index.html
705B -
intents/index.html
643B -
assets/manifest.json
185B -

Total files change -283B -0.01%

Groups updated (1)
Status Path Size Limits
**/*.js
5.98MB (-602B -0.01%) -
Unchanged groups (2)
Status Path Size Limits
**/*.{png,svg,ico}
2.16MB -
**/*.css
77.42KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@Crash-- Crash-- marked this pull request as ready for review June 21, 2026 06:11
@Crash-- Crash-- added the e2e Run the E2E suite on this PR label Jun 21, 2026
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.
@Crash-- Crash-- force-pushed the fix/onlyoffice-mobile-toolbar branch from c448885 to d360706 Compare June 22, 2026 07:18
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@Crash-- Crash-- force-pushed the fix/onlyoffice-mobile-toolbar branch from d360706 to 2878788 Compare June 22, 2026 07:22
codescene-delta-analysis[bot]

This comment was marked as outdated.

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.).
@Crash-- Crash-- force-pushed the fix/onlyoffice-mobile-toolbar branch from 2878788 to 23c837f Compare June 22, 2026 07:23

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@Crash-- Crash-- merged commit 46df4b3 into master Jun 22, 2026
7 checks passed
@Crash-- Crash-- deleted the fix/onlyoffice-mobile-toolbar branch June 22, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run the E2E suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants