Skip to content

fix(docs): add expandable code block controls#28

Open
vyctorbrzezowski wants to merge 1 commit into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/docs-expandable-code-blocks
Open

fix(docs): add expandable code block controls#28
vyctorbrzezowski wants to merge 1 commit into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/docs-expandable-code-blocks

Conversation

@vyctorbrzezowski
Copy link
Copy Markdown
Contributor

@vyctorbrzezowski vyctorbrzezowski commented Jun 1, 2026

Summary

Expandable code fences already had a capped height, but the rendered block did not explain that more content existed or give readers a way to reveal it. On long examples, that made the code feel abruptly clipped instead of intentionally collapsed.

This PR makes that state explicit:

  • add a visible Show more / Show less control for expandable code fences
  • keep truncated expandable blocks readable with a bottom fade instead of silently clipping content
  • preserve the existing copy-code control and generated code markup
  • add a hidden fixture example plus smoke coverage for the expandable block contract

Screenshots

Collapsed:

Collapsed expandable code block

Expanded:

Expanded expandable code block

Testing

  • git diff --check
  • DOCS_SITE_PREVIEW_INCLUDE_FIXTURE=1 npm run docs:build:preview
  • node --check scripts/docs-site/assets.mjs
  • node --check scripts/docs-site/mdx-ish.mjs
  • node --check scripts/docs-site/elements-fixture.mjs
  • node --check scripts/docs-site/smoke.mjs
  • node --check dist/docs-site/assets/docs-site.js
  • manual browser verification of collapsed and expanded states

@vyctorbrzezowski vyctorbrzezowski force-pushed the brzezowski/docs-expandable-code-blocks branch from bb158f8 to 94f12db Compare June 1, 2026 05:06
@vyctorbrzezowski vyctorbrzezowski marked this pull request as ready for review June 1, 2026 05:08
@vyctorbrzezowski vyctorbrzezowski requested a review from a team as a code owner June 1, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant