Repository navigation
Conversation
Why: - A Space library retains pages deleted in another tab despite fresh list responses. - Blind replacement would regress local creation races and discard open drafts. What: - Reconcile absent rows while preserving open pages and local mutations newer than a poll. - Serialize and bound polling, cancel obsolete requests, and retain revision/tombstone guards. - Warn when an open page was deleted and document the draft download workflow. - Add snapshot and component regressions for deletion, races, cancellation, and recovery. Risk: - An externally deleted editor stays open for draft recovery, not server restoration. - Browser verification uses synthetic SQLite data and real page routes, not live AI services. Tests: - Initial regressions failed on main before the fix; 23 related tests now pass. - npm test: 313 tests passed across 49 files on Node 24.16.0. - npm run check-format; npm run lint; npm run typecheck; npm run build. - Chrome two-page checks at 1280px and 390px: deletion/reparenting, draft preservation, keyboard download with exact content verification, and return-to-library reconciliation. - git diff --check; living-docs pre/post checks: zero errors and warnings. Live Docs: - docs/SETUP.md: externally deleted open-page recovery and server/draft distinction. Fixes CopilotKit#125
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #125
Workflow
The same owner opens a Space in two tabs. Deleting a page in B succeeds, but A's library keeps its old row indefinitely even though later complete page-list responses omit it. This does not require Intelligence or multi-user collaboration.
mergePageSnapshotpreviously used a permanent union to protect a locally created document from an older list response. Merely replacing the union with the latest list would lose that protection and could unmount an open unsaved draft.Change
Only the client snapshot/polling logic, its tests, and this usage explanation change. No backend, dependency, model configuration, or database migration changes. This branch is based directly on upstream main and does not contain #122. #114 touches the same workspace module but proposes history/trash/import-export; this PR does not add those features.
Verification
On Node 24.16.0, based on upstream
main:space-workspace,page-snapshots,autosave,page-document-delete).npm test: 49 files, 313 tests passed.npm run check-format,npm run lint,npm run typecheck,npm run build: passed.git diff --check: passed.Actual browser and page API checks
An isolated Vite fixture mounted the real SpaceWorkspace, SpaceLibrary, PageDocument, editor, menus and CSS in ReactDOM StrictMode. Two Chrome pages talked to the project's real Hono page routes and SQLite stores, using synthetic in-memory data.
Limits
The component tests mock child views and API responses to control races. The browser checks use real page routes/UI but a small fixture wrapper, not a full deployment; one save request is deliberately held to expose the draft-loss boundary. No live Intelligence/model, voice, Slack or Docker deployment was tested. Temporary browser scripts and screenshots are not committed.
The build retains the existing Vite native-config and large-chunk warnings. No test timeout was raised. AI-assisted investigation and implementation; all reported commands and browser checks were executed locally.