Feature: Trees: support file icon overrides by full path

Aperta
#1,279 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Read the @pierre/trees icon matching and setIcons() entry points, then trace how byFileName and extension rules are applied. Add exact canonical-path matching with the precedence described in the issue, and confirm path-specific icons can be updated through setIcons() while reusing the existing SVG sprite mechanism.

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

Descrizione

We use @pierre/trees 1.0.0-beta.6 to display task artifacts, with image thumbnails in place of file icons.

Different folders can contain different images with the same filename:

before/screenshot.png
after/screenshot.png

Currently, byFileName matches only the basename, so we cannot assign different thumbnails to these two files. Our workaround is to display generic icons when filenames collide.

Could Trees support icon overrides keyed by canonical tree path? For example, a proposed icons.byPath map:

byPath: {
  'before/screenshot.png': { name: 'thumbnail-before' },
  'after/screenshot.png': { name: 'thumbnail-after' },
}

Exact path matches could take precedence over the existing filename and extension rules, with updates supported through setIcons(). This would reuse the existing SVG sprite mechanism; thumbnail generation and loading would remain the application's responsibility.

Related: #498 and #691. This request is narrower than custom row rendering: it only adds path-specific icon overrides.

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

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.