feat(crud): persist document view COMPASS-6937#8168
Open
mabaasit wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds persistence for the selected Documents view (List/JSON/Table) so new CRUD tabs and app restarts restore the user’s last chosen view.
Changes:
- Introduces a
DOCUMENT_VIEW_STORAGE_KEYand reads an initial document view fromlocalStoragewhen initializing the CRUD store. - Persists document view changes to
localStorageonviewChanged(). - Extends the CRUD store test suite to cover the persistence behavior and improves some typings/casts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/compass-crud/src/stores/crud-store.ts | Adds a persisted document view key, initial view loading from localStorage, and stores view changes. |
| packages/compass-crud/src/stores/crud-store.spec.ts | Adds/adjusts tests around view persistence and minor typing improvements. |
Comment on lines
+1734
to
+1739
| fakeGetItem = sinon.fake((key: string) => { | ||
| return localStorageValues[key]; | ||
| }); | ||
| fakeSetItem = sinon.fake((key: string, value: any) => { | ||
| localStorageValues[key] = value.toString(); | ||
| }); |
Comment on lines
+264
to
+268
| /** | ||
| * The key we use to persist the user selected document view for other tabs or | ||
| * for the next application start. | ||
| * Exported only for test purpose | ||
| */ |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Anemy
approved these changes
Jun 23, 2026
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.
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes