Skip to content

Commit ef1d5af

Browse files
committed
Merge remote-tracking branch 'origin/staging' into fix/cubic-release-findings
# Conflicts: # .agents/skills/ship/SKILL.md # apps/docs/content/docs/cli/troubleshooting.mdx
2 parents 916d9af + 67e3f6d commit ef1d5af

4 files changed

Lines changed: 27 additions & 9 deletions

File tree

.agents/skills/ship/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ When the user runs `/ship`:
3737
- `bun run check:migrations origin/staging` must pass (staging is the PR base). Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy.
3838
6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `Lint and Test` job enforces. Both phases parallelize — but only across commands that write **disjoint** outputs — and a bare `wait` swallows child exit codes, so both phases below explicitly collect each job's status and abort ship if any failed.
3939

40-
**Phase A — regenerate the always-in-repo committed artifacts (parallel), then let step 7 stage whatever changed.** Regenerate only the generators whose inputs live entirely in this repo and that any ordinary code change can drift — `agent-stream-docs:generate` (derives from the provider model registry), `skills:sync` (derives from `.agents/skills/**`), and `docs-manifest:generate` (derives from `apps/docs/content/docs/**`, so any added, removed, or renamed docs page drifts it). They write disjoint trees (`apps/docs/…/agent.mdx`, the `.claude`/`.cursor` command projections, and `apps/sim/lib/copilot/generated/docs-manifest.ts`), so they parallelize safely, and each is idempotent (a no-op when already in sync). `docs-manifest:generate` in particular is what keeps Phase B's `docs-manifest:check` from aborting a ship it gives the user no way to fix:
40+
**Phase A — regenerate the always-in-repo committed artifacts (parallel), then let step 7 stage whatever changed.** Regenerate only the generators whose inputs live entirely in this repo and that any ordinary code change can drift — `agent-stream-docs:generate` (derives from the provider model registry), `docs-manifest:generate` (derives from docs page paths), and `skills:sync` (derives from `.agents/skills/**`). They write disjoint outputs (`apps/docs/…/agent.mdx`, `apps/sim/lib/copilot/generated/docs-manifest.ts`, and `.claude/skills` links), so they parallelize safely, and each is idempotent (a no-op when already in sync):
4141
```bash
4242
rm -f /tmp/ship-gen-results
43-
for g in agent-stream-docs:generate skills:sync docs-manifest:generate; do
43+
for g in agent-stream-docs:generate docs-manifest:generate skills:sync; do
4444
( bun run "$g" >"/tmp/ship-gen-${g//:/-}.log" 2>&1; echo "$? $g" >>/tmp/ship-gen-results ) &
4545
done
4646
wait

apps/docs/content/docs/cli/troubleshooting.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ sim --version
100100
Then upgrade with the package manager you installed it with — using a different
101101
one installs a second copy instead of replacing the executable on your `PATH`:
102102

103-
<Tabs items={['npm', 'pnpm', 'bun', 'yarn']}>
103+
<Tabs items={['npm', 'pnpm', 'bun', 'Yarn Classic']}>
104104
<Tab value="npm">
105105
```bash
106106
npm install -g sim@latest
@@ -116,7 +116,7 @@ one installs a second copy instead of replacing the executable on your `PATH`:
116116
bun add -g sim@latest
117117
```
118118
</Tab>
119-
<Tab value="yarn">
119+
<Tab value="Yarn Classic">
120120
```bash
121121
yarn global add sim@latest
122122
```

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ describe('ResourceContent table view handoff', () => {
5151
})
5252
}
5353

54+
it('hands off a restored view the table is mounted with', () => {
55+
// The table can only honour `initialViewId` while its views query already
56+
// lists that id. Reopening a chat against a cached list from before the
57+
// agent's write would otherwise strand the restored view.
58+
render({ type: 'table', id: 'table-1', title: 'Invoices', viewId: 'view-restored' })
59+
60+
expect(useTableViewPinStore.getState().pins['table-1']?.viewId).toBe('view-restored')
61+
})
62+
63+
it('does not pin a table opened without a saved view', () => {
64+
render({ type: 'table', id: 'table-1', title: 'Invoices' })
65+
66+
expect(useTableViewPinStore.getState().pins['table-1']).toBeUndefined()
67+
})
68+
5469
it('hands off a saved view that arrives after the embedded table mounts', () => {
5570
const table: MothershipResource = {
5671
type: 'table',

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ export const ResourceContent = memo(function ResourceContent({
179179
visible = true,
180180
onBrowserOverlayControllerChange,
181181
}: ResourceContentProps) {
182-
const observedTableViewRef = useRef(
183-
resource.type === 'table' ? { tableId: resource.id, viewId: resource.viewId } : null
184-
)
182+
const observedTableViewRef = useRef<{ tableId: string; viewId?: string } | null>(null)
185183

186184
useEffect(() => {
187185
const previous = observedTableViewRef.current
@@ -192,8 +190,13 @@ export const ResourceContent = memo(function ResourceContent({
192190
return
193191
}
194192
/**
195-
* `initialViewId` owns the first table adoption. If refreshed chat data
196-
* supplies it later, use the same one-shot handoff as live stream events.
193+
* Pinned on mount as well as on later changes. `initialViewId` alone is not
194+
* enough: the table honours it only while its views query already carries
195+
* that id, and a cached list from before the agent wrote the view resolves
196+
* it to nothing. Adoption then settles on the default and never revisits
197+
* the id, so the restored view is lost until the tab is reopened. The pin
198+
* waits for the refetch instead, and costs nothing when adoption already
199+
* applied the same view — the table consumes it without touching the URL.
197200
*/
198201
useTableViewPinStore.getState().pin(next.tableId, next.viewId)
199202
}, [resource.id, resource.type, resource.viewId])

0 commit comments

Comments
 (0)