Skip to content

[EPIC] Improve offline mode for document editing #2494

Description

@virgile-dev

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.
The current offline mode for document editing has significant limitations:

  1. Users cannot load a document while offline; they must keep it open in their browser beforehand.
  2. Users must keep their browser open and avoid shutting down their computer to prevent losing changes.
  3. Collaboration features are disabled, which is expected but could be improved for a smoother transition when reconnecting.

This creates a poor user experience, especially for users who frequently work in environments with unstable internet connections (e.g., trains, remote areas). The reliance on keeping the browser open and the computer running is impractical and risky for data loss.

Describe the solution you'd like
I propose implementing an offline mode similar to Google Docs' offline mode but without requiring a browser plugin. The ideal solution would include:

  1. Offline Access to Documents:

    • Allow users to explicitly mark documents as available offline (e.g., via a toggle or right-click option).
    • Cache these documents locally in the browser (using IndexedDB or similar) so they can be opened and edited even without an internet connection.
  2. Automatic Syncing:

    • When the user regains connectivity, automatically sync changes to the cloud.
    • Handle conflicts gracefully (e.g., notify the user if someone else edited the same document while they were offline).
  3. Persistent Edits:

    • Ensure edits are saved locally even if the browser is closed or the computer is shut down.
    • Restore the document to its last edited state when the user reopens the browser offline.
  4. User-Friendly Warnings:

    • Clearly indicate when a document is offline and unsynced.
    • Provide a visual cue (e.g., a status bar or icon) to show sync status.
  5. Optional Collaboration Features:

    • While offline, disable real-time collaboration features but queue changes to sync later.
    • Notify users when they regain connectivity and their changes are being synced.

Drawbacks Considered:

  • Storage Limitations: Caching documents locally may consume significant browser storage, especially for large files or many documents. This could be mitigated by allowing users to select which documents to make available offline.
  • Conflict Resolution: Handling merge conflicts when multiple users edit the same document offline could be complex. A clear UI for resolving conflicts would be necessary.
  • Browser Compatibility: Relying on browser storage APIs (e.g., IndexedDB) may introduce inconsistencies across browsers. Testing and fallbacks would be required.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions