@@ -18,11 +18,11 @@ class TsunamiViewModel extends WebViewModel {
1818 appMetaUnsubFn : ( ) => void ;
1919 isRestarting : jotai . PrimitiveAtom < boolean > ;
2020 viewName : jotai . Atom < string > ;
21+ viewIconColor : jotai . Atom < string > ;
2122
2223 constructor ( blockId : string , nodeModel : BlockNodeModel ) {
2324 super ( blockId , nodeModel ) ;
2425 this . viewType = "tsunami" ;
25- this . viewIcon = jotai . atom ( "cube" ) ;
2626 this . isRestarting = jotai . atom ( false ) ;
2727
2828 // Hide navigation bar (URL bar, back/forward/home buttons)
@@ -46,6 +46,14 @@ class TsunamiViewModel extends WebViewModel {
4646 } ) ;
4747
4848 this . appMeta = jotai . atom ( null ) as jotai . PrimitiveAtom < AppMeta > ;
49+ this . viewIcon = jotai . atom ( ( get ) => {
50+ const meta = get ( this . appMeta ) ;
51+ return meta ?. icon || "cube" ;
52+ } ) ;
53+ this . viewIconColor = jotai . atom ( ( get ) => {
54+ const meta = get ( this . appMeta ) ;
55+ return meta ?. iconcolor ;
56+ } ) ;
4957 this . viewName = jotai . atom ( ( get ) => {
5058 const meta = get ( this . appMeta ) ;
5159 return meta ?. title || "WaveApp" ;
@@ -58,6 +66,8 @@ class TsunamiViewModel extends WebViewModel {
5866 const meta : AppMeta = {
5967 title : rtInfo [ "tsunami:title" ] ,
6068 shortdesc : rtInfo [ "tsunami:shortdesc" ] ,
69+ icon : rtInfo [ "tsunami:icon" ] ,
70+ iconcolor : rtInfo [ "tsunami:iconcolor" ] ,
6171 } ;
6272 globalStore . set ( this . appMeta , meta ) ;
6373 }
@@ -151,15 +161,15 @@ class TsunamiViewModel extends WebViewModel {
151161 async remixInBuilder ( ) {
152162 const blockData = globalStore . get ( this . blockAtom ) ;
153163 const appId = blockData ?. meta ?. [ "tsunami:appid" ] ;
154-
164+
155165 if ( ! appId || ! appId . startsWith ( "local/" ) ) {
156166 return ;
157167 }
158-
168+
159169 try {
160170 const result = await RpcApi . MakeDraftFromLocalCommand ( TabRpcClient , { localappid : appId } ) ;
161171 const draftAppId = result . draftappid ;
162-
172+
163173 getApi ( ) . openBuilder ( draftAppId ) ;
164174 } catch ( err ) {
165175 console . error ( "Failed to create draft from local app:" , err ) ;
@@ -192,7 +202,7 @@ class TsunamiViewModel extends WebViewModel {
192202 const blockData = globalStore . get ( this . blockAtom ) ;
193203 const appId = blockData ?. meta ?. [ "tsunami:appid" ] ;
194204 const showRemixOption = appId && appId . startsWith ( "local/" ) ;
195-
205+
196206 // Add tsunami-specific menu items at the beginning
197207 const tsunamiItems : ContextMenuItem [ ] = [
198208 {
@@ -211,7 +221,7 @@ class TsunamiViewModel extends WebViewModel {
211221 type : "separator" ,
212222 } ,
213223 ] ;
214-
224+
215225 if ( showRemixOption ) {
216226 tsunamiItems . push (
217227 {
0 commit comments