Skip to content

Conversation

@dhruvisompura
Copy link
Contributor

@dhruvisompura dhruvisompura commented Jan 28, 2026

Addresses #11573

This PR fixes the relative execution time display (e.g., "2 mins ago") in the notebook cell footer not updating over time.

The lastRunEndTime value is set once after cell execution completes and never changes afterward. Since the cell footer component only re-rendered when this value changed, the relative time display would remain stuck at "Just now" indefinitely until another user action caused the cells in the notebook to re-render (e.g., adding a new cell to the notebook).

This PR adds a 60-second interval that forces the component to re-render, recalculating the relative time from getRelativeTime(). To prevent unnecessary re-renders, the interval only triggers a re-render when the cell is visible in the viewport, using the existing cell.isInViewport() method.

I also removes the seconds-level granularity from getRelativeTime() since the update only occurs on a minute level.

Screenshot

Note: I edited the video to skip the 1 minute of waiting while we wait for the cell footer to update

exeuction_time.mp4

Release Notes

New Features

  • N/A

Bug Fixes

  • N/A

QA Notes

To verify execution time is being updated:

  1. Open a notebook with the Positron Notebook Editor
  2. Create a code cell with a simple statement (e.g.print("hello"))
  3. Run the cell
  4. Observe the footer shows execution time of Just now
  5. Wait 1-2 minutes
  6. The footer should update to 1 min ago, then 2 mins ago, etc.

To verify only visible cells are re-rendering the footer:

  1. Run several cells in a notebook
  2. Scroll so the executed cells are out of view
  3. Wait 1+ minute
  4. Scroll back to view the hidden cells
  5. The relative time should show the old elapsed time and then update the correct elapsed time when the next minute interval is hit

@:positron-notebooks

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

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

readme  valid tags

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.

Worked well when the cell was on screen! If the cell is off screen we only start the interval when it is scrolled into view and rendered, which might be a bit confusing for users

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.

3 participants