Implement "New" badge logic for the visual search/Google Lens context menu item
Categories
(Firefox :: Search, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: adw, Assigned: adw)
References
Details
(Whiteboard: [sng])
Attachments
(1 file)
Implement the "New" badge logic for the visual search context menu item.
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
This adds a helper to nsContextMenu that shows or hides the "New" badge for a
given menuitem, so we can use it for any item in the content context menu.
As with the Perplexity badge in D253104, I don't see a way around having to
manually fetch the "New" l10n string from Fluent. It would be nice to be able to
use a string with the .badge attribute instead, but there's no way to do that
without duplicating the main menuitem string ("Search Image") so that there's a
version with the attribute and a version without the attribute. And that doesn't
scale anyway. It would be nice if there were a way to merge Fluent strings so
you could add attributes from one string to another.
I added nsISearchEngine.isNewEngineOrURL(), which can take an optional URL
arg, analogous to how the recently added displayNameForURL() can take an
optional URL. "isNewEngineOrURL" is more awkward as a name though. It might make
sense to split it into two functions, isNewEngine() and isNewURL().
This does not update search-config-v2-schema.json because I'm planning to do
that when I vendor the related app-services change.
Depends on D258655
Comment 3•1 year ago
|
||
| bugherder | ||
Description
•