The popup asked /api/versions/published/grouped and rendered one section per
item type, so a query answered best by a widget still opened on devices. It now
asks for page 0 of the flat read the search page makes (relevance sort, 10
rows) and renders those rows in the server's order, so the best match leads
whatever its type.
- Each row names its type before the author ("Widget · pinkevych.d"), in the
type's colour with its itemTypeIcons icon. The verified mark moves in front
of the author like on the item cards; an unverified author keeps the person
icon.
- Items without a screenshot (calculated fields, alarm rules, rule chains) sit
in the same 99x56 frame as a screenshot with a 36px coloured tile inside, so
names line up down the list.
- The footer says "See all N results for ..." when the search matched more than
the popup shows; N discounts the rows this page dropped (dashboards).
- itemTypeColors joins itemTypeIcons as the one type palette; the hero reads it
instead of repeating the six colours.
Removes getPublishedVersionsGrouped, MpItemVersionGroupedQuery,
MpItemVersionSection and the iot-hub.section-more key.
The flag was set by any user selection, but only the keyboard leaves a second half to
deal with: the trigger acts on keydown, the field's own handler on keyup, and
preventDefault on the first does not stop the second. A pointer selection is finished
when it returns, so the flag stayed set with nothing to consume it, and the next
onSearch took the early return - click a result, close the detail dialog, press the
magnifier, and the search page did not open. The magnifier is the plain case because
it calls onSearch with no keystroke at all; Enter in the field does the same once the
dialog restores focus there.
It is armed from the trigger's activeOption now, which is readable only at that moment
- the trigger holds it while it calls _selectViaInteraction and clears it on the next
line of its own handler - and which a pointer never sets. Focusing the field and
clearing it drop the flag as well, which covers the one pointer selection that can
still arm it: arrowing to a row and then clicking a different one.
Three things from the re-review, two of them introduced by the commit that turned the
popup's header and footer into options.
**The Enter guard never fired.** It asked the autocomplete trigger for its active
option during keyup, but the trigger clears that inside the same keydown - it calls
_selectViaInteraction and then _resetActiveItem, which with no autoActiveFirstOption
sets the active index to -1. So the guard always fell through, and one Enter on a
highlighted row opened it and then navigated away from it. That is worse than the
behaviour before, where the click handler simply never ran. The row that acts now
records it through rowSelectedByUser, which does not depend on the order the two
handlers run in, and typing clears the flag since a pointer selection leaves no keyup
behind it.
**The header's own padding was overridden.** Under one ancestor chain,
`.mat-mdc-option.tb-search-popup-group-header` and
`.mat-mdc-option:not(.mat-mdc-option-multiple)` both weigh (0,4,0), and the second was
declared later, so every section header shipped 8px taller than the 4px the comment
above it documents - with up to six of them in a 424px panel. The catch-all could not
match the old span header; it matches an option. Each row kind now carries its own
class and the shared parts sit in one rule, so nothing here rests on source order. The
footer had the same collision and only won by being declared last.
**The hover-scrollbar block is a mixin.** This branch added a second byte-identical
copy of it. Both now call tb-iot-hub-hover-scrollbar from the partial they already
import. The mixin records what is deliberately NOT settled here: whether these panels
should keep a thumb that is invisible until hover, and whether to add the standardised
scrollbar-width / scrollbar-color that Firefox reads, is a question for the IoT Hub
filter UI as a whole - iot-hub-browse and dashboard-widget-select carry the same
treatment and predate this branch.
The popup keeps focus in the input and walks its rows with an active-descendant key
manager, which only knows about options. A section header written as a span with
role="button" and tabindex="0" is therefore unreachable: the arrow keys skip it, its
keyup.enter can never fire because it can never hold focus, and Tab does not help
since leaving the input closes the panel. That header is the only way from the popup
into a type page, so without a mouse there was no way in at all. The footer had the
same shape, though its action is also on the input's own Enter.
The header also sat inside the group's label element, which is presentational, so the
section's name came out as the header's whole text - "Devices +12 more" - wrapping a
control nobody could operate.
Header and footer are now options like every other row. They take part in arrow
navigation, they read as part of the list, and the group wrapper goes away with the
label it was distorting.
Rows also acted on (click) alone. Pressing Enter on a highlighted result runs
_selectViaInteraction, which is not a DOM click, so the card never opened from the
keyboard. Every row now acts on (onSelectionChange) guarded by isUserInput, one path
for pointer and keyboard both.
Enter in the field needed a guard to go with that: the trigger acts on keydown and
this handler runs on keyup, which the trigger's preventDefault does not stop, so one
Enter would have opened a result and then navigated away from it.
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.
The type page adopted `?creatorId=` from the URL whenever its input was unbound.
Nothing in the platform builds such a URL: the only navigations carrying query
parameters send `search` and `itemType`, and the creator profile scopes its list by
binding the component's input rather than by navigating. The branch was reachable
only by typing the parameter in by hand, and there it rescoped a Hub-wide type page
with no visible sign of why the counts had changed.
Both live callers - the creator profile and the add-item dialog - bind the input,
which the removed code deferred to in any case.
These were the only two of the thirteen fields interpolated raw, and creatorId is not
an internal value: iot-hub-browse and the creator profile both read it straight off the
route with nothing between the URL and the request, so a crafted id could close the
parameter and append its own. The UUID shape is a convention here, not something this
code enforces.
The results container kept its old indentation after being wrapped in
.tb-search-layout, so it read as a sibling of the wrapper and the two closing tags
lined up at the same depth while closing different elements. The popup's @for sat in
an ng-container carrying no directive. Removing the -compact rule left a blank line
before the closing brace in four places.
The sort options lived in three arrays behind three identical local interfaces, and
'relevance' was spelled four ways; the six cross-type item types lived in two more
arrays, byte-identical and renamed by this branch on both sides. Adding one option
here meant editing three places, and a seventh item type would have needed two.
All of it moves to iot-hub-item.models.ts as SortOption, IOT_HUB_SORT_OPTIONS,
RELEVANCE_SORT_PROPERTY and CROSS_TYPE_ITEM_TYPES. The type list stays separate from
CREATOR_VISIBLE_ITEM_TYPES, which holds the same six: that one is a membership test
carrying the type tabs' order, this one is display order with DEVICE leading, and
folding them together would have silently reordered the Type facet.
The hero popup now sends relevance in both states like every other surface, rather
than switching on whether the field has text. Both spellings ask the server for the
same rows - with no text it substitutes the install count either way - so this is the
code agreeing with the decision recorded on TBIOH-33, not a behaviour change.
Two failures that were not survivable:
- One of the six getFilterInfo calls failing emptied the whole filter panel. forkJoin
is all-or-nothing, so typeOptions went unassigned although it needs no server data,
and the i?.categories guards below could never fire. Each request now carries its
own catchError, which is what those guards already expected.
- A section arriving without items would have thrown inside a subscribe callback,
out of reach of the catchError upstream, leaving the popup on its spinner. The
response is an unvalidated cast of a new endpoint, so items is defaulted.
The facet list held a Set the host mutated in place, which works only while that
component is on default change detection. The host now hands over a new Set per
toggle. SearchResultGroup.total went unread, and @for takes a track expression
rather than a TrackByFunction.
The Hub answers a sectioned search at /api/versions/published/grouped rather than
through a flag on the flat read. That endpoint takes the filters and a sort key
only - it sizes its own answer - so the popup asks through its own API method and
its own query string, and sends no page, page size or sort order.
MpItemVersionGroupedView mirrors what comes back: the view plus typeTotal, always
set, rather than the flat view with a nullable field and a comment about when it
is null. MpItemVersionQueryOptions loses grouped with it.
Two surfaces, one defect between them: a query answered by several content types
could not show all of them.
**The hero popup** asked /api/versions/published for one flat page of ten rows by
install count and grouped that page on the client. Ten rows cannot hold four of
each of six item types, so whichever types filled the page took it and the rest
had no section at all — and an absent section was indistinguishable from "no
matches of this type". Measured against the catalogue, `temperature` returns 71
matches across five types; a flat top-16 by install count shows no calculated
field and no alarm rule, and by relevance it shows none of the 22 devices. On
`gateway` neither ordering surfaces one of the 12 matching widgets.
It asks for a grouped answer now. The server caps each type and puts `typeTotal`
on every row, so the client renders what it was given: one section per type, the
header a link to that type page carrying the current query and, when more of that
type exists, a "+N more ›" chip. Count and chevron appear together or not at all —
on a section already showing everything a chevron points at nothing. The footer
names where it goes rather than an ordering.
**The search page** keeps its flat paginated grid — the site's equivalent is a
browsable catalogue with indexed page URLs, so neither product groups there — and
gains what it was missing beside the type pages:
* A filter panel: item type, category, use case. Type is new, this being the one
page that mixes them. There is no catalogue-wide filterInfo endpoint, so the six
per-type answers are merged client-side. Counts are deliberately not rendered:
filterInfo takes no text query, so beside a searched result they would be the
whole catalogue's numbers describing a different answer.
* A page size that follows the column count, read from a hidden probe carrying the
grid's own classes rather than restated from its media queries: max(12,
columns × 3). Fifteen at every width ended a page mid-row at four and six
columns.
* One card layout. Calculated fields, alarm rules and rule chains render as a
compact horizontal row that needs a wide cell; the type pages narrow the grid
for them, a mixed grid cannot, and those rows truncated their own titles.
**Relevance** is a sort option on all four surfaces that carry a search field, and
the default on each. With text it ranks the answer; without it the backend
substitutes the install count, so browsing keeps the order it had. Nothing
switches on the field state — a control that relabels itself unasked was tried and
rejected.
Also here: the search page moves onto the type pages' frame — one even padding on
the card, the component full bleed — which removes four breakpoints' worth of
negative margins, each written to cancel that padding for one element.
Mobile apps derive the scheme from their package name, which may contain
an underscore. It cannot introduce an authority, so accepting it keeps
the rule as strong as the RFC 3986 grammar.
The user was looked up by email across the whole platform, so a client
belonging to one tenant could resolve a user of another. New users were also
placed in the tenant named by the provider response rather than in the tenant
that owns the client.
Both now follow the client's own tenant. System clients keep the platform-wide
behaviour they rely on.
A rejected deep link is otherwise invisible to support. AdminController
reuses the prevUri parameter and cookie names instead of its own copies,
and its redirect target moves into a helper so the read side is covered
by a test.
The scheme is restored from the oauth2_auth_request cookie, which the
client can replace, so checking it only while the authorization request
is built still let a forged cookie point the token redirect at any host.
Both handlers now re-check it on read, sharing the rule with
OAuth2AppTokenFactory.
The success handler keeps prevUri out of the base URL as well, so the
error redirect no longer appends /login to an in-app path.