Skip to content
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

[EDT-1765] SnapshotSettings introduced #549

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

Conversation

evan-mcgeek
Copy link
Contributor

@evan-mcgeek evan-mcgeek commented Dec 19, 2024

This PR adds a new method getSnapshotWithSettings() with SnapshotSettings object to be able to control snapshot properties, eg. increase/decrease its resolution

PR Guidelines

Related tickets

Copy link
Contributor

Coverage Report

Coverage report can be checked at https://stgrafxstudiodevpublic.blob.core.windows.net/sdk/coverage/549/coverage.html

Use PR sdk package

Tarball can be downloaded from https://stgrafxstudiodevpublic.blob.core.windows.net/sdk/dev-packages/549/studio-sdk.tgz

To use in local project, change package.json to use local tarball

"dependencies": {
    "@chili-publish/studio-sdk": "https://stgrafxstudiodevpublic.blob.core.windows.net/sdk/dev-packages/549/studio-sdk.tgz"
}

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Unit Test Results

    1 files    40 suites   45s ⏱️
449 tests 449 ✔️ 0 💤 0
454 runs  454 ✔️ 0 💤 0

Results for commit e5dbe94.

♻️ This comment has been updated with latest results.

@sebastianpujina sebastianpujina added the Ready for QA run automated tests label Jan 3, 2025
@alexoparii alexoparii added Ready for QA run automated tests and removed Ready for QA run automated tests labels Jan 7, 2025
Copy link
Contributor

@Dvergar Dvergar left a comment

Choose a reason for hiding this comment

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

Why isn't getSnapshot kept with a nullable settings parameter instead?

@evan-mcgeek
Copy link
Contributor Author

Why isn't getSnapshot kept with a nullable settings parameter instead?

good idea indeed

Dvergar
Dvergar previously approved these changes Jan 31, 2025
Copy link
Contributor

@Dvergar Dvergar left a comment

Choose a reason for hiding this comment

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

nit, I would maybe describe what is the behavior of a null largestAxisSize and if there is an enforced limit from our side.

Dvergar
Dvergar previously approved these changes Feb 3, 2025
Matthiee
Matthiee previously approved these changes Feb 3, 2025
Dvergar
Dvergar previously approved these changes Feb 5, 2025
@evan-mcgeek evan-mcgeek dismissed stale reviews from Dvergar and Matthiee via 0bd9e50 February 6, 2025 13:54
@evan-mcgeek evan-mcgeek added Ready for QA run automated tests and removed Ready for QA run automated tests labels Feb 6, 2025
@evan-mcgeek evan-mcgeek enabled auto-merge (squash) February 6, 2025 14:08
Matthiee
Matthiee previously approved these changes Feb 6, 2025
@evan-mcgeek evan-mcgeek requested a review from Matthiee February 6, 2025 15:33
@evan-mcgeek evan-mcgeek added Ready for QA run automated tests and removed Ready for QA run automated tests labels Feb 6, 2025
const res = await this.#blobAPI;
return res.getPageSnapshot(pageId).then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));
return res
.getPageSnapshotWithSettings(pageId, JSON.stringify(settings))
Copy link
Member

Choose a reason for hiding this comment

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

Only perform JSON.stringify if settings are defined

Copy link
Member

Choose a reason for hiding this comment

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

getSnapshotWithSettings('0', 'null') will throw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for QA run automated tests
Development

Successfully merging this pull request may close these issues.

8 participants