44// Hierarchy browser widget — module tree with coloring.
55
66import { CheckboxTreeModel } from './checkbox-tree-model.js' ;
7- import { makeResizableHeaders } from './ui-utils.js' ;
7+ import { isStaticMode , makeResizableHeaders } from './ui-utils.js' ;
88
99const COLS = [
1010 'Instance' , 'Module' , 'Instances' , 'Macros' , 'Modules' ,
@@ -35,7 +35,7 @@ export class HierarchyBrowser {
3535 app . hierarchyBrowser = this ;
3636
3737 // Auto-load in static mode (data is already cached).
38- if ( app . websocketManager && app . websocketManager . isStaticMode ) {
38+ if ( isStaticMode ( app ) ) {
3939 this . update ( ) ;
4040 }
4141 }
@@ -51,6 +51,9 @@ export class HierarchyBrowser {
5151 this . _updateBtn = document . createElement ( 'button' ) ;
5252 this . _updateBtn . className = 'timing-btn' ;
5353 this . _updateBtn . textContent = 'Update' ;
54+ if ( isStaticMode ( this . _app ) ) {
55+ this . _updateBtn . style . display = 'none' ;
56+ }
5457
5558 this . _statusLabel = document . createElement ( 'span' ) ;
5659 this . _statusLabel . className = 'timing-path-count' ;
@@ -352,6 +355,20 @@ export class HierarchyBrowser {
352355
353356 tbody . appendChild ( tr ) ;
354357 }
358+
359+ if ( this . _rows . length === 0 ) {
360+ const tr = document . createElement ( 'tr' ) ;
361+ const td = document . createElement ( 'td' ) ;
362+ td . colSpan = COLS . length ;
363+ td . style . textAlign = 'center' ;
364+ td . style . color = 'var(--fg-secondary)' ;
365+ td . textContent = isStaticMode ( this . _app ) ?
366+ 'No hierarchy data available' :
367+ 'Click "Update" to load hierarchy' ;
368+ tr . appendChild ( td ) ;
369+ tbody . appendChild ( tr ) ;
370+ }
371+
355372 this . _table . appendChild ( tbody ) ;
356373 makeResizableHeaders ( this . _table ) ;
357374 }
0 commit comments