Skip to content

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

Open
ricardotejedorsanz wants to merge 1 commit into
rt/uom-measurement-vocabularyfrom
rt/uom-visualizer-docs
Open

[UoM prototype] Render measurement attributes in docs (3/3)#952
ricardotejedorsanz wants to merge 1 commit 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 3 times, most recently from 45ff80f to eb4dcd4 Compare July 1, 2026 19:39

@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

#### 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

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