Skip to content

Use Sealos Desktop host config instead of hardcoded return URL #230

Description

@zjy365

Problem

apps/ui/src/features/shell/app-sidebar.tsx hardcodes the Desktop return URL to:

https://usw-1.sealos.io/?openapp=

This only works for the usw-1 region. In other regions or environments, “Back to Sealos Desktop” may open the wrong Desktop instance.

The current target="_blank" behavior should be preserved because it prevents Brain from being restored unexpectedly when returning to Desktop.

Proposed solution

Use sealosApp.getHostConfig().cloud.domain as the single source of truth for the Desktop host and build the ?openapp= URL from that value.

Do not add a new environment variable or duplicate Desktop-domain configuration. When Brain is running outside a Sealos Desktop iframe (for example, standalone local development), getHostConfig() may be unavailable; the return button should handle that case gracefully instead of rendering a misleading hardcoded link.

Acceptance criteria

  • No region-specific Desktop URL remains hardcoded in the UI source or tests.
  • The return URL is derived from sealosApp.getHostConfig().cloud.domain.
  • The button continues opening Desktop in a new tab with the existing ?openapp= entry point.
  • Standalone/local runs where Desktop host config is unavailable do not throw or navigate to an incorrect destination.
  • Tests cover successful host-config resolution and unavailable host-config behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions