Skip to content

blocks2image: modal instead of menu items & new "copy to clipboard" - #6830

Merged
WorldLanguages merged 48 commits into
ScratchAddons:masterfrom
jazzathedev:copy-blocks-to-clip
Sep 12, 2024
Merged

blocks2image: modal instead of menu items & new "copy to clipboard"#6830
WorldLanguages merged 48 commits into
ScratchAddons:masterfrom
jazzathedev:copy-blocks-to-clip

Conversation

@jazzathedev

@jazzathedev jazzathedev commented Oct 31, 2023

Copy link
Copy Markdown
Contributor

Resolves #6823 and also my own suggestion
Resolves #6096

Changes

Lets you right click to copy the image of blocks to your clipboard

image

image

Reason for changes

Convenience

Tests

Tested on chrome and unlike the embarassment of my last pr im pretty sure there are no problems

@jazzathedev

Copy link
Copy Markdown
Contributor Author

#6823 (comment)

@mybearworld

Copy link
Copy Markdown
Contributor

#6823 (comment)

Maybe you could add an "as PNG/SVG" to the end of the options?

@WorldLanguages WorldLanguages changed the title Copy-blocks-to-clip blocks2image: add option to copy image to clipboard Oct 31, 2023
@Samq64 Samq64 added type: enhancement New feature for the project scope: addon Related to one or multiple addons labels Oct 31, 2023
@jazzathedev

Copy link
Copy Markdown
Contributor Author

any word on this?

Comment thread addons/blocks2image/addon.json Outdated
Comment thread addons/blocks2image/userscript.js Outdated
@WorldLanguages

Copy link
Copy Markdown
Member

any word on this?

I'm not convinced about adding so many items to the right click menu, this is also related to #4919

@DNin01

DNin01 commented Nov 26, 2023

Copy link
Copy Markdown
Member

any word on this?

I'm not convinced about adding so many items to the right click menu, this is also related to #4919

We should bundle all of the script snapshot-related options in a dropdown menu if possible.

jazzathedev and others added 2 commits December 6, 2023 10:34
Co-authored-by: Maximouse <51849865+mxmou@users.noreply.github.com>
@jazzathedev

Copy link
Copy Markdown
Contributor Author

any word on this?

I'm not convinced about adding so many items to the right click menu, this is also related to #4919

We should bundle all of the script snapshot-related options in a dropdown menu if possible.

A dropdown menu in the right click menu?

@DNin01

DNin01 commented Dec 8, 2023

Copy link
Copy Markdown
Member

any word on this?

I'm not convinced about adding so many items to the right click menu, this is also related to #4919

We should bundle all of the script snapshot-related options in a dropdown menu if possible.

A dropdown menu in the right click menu?

Yes, that's what I meant.

@jazzathedev

Copy link
Copy Markdown
Contributor Author

im not going to mess with the API at this stage so if anyone feels the need to implement this, go ahead lol

@Samq64 Samq64 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a few minor nitpicks but everything works fine.

Comment thread addons/blocks2image/addon.json
Comment thread addons/blocks2image/userscript.js Outdated
Comment thread addons/blocks2image/userscript.js Outdated
Comment thread addons-l10n/en/blocks2image.json Outdated
@Samq64

Samq64 commented Jan 14, 2024

Copy link
Copy Markdown
Member

An alternative to the submenu could be to have settings to turn of some of the options, but it's just 2 more items.

@Samq64 Samq64 added the status: needs review PR needs 1 more approval label Jan 14, 2024
@jazzathedev
jazzathedev requested review from Samq64 and mxmou January 20, 2024 11:57
@Samq64

Samq64 commented Jan 22, 2024

Copy link
Copy Markdown
Member

Could the description also mention copying?

@jazzathedev

Copy link
Copy Markdown
Contributor Author

Could the description also mention copying?

Sure, do you have a suggestion?

@Samq64

Samq64 commented Jan 22, 2024

Copy link
Copy Markdown
Member

Could the description also mention copying?

Sure, do you have a suggestion?

How about "Right click the code area to copy block images to clipboard, or download them as an SVG or PNG."?

@WorldLanguages

WorldLanguages commented Jan 30, 2024

Copy link
Copy Markdown
Member

An alternative to the submenu could be to have settings to turn of some of the options, but it's just 2 more items.

Maybe we could hide this by default (and make the 2 new buttons a setting) until we can figure out how to handle submenus? After this becomes a submenu we can just enable it for everyone and it won't take any more extra space.
By the way, I think other ways to preview block screenshots were suggested somewhere else in the repository, which could possibly reduce the number of context menu items to one, in exchange for a modal that shows all the download options and a preview image. (If anyone have the link to the comment where this was suggested, please post it)

