TOC fixes#995
Merged
Merged
Conversation
- Change Markdown source to use metadata.source as the basis, rather than editUrl. - Change "Copy as Markdown" button to conditionally show only when the Markdown source can be resolved. These changes are intended to allow autogenerated docs in the api directory to work with the "Cope as Markdown" option, and also to future-proof other docs incompatible with the option from displaying it.
Opportunistically fix incorrect command to install versioned templates in install-avalonia.mdx. (Raised in #974)
- Removed override settings in _toc.scss, which were overwriting the swizzled TOC component. - Adjust settings of the scroll container to allow the child block to shrink below the content height.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses usability issues in the docs site TOC panel by restoring proper scrolling behavior and fixing “Copy as Markdown” for generated API reference pages, plus an opportunistic correction in the installation docs.
Changes:
- Fix “Copy as Markdown” on
/apipages by deriving the raw source URL frommetadata.sourcerather thaneditUrl. - Restore TOC scrollbar behavior by switching TOC wrapper/content to a flex layout and removing a conflicting legacy SCSS override.
- Update the install guide’s Avalonia templates version install command.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/theme/TOC/styles.module.css | Makes the TOC wrapper a flex column and allows the TOC list to shrink/scroll properly. |
| src/theme/TOC/index.tsx | Builds a raw GitHub URL from metadata.source and conditionally shows “Copy as Markdown”. |
| src/styles/components/_toc.scss | Removes legacy layout/overflow overrides that prevented TOC scrolling. |
| docs/get-started/install-avalonia.mdx | Updates the pinned Avalonia.Templates install instruction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes two issues in the TOC panel of the docs site.
In addition, the erroneous installation command in #974 has been opportunistically fixed.
The above changes have been tested locally and confirmed to resolve the relevant issues.