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

feat(core): support copy as image in electron app #8939

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

akumatus
Copy link
Member

@akumatus akumatus commented Nov 27, 2024

Close issue AF-1785.

What changed?

  • Support copy as image in electron app:
    • Select the whole mindmap if any of the mindmap nodes is selected.
    • Hide unselected overlap elements before taking a snapshot.
    • Fit the selected elements to the screen.
    • Add CSS style to hide irrelevant dom nodes, like widgets, whiteboard background and so on.
      • Due to the usage of Shadow Dom in our code, not all node styles can be controlled. Thus this PR use -2px padding for affine:frame snapshots.
    • Using electron capturePage API to take a snapshot of selected elements.
🎥 Video uploaded on Graphite:

Copy link

graphite-app bot commented Nov 27, 2024

Your org has enabled the Graphite merge queue for merging into canary

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added mod:infra Environment related issues and discussions mod:i18n Related to i18n mod:env mod:component app:electron Related to electron app mod:dev app:core labels Nov 27, 2024
@akumatus akumatus changed the title feat: support copy as png feat: support copy as image in electron Nov 27, 2024
@akumatus akumatus changed the title feat: support copy as image in electron feat: support copy as image in electron app Nov 27, 2024
Copy link

nx-cloud bot commented Nov 27, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8d3d611. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.68%. Comparing base (68337fa) to head (8d3d611).

Additional details and impacted files
@@            Coverage Diff             @@
##           canary    #8939      +/-   ##
==========================================
- Coverage   64.73%   64.68%   -0.06%     
==========================================
  Files         664      664              
  Lines       37346    37346              
  Branches     3608     3608              
==========================================
- Hits        24177    24157      -20     
- Misses      12802    12822      +20     
  Partials      367      367              
Flag Coverage Δ
server-test 77.07% <ø> (-0.07%) ⬇️
unittest 34.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@akumatus akumatus marked this pull request as ready for review November 27, 2024 08:55
@akumatus akumatus requested review from donteatfriedrice and removed request for pengx17, forehalo, EYHN, CatsJuice and JimmFly November 27, 2024 08:55
@akumatus akumatus changed the title feat: support copy as image in electron app feat(core): support copy as image in electron app Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:core app:electron Related to electron app mod:component mod:dev mod:env mod:i18n Related to i18n mod:infra Environment related issues and discussions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant