Replace sidebar HTML element aside with nav - #660
Conversation
|
Amplify deployment status
|
|
@aatuvai Would you mind providing some context for why we are making this change? Are there any intended UX differences here, or just a tag swap? If this is addressing accessibility concerns, would it be worth working with the Docusaurus maintainers here instead of making changes downstream? Thanks! |
|
@ptgott This was one of the docs team Q2 items. Only the tag swap is intended. The reasoning was that agents reading the page as HTML would more quickly detect the sidebar as a navigation area in order to not waste tokens reading through it. @roraback Personally I'm not certain about the effectiveness of this though, as it is not straightforward to prove. Also, now that the Markdown pages are served alongside the HTML ones, the concerns of the original comment (in the spreadsheet) are less prominent I think. And yes, this sort of a change would preferably be done upstream in the Docusaurus repo. |
|
I asked Claude for alternatives and it suggested modifying the DocSidebar/Desktop component. Would that work as an alternative to ejecting the two components?
Thanks for the PR! A few thoughts. This repo already has a full eject of You could avoid both new ejections by modifying the file that's already there. Adding As you note, the right long-term home for this is Docusaurus core, where the maintenance burden is zero for downstream consumers. One thing worth checking before landing either approach: most LLM web scrapers identify skip regions by ARIA landmark role, and |
…t, add role="navigation" and aria-label="Docs sidebar" to DocSidebar/Desktop
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 946132c830
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@ptgott The change suggested by Claude doesn't actually make a whole lot of sense since it just suggests adding a If we want to avoid ejecting the components to prevent the additional maintenance burden, I'm leaning towards closing this PR and putting the task from the Q2 list on hold. Alternatively we could look into adding an issue on the Docusaurus repository to switch the tags. What do you think? |
Are we able to demonstrate that this change has the effect we want it to? If so, I think we can go ahead with it. We have already swizzled a number of components that are low in the component tree, so this isn't going to introduce a new class of issue, just increment the number of now-custom components we'll need to maintain. Going forward, it might make sense to implement a workflow in which we can merge upstream Docusaurus changes into our swizzled components to make sure we're up to date with bug fixes etc. |
The task description in the Q2 planning sheet reads:
@ptgott So the assumption in the task is that when an AI chatbot fetches a page, it would filter content based on the HTML structure of a web page. My understanding is that when e.g. Claude "reads" a web page, its internal fetch tool processes the whole page. These tools probably have some internal logic to only consider the main content of the page for further evaluation. Thus I can't tell how we could reliably demonstrate that the change has the desired effect. |
Changes
This PR replaces the
asideelement found in the DocusaurusDocRootLayoutSidebarcomponent withnav. Also thenavelement which was previously inDocSidebarDesktopContentis changed todivso that only onenavis present in the sidebar.Note
The update requires swizzling the internal Docusaurus components (The components are swizzled with the
--ejectflag). Swizzling the components might cause problems in the future if Docusaurus introduces breaking changes that are related to these components.