Skip to content

fix(web): truncate preview host label when no page name is resolved#4486

Merged
guitavano merged 2 commits into
mainfrom
guitavano/tianjin-v1
Jul 13, 2026
Merged

fix(web): truncate preview host label when no page name is resolved#4486
guitavano merged 2 commits into
mainfrom
guitavano/tianjin-v1

Conversation

@guitavano

@guitavano guitavano commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the preview address bar clipping the sandbox host URL when no page name is resolved.

  • Before (bug 1): the host fallback (previewLabel) was rendered in a shrink-0 span, so a long sandbox host was cut off mid-string by the container's overflow-hidden instead of truncating with an ellipsis.
  • Before (bug 2): the separate route-path span still rendered in the no-page-name case. Its competing flex-1 stole half the bar's width, forcing the host to truncate far too early — plus a redundant trailing /, since previewLabel already includes the path.
  • After: the label span truncates (min-w-0 flex-1 truncate) when there's no page name and keeps shrink-0 when a real page name is shown; the route-path span only renders when there's an actual page name.

Testing

  • bun run fmt clean.
  • Verified visually: host now fills the bar and truncates with an ellipsis at the real edge, no stray /.

Affected areas

apps/mesh/src/web/components/sandbox/preview/preview.tsx (preview address bar only).

🤖 Generated with Claude Code


Summary by cubic

Fixes the preview address bar so the sandbox host truncates correctly when no page name is resolved. The host now fills the bar and shows an ellipsis at the edge, with no extra slash.

  • Bug Fixes
    • The label span truncates (min-w-0 flex-1 truncate) when there’s no page name, and stays shrink-0 when a real page name exists.
    • The route-path span only renders when a page name exists, preventing width conflicts and removing the redundant trailing /.

Written for commit 17b3262. Summary will update on new commits.

Review in cubic

guitavano and others added 2 commits July 13, 2026 12:41
The preview address bar rendered the host fallback (previewLabel) in a
`shrink-0` span, so a long sandbox host was clipped mid-string by the
container instead of truncating with an ellipsis. It also still rendered
the separate route-path span, whose competing `flex-1` stole half the bar
and forced the host to truncate far too early (plus a redundant trailing
`/`, since previewLabel already includes the path).

Now the label span truncates (`min-w-0 flex-1 truncate`) in the
no-page-name case and keeps `shrink-0` when a real page name is shown, and
the route-path span only renders when there's an actual page name.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts:
#	apps/mesh/src/web/components/sandbox/preview/preview.tsx
@guitavano guitavano merged commit 690c549 into main Jul 13, 2026
14 checks passed
@guitavano guitavano deleted the guitavano/tianjin-v1 branch July 13, 2026 17:16
decocms Bot pushed a commit that referenced this pull request Jul 13, 2026
PR: #4486 fix(web): truncate preview host label when no page name is resolved
Bump type: patch

- decocms (apps/mesh/package.json): 4.12.1 -> 4.12.2

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