Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Feature: host-defined folded line ranges inside a FileDiff

Open
#1,146 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start with the FileDiff implementation and trace how collapsedContextThreshold, the virtualizer's height estimates, annotations, and split-view row pairing are handled. Then determine how foldedRanges and expand state should fit those paths, including the stated annotation behavior. Done means ranges render as labeled expandable separator rows, height estimates account for them, and split-view folding behaves as one unit.

Written by the indexing model from the issue text.

Description

Prerequisites
Proposal

An option on a diff item that lets me name ranges of lines to collapse, the same way collapsedContextThreshold folds unchanged context: one separator row with a customizable label and an expand control, with the virtualizer's height estimates accounting for it.

foldedRanges?: Array<{
  side: 'additions' | 'deletions';
  start: number;   // first line of the run, on that side
  end: number;     // last line, inclusive
  label?: string;  // separator text; falls back to "N lines"
}>;

Expand is a lib-owned interaction like the context expander, with onFoldToggle or a controlled expandedFolds so I can keep the state. In split view a range folds both columns as one unit. An annotation whose line is inside a folded range either forces it open or is rejected, whichever is simpler.

Motivation and context

I currently have a feature to compute moved-code (lines of code that moved from file to another unchanged) and paint them through unsafeCSS plus a line annotation carrying the origin. Long runs still make the reviewer scroll past code that exists elsewhere in the same diff. Folding those rows is the natural next step (since it moved unchanged, I display it as a collapsed hunk), and only the lib can do it correctly: it owns row heights, the collapsed-context separators, annotation layout, split-view pairing and line selection.

Version: @pierre/diffs 1.2.11.

Thanks.

Dominant language
TypeScript
Stars
6.2k
Forks
226
Avg merge
1d 13h
Merged PRs (30d)
33

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pierrecomputer/pierre

All issues in pierrecomputer/pierre

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.