Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…onfig on save - Add optional updateViewConfig method to DataSource interface in @object-ui/types - Update ObjectView.handleViewConfigSave to call dataSource.updateViewConfig when available - Log warning when updateViewConfig is not available (backward compatible) - Log error when updateViewConfig call fails - Add 3 new tests covering persistence, fallback warning, and error handling - Fix Button/Input/Switch mocks in ObjectView tests to pass through data-testid Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…n up Input mock Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…igPanel Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Save draft configuration to backend in ViewConfigPanel
feat: persist ViewConfigPanel draft to backend via DataSource.updateViewConfig
Feb 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds backend persistence for inline view configuration edits made in the Console’s ViewConfigPanel, by extending the DataSource contract and wiring ObjectView to call it when available.
Changes:
- Extend
DataSourcewith optionalupdateViewConfig(objectName, viewId, config)for persisting view config saves. - Update
ObjectView.handleViewConfigSaveto calldataSource.updateViewConfigwhen present, with warnings/errors for unsupported/failing backends. - Add unit tests covering success, unsupported fallback warning, and rejection/error handling; adjust component mocks to forward
data-testid.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/types/src/data.ts | Adds optional DataSource.updateViewConfig API for persisting view configuration. |
| apps/console/src/components/ObjectView.tsx | Calls updateViewConfig on save when supported; logs warnings/errors for fallback and failures. |
| apps/console/src/tests/ObjectView.test.tsx | Adds coverage for persistence behavior and updates mocks to support data-testid. |
| ROADMAP_CONSOLE.md | Notes backend persistence for ViewConfigPanel in the console roadmap. |
Comment on lines
+426
to
+432
| // Wait for the promise rejection to be caught | ||
| await vi.waitFor(() => { | ||
| expect(errorSpy).toHaveBeenCalledWith( | ||
| expect.stringContaining('Failed to persist view config'), | ||
| expect.any(Error), | ||
| ); | ||
| }); |
There was a problem hiding this comment.
vi.waitFor is not part of the standard Vitest API used elsewhere in this repo; this test likely fails at runtime with vi.waitFor is not a function. Use waitFor from @testing-library/react (import it alongside render/screen/fireEvent) to await the async console.error assertion.
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.
ViewConfigPanel saves config changes to local state only — lost on refresh or view switch. This adds backend persistence through the DataSource adapter.
Changes
@object-ui/types—DataSourceinterface: New optional method:ObjectView.handleViewConfigSave: CallsdataSource.updateViewConfigwhen available. Validates params before calling. Logsconsole.warnif method is absent (backward-compatible with older backends). Catches and logs persistence errors.Button/Input/Switchmocks to forwarddata-testidprops.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.