Skip to content

Feat/notebook cell execution info #9026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nstrayer
Copy link
Contributor

@nstrayer nstrayer commented Aug 13, 2025

Addresses #5495.

@:notebooks

Adds execution information display for notebook cells, showing execution order, duration, and status through a hover popup. The feature includes an execution order badge or status icon in the cell gutter that triggers a detailed popup on hover, providing users with visibility into when cells were executed, how long they took, and their success status. Includes e2e tests covering popup interactions, status changes, and accessibility features.

image

Release Notes

Bug Fixes

  • N/A

QA Notes

The e2e tests in test/e2e/tests/notebook/cell-execution-info.test.ts verify all interaction patterns

Manual Testing

Create a new Python notebook and execute cells to verify the execution info appears correctly.

import time
print("Quick execution")
import time
time.sleep(2)
print("Slow execution")

After running these cells, you should see:

  1. Execution order badges (1, 2) appear in the cell gutters
  2. Hover over the badges to see popup with execution duration and timestamp
  3. Status icons during execution (spinning icon while running)
  4. Different styling for successful vs failed executions
  5. Popup auto-closes when mouse leaves the area

Copy link

github-actions bot commented Aug 13, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:notebooks

readme  valid tags

Copilot

This comment was marked as outdated.

@nstrayer nstrayer force-pushed the feat/notebook-cell-execution-info branch from 14a2e04 to 77ab7a4 Compare August 13, 2025 20:08
Copy link
Contributor

@austin3dickey austin3dickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool!

I noticed 2 strange-feeling things:

  1. When the hover pops up, the outline of the entire Positron window seems to flash. In my video this is clearest up by the menu bar.
  2. When the hover is onscreen, I can't scroll the notebook. For some reason this subconsciously feels really sticky and annoying 😅
clip.mov

@nstrayer
Copy link
Contributor Author

Ah, this is probably because of my super-heavy handed use of the full positron modal system rather than a more lightweight popup.

@nstrayer nstrayer force-pushed the feat/notebook-cell-execution-info branch from 9066d40 to 4051f4b Compare August 20, 2025 18:37
@austin3dickey austin3dickey force-pushed the feat/notebook-cell-execution-info branch from 4051f4b to 9066d40 Compare August 20, 2025 18:51
@nstrayer nstrayer force-pushed the feat/notebook-cell-execution-info branch 2 times, most recently from 070484a to 291c5f6 Compare August 21, 2025 16:11
@nstrayer
Copy link
Contributor Author

Switched to a new lighterweight "Popover" component for the info... popover. Should be good now.

Copilot

This comment was marked as outdated.

@nstrayer nstrayer force-pushed the feat/notebook-cell-execution-info branch from c397033 to 158f3f0 Compare August 21, 2025 18:38
Copy link
Contributor

@seeM seeM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Sometimes the popover flickers for a frame in the top left of the window:

Screen.Recording.2025-08-22.at.11.27.06.mov

I think the UI details (alignment, choice of text and what we display in the popover, etc) can be refined via mockups and followup PRs.

@seeM
Copy link
Contributor

seeM commented Aug 22, 2025

Oh, also not sure how we want to approach Release Notes with Positron NB

@nstrayer nstrayer force-pushed the feat/notebook-cell-execution-info branch from 158f3f0 to dfc9973 Compare August 22, 2025 19:32
@nstrayer
Copy link
Contributor Author

Fixed flicker and removed the release notes

