From d15f115505debdb6bcab7d3c07d465ba3c2933ab Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 2 Nov 2026 16:56:32 -0500 Subject: [PATCH] fix(devices): pairing input moves into the Add Device modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pairing field sat at the bottom of the Devices page, below the device grid — unreachable on any account with more than a screenful of devices (the user's dev account has ~480 accumulated test devices; scrolling 224k px to reach the field is a non-starter). The Add Device button at the top of the page is where pairing intent already lives, so the code input and Find device button now sit inside the Connect a KOReader Device modal as instruction step 6, with the confirm card swapping into the same modal (container keeps the pairing-lookup ids; the htmx error-toast listener scopes to #add-device-modal now). Verified live: modal renders the full instruction list + input, a wrong code swaps the templ error partial inside the modal, and claim still HX-Refreshes on success (modal state resets with the reload, paired device appears in the grid). ui-controls glossary where-fields and the COVERAGE row updated with the control's new home. --- docs/developer/ui-controls.md | 4 +-- templates/devices.templ | 48 +++++++++++++++-------------------- templates/devices_templ.go | 38 +++++++++++++-------------- tests/ui/COVERAGE.md | 2 +- web/src/device-management.ts | 10 ++++---- 5 files changed, 47 insertions(+), 55 deletions(-) diff --git a/docs/developer/ui-controls.md b/docs/developer/ui-controls.md index 7fba381d..ebda1f07 100644 --- a/docs/developer/ui-controls.md +++ b/docs/developer/ui-controls.md @@ -183,11 +183,11 @@ where: All Books / Podcasts page → toolbar does: Opens the filter drawer for building and applying rules. label: Find device -where: Devices page → Pair a Device +where: Devices page → Add New Device modal does: Looks up the pairing code shown on the registering e-reader and renders the confirm card. label: Pair device -where: Devices page → Pair a Device → confirm card +where: Devices page → Add New Device modal → confirm card does: Binds the device behind the pairing code to the signed-in account. label: Download All diff --git a/templates/devices.templ b/templates/devices.templ index 75e9acfe..970dfceb 100644 --- a/templates/devices.templ +++ b/templates/devices.templ @@ -157,33 +157,6 @@ templ Devices(user User, devices []handlers.DeviceInfo, errorMessage string, bas } -
-

Pair a Device

-

- On your e-reader, open the Bookhoard sync menu and tap Register device — then enter the - 6-digit code it shows below. Only someone holding the device can see the code, so nobody - else can claim (or interfere with) your registration. -

-
- - -
-
-