Skip to content

fix(web): hide upgrade controls for csghub sandbox#137

Merged
RussellLuo merged 1 commit into
mainfrom
fix/hide-csghub-sandbox-upgrade
May 29, 2026
Merged

fix(web): hide upgrade controls for csghub sandbox#137
RussellLuo merged 1 commit into
mainfrom
fix/hide-csghub-sandbox-upgrade

Conversation

@GatewayJ
Copy link
Copy Markdown
Collaborator

@GatewayJ GatewayJ commented May 29, 2026

  • Add [server].show_upgrade to control whether the Web UI shows upgrade actions, defaulting to enabled.
  • Set show_upgrade = false for managed deployments that cannot self-upgrade.

@GatewayJ GatewayJ marked this pull request as ready for review May 29, 2026 02:33
@GatewayJ GatewayJ requested a review from RussellLuo May 29, 2026 02:33
currentUserID: displayData.current_user_id,
usersById: conversation.usersById,
collapsedWorkspaceGroups,
hideUpgradeControls: String(bootstrapConfig?.sandbox_provider ?? "").trim().toLowerCase() === "csghub",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hard-codes upgrade visibility to sandbox_provider == "csghub".

That couples a user-facing product decision to the runtime backend, so CSGHub users can never opt in and non-CSGHub users can never opt out. Consider exposing a dedicated config.toml flag instead, for example [server].show_upgrade = true by default, and let the UI follow that setting.

@GatewayJ GatewayJ force-pushed the fix/hide-csghub-sandbox-upgrade branch 3 times, most recently from da11c7b to bc2c936 Compare May 29, 2026 04:12
Comment thread internal/config/config.go Outdated
AdvertiseBaseURL string
AccessToken string
NoAuth bool
HideUpgrade bool
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The public config key and API field are both show_upgrade, but the internal Go field is HideUpgrade, so the meaning flips when reading call sites like !cfg.Server.HideUpgrade.

This works, but it adds avoidable cognitive overhead. Consider renaming the internal field to ShowUpgrade as well, so the config, API, frontend, and Go model all use the same positive direction.

@RussellLuo
Copy link
Copy Markdown
Collaborator

What does the UI look like when upgrade actions are hidden? For example, does the settings menu still show a version section with only the current version, or is the whole version-and-updates area removed? A screenshot in the PR would help confirm the intended UX.

@GatewayJ GatewayJ force-pushed the fix/hide-csghub-sandbox-upgrade branch from bc2c936 to 80fe54f Compare May 29, 2026 05:47
@GatewayJ
Copy link
Copy Markdown
Collaborator Author

GatewayJ commented May 29, 2026

What does the UI look like when upgrade actions are hidden? For example, does the settings menu still show a version section with only the current version, or is the whole version-and-updates area removed? A screenshot in the PR would help confirm the intended UX.

截屏2026-05-29 下午1 49 30

@GatewayJ GatewayJ force-pushed the fix/hide-csghub-sandbox-upgrade branch from 80fe54f to 315e9cc Compare May 29, 2026 05:56
Comment thread internal/config/config.go Outdated
AdvertiseBaseURL string
AccessToken string
NoAuth bool
ShowUpgrade *bool
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be a pointer bool? Would a plain bool be enough here?

@GatewayJ GatewayJ force-pushed the fix/hide-csghub-sandbox-upgrade branch from 315e9cc to de7e464 Compare May 29, 2026 06:02
@RussellLuo RussellLuo merged commit 9126a7f into main May 29, 2026
1 check passed
@RussellLuo RussellLuo deleted the fix/hide-csghub-sandbox-upgrade branch May 29, 2026 06:34
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.

2 participants