Page MenuHomePhabricator

Section heading link suggestions should update when headings are added/edited
Open, Needs TriagePublic

Description

Since T52881 we suggest page heading links after typing # (either for the current page, or another page). If the suggestions are for the current page, the list should be up-to-date with any edits that have been made to the document.

Note that "New section" (added in the current edit session), is not in the suggestion list:

image.png (454×803 px, 83 KB)

The slight complication here is that this feature lives in a core widget (mw.widgets.TitleWidget) and all suggestions, including for the current page, come from the API. We either need another config option to pass in, or the class needs to be sub-classed in VE.

Event Timeline

Finding the current section headings is also done in ve.ui.MWTocWidget.js, which might be a useful place to start