Skip to content

[DX-1525]: Collapse long snippets behind a "Show more" toggle#3470

Open
m-hulbert wants to merge 1 commit into
mainfrom
feature/codeblock-show-more
Open

[DX-1525]: Collapse long snippets behind a "Show more" toggle#3470
m-hulbert wants to merge 1 commit into
mainfrom
feature/codeblock-show-more

Conversation

@m-hulbert

Copy link
Copy Markdown
Contributor

Description

This PR collapses codeblocks by default if they are above 15 lines long, adding a 'show more' and 'show less' toggle so that it's easy to switch between them.

The intention is to improve the readability of pages with multiple, long codeblocks such as getting started guides.

Checklist

Clip code blocks longer than 15 lines (configurable via collapsedLineCount)
behind a fade-out gradient and a "Show more"/"Show less" toggle. The toggle
is a floating centered pill rather than a full-width bordered bar, so it
never reads as a second footer row when the API key selector sits below it.
Authors can opt out per block with collapse={false}.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@m-hulbert m-hulbert self-assigned this Jul 13, 2026
@m-hulbert m-hulbert added the review-app Create a Heroku review app label Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a75dfbdd-d39f-4337-b5e3-4e2cf8e17372

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/codeblock-show-more

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

2 participants