Skip to content

[UoM prototype] Render measurement attributes in docs (3/4) - #952

Open
ricardotejedorsanz wants to merge 2 commits into
rt/uom-measurement-vocabularyfrom
rt/uom-visualizer-docs
Open

[UoM prototype] Render measurement attributes in docs (3/4)#952
ricardotejedorsanz wants to merge 2 commits into
rt/uom-measurement-vocabularyfrom
rt/uom-visualizer-docs

Conversation

@ricardotejedorsanz

@ricardotejedorsanz ricardotejedorsanz commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

This PR updates the public docs/visualizer path to understand measurement attributes introduced in #950 and bulk-imported in #951.

It is stacked on #951 so the visualizer can be reviewed with the V0 measurement vocabulary.

What changed

  • Docs attribute serializers now emit type for attributes.
  • Measurement attributes emit measurement_type and supported_units instead of a values list.
  • Category and attribute visualizer pages render each attribute's type and measurement metadata instead of assuming every attribute has closed-list values.
  • The root README documents the V0 attribute-type shape.

UX changes

The visualizer now makes the attribute type explicit when an attribute is expanded:

  • Closed-list attributes show Type: closed_list, followed by a Values label and their allowed taxonomy values.
  • Measurement attributes show Type: measurement, Measurement type, and Supported units instead of a values list.
  • The dedicated attribute search/details page uses the same measurement metadata treatment, so measurement attributes can be understood outside of a category context as well.

Image 1 — closed-list attribute expanded in a category:

image

Image 2 — measurement attribute expanded in a category:

image

Image 3 — measurement attribute on the attribute details page:

image

Validation

  • ruby -c passed for the changed Ruby serializers/tests.
  • Focused docs serializer tests passed.
  • bundle exec rake test:unit passed.
  • bundle exec bin/product_taxonomy docs passed.
  • bundle exec jekyll build --source ../docs --destination /tmp/product-taxonomy-docs-site passed.
  • Verified generated unstable docs data and rendered HTML include measurement attributes with measurement_type and supported_units, and closed-list attributes with a Values label.
  • git diff --check passed.

@ricardotejedorsanz ricardotejedorsanz changed the title Render measurement attributes in docs [UoM prototype] Render measurement attributes in docs (3/3) Jul 1, 2026
@ricardotejedorsanz
ricardotejedorsanz force-pushed the rt/uom-visualizer-docs branch 2 times, most recently from c6fa39c to 77f1df6 Compare July 1, 2026 15:48
@ricardotejedorsanz
ricardotejedorsanz changed the base branch from rt/uom-prototype to rt/uom-measurement-vocabulary July 1, 2026 15:48
@ricardotejedorsanz
ricardotejedorsanz force-pushed the rt/uom-visualizer-docs branch 4 times, most recently from eb4dcd4 to 7c562f9 Compare July 1, 2026 19:45

@jeanguo-png jeanguo-png left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: could we default missing attribute.type to closed_list in the shared layouts? Older release docs data does not include type, so those pages will render a blank Type value even though the attributes are effectively closed-list. A small Liquid default would keep old release pages looking correct while supporting measurement attributes in the new data.

@danielpgross danielpgross left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach looks fine (details will depend on whether we make further changes to the data model)

Comment thread README.md Outdated

#### Attribute types

Attributes include an explicit `type`. Closed-list attributes define a set of taxonomy values. Measurement attributes define a `measurement_type` and `supported_units` instead of values.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty terse, it might help to add some examples here for clarity

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @danielpgross, I included one-line definitions for closed_list and measurement, plus compact JSON examples for both attribute shapes:

Attribute types

Attributes include an explicit type:

  • closed_list: an attribute whose value is selected from a predefined set of taxonomy values, used when consistent value standardization is needed across products.
  • measurement: an attribute whose value is a number paired with a supported unit, used when products need precise measurements such as dimensions, weight, volume, or power.

Closed-list attributes include values:

{
  "id": "gid://shopify/TaxonomyAttribute/1",
  "name": "Color",
  "handle": "color",
  "type": "closed_list",
  "values": [
    {
      "id": "gid://shopify/TaxonomyValue/1",
      "name": "Black",
      "handle": "color__black"
    }
  ]
}

Measurement attributes include measurement_type and supported_units instead of values:

{
  "id": "gid://shopify/TaxonomyAttribute/12429",
  "name": "Height",
  "handle": "height",
  "type": "measurement",
  "measurement_type": "dimension",
  "supported_units": ["cm", "in"]
}

@ricardotejedorsanz
ricardotejedorsanz force-pushed the rt/uom-measurement-vocabulary branch from 70e5460 to 46b2ef5 Compare July 13, 2026 11:37
@ricardotejedorsanz
ricardotejedorsanz force-pushed the rt/uom-measurement-vocabulary branch from 46b2ef5 to 3e9cc33 Compare July 13, 2026 11:39
@ricardotejedorsanz

Copy link
Copy Markdown
Collaborator Author

Non-blocking: could we default missing attribute.type to closed_list in the shared layouts? Older release docs data does not include type, so those pages will render a blank Type value even though the attributes are effectively closed-list.

Thanks @jeanguo-png, addressed this in a separate follow-up commit.

@ricardotejedorsanz ricardotejedorsanz changed the title [UoM prototype] Render measurement attributes in docs (3/3) [UoM prototype] Render measurement attributes in docs (3/4) Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants