yari icon indicating copy to clipboard operation
yari copied to clipboard

Compat Macros Shows Misleading Information

Open jpmedley opened this issue 3 years ago • 1 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility

What specific section or headline is this issue about?

Browser Compatibility

What information was incorrect, unhelpful, or incomplete?

The compat section shows multiple tables to cover each of the interfaces that are part of the push api. However, the autogenerated heading includes the interface's parent key within the browser compatibility database.

This will look to someone unfamiliar with the BCD data like a JavaScript object and member reference. In other words, they might assume they can type api.PushEvent or something similar in their code.

image

What did you expect to see?

Instead of something like "api.PushEvent", I should just see "PushEvent".

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

Readers should not need familiarity with MDN's data storage mechanisms to interpret what's on an MDN page.

jpmedley avatar Jul 22 '22 17:07 jpmedley

@schalkneethling Can you transfer this to mdn/yari?

teoli2003 avatar Jul 22 '22 18:07 teoli2003

This issue arised by allowing multiple BCD queries per page (https://github.com/mdn/yari/pull/6464).

The best solution I could think of is to strip common parent paths from the displayed BCD keys (taking the last path item would not necessarily always work).

@queengooborg Would you be interested in having a look at this?

caugner avatar Aug 22 '22 12:08 caugner

Yeah that sounds like a good plan to me -- it seems like that's what is going on in the tables themselves, so consistency sounds good!

We should also show the description if there is one available?

queengooborg avatar Aug 22 '22 12:08 queengooborg

We should also show the description if there is one available?

Do you mean 'instead of the path' or 'in addition to the path'? I'd think the former, since the latter would be redundant.

jpmedley avatar Aug 22 '22 15:08 jpmedley