@@ -15,6 +15,7 @@ import { NotebookCellInternalMetadata } from '../../../common/notebookCommon.js'
15
15
import { INotebookExecutionStateService } from '../../../common/notebookExecutionStateService.js' ;
16
16
import { executingStateIcon } from '../../notebookIcons.js' ;
17
17
import { renderLabelWithIcons } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js' ;
18
+ import { CellViewModelStateChangeEvent } from '../../notebookViewEvents.js' ;
18
19
19
20
const UPDATE_EXECUTION_ORDER_GRACE_PERIOD = 200 ;
20
21
@@ -67,6 +68,12 @@ export class CellExecutionPart extends CellContentPart {
67
68
this . updateExecutionOrder ( element . internalMetadata , true ) ;
68
69
}
69
70
71
+ override updateState ( element : ICellViewModel , e : CellViewModelStateChangeEvent ) : void {
72
+ if ( e . internalMetadataChanged ) {
73
+ this . updateExecutionOrder ( element . internalMetadata ) ;
74
+ }
75
+ }
76
+
70
77
private updateExecutionOrder ( internalMetadata : NotebookCellInternalMetadata , forceClear = false ) : void {
71
78
if ( this . _notebookEditor . activeKernel ?. implementsExecutionOrder || ( ! this . _notebookEditor . activeKernel && typeof internalMetadata . executionOrder === 'number' ) ) {
72
79
// If the executionOrder was just cleared, and the cell is executing, wait just a bit before clearing the view to avoid flashing
@@ -139,19 +146,19 @@ export class CellExecutionPart extends CellContentPart {
139
146
const statusBarVisible = this . currentCell . layoutInfo . statusBarHeight > 0 ;
140
147
141
148
// Sticky mode: cell is running and editor is not fully visible
149
+ const offset = editorBottom - scrollBottom ;
150
+ top -= offset ;
151
+ top = clamp (
152
+ top ,
153
+ lineHeight + 12 , // line height + padding for single line
154
+ this . currentCell . layoutInfo . editorHeight - lineHeight + this . currentCell . layoutInfo . statusBarHeight
155
+ ) ;
156
+
142
157
if ( scrollBottom <= editorBottom && cellIsRunning ) {
143
- const offset = editorBottom - scrollBottom ;
144
- top -= offset ;
145
- top = clamp (
146
- top ,
147
- lineHeight + 12 , // line height + padding for single line
148
- this . currentCell . layoutInfo . editorHeight - lineHeight + this . currentCell . layoutInfo . statusBarHeight
149
- ) ;
150
-
151
- const isAlreadySticky = this . _executionOrderLabel . classList . contains ( 'sticky' ) ;
158
+ const isAlreadyIcon = this . _executionOrderContent . classList . contains ( 'sticky-spinner' ) ;
152
159
// Add a class when it's in sticky mode for special styling
153
- if ( ! isAlreadySticky ) {
154
- this . _executionOrderLabel . classList . add ( 'sticky' ) ;
160
+ if ( ! isAlreadyIcon ) {
161
+ this . _executionOrderLabel . classList . add ( 'sticky-spinner ' ) ;
155
162
// Only recreate the content if we're newly becoming sticky
156
163
DOM . clearNode ( this . _executionOrderContent ) ;
157
164
const icon = ThemeIcon . modify ( executingStateIcon , 'spin' ) ;
0 commit comments