Closed Bug 2087591 Opened 17 days ago Closed 13 days ago

Allow widget registry entries to add items to their card menu

Categories

(Firefox :: Widgets, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: mconley, Assigned: mconley, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [hnt][hnt-wattle])

Attachments

(1 external file)

Widget registry entries have no way to add their own items to the menu of the card that MozWidgetCard draws for them. That menu only holds the shared widget items (hide, move, change size, learn more).

This adds an optional menu field to WidgetRegistryEntry, holding WidgetMenuItems that MozWidgetCard draws above the shared items:

  • A "choice" item is a submenu of checkable options. The chosen value is stored in a pref (the first option counts as chosen until one is picked), recorded as a change_<id> widget user event, and passed to the widget's document as an id=value parameter in its URL fragment, so the document can switch views without reloading.
  • An "action" item runs one of a fixed set of host actions New Tab supports. The only one so far is "show-customize", which opens the Customize panel.

useSizeSubmenu gains an optional dataset key so choice submenus can reuse it.

The Wrexham AFC widget (bug 2087516) needs this for its "View" (Matches, Table, Fixtures) and "Wallpapers" menu items.

Bug 2083852 plans to let extension widgets define menu items through the extension context menu. This is complementary: it covers widgets defined in the registry, including ones that have no extension.

MozWidgetCard draws an entry's menu items above the shared items. A "choice"
item is a submenu of checkable options whose value is stored in a pref and
passed to the widget's document in its URL fragment; an "action" item runs a
host action, of which "show-customize" is the only one. No registry entry has
a menu yet.

Assignee: nobody → mconley
Attachment #9671809 - Attachment description: WIP: Bug 2087591 - Allow New Tab widget registry entries to add items to their card menu. r?fchasen! → Bug 2087591 - Allow New Tab widget registry entries to add items to their card menu. r?fchasen!
Status: NEW → ASSIGNED
Pushed by mconley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/744459603b08 https://hg.mozilla.org/integration/autoland/rev/c34d0393af9d Allow New Tab widget registry entries to add items to their card menu. r=fchasen

Backed out for causing failure @ browser_wrexhamafc_widget.js

Backout link

Push with failures

Failure log

Flags: needinfo?(mconley)
Pushed by mconley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a3fc0af69f94 https://hg.mozilla.org/integration/autoland/rev/a554f7ee29c7 Allow New Tab widget registry entries to add items to their card menu. r=fchasen
Status: ASSIGNED → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: