@@ -2137,11 +2137,19 @@ function _tuneTab(ctx, el, cs, calData) {
21372137 if ( ! rx ) { infoCard . textContent = "Receiver not found." ; return ; }
21382138 const mapObj = maps_list . find ( m => m . id === ts . selectedRx . mapId ) ;
21392139 infoCard . innerHTML = "" ;
2140+ // Show floor + metres from fabric when available
2141+ const _floorName = ( ( ) => {
2142+ const fid = mapObj ?. floor_id || "main" ;
2143+ const fObj = ( ctx . state . model ?. floors || [ ] ) . find ( f => f . id === fid ) ;
2144+ return fObj ? fObj . name : fid ;
2145+ } ) ( ) ;
2146+ const _fabPos = ( ctx . state . model ?. scanner_positions_m || { } ) [ rx . source ] ;
2147+ const _posStr = _fabPos ? `${ _fabPos . x_m ?. toFixed ( 1 ) } m, ${ _fabPos . y_m ?. toFixed ( 1 ) } m` : `${ ( rx . x * 100 ) . toFixed ( 1 ) } %, ${ ( rx . y * 100 ) . toFixed ( 1 ) } %` ;
21402148 const lines = [
21412149 `<b style="color:#52b788">${ _esc ( rx . label || rx . id ) } </b>` ,
2142- `Map : ${ _esc ( mapObj ?. name || ts . selectedRx . mapId ) } ` ,
2143- `Room: ${ _esc ( rx . room || "— " ) } ` ,
2144- `Position: x ${ ( rx . x * 100 ) . toFixed ( 1 ) } %, y ${ ( rx . y * 100 ) . toFixed ( 1 ) } % ` ,
2150+ `Floor : ${ _esc ( _floorName ) } ` ,
2151+ `Room: ${ _esc ( rx . room || "\u2014 " ) } ` ,
2152+ `Position: ${ _posStr } ` ,
21452153 ] ;
21462154 const infoLine = document . createElement ( "div" ) ;
21472155 infoLine . innerHTML = lines . join ( " · " ) ;
@@ -2152,8 +2160,8 @@ function _tuneTab(ctx, el, cs, calData) {
21522160 const removeBtn = document . createElement ( "button" ) ;
21532161 removeBtn . className = "btn inline" ;
21542162 removeBtn . style . cssText = "font-size:10px;padding:2px 10px;color:#f87171;border-color:#f8717140;margin-top:6px" ;
2155- removeBtn . textContent = "Remove from this map " ;
2156- removeBtn . title = "Remove this receiver from " + ( mapObj ?. name || "this map" ) + " only" ;
2163+ removeBtn . textContent = "Remove from floor " ;
2164+ removeBtn . title = "Remove this receiver from " + _floorName ;
21572165 removeBtn . addEventListener ( "click" , async ( ) => {
21582166 const d = ts . draftReceivers [ _selMapId ] || [ ] ;
21592167 ts . draftReceivers [ _selMapId ] = d . filter ( r => r . id !== _selRxId ) ;
@@ -2170,7 +2178,7 @@ function _tuneTab(ctx, el, cs, calData) {
21702178 } ) ;
21712179 ts . dirtyMaps = { } ;
21722180 ts . _mapsStamp = null ;
2173- ctx . toast ( "Receiver removed from " + ( origMap . name || "map" ) ) ;
2181+ ctx . toast ( "Receiver removed" ) ;
21742182 await ctx . actions . mapsRefresh ( ) ;
21752183 } catch ( e ) {
21762184 ctx . toast ( "Remove failed: " + String ( e ) , true ) ;
@@ -4096,11 +4104,15 @@ function _beaconTuneTab(ctx, el, cs, calData) {
40964104 infoCard . innerHTML = "" ;
40974105 const infoLine = document . createElement ( "div" ) ;
40984106 infoLine . style . cssText = "display:flex;align-items:center;gap:0;flex-wrap:wrap" ;
4107+ const _bkFloor = ( ( ) => { const fid = mapObj ?. floor_id || "main" ; const f = ( ctx . state . model ?. floors || [ ] ) . find ( f2 => f2 . id === fid ) ; return f ? f . name : fid ; } ) ( ) ;
4108+ const _bkFab = ( ctx . state . model ?. beacon_positions_m || { } ) [ bk . key ] ;
4109+ const _bkPos = _bkFab ? `${ _bkFab . x_m ?. toFixed ( 1 ) } m, ${ _bkFab . y_m ?. toFixed ( 1 ) } m` : `${ ( bk . x * 100 ) . toFixed ( 1 ) } %, ${ ( bk . y * 100 ) . toFixed ( 1 ) } %` ;
4110+ const _bkRoom = _bkFab ?. room || detectedRoom ;
40994111 const lines = [
41004112 `<b style="color:#5eead4">${ _esc ( bk . label || bk . key ) } </b>` ,
4101- `Map : ${ _esc ( mapObj ?. name || bs . selectedBk . mapId ) } ` ,
4102- `Room: ${ _esc ( detectedRoom || "\u2014" ) } ` ,
4103- `Position: x ${ ( bk . x * 100 ) . toFixed ( 1 ) } %, y ${ ( bk . y * 100 ) . toFixed ( 1 ) } % ` ,
4113+ `Floor : ${ _esc ( _bkFloor ) } ` ,
4114+ `Room: ${ _esc ( _bkRoom || "\u2014" ) } ` ,
4115+ `Position: ${ _bkPos } ` ,
41044116 `RSSI: ${ lastRssi } ` ,
41054117 `Kind: ${ _esc ( bk . kind || "ble" ) } ` ,
41064118 ] ;
0 commit comments