fix(copilot): pin a restored table view so a stale views list cannot strand it - #7449
Merged
Conversation
…strand it Reopening a chat hands the embedded table its saved view through `initialViewId`, which the table honours only while its views query already lists that id. A cached list from before the agent created the view resolves it to nothing, so adoption settles on the default and stamps itself closed — nothing revisits the id when the refetch lands, and the restored view is lost until the tab is reopened. Pin on mount as well as on later changes, so the handoff waits for the list that carries the view. When adoption already applied the same view the table consumes the pin without touching the URL, and a table opened with no saved view still pins nothing. This also makes a first mount agree with a tab switch, which already re-pins the saved view through the same path.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR fixes restored table-view handoff by pinning the saved view on initial mount, allowing the embedded table to adopt it after a stale views query refreshes.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security issues identified. The mount-time handoff uses the existing table-scoped pin lifecycle, while later saved views overwrite prior pins and absent saved views clear them.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx | Enables the existing one-shot pin handoff on initial mount; table-scoped overwrite, clear, and consume semantics prevent stale pins from affecting subsequent resource state. |
| apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.test.tsx | Adds focused coverage proving that an initially restored view is pinned and that a resource without a saved view creates no pin. |
Reviews (1): Last reviewed commit: "fix(copilot): pin a restored table view ..." | Re-trigger Greptile
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.
Summary
initialViewId, which the table honours only while its views query already lists that id. A cached list from before the agent created the view resolves it to nothing, adoption settles on the default and stamps itself closed, and nothing revisits the id when the refetch lands — the restored view is lost until the tab is reopened.resource-content.tsx).Type of Change
Testing
bunx vitest runover the resource-content, view-pin store, view-state, copilot resources, and resource-event suites — 241 tests passingbunx tsc --noEmitandbun run lintcleanChecklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01FwmaLmAXSK2hsPBGZmkPnT