@nstrayer nstrayer requested review from seeM and Copilot August 22, 2025 19:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds a comprehensive cell execution information display feature for Positron notebooks, allowing users to view execution order, duration, timing, and status through an interactive hover popup. The feature enhances the notebook user experience by providing clear visibility into cell execution history and performance metrics.

  • Adds execution info icon to notebook cells displaying execution order badges or status indicators
  • Implements detailed hover popup showing execution status, duration, timing, and completion information
  • Provides responsive status updates during cell execution with visual feedback (spinning icons, status badges)

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/e2e/tests/notebook/positron-notebook-editor.test.ts Refactors test setup by extracting helper functions to the page object
test/e2e/tests/notebook/cell-execution-info.test.ts Comprehensive e2e test covering all execution info popup scenarios
test/e2e/pages/notebooksPositron.ts Adds extensive page object methods for Positron notebook interactions
src/vs/workbench/services/positronNotebook/browser/IPositronNotebookInstance.ts Updates observable import to use newer module
src/vs/workbench/services/positronNotebook/browser/IPositronNotebookCell.ts Adds execution timing observables to code cell interface
src/vs/workbench/contrib/positronNotebook/browser/notebookCells/NotebookCodeCell.tsx Integrates execution info icon component into code cells
src/vs/workbench/contrib/positronNotebook/browser/notebookCells/NotebookCellWrapper.tsx Adds test identifier for e2e testing
src/vs/workbench/contrib/positronNotebook/browser/notebookCells/NotebookCellWrapper.css Updates cell styling with margin adjustments and improved animations
src/vs/workbench/contrib/positronNotebook/browser/notebookCells/CellExecutionInfoPopup.tsx New popup component displaying detailed execution information
src/vs/workbench/contrib/positronNotebook/browser/notebookCells/CellExecutionInfoPopup.css Styling for the execution info popup with theme support
src/vs/workbench/contrib/positronNotebook/browser/notebookCells/CellExecutionInfoIcon.tsx New icon component with hover interactions and state management
src/vs/workbench/contrib/positronNotebook/browser/notebookCells/CellExecutionInfoIcon.css Styling for execution info icons with status-specific appearance
src/vs/workbench/contrib/positronNotebook/browser/PositronNotebookCells/PositronNotebookCodeCell.ts Backend implementation for tracking execution timing and metadata
src/vs/workbench/contrib/positronNotebook/browser/KernelStatusBadge.tsx Adds accessibility label for e2e test compatibility
src/vs/workbench/browser/positronComponents/popover/popover.tsx New reusable popover component with auto-positioning
src/vs/workbench/browser/positronComponents/popover/popover.css Basic styling for the popover component
Comments suppressed due to low confidence (1)

@@ -10,6 +10,7 @@ import { QuickAccess } from './quickaccess';
import test, { expect, Locator } from '@playwright/test';
import { HotKeys } from './hotKeys.js';

const DEFAULT_TIMEOUT = 10000;
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider making this timeout configurable or using a constant from a shared configuration file to ensure consistency across test suites.

Suggested change
const DEFAULT_TIMEOUT = 10000;
import { DEFAULT_TIMEOUT } from '../config';

Copilot uses AI. Check for mistakes.

cell: PositronNotebookCodeCell;
}

const POPUP_DELAY = 100;
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting this magic number to a configuration constant or making it configurable, as hover delays can impact user experience and may need adjustment.

Copilot uses AI. Check for mistakes.

? completedMoreThanAnHourAgo
? `${getRelativeTime(lastRunEndTime)} (${formatTimestamp(lastRunEndTime)})`
: `${getRelativeTime(lastRunEndTime)}`
: ''}
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The type narrowing comment should be more descriptive or the code could be restructured to make the type narrowing more explicit without inline comments.

Suggested change
: ''}
{completionTimeText}

Copilot uses AI. Check for mistakes.

anchorElement,
onClose,
autoCloseOnMouseLeave = true,
autoCloseDelay = 100,
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting magic numbers like this delay to named constants for better maintainability and consistency across the codebase.

Suggested change
autoCloseDelay = 100,
autoCloseDelay = DEFAULT_AUTO_CLOSE_DELAY_MS,

Copilot uses AI. Check for mistakes.

@juliasilge
Copy link
Contributor

In terms of release notes, we're not including any public facing release notes until we're ready to invite users to try it out, but I would still encourage folks to outline what a PR does in a single line like we usually do, for ease of navigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants