@@ -6,12 +6,9 @@ import { Package } from "@roo/package"
66import { useAppTranslation } from "@src/i18n/TranslationContext"
77import { useExtensionState } from "@src/context/ExtensionStateContext"
88import { vscode } from "@src/utils/vscode"
9- import { Dialog , DialogContent , DialogHeader , DialogTitle , DialogDescription } from "@src/components/ui"
9+ import { Dialog , DialogContent , DialogHeader , DialogTitle } from "@src/components/ui"
1010import { Button } from "@src/components/ui"
1111
12- // Define the production URL constant locally to avoid importing from cloud package in webview
13- const PRODUCTION_ROO_CODE_API_URL = "https://app.roocode.com"
14-
1512interface AnnouncementProps {
1613 hideAnnouncement : ( ) => void
1714}
@@ -28,8 +25,7 @@ interface AnnouncementProps {
2825const Announcement = ( { hideAnnouncement } : AnnouncementProps ) => {
2926 const { t } = useAppTranslation ( )
3027 const [ open , setOpen ] = useState ( true )
31- const { cloudApiUrl } = useExtensionState ( )
32- const cloudUrl = cloudApiUrl || PRODUCTION_ROO_CODE_API_URL
28+ const { cloudIsAuthenticated } = useExtensionState ( )
3329
3430 return (
3531 < Dialog
@@ -44,71 +40,57 @@ const Announcement = ({ hideAnnouncement }: AnnouncementProps) => {
4440 < DialogContent className = "max-w-96" >
4541 < DialogHeader >
4642 < DialogTitle > { t ( "chat:announcement.title" , { version : Package . version } ) } </ DialogTitle >
47- < DialogDescription >
48- < Trans
49- i18nKey = "chat:announcement.description"
50- components = { {
51- bold : < b /> ,
52- } }
53- />
54- </ DialogDescription >
5543 </ DialogHeader >
5644 < div >
57- < ul className = "space-y-2" >
58- < li >
59- •{ " " }
60- < Trans
61- i18nKey = "chat:announcement.feature1"
62- components = { {
63- bold : < b /> ,
64- } }
65- />
66- </ li >
67- < li >
68- •{ " " }
69- < Trans
70- i18nKey = "chat:announcement.feature2"
71- components = { {
72- bold : < b /> ,
73- } }
74- />
75- </ li >
76- </ ul >
77-
78- < div className = "mt-4" >
45+ < div className = "mb-3" >
7946 < Trans
80- i18nKey = "chat:announcement.learnMore "
47+ i18nKey = "chat:announcement.stealthModel.feature "
8148 components = { {
82- learnMoreLink : (
83- < VSCodeLink
84- href = "https://docs.roocode.com/update-notes/v3.28.0#task-sync--roomote-control"
85- onClick = { ( e ) => {
86- e . preventDefault ( )
87- window . postMessage (
88- {
89- type : "action" ,
90- action : "openExternal" ,
91- data : {
92- url : "https://docs.roocode.com/update-notes/v3.28.0#task-sync--roomote-control" ,
93- } ,
94- } ,
95- "*" ,
96- )
97- } }
98- />
99- ) ,
49+ bold : < b /> ,
10050 } }
10151 />
10252 </ div >
10353
54+ < p className = "mt-3 text-sm text-vscode-descriptionForeground" >
55+ { t ( "chat:announcement.stealthModel.note" ) }
56+ </ p >
57+
10458 < div className = "mt-4" >
105- < Button
106- onClick = { ( ) => {
107- vscode . postMessage ( { type : "openExternal" , url : cloudUrl } )
108- } }
109- className = "w-full" >
110- { t ( "chat:announcement.visitCloudButton" ) }
111- </ Button >
59+ { ! cloudIsAuthenticated ? (
60+ < Button
61+ onClick = { ( ) => {
62+ vscode . postMessage ( {
63+ type : "cloudLandingPageSignIn" ,
64+ text : "supernova" ,
65+ } )
66+ } }
67+ className = "w-full" >
68+ { t ( "chat:announcement.stealthModel.connectButton" ) }
69+ </ Button >
70+ ) : (
71+ < >
72+ < p className = "mb-3" >
73+ < Trans
74+ i18nKey = "chat:announcement.stealthModel.selectModel"
75+ components = { {
76+ code : < code /> ,
77+ } }
78+ />
79+ </ p >
80+ < Button
81+ onClick = { ( ) => {
82+ setOpen ( false )
83+ hideAnnouncement ( )
84+ vscode . postMessage ( {
85+ type : "switchTab" ,
86+ tab : "settings" ,
87+ } )
88+ } }
89+ className = "w-full" >
90+ { t ( "chat:announcement.stealthModel.goToSettingsButton" ) }
91+ </ Button >
92+ </ >
93+ ) }
11294 </ div >
11395
11496 < div className = "mt-4 text-sm text-center" >
@@ -132,7 +114,7 @@ const XLink = () => (
132114 href = "https://x.com/roo_code"
133115 onClick = { ( e ) => {
134116 e . preventDefault ( )
135- window . postMessage ( { type : "action" , action : " openExternal", data : { url : "https://x.com/roo_code" } } , "*" )
117+ vscode . postMessage ( { type : "openExternal" , url : "https://x.com/roo_code" } )
136118 } } >
137119 X
138120 </ VSCodeLink >
@@ -143,10 +125,7 @@ const DiscordLink = () => (
143125 href = "https://discord.gg/rCQcvT7Fnt"
144126 onClick = { ( e ) => {
145127 e . preventDefault ( )
146- window . postMessage (
147- { type : "action" , action : "openExternal" , data : { url : "https://discord.gg/rCQcvT7Fnt" } } ,
148- "*" ,
149- )
128+ vscode . postMessage ( { type : "openExternal" , url : "https://discord.gg/rCQcvT7Fnt" } )
150129 } } >
151130 Discord
152131 </ VSCodeLink >
@@ -157,10 +136,7 @@ const RedditLink = () => (
157136 href = "https://www.reddit.com/r/RooCode/"
158137 onClick = { ( e ) => {
159138 e . preventDefault ( )
160- window . postMessage (
161- { type : "action" , action : "openExternal" , data : { url : "https://www.reddit.com/r/RooCode/" } } ,
162- "*" ,
163- )
139+ vscode . postMessage ( { type : "openExternal" , url : "https://www.reddit.com/r/RooCode/" } )
164140 } } >
165141 r/RooCode
166142 </ VSCodeLink >
0 commit comments