Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature: flattenEmptyDirectories: support end-truncation for the whole flattened path instead of per-segment truncation

Aperta
#1,027 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@JoeJoeflyn ci sta già lavorando.

Dal 8/8/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Start at the useFileTree entry point and trace how flattenEmptyDirectories renders flattened path segments; then locate the related tests. Determine how to support an end-truncation option while preserving per-segment truncation as the default. Done means the whole flattened path can truncate at the end and the existing default behavior remains unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
Prerequisites
Proposal

Currently when
flattenEmptyDirectories: true is
enabled, each path segment is
individually wrapped in a Truncate
component, resulting in display
like:

Image

a... / b... / c... / dd... / ...

We'd like to support an option to
truncate the whole flattened path
at the end, like:

Image

aaa / bbb / ccc /...

This is more readable and matches
how most file explorers (e.g. VS
Code) handle deep nested paths.

Proposed API:

useFileTree({                      
  flattenEmptyDirectories: true,   
  flattenedSegmentsTruncation:   
'end', // 'per-segment' (default) |
 'end'                             
})      

Or alternatively a CSS variable /
data attribute that consumers can
use to override the truncation
strategy via unsafeCSS.

Motivation and context
Image Image

When flattenEmptyDirectories: true
is enabled and the tree is rendered
in a narrow container (e.g. a
sidebar panel pushed to the right
edge), the per-segment truncation
produces a very poor visual result
— every segment gets clipped
individually, leaving a string of
disconnected ellipses like a... /
b... / c... / dd... / .... This
makes the path nearly unreadable
and wastes space with repeated ...
markers.

VS Code handles this well by
truncating the entire flattened
path as a single string at the end
(aaa / bbb / ccc /...), which keeps
as much of the path visible as
possible and is far easier to scan
at a glance. Supporting
end-truncation for the whole path
would bring @pierre/trees in line
with this established UX pattern
and significantly improve usability
in space-constrained layouts.

Lingua principale
TypeScript
Stelle
6.2k
Fork
226
Merge medio
1g 11h
PR unite (30g)
33

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pierrecomputer/pierre

Tutte le issue di pierrecomputer/pierre

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.