iTwin / appui

Monorepo for iTwin.js AppUi
MIT License
8 stars 2 forks source link

Show property record description next to array indices #890

Closed Yato333 closed 1 week ago

Yato333 commented 2 weeks ago

Changes

Part of https://github.com/iTwin/presentation/issues/654 Property record description (if present) will be shown next to the index for array property items. This should improve user experience when browsing through the property grid having many related instances.

With array items defined like this:

const arrayMembers = [
  PropertyRecord.fromString("Value 1", "Item 1"),
  new PropertyRecord(
    {
      valueFormat: PropertyValueFormat.Array,
      itemsTypeName: "string",
      items: [
        PropertyRecord.fromString("Value 2", "Item 2"),
        PropertyRecord.fromString("Value 3", "Item 3"),
      ],
    },
    { ... }
  ),
  new PropertyRecord(
    {
      valueFormat: PropertyValueFormat.Struct,
      members: {
        "Member 1": PropertyRecord.fromString("Value 3", "Item 3"),
        "Member 2": PropertyRecord.fromString("Value 4", "Item 4"),
      },
    },
    { ... }
  ),
].map((record, idx) => {
  record.description = `Description ${idx}`;
  return record;
});

Before: image

After: image

Testing

A unit test was added.

Yato333 commented 1 week ago

@GerardasB there goes the NextVersion.md 😄 Added screenshots and updated NextVersion.md in #897