This patch adds the following Firefox Labs telemetry:
* toggle_button_pressed w/slug_id and enabled - the user interacted with the toggle button on an item
* toggled_dialog - w/slug_id did_user_confirm the dialog was accepted on items requiring restart
* restore_defaults_button_pressed - the user interacted with the restore button
* restore_defaults_dialog w/items_changed_count and did_user_confirm - the user confirmed the restart
Differential Revision: https://phabricator.services.mozilla.com/D305929
This patch adds the following Firefox Labs telemetry:
* share_feedback_opened w/slug_id - the user clicked the share feedback link on a Labs item
* empty_state_shown - the empty state was shown, no Labs items active
Differential Revision: https://phabricator.services.mozilla.com/D305730
Introduces a shared React hook for function-component newtab widgets so
they stop hand-building telemetry payloads. The hook covers all four
widget telemetry action types (WIDGETS_IMPRESSION, WIDGETS_USER_EVENT,
WIDGETS_ENABLED, WIDGETS_ERROR), reads widget_name from the widget's
WIDGET_REGISTRY entry, and tracks widget_size via a ref so dispatches
always reflect the latest value (with per-call override).
API:
- impressionRef: callback ref. Observes on assignment so widgets that
conditionally render the target still get observed.
- recordImpression({ size }): manual one-shot fire sharing the observer's
impressionFired guard.
- recordUserAction(action, { source, value, size, alsoToMain, legacy }):
alsoToMain switches routing from OnlyToMain to AlsoToMain (for the
Lists task-complete path); legacy co-dispatches a configured
legacyUserEventType with { userAction }.
- recordEnabled(enabled, { source, size })
- recordError(errorType, { size })
Constructor options legacyImpressionTypes (array) and legacyUserEventType
bridge the Bug 2012779 transition: while WIDGETS_TIMER_* / WIDGETS_LISTS_*
legacy events still exist alongside the unified events, FocusTimer and
Lists pass the matching legacy action types so the hook emits both.
Co-dispatches fire legacy first, unified second to match the pre-hook
dispatch order.
Scope: function-component widgets under content-src/components/Widgets/.
The class-based mini Weather at content-src/components/Weather/Weather.jsx
is intentionally out of scope - its legacy WEATHER_* actions with custom
payloads would require a non-hook payload helper.
No callers yet; webpack drops the hook from the bundle until a widget
imports it. Bundle is unchanged in this commit. Widget migrations follow
in separate commits.
Differential Revision: https://phabricator.services.mozilla.com/D300850
Guard the hw_frames_ctx dereference in GetVideoFrameSurface before reading
hwdeviceType. On the Vulkan direct-export path, frameForPool is a fresh
av_frame_alloc() populated by av_hwframe_map(), which does not set
hw_frames_ctx, causing a null dereference. The deref is used only for
diagnostic logging, so initialise hwdeviceType to AV_HWDEVICE_TYPE_NONE
and skip the lookup when hw_frames_ctx is null.
Differential Revision: https://phabricator.services.mozilla.com/D306411
Guard the hw_frames_ctx dereference in FFmpegDescToVA inside the
non-DRM_PRIME branch. V4L2 frames have a null hw_frames_ctx, so when
CreateImageV4L2 calls GetVideoFrameSurface with a non-DRM_PRIME format
the unconditional deref crashes at address 0x8. The deref is used only
for diagnostic logging so skip it when hw_frames_ctx is null.
Differential Revision: https://phabricator.services.mozilla.com/D306435
PollXInput passed the mGamepads array index to XInputGetState instead of
the device's stored XInput user index. With a single controller these
coincide, but when a DirectInput/raw-input device occupies an earlier array
slot (e.g. a Logitech pad in DirectInput mode alongside an Xbox 360), the
XInput controller's array index no longer matches its XInput slot. After
unplug/replug, array compaction shifts indices and the XInput controller
gets polled on the wrong slot, so it stops reporting input.
Differential Revision: https://phabricator.services.mozilla.com/D306166
The refresh button's only feedback was its disabled state. Spin the icon on click so the action reads as "working": start on click, stop when fresh /live data lands, with a 2s minimum so a fast response doesn't flicker and the 15s cooldown as a safety cap. Gated behind prefers-reduced-motion.
Differential Revision: https://phabricator.services.mozilla.com/D306453
Displays the Nova iconography when `browser.nova.enabled` is true.
Updates 7 existing add-ons icons with the following approach:
1. wraps the existing <path>(s) in a `<g class="proton">`
2. appends the Nova redrawn icon's <path>(s) in a `<g class="nova">`
3. adds a <style> block with rules to show only one group at a time
This is an unorthodox approach. It has several drawbacks:
1. increases individual SVG size
2. increases the time required to render each SVG
3. viewing the SVGs in normal image tools will only show the Proton variant, which is confusing
However, I think this approach is better than alternatives.
1. do not need to add new Nova icon files and CSS rules to use them conditionally
2. SVG uses in XHTML and similar contexts doesn't require special handling
3. this can be undone very easily after Nova is released, leaving only the Nova paths
4. the SVG rendering performance impact is not large, and alternatives would still have non-zero performance impact
5. total size of SVGs is not that much larger than if we added separate Nova icons
Differential Revision: https://phabricator.services.mozilla.com/D301967
Displays the Nova iconography when `browser.nova.enabled` is true.
Updates 2 existing form autofill icons with the following approach:
1. wraps the existing <path>(s) in a `<g class="proton">`
2. appends the Nova redrawn icon's <path>(s) in a `<g class="nova">`
3. adds a <style> block with rules to show only one group at a time
This is an unorthodox approach. It has several drawbacks:
1. increases individual SVG size
2. increases the time required to render each SVG
3. viewing the SVGs in normal image tools will only show the Proton variant, which is confusing
However, I think this approach is better than alternatives.
1. do not need to add new Nova icon files and CSS rules to use them conditionally
2. SVG uses in XHTML and similar contexts doesn't require special handling
3. this can be undone very easily after Nova is released, leaving only the Nova paths
4. the SVG rendering performance impact is not large, and alternatives would still have non-zero performance impact
5. total size of SVGs is not that much larger than if we added separate Nova icons
Differential Revision: https://phabricator.services.mozilla.com/D301966
Displays the Nova iconography when `browser.nova.enabled` is true.
Updates 1 existing ip-protection icon with the following approach:
1. wraps the existing <path>(s) in a `<g class="proton">`
2. appends the Nova redrawn icon's <path>(s) in a `<g class="nova">`
3. adds a <style> block with rules to show only one group at a time
This is an unorthodox approach. It has several drawbacks:
1. increases individual SVG size
2. increases the time required to render each SVG
3. viewing the SVGs in normal image tools will only show the Proton variant, which is confusing
However, I think this approach is better than alternatives.
1. do not need to add new Nova icon files and CSS rules to use them conditionally
2. SVG uses in XHTML and similar contexts doesn't require special handling
3. this can be undone very easily after Nova is released, leaving only the Nova paths
4. the SVG rendering performance impact is not large, and alternatives would still have non-zero performance impact
5. total size of SVGs is not that much larger than if we added separate Nova icons
Differential Revision: https://phabricator.services.mozilla.com/D301965
Add purple gradient border to new chat and close sidebar buttons (inside the smart window chat content) on both default and hover/active states.
Differential Revision: https://phabricator.services.mozilla.com/D306249
InflateUTF8StringHelper used a hand-rolled byte-by-byte decoder that
walked the input twice: a counting pass to compute the output length and
a copy pass to emit the chars. Route the char16_t case through a new
InflateUTF8ToNewTwoByteCharsZ helper that allocates srclen + 1 char16_t
and runs a single SIMD pass via encoding_rs
(mozilla::ConvertUtf8toUtf16{,WithoutReplacement}). On invalid UTF-8 in
Throw mode, fall back to the slow validator just to preserve the precise
byte-offset error report. The Latin1 path is unchanged.
This speeds up IOUtils::JsBuffer::IntoString by around 2.5x, so it should
speed up session restore.
Before: https://share.firefox.dev/3POjZVq
After: https://share.firefox.dev/4o5j5AE
Differential Revision: https://phabricator.services.mozilla.com/D303498
Adds localised text across the Sports widget's three tabs. The Now tab footer shows "Half time" or "Extra time" for live matches in those states. The Results tab footer shows "Full time" by default, with "• Penalties" added when the match was decided on penalties. The Upcoming tab badge replaces the kickoff time with "Delayed", "Postponed", "Suspended", or "Cancelled" when the status calls for it.
The Results tab always shows one of the localised strings (defaulting to "Full time" for any value that isn't mapped) per the Figma design - before, an unrecognised status would show through as raw text. The Upcoming tab also accepts both "cancelled" (British) and "canceled" (American) spellings, since the API [apparently uses the American form](https://github.com/mozilla-services/merino-py/blob/main/merino/providers/suggest/sports/backends/sportsdata/common/__init__.py#L20).
Differential Revision: https://phabricator.services.mozilla.com/D304294