diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFirmwareFlasher.java b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFirmwareFlasher.java
index ee58dbab..84d66a4f 100644
--- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFirmwareFlasher.java
+++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFirmwareFlasher.java
@@ -188,11 +188,21 @@ public class FaceclawFirmwareFlasher implements FaceclawBleListener {
if (!isEndOk(beginStatus)) {
emitLog("warning: unexpected begin status " + beginStatus + "; continuing");
}
+ // Progress is reported in bytes across the whole image: the segments
+ // are one large firmware blob plus several small ones, so a bar
+ // stepped per segment would sit still through the big one and then
+ // sprint through the rest.
+ long totalBytes = 0;
+ for (Segment seg : segs) {
+ totalBytes += seg.ps;
+ }
+ long bytesBefore = 0;
for (int i = 0; i < segs.size(); i++) {
if (cancelled) {
throw new IllegalStateException("Cancelled.");
}
- flashComponentWithRetry(lens, address, i, segs.size(), segs.get(i), img);
+ flashComponentWithRetry(lens, address, i, segs.size(), segs.get(i), img, bytesBefore, totalBytes);
+ bytesBefore += segs.get(i).ps;
}
emitLog(lens + " lens: all components verified");
try {
@@ -201,14 +211,15 @@ public class FaceclawFirmwareFlasher implements FaceclawBleListener {
}
}
- private void flashComponentWithRetry(String lens, String address, int index, int count, Segment seg, byte[] img) {
+ private void flashComponentWithRetry(String lens, String address, int index, int count, Segment seg, byte[] img,
+ long bytesBefore, long totalBytes) {
for (int attempt = 0; attempt < COMPONENT_RETRIES; attempt++) {
if (attempt > 0) {
emitLog(seg.name + ": re-flash attempt " + (attempt + 1) + "/" + COMPONENT_RETRIES);
}
int endStatus;
try {
- endStatus = flashComponent(lens, address, index, count, seg, img);
+ endStatus = flashComponent(lens, address, index, count, seg, img, bytesBefore, totalBytes);
} catch (TimeoutException | RuntimeException e) {
emitLog(seg.name + ": block phase failed: " + e.getMessage());
endStatus = -1;
@@ -226,8 +237,8 @@ public class FaceclawFirmwareFlasher implements FaceclawBleListener {
throw new IllegalStateException("component " + seg.name + " failed after " + COMPONENT_RETRIES + " attempts");
}
- private int flashComponent(String lens, String address, int index, int count, Segment seg, byte[] img)
- throws TimeoutException {
+ private int flashComponent(String lens, String address, int index, int count, Segment seg, byte[] img,
+ long bytesBefore, long totalBytes) throws TimeoutException {
byte[] sub = Arrays.copyOfRange(img, seg.off, seg.off + 128);
int ps = seg.ps;
int payloadStart = seg.off + 128;
@@ -260,7 +271,8 @@ public class FaceclawFirmwareFlasher implements FaceclawBleListener {
throw new IllegalStateException("block " + b + " NAK'd " + BLOCK_NAK_RETRIES + " times");
}
if (b % 20 == 0 || b == blockCount - 1) {
- emitProgress(lens, index + 1, count, b + 1, blockCount);
+ long bytesSent = bytesBefore + Math.min((long) (b + 1) * BLOCK_SIZE, (long) ps);
+ emitProgress(lens, index + 1, count, b + 1, blockCount, bytesSent, totalBytes);
}
}
emitLog(seg.name + ": data phase done; sending END");
@@ -651,11 +663,12 @@ public class FaceclawFirmwareFlasher implements FaceclawBleListener {
});
}
- private void emitProgress(String lens, int componentIndex, int componentCount, int blockIndex, int blockCount) {
+ private void emitProgress(String lens, int componentIndex, int componentCount, int blockIndex, int blockCount,
+ long bytesSent, long bytesTotal) {
mainHandler.post(() -> {
FaceclawFirmwareFlasherListener current = listener;
if (current != null) {
- current.onProgress(lens, componentIndex, componentCount, blockIndex, blockCount);
+ current.onProgress(lens, componentIndex, componentCount, blockIndex, blockCount, bytesSent, bytesTotal);
}
});
}
diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFirmwareFlasherListener.java b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFirmwareFlasherListener.java
index a111c174..2cd24e20 100644
--- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFirmwareFlasherListener.java
+++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawFirmwareFlasherListener.java
@@ -6,9 +6,12 @@ public interface FaceclawFirmwareFlasherListener {
/**
* Fine-grained progress for the UI bar. `lens` is "left"/"right";
- * component/block indices are 1-based against their counts.
+ * component/block indices are 1-based against their counts. `bytesSent` /
+ * `bytesTotal` cover the whole lens image, so a bar driven by them moves
+ * evenly even though the components differ wildly in size.
*/
- void onProgress(String lens, int componentIndex, int componentCount, int blockIndex, int blockCount);
+ void onProgress(String lens, int componentIndex, int componentCount, int blockIndex, int blockCount,
+ long bytesSent, long bytesTotal);
/**
* Coarse lifecycle. `state` is one of: validating, connecting, flashing,
diff --git a/app/app.css b/app/app.css
index 365b6da7..673fc5bb 100644
--- a/app/app.css
+++ b/app/app.css
@@ -20,6 +20,15 @@ TextField {
color: #222222;
}
+/* Without this, the theme's .ns-dark rules recolour the text white while the
+ * white background above sticks, rendering white-on-white fields.
+ * Order matters: .system-name-modal TextField must stay after this rule so the
+ * deliberately light modal wins the equal-specificity tie in dark mode. */
+.ns-dark TextField {
+ background-color: #2e2e2e;
+ color: #f0f0f0;
+}
+
.system-name-modal TextField {
background-color: #ffffff;
color: #222222;
@@ -35,6 +44,12 @@ Button.-primary {
font-size: 18;
}
+/* The logo art is black-on-transparent; tint it light in dark mode so it
+ * doesn't vanish into the dark page background. */
+.ns-dark .onboarding-logo {
+ tint-color: #e6e6e6;
+}
+
/*
* Stands in for the lens preview when showing it would be misleading (silent
* mode, or a disconnect explained by a flat battery). Sized by the view model
@@ -177,12 +192,6 @@ Button.-primary {
padding: 10;
}
-.pairing-diagnostics {
- font-size: 11;
- color: #888888;
- font-family: monospace;
-}
-
Button.pairing-link {
background-color: transparent;
color: #2a5bc4;
diff --git a/app/g2/ble-proximity.ts b/app/g2/ble-proximity.ts
index 9bb24686..4ca475a6 100644
--- a/app/g2/ble-proximity.ts
+++ b/app/g2/ble-proximity.ts
@@ -28,10 +28,9 @@
* absolute numbers metres out.
*
* It is **not** a measurement. A hand over the temple, a pocket, or a body
- * between phone and glasses moves the estimate by metres. Every user-facing
- * number is therefore rounded hard, prefixed with "~" when confidence is low,
- * and paired with a coarse zone rather than being presented as a distance the
- * wearer could act on precisely.
+ * between phone and glasses moves the estimate by metres. The wearer therefore
+ * only ever sees a coarse zone (glyph + label), never a number in metres they
+ * might over-trust; the metres value exists purely to rank and bucket.
*
* This module is pure (no NativeScript imports) so it can run under node tests.
*/
@@ -113,27 +112,6 @@ export type ProximityEstimate = {
readonly zone: ProximityZone;
};
-/** "0.4 m", "~3 m". The tilde marks an estimate the reader should not lean on. */
-export function formatDistance(estimate: ProximityEstimate): string {
- const prefix = estimate.confidence < 0.6 ? "~" : "";
- const meters = estimate.meters;
- if (meters < 1) {
- return `${prefix}${Math.round(meters * 100)} cm`;
- }
- if (meters < 10) {
- return `${prefix}${meters.toFixed(1)} m`;
- }
- if (meters < MAXIMUM_METERS) {
- return `${prefix}${Math.round(meters)} m`;
- }
- return `${prefix}>${MAXIMUM_METERS} m`;
-}
-
-/** "In your hand · 0.3 m" — zone first, because the zone is the trustworthy half. */
-export function proximitySummary(estimate: ProximityEstimate): string {
- return `${zoneLabel(estimate.zone)} · ${formatDistance(estimate)}`;
-}
-
/**
* Estimate distance from a signal sample. Null when there is no RSSI to work
* from, so callers can say "signal unknown" rather than render a fabricated
diff --git a/app/g2/pairing-candidates.ts b/app/g2/pairing-candidates.ts
index 8ddd367d..ce1f4d7e 100644
--- a/app/g2/pairing-candidates.ts
+++ b/app/g2/pairing-candidates.ts
@@ -14,10 +14,10 @@
import {
estimateProximity,
GLASSES_CALIBRATION,
- proximitySummary,
RING_CALIBRATION,
sortedByProximity,
zoneGlyph,
+ zoneLabel,
type ProximityEstimate,
type ProximityZone,
} from "./ble-proximity";
@@ -251,9 +251,11 @@ function stripSmoothing(record: EvenAdvertisement & { smoothedRssi: number | nul
/**
* The candidate whose signal is strong enough to call "the one you are
* holding". `null` when nothing leads clearly, which is the honest answer for
- * two pairs sitting on the same table.
+ * two pairs sitting on the same table — and when the list has a single entry,
+ * where "closest" has nothing to be closer than.
*/
export function nearestCandidateId(candidates: ReadonlyArray<{ id: string; rssi: number | null }>): string | null {
+ if (candidates.length < 2) return null;
const ranked = candidates
.filter((candidate): candidate is { id: string; rssi: number } => candidate.rssi != null)
.slice()
@@ -301,7 +303,7 @@ export type PairingRowPresentation = {
proximitySummary: string;
proximityGlyph: string;
zone: ProximityZone | null;
- /** "Left + right arms found", "Only the left arm has been seen", … */
+ /** "Left + right arms found", "Only the left arm has been seen", …; "" when there is nothing worth a line (an unbonded ring). */
armsSummary: string;
/** A problem the wearer should read before tapping, or "" when none. */
warning: string;
@@ -329,7 +331,7 @@ function presentationBase(
isNearest,
isPreviouslyPaired: isPaired,
badge: isPaired ? "Yours" : isNearest ? "Closest" : "",
- proximitySummary: proximity ? proximitySummary(proximity) : "Signal unknown",
+ proximitySummary: proximity ? zoneLabel(proximity.zone) : "Signal unknown",
proximityGlyph: proximity ? zoneGlyph(proximity.zone) : "○○○○",
zone: proximity?.zone ?? null,
warning: warnings.join(" "),
@@ -408,7 +410,9 @@ export function ringRow(ring: RingCandidate, context: RowContext = {}): PairingR
imagePath: R1_IMAGE_PATH,
hasVariantImage: true,
...presentationBase(ring.proximity, isNearest, isPaired, warnings),
- armsSummary: ad.bonded ? "Paired with this phone" : "Advertising",
+ // "Advertising" told the wearer nothing (a listed ring is advertising by
+ // definition); only the bonded state is worth a line.
+ armsSummary: ad.bonded ? "Paired with this phone" : "",
canSelect: true,
};
}
diff --git a/app/native/firmware-flasher.ts b/app/native/firmware-flasher.ts
index b2cfba7e..cd75d0b7 100644
--- a/app/native/firmware-flasher.ts
+++ b/app/native/firmware-flasher.ts
@@ -10,6 +10,9 @@ export type FlashProgress = {
componentCount: number;
blockIndex: number;
blockCount: number;
+ /** Bytes flashed so far across the whole lens image — the size-weighted progress signal. */
+ bytesSent: number;
+ bytesTotal: number;
};
/**
@@ -42,6 +45,8 @@ export class FirmwareFlasher {
componentCount: number,
blockIndex: number,
blockCount: number,
+ bytesSent: number,
+ bytesTotal: number,
) =>
this.emit(this.progressListeners, {
lens: String(lens),
@@ -49,6 +54,8 @@ export class FirmwareFlasher {
componentCount: Number(componentCount),
blockIndex: Number(blockIndex),
blockCount: Number(blockCount),
+ bytesSent: Number(bytesSent),
+ bytesTotal: Number(bytesTotal),
}),
onState: (state: string, detail: string) =>
this.emit(this.stateListeners, String(state) as FlashState, String(detail ?? "")),
diff --git a/app/phone-ui/config-page.xml b/app/phone-ui/config-page.xml
index 366c17b6..cffe6f9e 100644
--- a/app/phone-ui/config-page.xml
+++ b/app/phone-ui/config-page.xml
@@ -37,8 +37,8 @@
-
-
+
+
diff --git a/app/phone-ui/onboarding-flash-view-model.ts b/app/phone-ui/onboarding-flash-view-model.ts
index fa999606..0a4e368f 100644
--- a/app/phone-ui/onboarding-flash-view-model.ts
+++ b/app/phone-ui/onboarding-flash-view-model.ts
@@ -422,11 +422,9 @@ export class OnboardingFlashViewModel extends Observable {
private handleFlashProgress(progress: FlashProgress): void {
const lensIndex = progress.lens === "right" ? 1 : 0;
- const withinLens =
- progress.componentCount > 0
- ? (progress.componentIndex - 1 + (progress.blockCount > 0 ? progress.blockIndex / progress.blockCount : 0)) /
- progress.componentCount
- : 0;
+ // Weight by bytes, not by component index: the image is one large segment
+ // plus several small ones, so per-component steps move wildly unevenly.
+ const withinLens = progress.bytesTotal > 0 ? Math.min(1, progress.bytesSent / progress.bytesTotal) : 0;
this.progress = ((lensIndex + withinLens) / 2) * 100;
this.status =
`Flashing ${progress.lens} lens — part ${progress.componentIndex}/${progress.componentCount}, ` +
diff --git a/app/phone-ui/onboarding-page.xml b/app/phone-ui/onboarding-page.xml
index 56387fa6..6608ce8f 100644
--- a/app/phone-ui/onboarding-page.xml
+++ b/app/phone-ui/onboarding-page.xml
@@ -1,10 +1,14 @@
-
+
+
+
+
+
+
+
-
-
diff --git a/app/phone-ui/onboarding-view-model.ts b/app/phone-ui/onboarding-view-model.ts
index 5f24ba8b..a68cc6ff 100644
--- a/app/phone-ui/onboarding-view-model.ts
+++ b/app/phone-ui/onboarding-view-model.ts
@@ -1,4 +1,4 @@
-import { Frame, Observable } from "@nativescript/core";
+import { Frame, Observable, Screen } from "@nativescript/core";
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
@@ -10,8 +10,8 @@ type StepContent = {
body: string;
primaryLabel: string;
secondaryLabel: string;
- showLogo: boolean;
- showTagline: boolean;
+ /** Step 1 renders as the vertically-centered splash (headline + tagline + logo) instead of the scrolling body. */
+ splash: boolean;
showSecondary: boolean;
};
@@ -22,8 +22,7 @@ const STEP_CONTENT: Record = {
body: "",
primaryLabel: "Next",
secondaryLabel: "",
- showLogo: true,
- showTagline: true,
+ splash: true,
showSecondary: false,
},
2: {
@@ -33,8 +32,7 @@ const STEP_CONTENT: Record = {
"This unofficial software provides a custom user interface and functionality for the Even Realities G2 smart glasses. It is not created or supported by Even Realities. If this software somehow breaks my headset, this is not Even's fault and is not covered by the hardware's warranty. If this software doesn't break my headset, using this software may void the hardware's warranty anyways, at the sole discretion of Even Realities. This software is a development prototype and may not be relied on for anything important. This software may be broken at any time by software or firmware updates created by Even, and this will not be Even's fault.",
primaryLabel: "Agree",
secondaryLabel: "Back",
- showLogo: false,
- showTagline: false,
+ splash: false,
showSecondary: true,
},
3: {
@@ -44,8 +42,7 @@ const STEP_CONTENT: Record = {
"Faceclaw only runs on Even Realities G2 glasses that have Faceclaw's custom firmware installed. You have two choices:\n\n• Preview Only — explore Faceclaw's interface on your phone's screen without pairing any glasses. Nothing is written to a headset.\n\n• Flash Firmware — install the custom firmware on your glasses now, then use Faceclaw for real. Faceclaw first scans for nearby glasses so you can pick yours by model, colour, and serial, then connects, asks for confirmation on the lens, and downloads and prepares the firmware.\n\nFlashing replaces the official firmware. It may void your warranty and, like any firmware update, carries a risk of bricking the device. You can only be connected to one app at a time, so disconnect the official Even app before flashing (open it, go to Home, select your glasses, open Connection, and press Disconnect).",
primaryLabel: "Flash Firmware",
secondaryLabel: "Preview Only",
- showLogo: false,
- showTagline: false,
+ splash: false,
showSecondary: true,
},
};
@@ -112,24 +109,25 @@ export class OnboardingViewModel extends Observable {
return STEP_CONTENT[this._step].secondaryLabel;
}
- get showLogo(): boolean {
- return STEP_CONTENT[this._step].showLogo;
- }
-
- get showTagline(): boolean {
- return STEP_CONTENT[this._step].showTagline;
- }
-
get showSecondary(): boolean {
return STEP_CONTENT[this._step].showSecondary;
}
- get logoVisibility(): "visible" | "collapse" {
- return this.showLogo ? "visible" : "collapse";
+ get splashVisibility(): "visible" | "collapse" {
+ return STEP_CONTENT[this._step].splash ? "visible" : "collapse";
}
- get taglineVisibility(): "visible" | "collapse" {
- return this.showTagline ? "visible" : "collapse";
+ get contentVisibility(): "visible" | "collapse" {
+ return STEP_CONTENT[this._step].splash ? "collapse" : "visible";
+ }
+
+ /**
+ * The logo scales with the screen (~40% of its height) so it reads as a
+ * splash on tablets too, capped near the source PNG's height so it doesn't
+ * upscale into mush.
+ */
+ get logoHeight(): number {
+ return Math.min(480, Math.round(Screen.mainScreen.heightDIPs * 0.4));
}
get secondaryVisibility(): "visible" | "collapse" {
@@ -148,11 +146,9 @@ export class OnboardingViewModel extends Observable {
this.notifyPropertyChange("body", this.body);
this.notifyPropertyChange("primaryLabel", this.primaryLabel);
this.notifyPropertyChange("secondaryLabel", this.secondaryLabel);
- this.notifyPropertyChange("showLogo", this.showLogo);
- this.notifyPropertyChange("showTagline", this.showTagline);
this.notifyPropertyChange("showSecondary", this.showSecondary);
- this.notifyPropertyChange("logoVisibility", this.logoVisibility);
- this.notifyPropertyChange("taglineVisibility", this.taglineVisibility);
+ this.notifyPropertyChange("splashVisibility", this.splashVisibility);
+ this.notifyPropertyChange("contentVisibility", this.contentVisibility);
this.notifyPropertyChange("secondaryVisibility", this.secondaryVisibility);
}
}
diff --git a/app/phone-ui/pairing-page.xml b/app/phone-ui/pairing-page.xml
index c7e39b54..b1704d29 100644
--- a/app/phone-ui/pairing-page.xml
+++ b/app/phone-ui/pairing-page.xml
@@ -37,7 +37,7 @@
-
+
@@ -61,7 +61,7 @@
-
+
@@ -73,8 +73,6 @@
-
-
diff --git a/app/phone-ui/pairing-view-model.ts b/app/phone-ui/pairing-view-model.ts
index 5e4a96f9..15b29745 100644
--- a/app/phone-ui/pairing-view-model.ts
+++ b/app/phone-ui/pairing-view-model.ts
@@ -26,6 +26,7 @@ export type PairingRowItem = PairingRowPresentation & {
variantVisibility: "visible" | "collapse";
proximityLine: string;
proximityClass: string;
+ armsVisibility: "visible" | "collapse";
warningVisibility: "visible" | "collapse";
chevron: string;
/**
@@ -56,7 +57,6 @@ export class PairingViewModel extends Observable {
private startedAtMs = 0;
private advertisementCount = 0;
private scanFailure = "";
- private readonly logLines: string[] = [];
private _scanning = false;
private _status = "";
@@ -137,7 +137,6 @@ export class PairingViewModel extends Observable {
this.scanning = false;
this.refresh();
},
- onLog: (line) => this.appendLog(line),
});
if (!started) {
this.status = "Could not start the Bluetooth scan. Check that Bluetooth is on.";
@@ -271,14 +270,6 @@ export class PairingViewModel extends Observable {
return this.onboarding ? "Back" : "Cancel";
}
- get diagnostics(): string {
- return this.logLines.slice(-12).join("\n");
- }
-
- get diagnosticsVisibility(): "visible" | "collapse" {
- return this.logLines.length ? "visible" : "collapse";
- }
-
// --- actions ---------------------------------------------------------------
// Arrow property: NativeScript fires XML event handlers with `this` bound to the
@@ -443,18 +434,11 @@ export class PairingViewModel extends Observable {
"selectionVisibility",
"selectionSummary",
"primaryEnabled",
- "diagnostics",
- "diagnosticsVisibility",
] as const) {
this.notifyPropertyChange(property, this[property]);
}
}
- private appendLog(line: string): void {
- this.logLines.push(line);
- if (this.logLines.length > 50) this.logLines.splice(0, this.logLines.length - 50);
- }
-
private formatError(error: unknown): string {
return formatErrorMessage(error);
}
@@ -474,6 +458,7 @@ function toRowItem(row: PairingRowPresentation, selected: boolean, onRowTap: (ar
variantVisibility: row.variantSummary ? "visible" : "collapse",
proximityLine: `${row.proximityGlyph} ${row.proximitySummary}`,
proximityClass: row.zone === "immediate" ? "pairing-proximity pairing-proximity-immediate" : "pairing-proximity",
+ armsVisibility: row.armsSummary ? "visible" : "collapse",
warningVisibility: row.warning ? "visible" : "collapse",
chevron: selected ? "✓" : row.canSelect ? "›" : "…",
onRowTap,
diff --git a/tests/ble-proximity.test.cjs b/tests/ble-proximity.test.cjs
index e981e131..2bc35840 100644
--- a/tests/ble-proximity.test.cjs
+++ b/tests/ble-proximity.test.cjs
@@ -15,8 +15,6 @@ const {
MAXIMUM_METERS,
zoneFromMeters,
zoneLabel,
- formatDistance,
- proximitySummary,
sortedByProximity,
} = require("../.test-build/app/g2/ble-proximity.js");
@@ -66,22 +64,12 @@ test("zones and their boundaries", () => {
assert.equal(zoneLabel("immediate"), "In your hand");
});
-test("weak signals are marked as approximate", () => {
+test("weak signals carry lower confidence", () => {
const strong = estimateProximity(-45, GLASSES_CALIBRATION);
const weak = estimateProximity(-95, GLASSES_CALIBRATION);
- assert.ok(!formatDistance(strong).startsWith("~"));
- assert.ok(formatDistance(weak).startsWith("~"));
assert.ok(weak.confidence < strong.confidence);
});
-test("distance formatting is rounded hard", () => {
- const centimetres = estimateProximity(-30, GLASSES_CALIBRATION);
- assert.ok(formatDistance(centimetres).includes("cm"), formatDistance(centimetres));
- assert.equal(formatDistance({ meters: 2.34, confidence: 1, zone: "near" }), "2.3 m");
- assert.equal(formatDistance({ meters: 42.6, confidence: 1, zone: "distant" }), "43 m");
- assert.equal(proximitySummary({ meters: 0.3, confidence: 1, zone: "immediate" }), "In your hand · 30 cm");
-});
-
const device = (id, rssi) => ({ id, rssi });
const estimate = (d) => estimateProximity(d.rssi, GLASSES_CALIBRATION);
const byId = (d) => d.id;
diff --git a/tests/pairing-candidates.test.cjs b/tests/pairing-candidates.test.cjs
index 0dfe7af0..996c214d 100644
--- a/tests/pairing-candidates.test.cjs
+++ b/tests/pairing-candidates.test.cjs
@@ -163,8 +163,8 @@ test("nearest requires a clear signal lead", () => {
const d = (id, rssi) => ({ id, rssi });
assert.equal(nearestCandidateId([d("1", -40), d("2", -70)]), "1");
assert.equal(nearestCandidateId([d("1", -60), d("2", -57)]), null);
- // A lone advertiser is trivially the nearest.
- assert.equal(nearestCandidateId([d("1", -80)]), "1");
+ // A lone advertiser has nothing to be closer than, so no Closest badge.
+ assert.equal(nearestCandidateId([d("1", -80)]), null);
// Nothing to rank without RSSI.
assert.equal(nearestCandidateId([d("1", null)]), null);
assert.equal(nearestCandidateId([]), null);