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

highlight+copy barcode straight from OFF page to OP search box results in Product not found - transit via textfile works #574

Open
serpico opened this issue May 8, 2024 · 11 comments

Comments

@serpico
Copy link

serpico commented May 8, 2024

Epic: #

Description

  1. start at https://world.openfoodfacts.org/product/7622210796301/monaco-biscuits-crackers-a-l-emmental-belin
  2. highlight EAN after Barcode: ( located above quantity: 100g ) via double-click
  3. copy EAN via right-click and contextual menu
  4. paste EAN
  5. Product not found in Open Food Facts... Don't hesitate to add it :)

repeat steps 1 to 3 but paste into a text editor ( gedit in my case ), highlight and copy from there, product is found.

Same thing happen when you want to copy EAN from OFF page to add a new product

Looks like there's a space added in front of the EAN

@raphodn
Copy link
Member

raphodn commented May 8, 2024

Where are you pasting the EAN ?

@serpico
Copy link
Author

serpico commented May 8, 2024

Sorry, in the OP search box see attachment

searchbox

@raphodn
Copy link
Member

raphodn commented May 8, 2024

ok ! I'll be on holidays for the next few days.
btw are you on the OFF Slack ? We have a #prices channel ;)

@raphodn
Copy link
Member

raphodn commented May 22, 2024

On my laptop I can't seem to reproduce 🤔
Are you on mobile ?

@raphodn
Copy link
Member

raphodn commented May 22, 2024

One solution would be to strip spaces when searching (remove any space at the start and at the end of the text)

@serpico
Copy link
Author

serpico commented May 22, 2024

On my laptop I can't seem to reproduce 🤔 Are you on mobile ?

I first noticed the problem when copying from a tab OFF's website on my laptop to the searchbox on OP's searchbox on the webapp on mobile ( using KDE connect's clipboard sharing feature). After this message I tried while staying on the laptop, copy from one tab with OFF's website to the next tab containing OP's webapp searchbox but the behavior was the same.

@serpico
Copy link
Author

serpico commented May 22, 2024

One solution would be to strip spaces when searching (remove any space at the start and at the end of the text)

If it's a quick fix to go that way ( a few lines of code ) I'd appreciate if we could give this a try and if it doesn't work we'll move on, either close the issue or keep it for reference but without plan to dig deeper until someone else report it.

@raphodn
Copy link
Member

raphodn commented May 22, 2024

Could you try on a phone ? Or on another laptop ? Or send a video ?

I can't reproduce, so it could come from your OS.. ?

@serpico
Copy link
Author

serpico commented May 23, 2024

here's a video entirely on a mobile phone

https://transfert.free.fr/8gpgVe1

I'll try all on a windows laptop soon and report

PS: I tried to upload the file here on github but it was > 10MB, used ffmpeg to get it down to 2.5 then there was a message about mime type...

@raphodn
Copy link
Member

raphodn commented May 23, 2024

Thanks a lot for the video !

So i did some tests, and dug inside the code

Could you try to test again in the staging environment ? https://prices.openfoodfacts.net/app/

@serpico
Copy link
Author

serpico commented May 23, 2024

Thank you to keep trying!!! ( I realize it's kinda trivial and related to my workflow 😄 )

All the following was done on desktop laptop.(edited)

It seems the problem comes from the "copying from OFF" part as :
when I select and copy the EAN and see this ( a screenshot I took from OFF )
testnospace
I'm thinking, ok only the selected/highlighted part is being copied (so there will be no space).
However when I paste on a text editor the "problematic" space before the EAN is already there (as it would be if I pasted on the OP searchbox).

Is it the same behavior on your machine?

PS: I noticed a change, my screenshoter allows me to draw a zone to screenshot.

  • If the EAN string begins with the space it will disappear as soon as I activate the "draw" mode (but the EAN is still screenshot somehow in the resulting file).

  • If the EAN string is "conform" ( no space, copied "cleanly" from a text editor for example ) it doesn't disappear ( no change whether the draw mode is activated or not ).

Before it was the same in both case, space or no space, there was no "disappearance" whether the draw mode was activated or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants