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 calculator search result to clipboard #4798

Open
wants to merge 6 commits into
base: 14-dev
Choose a base branch
from

Conversation

tgex0
Copy link
Contributor

@tgex0 tgex0 commented Sep 11, 2024

Description

New feature to copy the calculator search result to the clipboard (by just tapping the calculator search result tile).

Fixes #4729

TODO

1. Revert icon to regular calculator.xml (reference in SearchTargetFactory.kt)
2. Add ic_copy.xml icon to right-hand side of calculator search result tile

Type of change

❌ General change (non-breaking change that doesn't fit the below categories like copyediting)
❌ Bug fix (non-breaking change which fixes an issue)
✅ New feature (non-breaking change which adds functionality)
❌ Breaking change (fix or feature that would cause existing functionality to not work as expected)

@tgex0
Copy link
Contributor Author

tgex0 commented Sep 11, 2024

Basic functionality works fine but there is no indication that tapping the tile will copy the result to the clipboard. Maybe this is fine as it is.

Rather than adding text somewhere or a further icon, I thought the least intrusive solution might be to change the calculator icon to a combo calculator/copy-to-clipboard icon. Something like this:

icon

Please let me know what you think. Thanks.

@SuperDragonXD
Copy link
Collaborator

I'd suggest to add an icon to copy the result to the clipboard (at the right side), as it makes it significantly clear that you can copy the result.

@tgex0
Copy link
Contributor Author

tgex0 commented Sep 12, 2024

I agree but, unfortunately, I could not figure out how to do that.

@SuperDragonXD
Copy link
Collaborator

I guess we can make the icon a temporary solution as of now (make sure to mark it as TODO).

@tgex0
Copy link
Contributor Author

tgex0 commented Sep 12, 2024

OK, I've added and implemented the new combo icon and added a TODO in this PR's description.

@tgex0
Copy link
Contributor Author

tgex0 commented Sep 12, 2024

I'll leave this in draft mode as I need to fix the icon...

@tgex0
Copy link
Contributor Author

tgex0 commented Sep 12, 2024

Icon is probably OK. I think the problem I experienced with it may be due to #4807.

@tgex0
Copy link
Contributor Author

tgex0 commented Sep 13, 2024

Icon not displaying correctly (in Dark theme) is due to #4813. (No problem with icon. Problem was with backup file.)

@tgex0
Copy link
Contributor Author

tgex0 commented Sep 15, 2024

TODO tasks complete.

@tgex0 tgex0 marked this pull request as ready for review September 15, 2024 17:45
Copy link
Collaborator

@SuperDragonXD SuperDragonXD left a comment

Choose a reason for hiding this comment

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

Hello again, and thanks for your patience.

While this solution isn't exactly elegant, it works for the purpose of showing single that the text is copyable. I'd probably refactor this (alongside other related code) after some time.

@tgex0
Copy link
Contributor Author

tgex0 commented Oct 10, 2024

Just for clarification, I was able to include the regular clipboard icon at the right-hand side of the calculator results tile as you suggested (via a new layout) and the current PR reflects this. I reverted the calculator icon to the original one.

Screenshot

I hope that's OK.

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.

[FEATURE] Calculator copy on interaction
2 participants