Skip to content

Conversation

@gspencergoog
Copy link
Collaborator

Currently, on pages like this, the animations produced don't have unique IDs, because for enum fields, their oneLineDoc contains the entire documentation, so that they all appear in the Constants list on the enum's class page.

The way we tried to generate unique values in the past was to assume that each element would appear on its own page, and so be unique, but that's not true for enums.

This change creates a package-level Map<String, Set<String> that contains a mapping from Element.href to a set of animation IDs that have been already used for that href. We then generate new ids, making sure that each new ID is unique for the href. This should assure that there are no non-unique IDs on a single output page, including checking to make sure that user-supplied IDs are unique per page.

Also added a test that should make sure this is the case.

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Nov 6, 2019
@gspencergoog gspencergoog force-pushed the fix_enums branch 3 times, most recently from 47fed1d to 64fed6e Compare November 8, 2019 17:02
@jcollins-g jcollins-g merged commit 8c4227b into dart-lang:master Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Google CLA check succeeded.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants