Skip to content

Conversation

@BrianHung
Copy link
Contributor

@BrianHung BrianHung commented Jan 7, 2026

Description

This PR adds collapse/expand functionality to the File component, mirroring the existing diff hunks UI/UX.

New FileRenderer API:

  • visibleRanges: LineRange[] - specify which line ranges to show
  • expansionLineCount: number - lines to reveal per expand click
  • hunkSeparators: HunkSeparators - separator style for collapsed regions

I've also added a demo to apps/demo/index.html

Motivation & Context

I would like to have same UI/UX for collapsed or hidden lines, but for FileRenderer.

Screenshot
CleanShot 2026-01-07 at 02 45 31@2x

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)
  • Documentation update

Checklist

  • I have read the
    contributing guidelines
  • My code follows the code style of the project (bun run lint)
  • My code is formatted properly (bun run format)
  • I have updated the documentation accordingly (if applicable)
  • I have added tests to cover my changes (if applicable)
  • All new and existing tests pass (bun run diffs:test)

@vercel
Copy link

vercel bot commented Jan 7, 2026

@BrianHung is attempting to deploy a commit to the Pierre Computer Company Team on Vercel.

A member of the Team first needs to authorize it.

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