Skip to content

fix(copilot): pin a restored table view so a stale views list cannot strand it - #7449

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/restore-table-view-pin
Sep 3, 2026
Merged

fix(copilot): pin a restored table view so a stale views list cannot strand it#7449
waleedlatif1 merged 1 commit into
stagingfrom
fix/restore-table-view-pin

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Reopening a chat restores a table's 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, 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.
  • Pin the view on mount as well as on later changes, so the handoff waits for the list that carries it. Adoption that already applied the same view consumes the pin without touching the URL, and a table opened with no saved view still pins nothing.
  • Behavior change worth a look: on a reload where the URL names a view picked by hand and the chat resource carries an agent pin, the pin now wins. A tab switch already behaves this way, so this makes a first mount agree with it.
  • Raised by cubic on v0.8.21: additional self hosting documentation, workspace fork improvements, tiptap and tailwind dep upgrades #7446 (P2, resource-content.tsx).

Type of Change

  • Bug fix

Testing

  • bunx vitest run over the resource-content, view-pin store, view-state, copilot resources, and resource-event suites — 241 tests passing
  • New test fails against the unfixed component and passes with it
  • bunx tsc --noEmit and bun run lint clean

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code

https://claude.ai/code/session_01FwmaLmAXSK2hsPBGZmkPnT

…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.
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 3, 2026 8:55pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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.

  • Initializes table-view observation without treating the mounted resource as already observed.
  • Pins an initial saved view while preserving the no-saved-view behavior.
  • Adds focused tests for mount-time restoration and the absent-view case.

Confidence Score: 5/5

The 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.

Important Files Changed

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

@waleedlatif1
waleedlatif1 merged commit a50c259 into staging Sep 3, 2026
23 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/restore-table-view-pin branch September 3, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant