Feature: Public API for sub-line span decorations
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Start by reading the existing intra-line diff highlighting built with Shiki DecorationItems and the exported createDiffSpanDecoration, then compare the consumer APIs on File, FileDiff, CodeView, and BaseCodeOptions. The issue leaves the API shape and naming open, so settle those questions before implementation. Done means consumers can supply character ranges and have them rendered as spans with the requested class.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prerequisites
- I have searched for duplicate or closed feature requests
- I have read the contributing guidelines
Proposal
Hi! Big fan.
I (on behalf of design systems @ Anthropic) would like to propose a consumer-facing way to style arbitrary character ranges within a rendered line. Something like a spanDecorations input on File / FileDiff / CodeView that addresses {lineNumber, spanStart, spanLength, className} and wraps the range in a span carrying the class.
The machinery seems to already exists internally... intra-line word/char diff highlighting is implemented with Shiki DecorationItems, and createDiffSpanDecoration is already exported. This would be exposing that stuff for consumer-supplied ranges. I'm aware of #459; this is the character-granularity counterpart, and I'd want to pick a name that doesn't collide with it.
Open API questions I'd defer to y'all on:
- Render prop (like
lineAnnotations) vs. option onBaseCodeOptions - Whether interaction callbacks (
onDecoration*, mirroringonToken*) are in scope or a separate ask - Naming (
spanDecorationsvs. something else, given #459)
I'd previously opened #810 with an implementation before discussing it here (sorry for jumping the gun!) That PR is available as a reference if useful, but I'm treating the API shape as fully open.
Motivation and context
We use @pierre/diffs in an internal code review tool. We'd like to add overlays anchored to sub-line ranges for things like...
- Highlighting high-risk spans (e.g. flagging string-concatenated SQL on an added line)
- Muting low-relevance code so the behavioral change stands out
- IDE-style diagnostics squiggles at exact character positions
- Anchoring AI-assist affordances (click a flagged span → explainer card)
I had Claude create some examples of this in action:
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 226
- Merge medio
- 2g 56m
- PR unite (30g)
- 44
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pierrecomputer/pierre
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pierrecomputer/pierre#1270 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Missing aria fields in the search inputForse già presa @saurav-shakya l’ha presa 3 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pierrecomputer/pierre#1242 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Row decorations and git status aren't part of a row's accessible nameForse già presa @saurav-shakya l’ha presa 3 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pierrecomputer/pierre#1187 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
pierrecomputer/pierre#1258 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Text selection and copy break across the virtualization boundaryForse già presa @Son-Of-Zeus l’ha presa 3 giorni fa. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
pierrecomputer/pierre#1255 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pierrecomputer/pierre
Issue simili
-
Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
getsentry/sentry-javascript#26203 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bytedance/flowgram.ai#1235 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
devswha/herdr-web-ui#3325 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100