There's an issue with the document preview titles in the navigator.
The titles end up always being generated from the pathname, regardless of a document's actual title.
This is problematic, for example, if a page's title and pathname differ:
It's also an issue for non-English titles, for example:
This PR fixes the preview logic so that the correct titles are always shown:
This should make it clear to editors which page is which, even if the pathname differs or if there are special characters or capitalized characters in the title.
I used these components in Sanity's repo as reference for this change:
It seems to work well, but I'm not too well-versed in the inner workings of these parts so there may well be a better way to do it, so I'm open to adjusting this as needed.
There's an issue with the document preview titles in the navigator. The titles end up always being generated from the pathname, regardless of a document's actual title.
This is problematic, for example, if a page's title and pathname differ:
It's also an issue for non-English titles, for example:
This PR fixes the preview logic so that the correct titles are always shown:
This should make it clear to editors which page is which, even if the pathname differs or if there are special characters or capitalized characters in the title.
I used these components in Sanity's repo as reference for this change:
It seems to work well, but I'm not too well-versed in the inner workings of these parts so there may well be a better way to do it, so I'm open to adjusting this as needed.