pontoon icon indicating copy to clipboard operation
pontoon copied to clipboard

Improve link for notifications of new strings

Open flodolo opened this issue 3 years ago • 2 comments

The original request was to link to the strings added to the project when we send notifications for new strings.

The current implementation links to the project with all-resources/?status=missing%2Cfuzzy, which only satisfies that requirement in one scenario: the project was 100% translated before the new batch of strings, nobody translated those strings in the meantime, there are no new batches of strings after that notification.

In particular, this fails when strings are pre-translated (e.g. Fluent migrations, or strings moving around in the repository).

Maybe naive, but it feels like it should be relatively straightforward to link to the actual batch of strings:

  • If I understand the code, we know when a notification was generated, and when entities were created. So, we could filter by creation date around the time of the notification, give or take a few minutes. It's far from perfect, but it would cover most cases.
  • We could add an additional field to entities (e.g. batch ID), and associate that field to notifications, so it's even easier and more precise to filter them out.

I think it would make sense to make this filter only available via URLs, but not in the UI, to simplify things a bit. In case, people interested would still have the link from their notification to share it with others in the community.

flodolo avatar Jan 13 '22 06:01 flodolo

In https://bugzilla.mozilla.org/show_bug.cgi?id=1693321 we consciously changed the original request to point to missing + unreviewed (later dropped) + fuzzy strings. That's not such a bad compromise, because users usually want to translate untranslated strings regardless of when they were imported.

That said, it would still be more natural (and less surprising for the user) if the notification link pointed to the actual new strings. They are indeed pretty easy to detect - all new strings included in the same notification have the exact same timestamp (they are created using a bulk command).

Note that addressing the problem of strings that are translated during sync (e.g. moved or migrated) is separate from that and is tracked in #2063.

mathjazz avatar Feb 02 '22 15:02 mathjazz

Note that the current implementation still links to the dashboard if the user hasn't set their custom homepage: https://github.com/mozilla/pontoon/pull/1989/files/b404f21cfe312f2020a33265706aad8a56fd00a5#diff-4ebc5e9888b2962aecd470dd76f7d410b4e246f2d8323df57ed7dd0c8d5e3ade

While we agreed checking the custom homepage first is a good idea, I think we should default (in case custom homepage is not set) to the locale-agnostic translate view, rather than to the dashboard.

mathjazz avatar Sep 13 '22 18:09 mathjazz

Filed #2726 to default to the locale-agnostic translate view.

mathjazz avatar Jan 23 '23 23:01 mathjazz