* chore: stabilize React context values and callback references to prevent unnecessary re-renders
* fix: stabilize chat, editor, and database interactions
- preserve first-message chat renames and stable model reads
- guard async chat settings and notification updates after unmount
- fix board/grid scroll listener cleanup and align toolbar fallback
- add cypress stability coverage for chat, database, editor, and image toolbar flows
* chore: fix test
* refactor: split app context into focused providers and explicit hooks
- replace legacy AppContext access with auth/navigation/outline/operations/sync hooks
- make optional auth and workspace dependencies explicit at call sites
- split board selection state from board actions
- update Storybook and modal/view wiring for the new context boundaries
* chore: lint
* chore: stableize provider state and event listeners
* chore: harden context providers and stabilize context values
* chore: harden context providers and stabilize context values
* fix: hide raw slate text in embed blocks
The absolute div holding Slate's raw text nodes for cursor positioning
was missing text-transparent, causing the formula source text to render
visibly on top of the KaTeX output. Triggered by .text-element { z-index: 2 }
added in the realtime sync PR. Fix applied to MathEquation, PDF, and File blocks.
* chore: add math equation block component test
Verify KaTeX renders correctly and the raw Slate text node
is hidden via text-transparent to prevent duplicate display.
* 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>
layout for all databases. For inline databases embedded in documents,
this caused a duplicate header - one at the top of the page and one
inside the grid.