-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(copilot): open the table on the view table_views just wrote #7166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+2,575
−415
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
cd339c8
feat(copilot): add create_table_view and edit_table_view
j15z b1cd4a9
fix(copilot): address review findings on table view tools
j15z ec72d49
Merge remote-tracking branch 'origin/staging' into feat/let-mothershi…
j15z 9a6b0ce
refactor(copilot): drop the direct view tools, pin views through tabl…
j15z 6adf211
chore(copilot): sync table view update semantics
j15z c59ebc2
Merge remote-tracking branch 'origin/staging' into feat/let-mothershi…
j15z 3aa7dbf
fix(copilot): sync table view sort item schema
j15z f2fc678
Merge remote-tracking branch 'origin/staging' into feat/let-mothershi…
j15z 3e6eb75
fix(copilot): persist table view pin updates
j15z 838c936
fix(tables): reconcile agent view pins
j15z dac94a3
fix(copilot): type resource update directives
j15z e2d2284
fix(tables): serialize default view demotions
j15z 0a0b72a
fix(copilot): preserve view pin clear requests
j15z 29341bf
fix(copilot): serialize resource view updates
j15z 861c966
fix(copilot): close resource persistence races
j15z 905fc86
fix(copilot): retain resource removal intent
j15z ba35219
fix: isolate copilot resource persistence by chat
j15z 6c6da57
fix(tables): restore view when returning to chat
j15z 390e1b3
fix(copilot): bound resource-write locks and repair reorder persistence
waleedlatif1 081b5cf
fix(copilot): hold a reorder for pending deletes too
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
70 changes: 70 additions & 0 deletions
70
...Id]/home/components/mothership-view/components/resource-content/resource-content.test.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /** | ||
| * @vitest-environment jsdom | ||
| */ | ||
| import { act, type ReactNode } from 'react' | ||
| import { createRoot, type Root } from 'react-dom/client' | ||
| import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' | ||
|
|
||
| vi.mock('@/app/workspace/[workspaceId]/tables/[tableId]/table', () => ({ | ||
| Table: () => null, | ||
| })) | ||
| vi.mock( | ||
| '@/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/browser-session/browser-session', | ||
| () => ({ BrowserSession: () => null }) | ||
| ) | ||
| vi.mock( | ||
| '@/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/terminal-session/terminal-session', | ||
| () => ({ TerminalSession: () => null }) | ||
| ) | ||
|
|
||
| import { ResourceContent } from '@/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content' | ||
| import type { MothershipResource } from '@/app/workspace/[workspaceId]/home/types' | ||
| import { useTableViewPinStore } from '@/stores/table/view-pin/store' | ||
|
|
||
| describe('ResourceContent table view handoff', () => { | ||
| let container: HTMLDivElement | ||
| let root: Root | ||
|
|
||
| beforeEach(() => { | ||
| ;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true | ||
| useTableViewPinStore.getState().reset() | ||
| container = document.createElement('div') | ||
| root = createRoot(container) | ||
| }) | ||
|
|
||
| afterEach(() => { | ||
| act(() => root.unmount()) | ||
| useTableViewPinStore.getState().reset() | ||
| }) | ||
|
|
||
| function render(resource: MothershipResource) { | ||
| act(() => { | ||
| root.render( | ||
| ( | ||
| <ResourceContent | ||
| workspaceId='workspace-1' | ||
| desktopScopeId='chat:chat-1' | ||
| resource={resource} | ||
| /> | ||
| ) as ReactNode | ||
| ) | ||
| }) | ||
| } | ||
|
|
||
| it('hands off a saved view that arrives after the embedded table mounts', () => { | ||
| const table: MothershipResource = { | ||
| type: 'table', | ||
| id: 'table-1', | ||
| title: 'Invoices', | ||
| } | ||
| render(table) | ||
| expect(useTableViewPinStore.getState().pins['table-1']).toBeUndefined() | ||
|
|
||
| render({ ...table, viewId: 'view-edited' }) | ||
| const pin = useTableViewPinStore.getState().pins['table-1'] | ||
| expect(pin?.viewId).toBe('view-edited') | ||
|
|
||
| render({ ...table, viewId: 'view-edited' }) | ||
| expect(useTableViewPinStore.getState().pins['table-1']?.seq).toBe(pin?.seq) | ||
| }) | ||
| }) |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.