mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.18k stars 501 forks source link

Show inherited properties/methods in the APIRef sidebar #6595

Open ADTC opened 2 years ago

ADTC commented 2 years ago

What page(s) did you find the problem on?

https://developer.mozilla.org/en-US/docs/Web/API/File/size https://developer.mozilla.org/en-US/docs/Web/API/File

Specific page section or heading?

(Sidebar) Related Topics > Properties image

What is the problem?

The sidebar doesn't have a link to the size property.

What did you expect to see?

The sidebar has a link to the size property.

Did you test this? If so, how?

I checked the File API specification. The size property is listed under Instance properties as File.prototype.size.

teoli2003 commented 2 years ago

That's because File.size is in fact defined on Blob. That page should be a redirect to Blob.size. I agree that inherited properties/methods are a bit hidden, though.

teoli2003 commented 2 years ago

To make it appear on the sidebar, we should modify the macro. @Elchi3, @wbamberg, @rumyra: do you think we should?

schalkneethling commented 2 years ago

To make it appear on the sidebar, we should modify the macro. @Elchi3, @wbamberg, @Rumyra: do you think we should?

Friendly ping to @Rumyra for your thoughts on this issue. Thank you.

Rumyra commented 2 years ago

I think this is a good issue to address with the work (and discussion) around page types, organising web apis and that sidebar work - I haven't made a decision, but the options are:

schalkneethling commented 2 years ago

@teoli2003 Thoughts on the above?

teoli2003 commented 2 years ago

I don't think the current sidebar system allows for adding it to the sidebar. (Without a significant revamp). It just doesn't list inherited properties and methods, only a link to the inherited interfaces.

So this will need to wait for engineering time to move the sidebars from macros to yari (using page-type, etc), I guess.

schalkneethling commented 2 years ago

I don't think the current sidebar system allows for adding it to the sidebar. (Without a significant revamp). It just doesn't list inherited properties and methods, only a link to the inherited interfaces.

So this will need to wait for engineering time to move the sidebars from macros to yari (using page-type, etc), I guess.

Does it then make more sense to move this to Yari?

wbamberg commented 2 years ago

I don't think the current sidebar system allows for adding it to the sidebar. (Without a significant revamp). It just doesn't list inherited properties and methods, only a link to the inherited interfaces. So this will need to wait for engineering time to move the sidebars from macros to yari (using page-type, etc), I guess.

Does it then make more sense to move this to Yari?

Either way this is a Yari bug, since sidebars are implemented in KS now, and that is in Yari.

caugner commented 1 year ago

To show inherited properties (and methods!?) in the APIRef sidebar, we can use the same data source as the InheritanceDiagram macro (i.e. the InterfaceData.json).

Requirements:

  1. Show all inherited properties and methods in the sidebar, unless they are overridden (e.g. Blob.type -> File.type).
  2. Make them distinguishable (since navigating to an inherited property or method will lead to a different sidebar).