Skip to content

armgit / plexo

Public Imported from GitHub
0

Speed up downloads by combining multiple network connections in parallel

Landing page: Detected badge only when known, extension coming-soon strip (#114)

Anmol Kapil9fdb3a26ef0a
diff --git a/docs/downloads.js b/docs/downloads.js
index 0efa4e6..24441bb 100644
--- a/docs/downloads.js
+++ b/docs/downloads.js
@@ -229,6 +229,8 @@
var chosen = choose(assets, env || { os: 'other', arch: null })
var primary = chosen && chosen.primary
+ // Only a build we know fits is recommended. Without the CPU, an arm64 or x64 build is a guess.
+ var known = primary && (env.arch || primary.arch === 'any') ? primary : null
var groups = OS_ORDER.map(function (os) {
var rows = assets
@@ -239,7 +241,7 @@
return a.sort - b.sort
})
.map(function (a) {
- a.recommended = a === primary
+ a.recommended = a === known
return a
})
return {
diff --git a/docs/index.html b/docs/index.html
index 41c8b04..6ebf2e5 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -114,6 +114,8 @@
<div class="tg-fade"></div>
</div>
+ <p class="announce"><span>Coming soon</span>Download with Plexo Browser Extension</p>
+
<!-- NAV -->
<header
style="
diff --git a/docs/landing.css b/docs/landing.css
index b480639..58098d4 100644
--- a/docs/landing.css
+++ b/docs/landing.css
@@ -203,6 +203,33 @@ a {
background-clip: text;
color: transparent;
}
+.announce {
+ position: relative;
+ z-index: 31;
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: center;
+ gap: 6px 14px;
+ margin: 0;
+ padding: 12px 16px;
+ border-bottom: 1px solid rgba(243, 103, 18, 0.28);
+ background: #160c06;
+ font-size: 14px;
+ font-weight: 500;
+ text-align: center;
+}
+.announce span {
+ padding-right: 14px;
+ border-right: 1px solid rgba(255, 255, 255, 0.16);
+ font:
+ 11px 'Geist Mono',
+ ui-monospace,
+ monospace;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: #ffb98c;
+}
.top-glow {
position: absolute;
top: 0;
diff --git a/e2e/downloads.spec.ts b/e2e/downloads.spec.ts
index 21866bd..5afc921 100644
--- a/e2e/downloads.spec.ts
+++ b/e2e/downloads.spec.ts
@@ -238,7 +238,7 @@ test.describe('which download is offered', () => {
expect(D.build({ assets: [] }, { os: 'win', arch: null }).empty).toBe(true)
})
- test('grouped by OS, in a fixed order, exactly one row recommended', () => {
+ test('grouped by OS, in a fixed order, one row recommended unless the CPU is a guess', () => {
const model = D.build(release(), { os: 'linux', arch: 'x64' })
expect(model.groups.map((g) => `${g.label}:${g.rows.length}`)).toEqual([
'macOS:2',
@@ -252,6 +252,8 @@ test.describe('which download is offered', () => {
'plexo_1.0.0-rc.7_arm64.deb'
])
expect(model.groups.flatMap((g) => g.rows).filter((r) => r.recommended)).toHaveLength(1)
+ const guessed = D.build(release(), { os: 'mac', arch: null })
+ expect(guessed.groups.flatMap((g) => g.rows).filter((r) => r.recommended)).toHaveLength(0)
for (const group of model.groups) expect(group.notes.length).toBeGreaterThan(0)
})