@@ -117,6 +117,18 @@ const WorkspaceItem: React.FC<WorkspaceItemProps> = ({
117117 getCronJobCountsSnapshot ,
118118 ) ;
119119 const scheduledJobCount = cronJobCounts . byWorkspaceId . get ( workspace . id ) ?? 0 ;
120+ // Rendered through ActionItem's trailing slot so both name rows keep the badge on
121+ // the name line. The rows flatten that label slot with `display: contents`, so a
122+ // badge appended to the label children would silently break if that rule changed.
123+ const scheduledJobBadge = scheduledJobCount > 0 ? (
124+ < span
125+ className = "openbitfun-nav-panel__inline-item-cron-badge"
126+ title = { t ( 'nav.scheduledJobs.badgeTooltip' , { count : scheduledJobCount } ) }
127+ >
128+ < Icon name = "clock" size = "2xs" aria-hidden />
129+ { scheduledJobCount }
130+ </ span >
131+ ) : undefined ;
120132 const {
121133 setActiveWorkspace,
122134 closeWorkspaceById,
@@ -866,20 +878,12 @@ const WorkspaceItem: React.FC<WorkspaceItemProps> = ({
866878 className = "openbitfun-nav-panel__assistant-item-name-action"
867879 triggerClassName = "openbitfun-nav-panel__assistant-item-name-btn"
868880 labelBehavior = "static"
881+ metadata = { scheduledJobBadge }
869882 onClick = { e => { e . stopPropagation ( ) ; handleCollapseToggle ( ) ; } }
870883 data-testid = "nav-workspace-name-btn"
871884 data-workspace-id = { workspace . id }
872885 >
873886 < OverflowText className = "openbitfun-nav-panel__assistant-item-label" data-openbitfun-product-component = "workspace-item" data-openbitfun-product-part = "label" > { workspaceDisplayName } </ OverflowText >
874- { scheduledJobCount > 0 ? (
875- < span
876- className = "openbitfun-nav-panel__inline-item-cron-badge"
877- title = { t ( 'nav.scheduledJobs.badgeTooltip' , { count : scheduledJobCount } ) }
878- >
879- < Icon name = "clock" size = "2xs" aria-hidden />
880- { scheduledJobCount }
881- </ span >
882- ) : null }
883887 </ ActionItem >
884888 </ Tooltip >
885889
@@ -1181,6 +1185,7 @@ const WorkspaceItem: React.FC<WorkspaceItemProps> = ({
11811185 className = "openbitfun-nav-panel__workspace-item-name-action"
11821186 triggerClassName = "openbitfun-nav-panel__workspace-item-name-btn"
11831187 labelBehavior = "static"
1188+ metadata = { scheduledJobBadge }
11841189 onClick = { e => { e . stopPropagation ( ) ; handleCollapseToggle ( ) ; } }
11851190 data-testid = "nav-workspace-name-btn"
11861191 data-workspace-id = { workspace . id }
0 commit comments