Skip to content

Commit

Permalink
Remove Edge as a default product, but add breadcrumb link
Browse files Browse the repository at this point in the history
After a lot of discussion, we have decided to remove Edge as a default
product from wpt.fyi due to overlap in browser engine between Chrome and
Edge. In a perfect world we would invest in per-user default products,
but there is no resourcing for that currently.

To try to minimize the disruption, we add a breadcrumb link back to
easily let users get Edge back on the page.

See #1519
  • Loading branch information
stephenmcgruer committed Mar 26, 2021
1 parent 54954ce commit 007e04f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 0 additions & 2 deletions api/query/atoms.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ import (
"github.com/web-platform-tests/wpt.fyi/shared"
)

var browsers = shared.GetDefaultBrowserNames()

// AbstractQuery is an intermetidate representation of a test results query that
// has not been bound to specific shared.TestRun specs for processing.
type AbstractQuery interface {
Expand Down
4 changes: 2 additions & 2 deletions shared/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
// A list of browsers that are shown on the homepage by default.
// (Must be sorted alphabetically!)
var defaultBrowsers = []string{
"chrome", "edge", "firefox", "safari",
"chrome", "firefox", "safari",
}

// An extra list of known browsers.
var extraBrowsers = []string{
"android_webview", "epiphany", "servo", "uc", "webkitgtk",
"android_webview", "edge", "epiphany", "servo", "uc", "webkitgtk",
}

var allBrowsers mapset.Set
Expand Down
4 changes: 3 additions & 1 deletion webapp/components/product-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const AllBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari', 's
// The list of default browsers used in cases where the user has not otherwise
// chosen a set of browsers (e.g. which browsers to show runs for). Stored as
// an ordered list so that the first entry can be used as a consistent default.
const DefaultBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari']);
//
// This should be kept in sync with defaultBrowsers in shared/browsers.go
const DefaultBrowserNames = Object.freeze(['chrome', 'firefox', 'safari']);
const DefaultProductSpecs = DefaultBrowserNames;

// The above sets, encoded as product objects. This avoids repeatedly calling
Expand Down
19 changes: 19 additions & 0 deletions webapp/views/wpt-app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PathInfo } from '../components/path.js';
import { DefaultBrowserNames } from '../components/product-info.js';
import '../components/test-runs-query-builder.js';
import { TestRunsUIBase } from '../components/test-runs.js';
import '../components/test-search.js';
Expand Down Expand Up @@ -130,6 +131,9 @@ class WPTApp extends PathInfo(WPTFlags(TestRunsUIBase)) {
<template is="dom-if" if="[[!editable]]">
<a href="javascript:window.location.search='';"> (switch to the default product set instead)</a>
</template>
<template is="dom-if" if="[[showAddEdgeBackLink(queryParams)]]">
<a href='#' on-click="addEdgeBack"> (add Microsoft Edge back)</a>
</template>
<wpt-permalinks path="[[path]]"
path-prefix="/[[page]]/"
query-params="[[queryParams]]"
Expand Down Expand Up @@ -386,6 +390,21 @@ class WPTApp extends PathInfo(WPTFlags(TestRunsUIBase)) {
return true;
}

showAddEdgeBackLink(queryParams) {
// We only show the 'add edge' link when the user has originally gone to
// the main page (e.g. just https://wpt.fyi/results). We can detect that by
// checking that no products were specified.
return queryParams.product === undefined;
}

addEdgeBack() {
// Attempt to put Edge back in the place it used to go (next to Chrome),
// but also allow for some change in the default browser set.
const newProducts = [DefaultBrowserNames[0], 'edge', ...DefaultBrowserNames.slice(1)];
this.queryParams.product = newProducts;
this.updateQueryParams(this.queryParams);
}

computeResultsTotalsRangeMessage(page, path, searchResults, shas, productSpecs, from, to, maxCount, labels, master, runIds) {
const msg = super.computeResultsRangeMessage(shas, productSpecs, from, to, maxCount, labels, master, runIds);
if (page === 'results' && searchResults) {
Expand Down

0 comments on commit 007e04f

Please sign in to comment.