-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
feat: Allow to share and view lists on web #3757
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @M123-dev!
I cannot say that it does not work, but there are still pending questions:
- the URL has a limited length - there will be a limited number of products
- potential localization issue - should we add the language, the country?
@M123-dev The localization is problematic, because if I land on an EN page and change the country to France, I land on the French home page (I mean, with the "normal" French products, not the shared products). |
Can you log how often list sharing is used in Matomo ? |
You can get a translated page with URLs like https://world-fr.openfoodfacts.org/products/20442484,8021299992601 or https://world-de.openfoodfacts.org/products/20442484,8021299992601, |
|
||
// TODO(m123): Move this to off-dart | ||
Uri shareProductList(List<String> barcodes) { | ||
final StringBuffer buffer = StringBuffer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not something like
final String commaSeparatedBarcodes = barcodes.join(',');
That's simpler and would get rid of the extra comma at the end.
I just added localization as well as some analytics for it. I initially thought that .getUri already handles localization but it turns out it does not |
What
Allow to share lists with friends, as well as opening it on the web
fixes: #2631
related to: #2627
This will not work with large list (URLs will break when exceeding 2048 characters) but thats the best we can offer right now until we have a better method