Skip to content

51 overhaul of screenshot modal#88

Open
Peer222 wants to merge 9 commits into
mainfrom
51-overhaul-of-screenshot-modal
Open

51 overhaul of screenshot modal#88
Peer222 wants to merge 9 commits into
mainfrom
51-overhaul-of-screenshot-modal

Conversation

@Peer222

@Peer222 Peer222 commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Screenshot modal with zooming and associated annotations
Export of zip file containing screenshot and associated annotations in json format with an export_screenshot worker (adapted from export_screenshots worker; currently not implemented in server/)

@Peer222 Peer222 linked an issue May 6, 2026 that may be closed by this pull request
3 tasks
@rxvl-d

rxvl-d commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Might not be able to review this in time for today's release. Will get to this next week.

@rxvl-d

rxvl-d commented May 14, 2026

Copy link
Copy Markdown
Collaborator

Follow the same visual language for Export and cancel buttons as already exists in the annotations overlay for example:

Screenshot 2026-05-14 at 11 11 29 AM Screenshot 2026-05-14 at 11 12 10 AM

workerData.location,
workerData.screenshot,
workerData.associatedAnnotations
).then((err) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Apparently this doesn't work anymore.

$ node -e "const f = async () => { throw new Error('oops') }; f().then((err) => { if (err) console.log('caught here'); else console.log('success') }).catch((err) => console.log('actually caught'))"

actually caught

You need to use .catch. I think this pattern is used in a few other places as well.

.replaceAll(':', '-')
.replace(',', '_')
try {
fs.copyFileSync(imagePath, path.join(tmpPath, imageName + '.jpg'))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be better to use fs.promises.copyFile here since this is an async function to avoid blocking. It doesn't matter so much since this happens in a worker but still good code hygiene.

@Peer222 Peer222 self-assigned this May 18, 2026
@Peer222

Peer222 commented May 20, 2026

Copy link
Copy Markdown
Collaborator Author

I have fixed the buttons and error catch.
I think the code has to wait for the file copy anyways to create the zip file with the image and the annotations.

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.

Overhaul of screenshot modal

2 participants