@@ -7,6 +7,10 @@ import { getAppearanceOverlayHost } from '@/infrastructure/appearance/runtime/Ap
77import { useAnchoredPopoverPosition } from '@/shared/utils/useAnchoredPopoverPosition' ;
88import { usePeerDeviceModeOptional } from '@/infrastructure/peer-device/peerDeviceContextState' ;
99import { useNotification } from '@/shared/notification-system' ;
10+ import {
11+ ChatAppBrandIcon ,
12+ type ChatAppBrand ,
13+ } from '../../RemoteConnectDialog/ChatAppBrandIcon' ;
1014import {
1115 selectActivityFacts ,
1216 selectAttachedGroups ,
@@ -23,15 +27,36 @@ interface DeviceStatusControlProps {
2327 onManageDevices : ( ) => void ;
2428}
2529
26- function DeviceIcon ( { kind, size = 17 } : { kind : DeviceOverviewDeviceKind ; size ?: number } ) {
30+ /** Resolve the provider from backend ids, aliases, or display names. */
31+ function chatAppBrandFromIdentity ( identity : string | null | undefined ) : ChatAppBrand | null {
32+ const normalized = identity ?. trim ( ) . toLocaleLowerCase ( ) ;
33+ if ( ! normalized ) return null ;
34+ if ( normalized . includes ( 'telegram' ) ) return 'telegram' ;
35+ if ( normalized . includes ( 'feishu' ) || normalized . includes ( 'lark' ) ) return 'feishu' ;
36+ if ( normalized . includes ( 'weixin' ) || normalized . includes ( 'wechat' ) ) return 'weixin' ;
37+ return null ;
38+ }
39+
40+ function DeviceIcon ( {
41+ identity,
42+ kind,
43+ size = 17 ,
44+ } : {
45+ identity ?: string | null ;
46+ kind : DeviceOverviewDeviceKind ;
47+ size ?: number ;
48+ } ) {
2749 const catalogSize = size <= 11 ? '2xs' : size <= 13 ? 'xs' : size <= 15 ? 'sm' : size <= 17 ? 'md' : 'lg' ;
2850 switch ( kind ) {
2951 case 'mobile' :
3052 return < Smartphone size = { size } aria-hidden = "true" /> ;
3153 case 'execution-host' :
3254 return < Server size = { size } aria-hidden = "true" /> ;
33- case 'message-app' :
55+ case 'message-app' : {
56+ const chatApp = chatAppBrandFromIdentity ( identity ) ;
57+ if ( chatApp ) return < ChatAppBrandIcon app = { chatApp } size = { size } /> ;
3458 return < Icon name = "side-chat" size = { catalogSize } aria-hidden = "true" /> ;
59+ }
3560 default :
3661 return < Monitor size = { size } aria-hidden = "true" /> ;
3762 }
@@ -131,6 +156,9 @@ const DeviceStatusControl: React.FC<DeviceStatusControlProps> = ({
131156 [ activityFactSentence , overview ] ,
132157 ) ;
133158 const attachedGroups = useMemo ( ( ) => selectAttachedGroups ( overview ) , [ overview ] ) ;
159+ const attachedMessageAppIdentity = useMemo ( ( ) => (
160+ overview . connectedDevices . find ( device => device . kind === 'message-app' ) ?. name
161+ ) , [ overview . connectedDevices ] ) ;
134162 const accessibleSummary = [ overview . currentWorkDeviceName , ...activityLines ] . join ( ' · ' ) ;
135163
136164 const deviceActivity = useCallback ( ( device : DeviceOverviewDevice ) => {
@@ -149,6 +177,16 @@ const DeviceStatusControl: React.FC<DeviceStatusControlProps> = ({
149177 return parts . join ( ' · ' ) ;
150178 } , [ t ] ) ;
151179
180+ const deviceDisplayName = useCallback ( ( device : DeviceOverviewDevice ) => {
181+ const chatApp = device . kind === 'message-app'
182+ ? chatAppBrandFromIdentity ( `${ device . id } ${ device . name } ` )
183+ : null ;
184+ if ( chatApp === 'telegram' ) return 'Telegram' ;
185+ if ( chatApp === 'feishu' ) return t ( 'remoteConnect.feishu' ) ;
186+ if ( chatApp === 'weixin' ) return t ( 'remoteConnect.weixin' ) ;
187+ return device . name ;
188+ } , [ t ] ) ;
189+
152190 const serviceContent = useMemo ( ( ) => {
153191 const service = overview . connectionService ;
154192 if ( ! service ) return null ;
@@ -196,9 +234,14 @@ const DeviceStatusControl: React.FC<DeviceStatusControlProps> = ({
196234 { attachedGroups . map ( group => (
197235 < span
198236 className = "bitfun-nav-panel__footer-device-status-attached-group"
237+ data-bf-device-kind = { group . kind }
199238 key = { group . kind }
200239 >
201- < DeviceIcon kind = { group . kind } size = { 13 } />
240+ < DeviceIcon
241+ identity = { group . kind === 'message-app' ? attachedMessageAppIdentity : null }
242+ kind = { group . kind }
243+ size = { 13 }
244+ />
202245 { group . count > 1 && (
203246 < span className = "bitfun-nav-panel__footer-device-status-attached-count" >
204247 { group . count }
@@ -238,9 +281,7 @@ const DeviceStatusControl: React.FC<DeviceStatusControlProps> = ({
238281 } }
239282 >
240283 < CardHeader
241- align = "center"
242284 className = "bitfun-device-overview__header"
243- contentAlign = "center"
244285 title = { < h2 className = "bitfun-device-overview__title" > { t ( 'deviceOverview.title' ) } </ h2 > }
245286 />
246287 < ScrollArea className = "bitfun-device-overview__scroll" >
@@ -250,15 +291,27 @@ const DeviceStatusControl: React.FC<DeviceStatusControlProps> = ({
250291 className = "bitfun-device-overview__local-device"
251292 data-testid = "nav-device-status-summary"
252293 >
253- < DeviceIcon kind = { overview . primaryDevice . kind } size = { 19 } />
294+ < span className = "bitfun-device-overview__device-icon" aria-hidden = "true" >
295+ < DeviceIcon
296+ identity = { `${ overview . primaryDevice . id } ${ overview . primaryDevice . name } ` }
297+ kind = { overview . primaryDevice . kind }
298+ size = { 17 }
299+ />
300+ </ span >
254301 < strong > { overview . currentWorkDeviceName } </ strong >
255302 </ div >
256303 ) : (
257304 < >
258305 < section className = "bitfun-device-overview__device-group is-primary" >
259306 < h3 > { t ( 'deviceOverview.currentUse' ) } </ h3 >
260307 < div className = "bitfun-device-overview__device-row" >
261- < DeviceIcon kind = { overview . primaryDevice . kind } />
308+ < span className = "bitfun-device-overview__device-icon" aria-hidden = "true" >
309+ < DeviceIcon
310+ identity = { `${ overview . primaryDevice . id } ${ overview . primaryDevice . name } ` }
311+ kind = { overview . primaryDevice . kind }
312+ size = { 16 }
313+ />
314+ </ span >
262315 < strong > { overview . primaryDevice . name } </ strong >
263316 { overview . primaryDevice . activities . includes ( 'background-execution' ) && (
264317 < span > { deviceActivity ( overview . primaryDevice ) } </ span >
@@ -278,8 +331,14 @@ const DeviceStatusControl: React.FC<DeviceStatusControlProps> = ({
278331 data-bf-device-kind = { device . kind }
279332 data-bf-activities = { device . activities . join ( ' ' ) }
280333 >
281- < DeviceIcon kind = { device . kind } />
282- < strong > { device . name } </ strong >
334+ < span className = "bitfun-device-overview__device-icon" aria-hidden = "true" >
335+ < DeviceIcon
336+ identity = { `${ device . id } ${ device . name } ` }
337+ kind = { device . kind }
338+ size = { 16 }
339+ />
340+ </ span >
341+ < strong > { deviceDisplayName ( device ) } </ strong >
283342 < span > { deviceActivity ( device ) } </ span >
284343 </ div >
285344 ) ) }
@@ -321,9 +380,9 @@ const DeviceStatusControl: React.FC<DeviceStatusControlProps> = ({
321380
322381 < CardFooter align = "center" className = "bitfun-device-overview__actions" >
323382 < Button
324- variant = "fill "
383+ variant = "outline "
325384 size = "sm"
326- leadingIcon = { < Icon name = "link" size = "lg " /> }
385+ leadingIcon = { < Icon name = "link" size = "md " /> }
327386 onClick = { handleManageDevices }
328387 data-testid = "nav-device-status-manage"
329388 >
0 commit comments