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

Clipboard Setting Issue #786 #790

Closed
wants to merge 6 commits into from

Conversation

aramrw
Copy link

@aramrw aramrw commented Mar 26, 2024

Fixed #786

Regarding search page clipboard text monitoring feature changes.

  • Now only updates if you already have a search window open.
  • No longer needs to also have background clipboard text monitoring enabled for it to update the search window.
  • No longer creates a new search window everytime clipboard changes (unless background clipboard text monitoring is also enabled).

Prop drilling a new boolean variable was the simplest/cleanest way I could implement this feature without refactoring.
This doesn't affect any apis or functions since isShortcut can be undefined.

Regarding background/backend.js 1165 - 1184

  • I believe this is the easiest way to return null without having to update several function variables types.
  • It doesn't create any ghost tabs or allocate anything after testing.

@aramrw aramrw requested a review from a team as a code owner March 26, 2024 00:58
After testing an id of 0 had not caused any problems that I know of, but just to be safe I will change it to 999

Signed-off-by: aramrw <106574385+aramrw@users.noreply.github.com>
@cashewnuttynuts cashewnuttynuts added kind/enhancement The issue or PR is a new feature or request area/ui-ux The issue or PR is related to UI/UX/Design labels Mar 28, 2024
Copy link

github-actions bot commented Apr 10, 2024

⚠️ Visual differences introduced by this PR; please validate if they are desirable.

View Playwright Report (note: open the "playwright-report" artifact)

@StefanVukovic99
Copy link
Member

Screencast.from.04-10-2024.03.00.20.PM.webm

I don't usually use this feature, but it seems to already be working correctly for me? Has anyone reproduced this?

@aramrw
Copy link
Author

aramrw commented Apr 11, 2024

Yomitan.mp4

Maybe you could try with my yomitan settings? Either way there is something broken somewhere, but I think other people should test it as well 👍🏼
yomitan-settings-2024-04-11-04-41-02.json

@Kuuuube
Copy link
Member

Kuuuube commented May 14, 2024

I'm unable to replicate this using those settings using the normal search page.

But I can replicate it like this: Enable background clipboard text monitoring -> copy something (new window pops up) -> turn off Enable background clipboard text monitoring -> copy something. The second copy doesn't make it through on master but does with this pr.

Is there a way to open that special search page without having to enable Enable background clipboard text monitoring first?

@@ -1303,7 +1327,7 @@ export class Backend {

this._mecab.setEnabled(options.parsing.enableMecabParser && enabled);

if (options.clipboard.enableBackgroundMonitor && enabled) {
if ((options.clipboard.enableBackgroundMonitor || options.clipboard.enableSearchPageMonitor) && enabled) {
Copy link
Member

Choose a reason for hiding this comment

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

This change seems fine and good but I'm not sure about the rest of this pr. Can't replicate the issue you're mentioning at all.

This bit "No longer creates a new search window everytime clipboard changes (unless background clipboard text monitoring is also enabled)." seems to already be how Yomitan works.

I would be okay with approving and getting this merged with only this one line changed. Maybe split the rest into a separate pr and try to provide some steps for reproducing the issue.

Copy link
Author

Choose a reason for hiding this comment

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

This bit "No longer creates a new search window everytime clipboard changes (unless background clipboard text monitoring is also enabled)." seems to already be how Yomitan works.

That is actually not true. I just tested it by cloning and only adding the if statement part and it does in fact create a new popup every time with only the search page clipboard text monitoring being enabled, it's only supposed to update the search page if one is open, not create a new one (unless background clipboard text monitoring) is enabled.

Not only that, even with that if statement, background clipboard text monitoring does all the work, you don't even need to have search page clipboard text monitoring enabled for it to update the search page, so basically it's useless.

In my pr, the enable cb monitor if either cb setting === true commit does not disable making a brand new popup every time if one is not open (which is the main problem), it only give it permission to update the search without needing the first option to be enabled.

Is there a way to open that special search page without having to enable Enable background clipboard text monitoring first?

Yes, under Native Keyboard Shortcuts -> Open the popup window. But that doesn't change anything, it still creates a new popup every time, because the logic in backend.js has no other choice. That's the whole reason I made the ghost tab.

The rest of my pr allows the second option, instead of creating a new search tab popup, to create a fake tab if none exist, or update the search page if one does.

I believe this was the intended feature of that second option..? However as I mentioned before, it currently does nothing...

I would be okay with approving and getting this merged with only this one line changed. Maybe split the rest into a separate pr and try to provide some steps for reproducing the issue.

As for this, there's not much else I can do on my end, If you have doubts I can go and get some more users to go upvote / give further evidence in the issue that I made.

As I showed in the video, I am on the latest version + chrome (tried right now, it still doesn't work for me), with default settings, and also by cloning this repo and only adding that if statement (default settings). Same issue, that video is still accurate as of right now.

I would like more developers to test this before my pr gets discarded, as I can't be the only person experiencing this issue, that doesn't make any sense.

I will try to get some regular users to try it and see what's going on for them as well. 👍🏼

Copy link
Member

Choose a reason for hiding this comment

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

I just tested this again to sanity check and yeah just including this one line doesn't look like a good idea. I still can't replicate any of the other issues though.

I think the issue you're having needs a step by step reproduction process starting from Yomitan set to default settings.

Copy link
Author

Choose a reason for hiding this comment

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

Steps

  1. Reset Yomitan settings.
  2. Only Turn on search page clipboard text monitoring.
  1. Copy a word to clipboard... -> Nothing happens.
  2. Turn off search page clipboard text monitoring.
  3. Only turn on background clipboard text monitoring`.
  1. Copy a word to clipboard... -> Search popup gets updated.

Chrome Extension Video Details 5/27/2024.

  • Yomitan v24.5.14.1 from Google Chrome Store (Default Settings).
  • Google Chrome v125.0.6422.112 (Official Build) (64 bit)

Also Tested on

  • Microsoft Edge v126.0.2592.13 (Official Build) beta (64 bit)

Chrome Extension Video Evidence

Desktop.2024.05.27.-.15.online-video-cutter.com.mp4
  • I also tested this by cloning the Github repo, it does the exact same thing shown in the Chrome Extension Video.

@Kuuuube
Copy link
Member

Kuuuube commented May 28, 2024

Thank you for the thorough explanation and example of the issue. I think I see what's going wrong here. Can you test if #1003 fixes the issues?

I think you're fixing the wrong issue to fix your issue here.

@aramrw
Copy link
Author

aramrw commented May 28, 2024

perfect thanks 👍🏼 that fixed it

@Kuuuube
Copy link
Member

Kuuuube commented May 28, 2024

Closing in favor of #1003

@Kuuuube Kuuuube closed this May 28, 2024
@aramrw aramrw deleted the clipboard-setting-issue-786 branch June 3, 2024 02:48
@aramrw aramrw restored the clipboard-setting-issue-786 branch June 3, 2024 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-ux The issue or PR is related to UI/UX/Design kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clipboard Text Setting Bug?
4 participants