Skip to content

fix(thread/github): enable "Visit preview" in publish modal for hosted sandboxes - #5164

Merged
guitavano merged 2 commits into
mainfrom
guitavano/fix-preview-button-disabled
Jul 24, 2026
Merged

guitavano merged 2 commits into
mainfrom
guitavano/fix-preview-button-disabled

Conversation

@guitavano

@guitavano guitavano commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The publish modal's "Visit preview" button was permanently disabled.

Root cause: since #5132 (feat(sandbox): use shared staging branch), GitHub-backed threads run on the hosted agent-sandbox provider. That provider persists its previewUrl in the agentSandboxSessions table (via sharedStart.completeStart), not in vm.metadata.sandboxMap — the else branch in start.ts that writes to the sandboxMap only runs for non-hosted providers.

header-actions.tsx (which feeds previewUrl into the publish dialog) still read from the raw vm.metadata.sandboxMap, so the lookup always returned null and the button stayed disabled.

The preview drawer/tab never broke because it reads from useSandboxLifecycle(), which overlays the agentSandboxSession onto the branch map (agent-shell-layout/index.tsx). The header didn't use that path.

Changes

  • header-actions.tsx: read previewUrl from useSandboxLifecycle() instead of recomputing it from the raw vMCP sandboxMap. HeaderActions already renders inside SandboxLifecycleProvider (via VmEventsBridge → DesktopTaskWorkspace → WorkspacePanelGroup → VirtualMcpHeaderInfo), and it returns the same URL the preview drawer uses. Removed the now-orphaned parseBranchMap import.
  • Relabel pt-br string thread.publishDialog.visitPreview → "Visitar o Preview".

Testing

  • bun run fmt ✅
  • bun run --cwd=apps/mesh check (tsc) ✅
  • Manual: open the publish modal on a GitHub thread with a running hosted sandbox → "Visit preview" is enabled and opens the preview URL.

🤖 Generated with Claude Code


Summary by cubic

Enables the "Visit preview" button in the publish modal for GitHub threads on hosted sandboxes by reading previewUrl from useSandboxLifecycle() instead of vm.metadata.sandboxMap. Aligns the header with the preview drawer and restores the button for agent-sandbox sessions.

  • Bug Fixes
    • Read previewUrl from useSandboxLifecycle() in header-actions.tsx; remove parseBranchMap.
    • Update pt-br string thread.publishDialog.visitPreview to "Abrir o Preview".

Written for commit 74a07b9. Summary will update on new commits.

Review in cubic

guitavano and others added 2 commits July 24, 2026 09:30
…d sandboxes

The publish modal's "Visit preview" button read previewUrl from the raw
`vm.metadata.sandboxMap`. Since the shared-staging change (#5132), GitHub
threads run on the hosted `agent-sandbox` provider, whose previewUrl is
persisted in `agentSandboxSessions` (not the vMCP sandboxMap), so the lookup
always returned null and the button stayed disabled.

Read previewUrl from `useSandboxLifecycle()` instead — the same overlay the
preview drawer uses, which merges the agent-sandbox session into the branch
map. HeaderActions already renders inside SandboxLifecycleProvider.

Also relabel the pt-br string to "Visitar o Preview".

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@guitavano
guitavano merged commit 80d7228 into main Jul 24, 2026
14 checks passed
@guitavano
guitavano deleted the guitavano/fix-preview-button-disabled branch July 24, 2026 12:41
decocms Bot pushed a commit that referenced this pull request Jul 24, 2026
PR: #5164 fix(thread/github): enable "Visit preview" in publish modal for hosted sandboxes
Bump type: patch

- decocms (apps/mesh/package.json): 4.122.2 -> 4.122.3

Deploy-Scope: web
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