Skip to content

Commit 007e04f

Browse files
Remove Edge as a default product, but add breadcrumb link
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
1 parent 54954ce commit 007e04f

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

api/query/atoms.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ import (
4545
"github.com/web-platform-tests/wpt.fyi/shared"
4646
)
4747

48-
var browsers = shared.GetDefaultBrowserNames()
49-
5048
// AbstractQuery is an intermetidate representation of a test results query that
5149
// has not been bound to specific shared.TestRun specs for processing.
5250
type AbstractQuery interface {

shared/browsers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
// A list of browsers that are shown on the homepage by default.
1010
// (Must be sorted alphabetically!)
1111
var defaultBrowsers = []string{
12-
"chrome", "edge", "firefox", "safari",
12+
"chrome", "firefox", "safari",
1313
}
1414

1515
// An extra list of known browsers.
1616
var extraBrowsers = []string{
17-
"android_webview", "epiphany", "servo", "uc", "webkitgtk",
17+
"android_webview", "edge", "epiphany", "servo", "uc", "webkitgtk",
1818
}
1919

2020
var allBrowsers mapset.Set

webapp/components/product-info.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ const AllBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari', 's
4242
// The list of default browsers used in cases where the user has not otherwise
4343
// chosen a set of browsers (e.g. which browsers to show runs for). Stored as
4444
// an ordered list so that the first entry can be used as a consistent default.
45-
const DefaultBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari']);
45+
//
46+
// This should be kept in sync with defaultBrowsers in shared/browsers.go
47+
const DefaultBrowserNames = Object.freeze(['chrome', 'firefox', 'safari']);
4648
const DefaultProductSpecs = DefaultBrowserNames;
4749

4850
// The above sets, encoded as product objects. This avoids repeatedly calling

webapp/views/wpt-app.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { PathInfo } from '../components/path.js';
2+
import { DefaultBrowserNames } from '../components/product-info.js';
23
import '../components/test-runs-query-builder.js';
34
import { TestRunsUIBase } from '../components/test-runs.js';
45
import '../components/test-search.js';
@@ -130,6 +131,9 @@ class WPTApp extends PathInfo(WPTFlags(TestRunsUIBase)) {
130131
<template is="dom-if" if="[[!editable]]">
131132
<a href="javascript:window.location.search='';"> (switch to the default product set instead)</a>
132133
</template>
134+
<template is="dom-if" if="[[showAddEdgeBackLink(queryParams)]]">
135+
<a href='#' on-click="addEdgeBack"> (add Microsoft Edge back)</a>
136+
</template>
133137
<wpt-permalinks path="[[path]]"
134138
path-prefix="/[[page]]/"
135139
query-params="[[queryParams]]"
@@ -386,6 +390,21 @@ class WPTApp extends PathInfo(WPTFlags(TestRunsUIBase)) {
386390
return true;
387391
}
388392

393+
showAddEdgeBackLink(queryParams) {
394+
// We only show the 'add edge' link when the user has originally gone to
395+
// the main page (e.g. just https://wpt.fyi/results). We can detect that by
396+
// checking that no products were specified.
397+
return queryParams.product === undefined;
398+
}
399+
400+
addEdgeBack() {
401+
// Attempt to put Edge back in the place it used to go (next to Chrome),
402+
// but also allow for some change in the default browser set.
403+
const newProducts = [DefaultBrowserNames[0], 'edge', ...DefaultBrowserNames.slice(1)];
404+
this.queryParams.product = newProducts;
405+
this.updateQueryParams(this.queryParams);
406+
}
407+
389408
computeResultsTotalsRangeMessage(page, path, searchResults, shas, productSpecs, from, to, maxCount, labels, master, runIds) {
390409
const msg = super.computeResultsRangeMessage(shas, productSpecs, from, to, maxCount, labels, master, runIds);
391410
if (page === 'results' && searchResults) {

0 commit comments

Comments
 (0)