@@ -10,7 +10,12 @@ import {
1010 Settings as SettingsIcon ,
1111} from "lucide-react" ;
1212import type { ReactNode } from "react" ;
13- import { useDatasets , useModelStatus , useNavCounts } from "../../api/hooks" ;
13+ import {
14+ useDatasets ,
15+ useModelStatus ,
16+ useNavCounts ,
17+ useProfiles ,
18+ } from "../../api/hooks" ;
1419import type { ViewId } from "../../api/types" ;
1520import { colors , font } from "../../design/tokens" ;
1621import { useUiStore } from "../../store/uiStore" ;
@@ -49,8 +54,16 @@ export function Sidebar() {
4954 const datasets = useDatasets ( ) ;
5055 const totals = useNavCounts ( ) ;
5156 const status = useModelStatus ( ) ;
57+ const profiles = useProfiles ( ) ;
5258 const running = useRunningCount ( ) ;
5359
60+ // The loaded model shown as its profile (name + weights file); a model
61+ // loaded outside profiles falls back to the loader's filename.
62+ const loaded = status . data ?. loaded ?? false ;
63+ const loadedProfile = profiles . data ?. profiles . find (
64+ ( p ) => p . id === profiles . data . loaded_id ,
65+ ) ;
66+
5467 // The Caption badge counts the dataset that tab is actually working on,
5568 // not the library: it is the size of the grid the user is about to see.
5669 const active = datasets . data ?. datasets . find ( ( row ) => row . id === datasetId ) ;
@@ -135,22 +148,40 @@ export function Sidebar() {
135148 display : "flex" ,
136149 alignItems : "center" ,
137150 gap : 8 ,
138- fontSize : 11.5 ,
139- color : colors . textSecondary ,
140151 marginBottom : 10 ,
141152 } }
153+ title = { loaded ? ( loadedProfile ?. file ?? status . data ?. name ?? "" ) : "" }
142154 >
143- < Dot color = { status . data ?. loaded ? colors . ok : colors . textFaint } />
144- < span
145- style = { {
146- flex : 1 ,
147- overflow : "hidden" ,
148- textOverflow : "ellipsis" ,
149- whiteSpace : "nowrap" ,
150- } }
151- >
152- { status . data ?. loaded ? status . data . name : "No model loaded" }
153- </ span >
155+ < Dot color = { loaded ? colors . ok : colors . textFaint } />
156+ < div style = { { flex : 1 , minWidth : 0 } } >
157+ < div
158+ style = { {
159+ fontSize : 11.5 ,
160+ color : colors . textSecondary ,
161+ overflow : "hidden" ,
162+ textOverflow : "ellipsis" ,
163+ whiteSpace : "nowrap" ,
164+ } }
165+ >
166+ { loaded
167+ ? ( loadedProfile ?. name ?? status . data ?. name ?? "Model loaded" )
168+ : "No model loaded" }
169+ </ div >
170+ < div
171+ style = { {
172+ fontFamily : font . mono ,
173+ fontSize : 9 ,
174+ color : colors . textFaint ,
175+ overflow : "hidden" ,
176+ textOverflow : "ellipsis" ,
177+ whiteSpace : "nowrap" ,
178+ } }
179+ >
180+ { loaded
181+ ? `${ loadedProfile ?. file ?? status . data ?. name ?? "" } · loaded`
182+ : "unloaded — memory purged" }
183+ </ div >
184+ </ div >
154185 </ div >
155186 < button
156187 onClick = { ( ) => toggleJobs ( ) }
0 commit comments