Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ export class CellExecutionPart extends CellContentPart {
`[${internalMetadata.executionOrder}]` :
'[ ]';
this._executionOrderContent.innerText = executionOrderLabel;
this._executionOrderLabel.classList.remove('sticky-spinner');

// Call _updatePosition to refresh sticky status
this._updatePosition();
} else {
this._executionOrderContent.innerText = '';
this._executionOrderLabel.classList.remove('sticky-spinner');
}
}

Expand All @@ -119,11 +121,11 @@ export class CellExecutionPart extends CellContentPart {
const cellIsRunning = !!this._notebookExecutionStateService.getCellExecution(this.currentCell.uri);

// Store sticky state before potentially removing the class
const wasSticky = this._executionOrderLabel.classList.contains('sticky');
const wasSticky = this._executionOrderLabel.classList.contains('sticky-spinner');

if (!cellIsRunning) {
// Keep showing the execution order label but remove sticky class
this._executionOrderLabel.classList.remove('sticky');
this._executionOrderLabel.classList.remove('sticky-spinner');

// If we were sticky and cell stopped running, restore the proper content
if (wasSticky) {
Expand Down Expand Up @@ -156,7 +158,7 @@ export class CellExecutionPart extends CellContentPart {
);

if (scrollBottom <= editorBottom && cellIsRunning) {
const isAlreadyIcon = this._executionOrderContent.classList.contains('sticky-spinner');
const isAlreadyIcon = this._executionOrderLabel.classList.contains('sticky-spinner');
// Add a class when it's in sticky mode for special styling
if (!isAlreadyIcon) {
this._executionOrderLabel.classList.add('sticky-spinner');
Expand All @@ -168,8 +170,8 @@ export class CellExecutionPart extends CellContentPart {
// When already sticky, we don't need to recreate the content
} else if (!statusBarVisible && cellIsRunning) {
// Status bar is hidden but cell is running: show execution order label at the bottom of the editor area
const wasStickyHere = this._executionOrderLabel.classList.contains('sticky');
this._executionOrderLabel.classList.remove('sticky');
const wasStickyHere = this._executionOrderLabel.classList.contains('sticky-spinner');
this._executionOrderLabel.classList.remove('sticky-spinner');
top = this.currentCell.layoutInfo.editorHeight - lineHeight; // Place at the bottom of the editor
// Only update content if we were previously sticky or content is not correct
// eslint-disable-next-line no-restricted-syntax
Expand All @@ -183,8 +185,8 @@ export class CellExecutionPart extends CellContentPart {
}
} else {
// Only update if the current state is sticky
const currentlySticky = this._executionOrderLabel.classList.contains('sticky');
this._executionOrderLabel.classList.remove('sticky');
const currentlySticky = this._executionOrderLabel.classList.contains('sticky-spinner');
this._executionOrderLabel.classList.remove('sticky-spinner');

// When transitioning from sticky to non-sticky, restore the proper content
if (currentlySticky) {
Expand Down