@Samq64

Samq64 commented Jan 30, 2024

Copy link
Copy Markdown
Member

I think other ways to preview block screenshots were suggested somewhere else in the repository

Is it #6632? There's also the copy BBCode suggestion: #2336.

@Samq64 Samq64 self-assigned this Feb 26, 2024
@jazzathedev

Copy link
Copy Markdown
Contributor Author

I can still reproduce the scrollbar bug with the Steve arm sprite and the browser maximized on a 1440p monitor.

I have a 1600p screen so maybe that small difference is enough. I'm pretty sure there is css I can do to make sure the buttons stay at the bottom no matter what, I thought I did but I'll look at it another time. Can't rn, so @WorldLanguages please remind me on discord in about 9 hours.

@WorldLanguages

Copy link
Copy Markdown
Member

@mxmou If you have some time maybe you can help with the CSS of the modal to avoid the bug I mentioned yesterday.

@mxmou

mxmou commented Jul 29, 2024

Copy link
Copy Markdown
Member

@mxmou If you have some time maybe you can help with the CSS of the modal to avoid the bug I mentioned yesterday.

I can't test this right now, but I think making .sa-export-content a flex container and adding flex-basis: 0 and flex-grow: 1 to the image container would work.

@jazzathedev

Copy link
Copy Markdown
Contributor Author

On the modal header:
position: fixed;
width: 692px;
border-radius: inherit;

I have no idea why this works so its a bad idea. But it does work, so its worth sending here? Mxmou's suggestion doesn't work without a min-width, and doesn't work well with it. I am not sure why there is not a simple solution to this? This is essentially a footer, yet it seems to not work the same.

@mxmou

mxmou commented Jul 30, 2024

Copy link
Copy Markdown
Member

But it does work, so its worth sending here?

You can push the code, then I'll try to improve it when I have time.

@Samq64 Samq64 added the status: awaiting answer/followup A comment will be sent if there's no activity for 7 days, for issues that have this label. label Aug 5, 2024
@scratchaddons-bot

Copy link
Copy Markdown
Contributor

Ping! There has been no activity for 7 days.

@scratchaddons-bot scratchaddons-bot Bot added the status: stale Issue or PR marked stale by a bot label Aug 13, 2024
@WorldLanguages WorldLanguages modified the milestones: v1.39.0, v1.40.0 Aug 14, 2024
@scratchaddons-bot scratchaddons-bot Bot removed the status: stale Issue or PR marked stale by a bot label Aug 15, 2024
@scratchaddons-bot

Copy link
Copy Markdown
Contributor

Ping! There has been no activity for 7 days.

@scratchaddons-bot scratchaddons-bot Bot added the status: stale Issue or PR marked stale by a bot label Aug 22, 2024
@sfederici

Copy link
Copy Markdown

Can someone please approve this update so that it will be available in the next release? Thanks in advance.

@scratchaddons-bot scratchaddons-bot Bot removed the status: stale Issue or PR marked stale by a bot label Aug 23, 2024
@WorldLanguages

Copy link
Copy Markdown
Member

@sfederici No, this is planned for v1.40
For personal use you may download this branch as a zip file and manually add it to your browser by enabling developer mode in chrome://extensions.

@scratchaddons-bot

Copy link
Copy Markdown
Contributor

Ping! There has been no activity for 7 days.

@scratchaddons-bot scratchaddons-bot Bot added the status: stale Issue or PR marked stale by a bot label Sep 1, 2024
Comment thread addons/blocks2image/style.css Outdated
@scratchaddons-bot scratchaddons-bot Bot removed the status: stale Issue or PR marked stale by a bot label Sep 7, 2024
WorldLanguages and others added 3 commits September 8, 2024 16:50
Co-authored-by: Samq64 <81489795+Samq64@users.noreply.github.com>
@Samq64 Samq64 removed status: awaiting answer/followup A comment will be sent if there's no activity for 7 days, for issues that have this label. status: needs review PR needs 1 more approval labels Sep 8, 2024
@WorldLanguages
WorldLanguages merged commit db1cda8 into ScratchAddons:master Sep 12, 2024
@Secret-chest

Copy link
Copy Markdown
Contributor

How do I copy SVG to clipboard?

@jazzathedev

Copy link
Copy Markdown
Contributor Author

How do I copy SVG to clipboard?

This is not useful enough to be added, as of now you can not copy the svg to your clipboard. The clipboard is not designed for that amount of data in that format (essentially text).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: addon Related to one or multiple addons type: enhancement New feature for the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

blocks2image addon: new feature to copy image instead of downloading it Improving "Save blocks as image" addon

10 participants