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

Copy and Paste + Shortcuts #79

Merged
merged 8 commits into from
Jul 19, 2024
Merged

Conversation

Creepler13
Copy link
Contributor

Added buttons to copy and paste the fields of entries and their shortcuts (Ctrl+C, Ctrl+V)

It would be good to add the ability to unselected selected entries by clicking at the background or other elements in order to avoid accidents.

@Creepler13 Creepler13 marked this pull request as ready for review April 28, 2024 00:05
@Loran425 Loran425 added the Type: Enhancement New feature or request label May 1, 2024
@Creepler13 Creepler13 closed this May 8, 2024
@Creepler13 Creepler13 reopened this May 8, 2024
@yedpodtrzitko
Copy link
Collaborator

when I select multiple items, it copies the fields from the first item selected only. Is that intended behaviour? Eg.

selected item 1:
tags: [foo, bar]
metatags: []

selected item 2:
tags: [aaa]
metatags: [bbb]

target item:
tags: [foo, bar]
metatags: []

Copy link
Collaborator

@yedpodtrzitko yedpodtrzitko left a comment

Choose a reason for hiding this comment

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

nice done overall, but there's a few things which could improve the code readability.

@Creepler13
Copy link
Contributor Author

when I select multiple items, it copies the fields from the first item selected only. Is that intended behaviour? Eg.

selected item 1: tags: [foo, bar] metatags: []

selected item 2: tags: [aaa] metatags: [bbb]

target item: tags: [foo, bar] metatags: []

I intended to copy the last item from the selection, but forgot the break

@CyanVoxel CyanVoxel added this to the Alpha 9.3.x milestone May 10, 2024
@Creepler13 Creepler13 changed the title Copy and Paste added + Shortcuts Copy and Paste + Shortcuts May 23, 2024
@CyanVoxel CyanVoxel changed the base branch from main to Alpha-v9.4 June 13, 2024 18:04
@CyanVoxel CyanVoxel self-assigned this Jun 14, 2024
- Multi-selection copy now merges fields of all selected entries
- Action states are now handled
@CyanVoxel
Copy link
Member

I've made some significant changes to this, including:

  • Handling state of menu text and action availability
  • Fix entanglement with shallow copying
  • Fix paste overwriting existing data
  • Multi-selection copying now merges all fields of selected entries in the buffer instead of only copying the last entry in the selection, which is now reflected in action command text.

I'll be labeling this as "review needed" to get some extra eyes on these changes. While there can be some funkiness with the copy paste behavior at times, I believe most of that is due to preexisting bugs with the field system and just the general awkwardness of it compared to the upcoming changes to it. If there are any bugs specifically related to my changes here then I'll be happy to address them.

I think the copy/paste actions should also be in the context menu for the ItemThumbs themselves, however I most likely won't be able to implement that until tomorrow.

@CyanVoxel CyanVoxel added the Status: Review Needed A review of this is needed label Jun 14, 2024
@CyanVoxel CyanVoxel removed the Status: Review Needed A review of this is needed label Jul 19, 2024
@CyanVoxel CyanVoxel merged commit aa0aad4 into TagStudioDev:Alpha-v9.4 Jul 19, 2024
4 checks passed
@Creepler13 Creepler13 deleted the Copy-Paste branch July 19, 2024 13:09
CarterPillow pushed a commit to CarterPillow/TagStudio that referenced this pull request Sep 7, 2024
* Fixed merge conflicts

* fixed format?

* Improve readability (Apply suggestions from code review)

Co-authored-by: yed podtrzitko <[email protected]>

* bug fix: Copy last selected not first

* Fix copy entanglement; Fix paste overwriting

* Change multi-selection copy to merge data

- Multi-selection copy now merges fields of all selected entries
- Action states are now handled

---------

Co-authored-by: yed podtrzitko <[email protected]>
Co-authored-by: Travis Abendshien <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

4 participants