@@ -15,7 +15,7 @@ import { scopeThreadRef } from "@t3tools/client-runtime";
1515import { DEFAULT_UNIFIED_SETTINGS } from "@t3tools/contracts/settings" ;
1616import { createModelSelection } from "@t3tools/shared/model" ;
1717import * as Equal from "effect/Equal" ;
18- import { APP_VERSION } from "../../branding" ;
18+ import { APP_VERSION , HOSTED_APP_CHANNEL , HOSTED_APP_CHANNEL_LABEL } from "../../branding" ;
1919import {
2020 canCheckForUpdate ,
2121 getDesktopUpdateButtonTooltip ,
@@ -26,6 +26,7 @@ import {
2626import { ProviderModelPicker } from "../chat/ProviderModelPicker" ;
2727import { TraitsPicker } from "../chat/TraitsPicker" ;
2828import { isElectron } from "../../env" ;
29+ import { buildHostedChannelSelectionUrl , type HostedAppChannel } from "../../hostedPairing" ;
2930import { useTheme } from "../../hooks/useTheme" ;
3031import { useSettings , useUpdateSettings } from "../../hooks/useSettings" ;
3132import { useThreadActions } from "../../hooks/useThreadActions" ;
@@ -162,6 +163,7 @@ function AboutVersionSection() {
162163 const updateState = updateStateQuery . data ?? null ;
163164 const hasDesktopBridge = typeof window !== "undefined" && Boolean ( window . desktopBridge ) ;
164165 const selectedUpdateChannel = updateState ?. channel ?? "latest" ;
166+ const selectedHostedAppChannel = hasDesktopBridge ? null : HOSTED_APP_CHANNEL ;
165167
166168 const handleUpdateChannelChange = useCallback (
167169 ( channel : DesktopUpdateChannel ) => {
@@ -314,36 +316,66 @@ function AboutVersionSection() {
314316 </ Tooltip >
315317 }
316318 />
317- < SettingsRow
318- title = "Update track"
319- description = "Stable follows full releases. Nightly follows the nightly desktop channel and can switch back to stable immediately."
320- control = {
321- < Select
322- value = { selectedUpdateChannel }
323- onValueChange = { ( value ) => {
324- handleUpdateChannelChange ( value as DesktopUpdateChannel ) ;
325- } }
326- >
327- < SelectTrigger
328- className = "w-full sm:w-40"
329- aria-label = "Update track"
330- disabled = { ! hasDesktopBridge || isChangingUpdateChannel }
319+ { hasDesktopBridge ? (
320+ < SettingsRow
321+ title = "Update track"
322+ description = "Stable follows full releases. Nightly follows the nightly desktop channel and can switch back to stable immediately."
323+ control = {
324+ < Select
325+ value = { selectedUpdateChannel }
326+ onValueChange = { ( value ) => {
327+ handleUpdateChannelChange ( value as DesktopUpdateChannel ) ;
328+ } }
331329 >
332- < SelectValue >
333- { selectedUpdateChannel === "nightly" ? "Nightly" : "Stable" }
334- </ SelectValue >
335- </ SelectTrigger >
336- < SelectPopup align = "end" alignItemWithTrigger = { false } >
337- < SelectItem hideIndicator value = "latest" >
338- Stable
339- </ SelectItem >
340- < SelectItem hideIndicator value = "nightly" >
341- Nightly
342- </ SelectItem >
343- </ SelectPopup >
344- </ Select >
345- }
346- />
330+ < SelectTrigger
331+ className = "w-full sm:w-40"
332+ aria-label = "Update track"
333+ disabled = { isChangingUpdateChannel }
334+ >
335+ < SelectValue >
336+ { selectedUpdateChannel === "nightly" ? "Nightly" : "Stable" }
337+ </ SelectValue >
338+ </ SelectTrigger >
339+ < SelectPopup align = "end" alignItemWithTrigger = { false } >
340+ < SelectItem hideIndicator value = "latest" >
341+ Stable
342+ </ SelectItem >
343+ < SelectItem hideIndicator value = "nightly" >
344+ Nightly
345+ </ SelectItem >
346+ </ SelectPopup >
347+ </ Select >
348+ }
349+ />
350+ ) : selectedHostedAppChannel ? (
351+ < SettingsRow
352+ title = "Update track"
353+ description = "Switches the hosted app release channel."
354+ control = {
355+ < Select
356+ value = { selectedHostedAppChannel }
357+ onValueChange = { ( value ) => {
358+ if ( value === selectedHostedAppChannel ) return ;
359+ window . location . assign (
360+ buildHostedChannelSelectionUrl ( { channel : value as HostedAppChannel } ) ,
361+ ) ;
362+ } }
363+ >
364+ < SelectTrigger className = "w-full sm:w-40" aria-label = "Update track" >
365+ < SelectValue > { HOSTED_APP_CHANNEL_LABEL } </ SelectValue >
366+ </ SelectTrigger >
367+ < SelectPopup align = "end" alignItemWithTrigger = { false } >
368+ < SelectItem hideIndicator value = "latest" >
369+ Latest
370+ </ SelectItem >
371+ < SelectItem hideIndicator value = "nightly" >
372+ Nightly
373+ </ SelectItem >
374+ </ SelectPopup >
375+ </ Select >
376+ }
377+ />
378+ ) : null }
347379 </ >
348380 ) ;
349381}
0 commit comments