question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Screenshot: stop repeating the same screenshot over and over when it doesn't change

See original GitHub issue

In this patch we want to do an experiment, it’s not sure we’ll land this in the end. This experiment is that we don’t want that we repeat the screenshot in the screenshot track, if it doesn’t change.

The current logic is at https://github.com/firefox-devtools/profiler/blob/0ecc660cb4fc6877dff6cb8db08d08451453ff36/src/components/timeline/TrackScreenshots.js#L273-L333

What it does is that for each pixel we try to find the right screenshot. Especially here: https://github.com/firefox-devtools/profiler/blob/0ecc660cb4fc6877dff6cb8db08d08451453ff36/src/components/timeline/TrackScreenshots.js#L301-L307 We see that if don’t find a screenshot, by breaking we reuse the previous data.

We also see that there are 2 nested loops: the outer loop loops over the pixel “left” information, and the inner loops over the screenshots.

Instead I think we’ll want to invert the logic: the outer loop looping over the screenshots, and some logic inside to compute the “left” information. Especially take care that we don’t overlap images, so when looping over the screenshots you’ll need to skip them until we have some space. When finally we have some space we’ll need to display the last screenshot.

Maybe that’s not the easiest solution, and instead we should just change something at the break in the existing code. So this will need some research.

Here are some profile links containing screenshots:

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
julienwcommented, Dec 18, 2020

what exactly is the task is it to only show the screen shot and if it is not changing then we do not show it until the new screenshot has a change relative to previous one . do i got it wright or correct me if i am wrong . and what to show if the screenshot does not changes .

Yes, this is exactly this!

If the screenshot does not change, I believe this could just be “blank”, nothing drawn. We can decide later if we want to change the background to something grey instead of white, but that’s easy to do later.

0reactions
julienwcommented, Mar 10, 2021

Hey @Bucky25, in this issue we don’t want to compare? So I don’t understand your question… Can you please explain this more?

Read more comments on GitHub >

github_iconTop Results From Across the Web

When trying to capture a screenshot my screen shifts or resizes
When trying to capture a screen shot the screen will resize if more than one monitor is attached to the computer and the...
Read more >
Fixed: Print Screen Not Working on Windows 10 | SoftwareKeep
Solution 1. Stop Background programs · Using the menu on top, switch over to the Boot tab. · Check if your Print Screen...
Read more >
Capture Screenshots at Defined Time Intervals Automatically ...
Finally, you may want to capture multiple screenshots over a certain time period so that you can see the activity occurring on the...
Read more >
windows 10 - How to snip same part of screen as last time?
Capture either the entire screen with Ctrl + PrnScr or a window with Alt + PrnScr ; paste into an image editor which...
Read more >
I've been doing Windows screenshots wrong this whole time
The first of six ways described my own method. But ways two through six blew my mind! It turns out if you hold...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found