Files
Bartosz Sypytkowski f7c727fc61 Feat/page history UI (#262)
* chore: view history

* chore: remove outdated collab version listing and add version preview api

* chore: update collab history list api

* chore: fixed revert collab http api data nesting

* chore: integrated collab version into YDoc

* chore: view history

* chore: remove outdated collab version listing and add version preview api

* feat: implement document history ui modal

* fix: ai code review

* chore: fixed doc preview

* chore: move version to doc itself

* chore: only update user mappings when current user made a change locally

* chore: always restore doc version

* chore: add version as part of the key to the document editor

* chore: add cypress e2e tests for collab version history

* fix: harden version history sync and preview flow

- remove duplicate collab message handling in sync
- await revert before refreshing version history state
- guard and cancel stale preview fetches in history modal
- show "Version History" action only for document views
- clean up history list memoization/lint issues

* fix: dedupe collab handling and stabilize history list item memoization

- apply version-reset logic to broadcast-channel collab updates
- avoid replaying the same collab message when non-message deps change
- remove inline per-item callbacks to preserve VersionListItem memo benefits

* fix: harden version reset and revert flows

- use server-returned collab version after revert

- drop queued local updates during version reset/revert instead of flushing stale edits

- compare expectedVersion against persisted provider version in openCollabDBWithProvider

- unregister sync destroy listeners during cleanup

- document guid identity assignments for workspace/database/row docs

* fix(sync): restore row API contract and harden reset flow

- restore AppService methods to createRow/deleteRow

- ensure version reset continues rebinding after teardown

- keep doc reset handling scoped by view identity

- simplify history modal preview path and update tests

* fix(history): keep awareness/reset state consistent

- update awarenessMap when Y.Doc is replaced during reset/revert

- fail restore when sync context/workspace is unavailable

- clear selected version when filters hide all versions

* fix(sync): avoid legacy version reset data loss

- skip destructive resets when local doc version is unknown and migrate to incoming version

- remove duplicate collab proto declarations to keep schema canonical

* fix(history-sync): harden version history reset flows and clean test/lint regressions

* fix(sync): guard stale reset tasks and clear modal state on doc switch

* fix(sync): harden version reset and restore flows

- recreate a fresh Y.Doc after IndexedDB clear when expectedVersion mismatches

- remove timeout-based deleteDB path that could race with reopen

- keep old doc active until replacement doc is opened/applied successfully

* fix(history): harden version flows and optimize modal render

- persist learned collab versions and preserve deferred cleanup during resets

- filter tombstoned history entries from modal state

- lazy-load history modal and pass stable preview editor props

* fix(sync): avoid dropped updates and isolate history preview

- abort stale reset handlers on active-context replacement and apply guards before/after open

- remove loadView/bindViewSync from history preview editor props to prevent live nested sync

* fix(sync): align reset/update handling with desktop parity

- reroute superseded reset messages to active context instead of dropping

- enforce version match before applying rerouted updates

- disable version-history entry in ViewModal host that lacks doc-reset rebinding

* test(sync): cover version-gated updates and reset concurrency

* fix(sync): serialize reset replay and recover context on reopen failure

* chore(deps): upgrade uuid for collab version validation

* fix(sync): harden restore flow and history API handling

* fix(sync): tighten version-history reset and cleanup paths

* refactor(history): simplify modal refs and preview props

* chore: dismiss dialog after restore with correct editor state

* refactor: make view vs collab ids explicit across sync flow

* fix(sync): align unknown-version reset behavior with desktop

* refactor(history): normalize tombstone field to deletedAt

* fix(sync): scope incoming collab serialization per object

Avoid global head-of-line blocking in useSync by replacing the single incoming-message queue with per-objectId queues and per-object processors.

This preserves in-order processing for each document (required for reset/version safety) while allowing unrelated documents to continue syncing when one object is waiting on a slow reset/open path.

Also adds a regression test to ensure a pending reset for object A does not block updates for object B.

* chore(sync): remove extra inline comment

* test(sync): expand useSync coverage and align version reset behavior

Add a comprehensive useSync hook test matrix for notifications, queueing, public API methods, and revert/reset edge cases.

Align version mismatch handling with desktop semantics for known/unknown version states and add force-reset support in openCollabDB APIs for mismatch resets without expectedVersion.

* refactor: extract database identity logic into dedicated hook

* chore: fix test

* feat(history): show dialog when document is externally reverted

* chore: fix sync

* refactor: separate sync

* fix: show dialog

* refactor: stabilize hook deps, fix revert dialog timing, and clean up debug logging

* chore: exract use row operation from view operation

* refactor: remove duplicate extension

* fix: prevent blank page when outline patch targets lazy-loaded children

* fix: test

---------

Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
Co-authored-by: Nathan <nathan@appflowy.io>
2026-02-28 00:29:39 +08:00
..
2026-02-20 21:48:29 +08:00
2025-11-15 11:37:37 +08:00
2026-02-20 13:17:56 +08:00
2025-11-15 11:37:37 +08:00
2026-01-09 00:16:02 +08:00
2025-11-17 12:12:56 +08:00
2025-12-17 11:01:14 +08:00
2025-01-02 18:06:12 +08:00
2025-12-28 23:33:46 +08:00
2025-09-05 19:11:40 +08:00
2025-11-15 11:37:37 +08:00
2025-01-08 11:11:11 +08:00
2026-01-31 14:02:38 +08:00
2025-11-17 12:12:56 +08:00
2026-01-09 00:16:02 +08:00
2025-11-20 00:21:55 +08:00
2025-09-03 16:13:44 +08:00
2026-02-20 21:48:29 +08:00
2026-02-01 08:08:04 +08:00
2026-02-28 00:29:39 +08:00
2026-01-09 00:16:02 +08:00
2025-11-25 10:35:10 +08:00
2025-11-17 12:12:56 +08:00