Slaif fixes#235
Merged
Merged
Conversation
janezd
commented
Jun 11, 2026
Contributor
- Limit the width of the content index to prevent it to be mostly to the left of the window in case of long titles.
- Fix copy to clipboard in Expressive Code elements.
- Remove Expressive Code terminal frames.
- Fix sizing of Expressive Code elements (in particular, excluding horizontal scrollbars from calculation)
There was a problem hiding this comment.
Pull request overview
This PR addresses several UX and rendering issues related to the Content Index positioning and rehype-expressive-code output in rendered MDX, including copy-to-clipboard behavior and terminal styling.
Changes:
- Adds a client-side copy-to-clipboard initializer for Expressive Code copy buttons and wires it into the Book page.
- Removes Expressive Code “terminal frame” styling by stripping the
is-terminalclass during ingestion. - Constrains the header content-index width to prevent it from shifting off-screen with long titles.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
utils/copyToClipboard.ts |
Adds DOM-based copy button wiring with Clipboard API + fallback. |
components/Book/Book.tsx |
Runs Expressive Code “init” logic on mount and on DOM mutations to support MDX-rendered content. |
ingest/plugins.ts |
Introduces a rehype plugin that removes the is-terminal class from output. |
ingest/md-helpers.ts |
Registers the new rehype plugin in the MDX compilation pipeline. |
styles/content-index/content-index.scss |
Adds a max-width to keep the header content index from becoming too wide. |
💡 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.