fix(desktop): restore artifacts grid views and multi-repo tasks clobbered by canvas port - #78183
Conversation
…ng clobbered by the canvas port The canvas artifacts port (#76649) was built from a stale snapshot and overwrote newer master work when it merged. This restores the artifacts page's list/grid/masonry view toggle, page header, and delete-undo handling; the Task.repositories field and its three consumers (task normalization, cloud-run instructions/checkpointing, local handoff) from #76448 that #77252 did not cover; the deleted multi-repo handoff tests; converts the new CanvasBuildStatus component off banned Radix imports; and drops the stale common/alerting entry #73874's conflict resolution re-added to .dockerignore. Generated-By: PostHog Code Task-Id: 167fa10a-0a98-447b-bc44-34d4433de1f0
|
😎 Merged successfully - details. |
|
Hey @k11kirky! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
Reviews (1): Last reviewed commit: "fix(desktop): restore artifacts grid vie..." | Re-trigger Greptile |
| const repositories = task.repositories?.length | ||
| ? task.repositories | ||
| : task.repository | ||
| ? [task.repository] | ||
| : []; |
There was a problem hiding this comment.
Logic error: checking task.repositories?.length will treat an explicit empty array [] as falsy and incorrectly fall back to task.repository. If a task is normalized with no repositories (repositories: []), but has a legacy repository field, this will incorrectly use the single repository instead of respecting the empty array.
Fix:
const repositories = task.repositories !== undefined
? task.repositories
: task.repository
? [task.repository]
: [];This ensures an explicit empty array is respected rather than falling through to the legacy field.
| const repositories = task.repositories?.length | |
| ? task.repositories | |
| : task.repository | |
| ? [task.repository] | |
| : []; | |
| const repositories = task.repositories !== undefined | |
| ? task.repositories | |
| : task.repository | |
| ? [task.repository] | |
| : []; | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Keeping this as is: it restores the exact semantics of #76448, which #76649 clobbered. An empty repositories list means the multi-repo field wasn't populated, so falling back to the legacy single repository field keeps handoff working for such tasks. normalizeTaskResponse also wraps repository into repositories now, so the empty-plus-legacy combination only arises for Task objects built outside the normalizer, where the fallback is the safe choice.
…text editor fill Second adversarial audit pass over the #76649 diff found four more still-broken downgrades: the canvas toolbar's Delete… flow (destructive confirm + undo toast + navigate back to artifacts) was removed, the pin menu label was hardcoded to "channel" under the Spaces layout, the menu lost the w-auto min-w-fit width fix that prevented "Unpin from space" clipping, and the CONTEXT.md edit textarea stopped filling the viewport (fixed rows inside a scroll area). Generated-By: PostHog Code Task-Id: 167fa10a-0a98-447b-bc44-34d4433de1f0
|
/trunk merge |
Problem
PR #76649 ported the canvas build pipeline from a stale snapshot and silently downgraded unrelated desktop code when it merged. #77252 restored part of the damage (space repository linking). Two audit passes over both canvas PRs (#73874, #76649) against the master commits they overwrote found the rest:
Task.repositories(from feat(tasks): link repositories to spaces in the desktop UI #76448) lost its type field and all three consumers, so multi-repo cloud tasks degrade to single-repo: run instructions and git checkpoints cover only one repo, and local handoff clones only the first repository. The covering tests were deleted.CanvasBuildStatuscomponent shipped with banned@radix-ui/themesimports.!common/alertingline to.dockerignore(the directory no longer exists).Changes
WebsiteChannelArtifacts.tsxto its pre-feat(canvas): build and securely deliver cloud artifacts #76649 shape, adapted to the new schema:DashboardRecord, PR keys bytaskId, and quill components instead of the reintroduced Radix import.WebsiteDashboardsIndex, because records no longer carry source code.repositories?: string[]onTaskand the fallbacks innormalizeTaskResponse,AgentServer, andLocalHandoffService.start.WebsiteLayout.tsx, with its space/channel pin label andw-auto min-w-fitmenu width fix.WebsiteContext.tsxso it fills the viewport again.CanvasBuildStatus.tsxfrom RadixFlex/Text/Tooltipto quill equivalents.!common/alertingline from.dockerignore.Note
Still degraded after this PR, left for a product decision: live canvas previews in grid cards (needs per-card artifact URL wiring;
WebsiteDashboardsIndexhas the same deliberate placeholder) and the removed "Save as fork" toolbar action inWebsiteLayout.tsx.How did you test this code?
normalizeTaskResponsecase asserting therepositoriesfallback, since deleting that line previously broke nothing.@posthog/core(3064 tests),@posthog/api-client(163), and@posthog/uicanvas tests (360); all pass, including after the second-pass toolbar and context editor fixes.shared,api-client,core,agent, andui; Biome clean;hogli ci:preflight --fixreports 0 failures.Automatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Created with PostHog Code