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

Feature: Allow Tree flatten if fits

Open
#948 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
frontend

Research direction

Start by finding where flattenEmptyDirectories is applied and reading the tree rendering and layout code around it. Check how the tree responds to container resizing and whether existing tests cover directory flattening. Done means long paths remain readable when space is limited and flatten when the available width is sufficient.

Written by the indexing model from the issue text.

Description

enhancement
Prerequisites
Proposal

Is there a way to configure the flattenEmptyDirectories for trees so that it only flattens if the flattened text will fit without overflowing?

eg: if the directory is foo/bar/baz/foo2/bar2/baz2 and the container is too small, instead of showing something like /f./.b./b./f./b./b. it will simplify not flatten it in the first place. if the container is expanded and the text will fit if flattened, then convert it to flatten.

this way it can respond to changing containers and flow nicely instead of showing an ellipsis, which is not easy to use if there is a very long directory.

Motivation and context

I have lots of nested directories with very long names (total of potentially 300 char long path). This will not fit in the size of container we want to use.
However, the user can choose to resize it.

Dominant language
TypeScript
Stars
6.2k
Forks
226
Avg merge
1d 11h
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.