From bf66c5a53ccf35e9fc751a43a17e80656d047289 Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sun, 8 Nov 2026 01:05:51 -0800 Subject: [PATCH] Clean up redundant messages on the Pair Glasses page --- app/g2/ble-proximity.ts | 15 +-------------- app/g2/pairing-candidates.ts | 5 +---- app/phone-ui/pairing-view-model.ts | 14 ++------------ tests/ble-proximity.test.cjs | 2 -- tests/pairing-candidates.test.cjs | 2 +- 5 files changed, 5 insertions(+), 33 deletions(-) diff --git a/app/g2/ble-proximity.ts b/app/g2/ble-proximity.ts index b3a6809c..e5374c62 100644 --- a/app/g2/ble-proximity.ts +++ b/app/g2/ble-proximity.ts @@ -27,7 +27,7 @@ * * It is **not** a measurement. A hand over the temple, a pocket, or a body * 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 + * only ever sees a coarse zone (a signal-strength glyph), 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. @@ -75,19 +75,6 @@ export function zoneFromMeters(meters: number): ProximityZone { return "distant"; } -export function zoneLabel(zone: ProximityZone): string { - switch (zone) { - case "immediate": - return "In your hand"; - case "near": - return "Nearby"; - case "far": - return "Across the room"; - case "distant": - return "Far away"; - } -} - /** A glyph for the zone; SF Symbols have no Android equivalent, so plain text. */ export function zoneGlyph(zone: ProximityZone): string { switch (zone) { diff --git a/app/g2/pairing-candidates.ts b/app/g2/pairing-candidates.ts index 7c3de28f..f6c8a059 100644 --- a/app/g2/pairing-candidates.ts +++ b/app/g2/pairing-candidates.ts @@ -16,7 +16,6 @@ import { RING_CALIBRATION, sortedByProximity, zoneGlyph, - zoneLabel, type ProximityEstimate, type ProximityZone, } from "./ble-proximity"; @@ -329,7 +328,6 @@ export type PairingRowPresentation = { isPreviouslyPaired: boolean; /** "Yours" / "Closest" / "". */ badge: string; - proximitySummary: string; proximityGlyph: string; zone: ProximityZone | null; /** "Left + right arms found", "Only the left arm has been seen", …; "" when there is nothing worth a line (an unbonded ring). */ @@ -355,12 +353,11 @@ function presentationBase( isNearest: boolean, isPaired: boolean, warnings: readonly string[], -): Pick { +): Pick { return { isNearest, isPreviouslyPaired: isPaired, badge: isPaired ? "Yours" : isNearest ? "Closest" : "", - proximitySummary: proximity ? zoneLabel(proximity.zone) : "Signal unknown", proximityGlyph: proximity ? zoneGlyph(proximity.zone) : "○○○○", zone: proximity?.zone ?? null, warning: warnings.join(" "), diff --git a/app/phone-ui/pairing-view-model.ts b/app/phone-ui/pairing-view-model.ts index 78c743e3..d34046eb 100644 --- a/app/phone-ui/pairing-view-model.ts +++ b/app/phone-ui/pairing-view-model.ts @@ -504,22 +504,12 @@ export class PairingViewModel extends Observable { ), ); - const complete = pairs.filter((pair) => pair.completeness === "complete").length; - const partial = pairs.length - complete; if (this.scanFailure) { this.status = `Scan failed: ${this.scanFailure}`; } else if (!this._scanning) { this.status = "Scan paused."; - } else if (!pairs.length && !rings.length && !rayneos.length) { - this.status = "Scanning…"; } else { - const bits = [ - complete ? `${complete} ${complete === 1 ? "pair" : "pairs"} ready` : null, - partial ? `${partial} with one arm heard` : null, - rings.length ? `${rings.length} ${rings.length === 1 ? "ring" : "rings"}` : null, - rayneos.length ? `${rayneos.length} RayNeo iO` : null, - ].filter(Boolean); - this.status = `Scanning… ${bits.join(" · ")}. Tap a pair to select it.`; + this.status = "Scanning…"; } for (const property of [ @@ -554,7 +544,7 @@ function toRowItem(row: PairingRowPresentation, selected: boolean, onRowTap: (ar colorwayLabel: colorwayLabel(row.colorway), badgeVisibility: row.badge ? "visible" : "collapse", variantVisibility: row.variantSummary ? "visible" : "collapse", - proximityLine: `${row.proximityGlyph} ${row.proximitySummary}`, + proximityLine: row.proximityGlyph, proximityClass: row.zone === "immediate" ? "pairing-proximity pairing-proximity-immediate" : "pairing-proximity", armsVisibility: row.armsSummary ? "visible" : "collapse", warningVisibility: row.warning ? "visible" : "collapse", diff --git a/tests/ble-proximity.test.cjs b/tests/ble-proximity.test.cjs index c9bf8298..68f51279 100644 --- a/tests/ble-proximity.test.cjs +++ b/tests/ble-proximity.test.cjs @@ -12,7 +12,6 @@ const { MINIMUM_METERS, MAXIMUM_METERS, zoneFromMeters, - zoneLabel, sortedByProximity, } = require("../.test-build/app/g2/ble-proximity.js"); @@ -59,7 +58,6 @@ test("zones and their boundaries", () => { assert.equal(zoneFromMeters(3), "far"); assert.equal(zoneFromMeters(9.9), "far"); assert.equal(zoneFromMeters(10), "distant"); - assert.equal(zoneLabel("immediate"), "In your hand"); }); test("weak signals carry lower confidence", () => { diff --git a/tests/pairing-candidates.test.cjs b/tests/pairing-candidates.test.cjs index a2e3a9a5..ed2f5d88 100644 --- a/tests/pairing-candidates.test.cjs +++ b/tests/pairing-candidates.test.cjs @@ -189,7 +189,7 @@ test("scan row carries the decoded variant, artwork, and proximity", () => { assert.equal(row.colorway, "brown"); assert.equal(row.imagePath, "~/images/glasses/glasses_g2_b_brown.png"); assert.equal(row.hasVariantImage, true); - assert.match(row.proximitySummary, /In your hand|Nearby/); + assert.match(row.proximityGlyph, /^●●●[●○]$/); assert.match(row.armsSummary, /serials match/); assert.equal(row.canSelect, true); assert.equal(row.isNearest, false);