Show only the bundle's name in the sensor configuration row

The row carried the origin, the calibration selection and the SDK's verdict, which a 30 px
line cannot explain; it is now the descriptor's display_name, else the folder name, and the
sensor dialog states the rest under the selector — name and folder, profile, shape, root,
verdict, calibration and every finding — with a suffix only where two rows would otherwise
read alike. Verified with the studio suite, the catalog tests in shared/tests, ui_check and
the lint gate.
This commit is contained in:
ykcheungab
2026-10-05 17:01:42 +08:00
parent 92b2f2fcd7
commit d11441cd79
7 changed files with 457 additions and 135 deletions
@@ -7,8 +7,9 @@ descriptor bundle, a legacy ``sensor.json`` bundle, or an entry that stays liste
with the SDK's own reason.
The two functions below stay the picker's compatibility surface. The picker itself uses the
catalog object directly, so it can show each entry's name, origin and calibration selection,
with the identity and the SDK's verdict in the tooltip.
catalog object directly, so it can show each entry's name — with the origin only where two rows
would otherwise read alike — and keep the identity and the SDK's verdict in the details surface
below the selector.
"""
from __future__ import annotations
@@ -29,19 +30,23 @@ def list_sensor_types() -> list[str]:
def list_configs_for_type(sensor_type: str) -> list[tuple[str, str]]:
"""Return ``(display_name, config_key)`` entries for one family.
"""Return ``(row_name, config_key)`` entries for one family.
The key is the configuration file path the app already passes around (``sensor.json``, or
the bundle folder for an entry that has none), so a selection keeps its meaning. When no
bundle exists at all, a single default entry named after the type is offered — for
preferences and a future Run — exactly as before.
the bundle folder for an entry that has none), so a selection keeps its meaning. The name is
the row the picker shows: the bundle's own name, with the origin appended only where two
entries offered together would read alike (see
:func:`~orisys_app_shared.sensors.bundle_catalog.row_labels`). When no bundle exists at all, a
single default entry named after the type is offered — for preferences and a future Run —
exactly as before.
"""
name = str(sensor_type or "").strip()
if not name:
return []
entries = scan_sensor_catalog().entries_for_family(name)
catalog = scan_sensor_catalog()
entries = catalog.entries_for_family(name)
if entries:
return [(entry.label(), entry.key) for entry in entries]
return [(catalog.row_label(entry), entry.key) for entry in entries]
if name == FAMILY_UNIDENTIFIED:
return []
return [(name, name)]