From 6aae7899bf9c8a55bef1904b4a9be3db74153838 Mon Sep 17 00:00:00 2001 From: dshvaika Date: Wed, 16 Sep 2026 14:38:38 +0300 Subject: [PATCH] docs(iot-hub): cite what a reader can find Two comments explaining why relevance is the default in both states pointed at an internal ticket, one of them at three numbered sections of it that are being rewritten precisely because the code no longer matches them. Neither pointer is reachable from this repository, and the numbering is due to move. The reasoning stays inline, with the accepted cost named: the menu reads "Most relevant" over an install-ordered list until the user types. --- .../modules/home/pages/iot-hub/iot-hub-home.component.ts | 4 ++-- .../src/app/shared/models/iot-hub/iot-hub-item.models.ts | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts index 577ed03a08..91511f533d 100644 --- a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts +++ b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts @@ -165,8 +165,8 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy { this.searchLoading = true; const trimmed = text.trim(); // Relevance in both states, the same value every other IoT Hub surface sends: with an - // empty field the backend substitutes the install count, so this panel opens on - // popularity without having to say so. See TBIOH-33 for the decision. + // empty field the backend serves the install count under this key, so the panel opens on + // popularity without this component having to know it. const query = new MpItemVersionGroupedQuery({}, trimmed, RELEVANCE_SORT_PROPERTY); // A failed request must not end the subscription: the interceptor reports it, and the // panel goes back to an empty answer the next keystroke can replace. diff --git a/ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts b/ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts index 68ca5c0158..8fbe84440b 100644 --- a/ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts +++ b/ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts @@ -83,10 +83,11 @@ export interface SortOption { * The sort menu every IoT Hub surface carrying a search field offers, and the order it offers * them in: the first entry is the default each surface opens on. * - * Relevance is that default in both states. With text it ranks the answer; with none the backend - * substitutes the install count, so a surface opens on the order it opened on before and nothing - * switches on the field state. Agreed with the product owner and recorded on TBIOH-33, which - * supersedes that ticket's SCOPE-IN 2, SCOPE-IN 4 and AC-4. + * Relevance is that default with or without text. With text it ranks the answer; with none the + * backend serves the install count under the same key, so a surface opens on the order it opened + * on before and nothing here switches on the field state. The cost is a menu reading "Most + * relevant" over an install-ordered list until the user types; the alternative - flipping the + * selector once text appears - moves a control the user did not touch and reorders nothing. * * One list rather than one per surface: a new key must reach all of them, and the surface that * missed it would keep a different default without failing.