@@ -77,20 +77,36 @@ export function ExchangesPage() {
7777 * Every promoted key any information type declares, with the types that declare it.
7878 * Read off the list already fetched for the information-type filter, so offering the
7979 * keys costs nothing — and picking from real names beats remembering how one was spelled.
80+ *
81+ * Narrowed to the picked information type when there is one: a short list of its own keys
82+ * beats the whole catalogue with a disambiguating line on every row.
8083 */
8184 const propertyKeyOptions = useMemo ( ( ) => {
82- const owners = new Map < string , string [ ] > ( ) ;
83- for ( const t of infoTypes )
85+ const scoped = query . informationTypeId
86+ ? infoTypes . filter ( ( t ) => t . id === query . informationTypeId )
87+ : infoTypes ;
88+ const owners = new Map < string , { type : string ; path : string } [ ] > ( ) ;
89+ for ( const t of scoped )
8490 for ( const p of t . promotedProperties ?? [ ] ) {
8591 const carriers = owners . get ( p . key ) ?? [ ] ;
86- const name = t . code ?? t . name ;
87- if ( ! carriers . includes ( name ) ) carriers . push ( name ) ;
92+ const type = t . code ?? t . name ;
93+ if ( ! carriers . some ( ( c ) => c . type === type ) ) carriers . push ( { type , path : p . path } ) ;
8894 owners . set ( p . key , carriers ) ;
8995 }
9096 return [ ...owners . entries ( ) ]
9197 . sort ( ( [ a ] , [ b ] ) => a . localeCompare ( b ) )
92- . map ( ( [ key , carriers ] ) => ( { value : key , label : key , hint : carriers . join ( ", " ) } ) ) ;
93- } , [ infoTypes ] ) ;
98+ . map ( ( [ key , carriers ] ) => ( {
99+ value : key ,
100+ label : key ,
101+ // A second line rather than text beside the name: these run long enough
102+ // ("InventoryTransactionPosted") that sharing one line left the name with no room at
103+ // all. Dropped once a type is picked above — naming it again on every row says nothing.
104+ sublabel : query . informationTypeId ? undefined : carriers . map ( ( c ) => c . type ) . join ( ", " ) ,
105+ // What the key actually reads out of the payload. The thing you want when a filter
106+ // comes back empty and you can't tell whether the key or the value is wrong.
107+ title : carriers . map ( ( c ) => `${ c . type } : ${ c . path } ` ) . join ( "\n" ) ,
108+ } ) ) ;
109+ } , [ infoTypes , query . informationTypeId ] ) ;
94110
95111 /** Set (or drop) one URL param; changing any filter resets paging. */
96112 const setParam = ( key : string , value : string | null , resetOffset = true ) => {
0 commit comments