Fix a bug where VS Code's eslint integration does not work for the
newtab project because of a conflict caused by sass-lint's eslint
dependency. Switching over to stylelint eliminates that dependency and
generally modernizes our SCSS linting. stylelint doesn't have a 1 to 1
replacement for every sass-lint rule, so a few rules have been changed.
Differential Revision: https://phabricator.services.mozilla.com/D173605
Add some properties to the migration wizard screen JSON to specify what
action to perform when CTAs inside the embedded migration wizard are
clicked. This lets us advance screens when the cancel or finish button
is clicked, and send telemetry when the start button is clicked. In
theory we could perform any special message actions too, but for now we
only need telemetry and screen navigation.
Differential Revision: https://phabricator.services.mozilla.com/D176358
This patch restores link underlines in the new tab page, particularly the settings page and discovery stream (top sites, pocket tiles, and recent activity). Only links that had underlines on hover were updated. `text-decoration: none` is added for cards to maintain original styling.
Differential Revision: https://phabricator.services.mozilla.com/D176819
Significant portions of this were written by Shane Hughes <shughes@mozilla.com> -
specifically the parts that move the Firefox Account sign-in flow for tabs into
a SpecialMessageAction, and making AboutWelcomeUtils.handleUserAction return
a Promise.
Differential Revision: https://phabricator.services.mozilla.com/D176453
Significant portions of this were written by Shane Hughes <shughes@mozilla.com> -
specifically the parts that move the Firefox Account sign-in flow for tabs into
a SpecialMessageAction, and making AboutWelcomeUtils.handleUserAction return
a Promise.
Differential Revision: https://phabricator.services.mozilla.com/D176453
about:welcome checkboxes can now set an `checkedAction` and an
`uncheckedAction`, which will occur when the checkbox is checked or unchecked,
respectively, and the primary button is clicked.
The old `action` parameter is still supported for backwards compatability, but
`checkedAction` takes precedence.
Differential Revision: https://phabricator.services.mozilla.com/D174192
This adds a card to the about:welcome defaults that embeds the new Migration Wizard
if browser.migrate.content-modal.about-welcome-behavior is set to "embedded".
This requires adding a useEmbeddedMigrationWizard targeting attribute to
ASRouterTargeting.
Differential Revision: https://phabricator.services.mozilla.com/D175945
This commit:
* Adds a `position` key to the `topsites.{impression, click}` events.
This position is zero-based, to align with `pocket_position`.
* Refactors the impression stats actions in `TelemetryFeed` to receive
the zero-based tile position, and adds one to the structured
ingestion payloads and scalar values.
* Adds a new Glean metric, `topsites.rows`, to record the number of
rows shown on the New Tab page.
Differential Revision: https://phabricator.services.mozilla.com/D172292
Add logic to apply theme colors to Feature Callout based on where it's
going to show. We can use in-content CSS properties for Firefox View and
other themed system pages, but not for PDF.js, nor for any callouts we
might show in the browser chrome in the future. For the browser chrome
in general, we can use the lightweight theme properties directly, in the
same way the chrome frontend does. But PDF.js is a special case, since
although it exists in the chrome, it's meant to appear like it's in the
PDF.js viewer. And the PDF.js viewer has its own theme totally
independent of everything else. So this dynamically applies themes from
different sources.
This also fixes the bug where the PDF.js color scheme could mismatch the
PDF.js viewer if the browser theme and system color scheme don't match,
e.g. where system color scheme is light but a dark theme is installed,
or vice versa. For PDF.js specifically, we can use the
-moz-content-prefers-color-scheme media query to follow the color scheme
as it exists in the PDF.js viewer page instead of the color scheme in
the chrome window where the Feature Callout actually exists.
It also adds or modifies some colors that were previously missing or
different from the prototype, fixes the illegibility of buttons in HCM
and forced colors mode, and makes some other minor color changes.
Differential Revision: https://phabricator.services.mozilla.com/D173088
Add logic to apply theme colors to Feature Callout based on where it's
going to show. We can use in-content CSS properties for Firefox View and
other themed system pages, but not for PDF.js, nor for any callouts we
might show in the browser chrome in the future. For the browser chrome
in general, we can use the lightweight theme properties directly, in the
same way the chrome frontend does. But PDF.js is a special case, since
although it exists in the chrome, it's meant to appear like it's in the
PDF.js viewer. And the PDF.js viewer has its own theme totally
independent of everything else. So this dynamically applies themes from
different sources.
This also fixes the bug where the PDF.js color scheme could mismatch the
PDF.js viewer if the browser theme and system color scheme don't match,
e.g. where system color scheme is light but a dark theme is installed,
or vice versa. For PDF.js specifically, we can use the
-moz-content-prefers-color-scheme media query to follow the color scheme
as it exists in the PDF.js viewer page instead of the color scheme in
the chrome window where the Feature Callout actually exists.
It also adds or modifies some colors that were previously missing or
different from the prototype, fixes the illegibility of buttons in HCM
and forced colors mode, and makes some other minor color changes.
Differential Revision: https://phabricator.services.mozilla.com/D173088
The schema still imposes the following restrictions:
- Having "template" present makes "content" and "id" required.
- Having "content" present makes "template" and "id" required.
Template and content are dependent on eachother because we do not know how to
interpret content without a template and we a template with no content to
interpret is useless.
If we have a template and content, then we also need an ID for the message
because we cannot reference the message content except by its ID.
Differential Revision: https://phabricator.services.mozilla.com/D172458
The schema still imposes the following restrictions:
- Having "template" present makes "content" and "id" required.
- Having "content" present makes "template" and "id" required.
Template and content are dependent on eachother because we do not know how to
interpret content without a template and we a template with no content to
interpret is useless.
If we have a template and content, then we also need an ID for the message
because we cannot reference the message content except by its ID.
Differential Revision: https://phabricator.services.mozilla.com/D172458
The schema still imposes the following restrictions:
- Having "template" present makes "content" and "id" required.
- Having "content" present makes "template" and "id" required.
Template and content are dependent on eachother because we do not know how to
interpret content without a template and we a template with no content to
interpret is useless.
If we have a template and content, then we also need an ID for the message
because we cannot reference the message content except by its ID.
Differential Revision: https://phabricator.services.mozilla.com/D172458
Currently, the Glean `newtab` ping and legacy scalars collect
impressions and clicks for sponsored (Pocket and Contile) tiles, but
not organic tiles from Places.
This commit adds:
* Support for recording organic impressions to the
`TopSiteImpressionWrapper` component.
* Support for recording organic clicks to the `TopSiteLink`
component.
* Instrumentation for recording organic impressions and clicks,
separate from sponsored ones, to `TelemetryFeed`.
Differential Revision: https://phabricator.services.mozilla.com/D171830
This also fixes a bug in ASRouter devtools that prevented evaluation of
expressions containing nested promises. Objects containing promises are now
correctly serialized to the ASRouter devtools and expressions evaluate
correctly.
Differential Revision: https://phabricator.services.mozilla.com/D169408
This also fixes a bug in ASRouter devtools that prevented evaluation of
expressions containing nested promises. Objects containing promises are now
correctly serialized to the ASRouter devtools and expressions evaluate
correctly.
Differential Revision: https://phabricator.services.mozilla.com/D169408
Fixes the border radius and color/style of the outline applied to
feature callouts when they are focused. Also applies the focus ring to
the callout's arrow with some CSS changes.
Differential Revision: https://phabricator.services.mozilla.com/D170524
Fixes the border radius and color/style of the outline applied to
feature callouts when they are focused. Also applies the focus ring to
the callout's arrow with some CSS changes.
Differential Revision: https://phabricator.services.mozilla.com/D170524
Remove all the transition-in and transition-out animations from the
Spotlight dismiss button, leaving the dialog-initial and dialog-last
animations, anticipating that all our messages will either have a
dismiss button on every screen or on none of the screens.
Differential Revision: https://phabricator.services.mozilla.com/D170527
This patch does two things:
1. Brings focus into the add/edit top site dialogs when they are opened.
2. Sets the `aria-haspopup=dialog` attribute on the buttons that open the dialogs. This helps assistive technologies announce that a dialog is being opened before it opens.
Differential Revision: https://phabricator.services.mozilla.com/D168564
Adds new "dismiss" about:welcome action that can be used to close Spotlight modals, sending a DISMISS telemetry ping.
This will allow us to configure buttons permitting a user to exit a multistage Spotlight modal on any screen (currently we can only do this for the last screen and for single screen messages).
Depends on D165254
Differential Revision: https://phabricator.services.mozilla.com/D165981
Unify the values of "source" and "page" as used in FeatureCallout.sys.mjs:
- Explicitly pass in a value for "page" when instantiating a Feature Callout and use this for the value of "page" when sending Feature Callout telemetry and as the "source" when making calls to `sendTriggerMessage`. This avoids the risk of including non-about: page URLs or PDF file extensions in our telemetry.
- Set the value of "page" in an HTML data attribute that can be accessed for use in about:welcome telemetry for Spotlight and Feature Callouts.
- Update references to the page value previously used as the page/source for telemetry from `about:firefoxview` Feature Callouts from "firefoxview" to "about:firefoxview"
- Pass the token "chrome" when creating a callout from the browser chrome and update references to the source in PDF.js messages' targeting
- Update the page value expected in automated tests as needed
Differential Revision: https://phabricator.services.mozilla.com/D165910
This patch accomplishes a couple different things in one go.
about:welcome has a feature to allow switching screens by history
navigation. But the screen transitions don't play in that case. There
was also an issue (see bug 1804098) where rounding inconsistencies could
cause 1px gaps to appear in the animated progress bar, because of the
use of transform. By converting the progress bar into a single element
and just modulating its width, we can stop using transform and also
enable transitions for history navigation. Technically, this also allows
us to advance by more than 1 screen without messing up the animations,
though this is not currently used. Incidentally, it simplifies the CSS.
Differential Revision: https://phabricator.services.mozilla.com/D164310
Modify the enzyme assertions in unit tests so they can fail when
regressed. Update the same tests since now they would fail otherwise.
One of them also required fixing a bug in MSLocalized.jsx.
Differential Revision: https://phabricator.services.mozilla.com/D164403
This patch accomplishes a couple different things in one go.
about:welcome has a feature to allow switching screens by history
navigation. But the screen transitions don't play in that case. There
was also an issue (see bug 1804098) where rounding inconsistencies could
cause 1px gaps to appear in the animated progress bar, because of the
use of transform. By converting the progress bar into a single element
and just modulating its width, we can stop using transform and also
enable transitions for history navigation. Technically, this also allows
us to advance by more than 1 screen without messing up the animations,
though this is not currently used. Incidentally, it simplifies the CSS.
Differential Revision: https://phabricator.services.mozilla.com/D164310
ASRouter's remote message providers were written to include a property
to specify the desired collection on the Remote Settings Kinto server.
But this property was mistakenly labeled `bucket` in many places. This
could be confusing because Kinto storage is organized by both buckets
and collections, with buckets being a higher level of organization and
collections belonging to buckets. Each individual message provider
specifies a collection like "cfr", while the bucket is set by the router
code ("main"). This carried over to everything that interacted with the
providers, so this patch effectively replaces every reference to a
"message provider bucket" with "message provider collection." But more
importantly, provider definitions are stored as JSON strings in
preference values, so these definitions erroneously contained key-value
pairs like `bucket: "cfr"` which should have been `collection: "cfr"`.
That means the pref values themselves must be migrated to ensure that
modified prefs continue to work. Existing tests are updated and a new
test is added for the migrator, to meet minimum coverage requirements.
Documentation is also updated to reflect the correct property name.
Differential Revision: https://phabricator.services.mozilla.com/D162067
Because of the `::before` element which requires a z-index of 1 to render the box-shadow, it was causing links to be unclickable/behind the element. By adding `pointer-events: none` to the pseudo element, it is possible to click through the elements again/interact with the `<a>` tag
Differential Revision: https://phabricator.services.mozilla.com/D162226
Update Feature Callout code to ensure styling is the same in browser chrome as it is when used in content pages such as Firefox View.
Differential Revision: https://phabricator.services.mozilla.com/D159598
The Sign In button on about:welcome is currently hidden when it would
overlap with the screen. This patch changes the CSS so that instead of
hiding it, we reposition it when it would overlap, aligning it to the
top right of the screen.
Differential Revision: https://phabricator.services.mozilla.com/D158207
Also define explicit HCM color rules for headings in the secondary section of
split screens to fulfill minimum contrast guidelines.
Differential Revision: https://phabricator.services.mozilla.com/D158512