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

💡 translate: shift an element's paint without affecting flow

Aperta
#82 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
c, typescript
Ambito
cli

Direzione di ricerca

Inizia con il test fallito in test/translate.test.ts, poi leggi le definizioni di layout in ops.ts:97-120 e ops.ts:245-253, seguite dalla decodifica dei gruppi di layout in src/clayterm.c:499-516. Verifica che translate venga applicato dopo il layout di flusso, sposti i discendenti disegnati e i bounds riportati, mantenga il posizionamento dei fratelli e cambi l’output atteso da "AB " a " BA ".

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

Descrizione

enhancement

Is your feature request related to a problem?

There's no way to nudge an element a few cells from where layout placed it while leaving its neighbors put. The only offset tool today is floating, which pulls the element out of flow so siblings reflow to fill the gap. A fixed(5) row holding element a (text A) followed by text B renders "AB "; we can't shift A two cells right while B stays put, since anything that moves A collapses B back to column 0. That rules out small visual nudges (badges, carets, hover) that shouldn't disturb surrounding layout.

Describe the solution you'd like

A render-time translate that shifts an element's painted cells (and its descendants') by {x, y} after flow layout, mirroring the CSS translate property (exact name TBD). It does not change layout: the element keeps its computed flow slot and siblings don't move. It's purely a visual displacement, with the element's reported bounds following the shift so hit-testing stays correct. Above, a keeps its slot at x=0, B stays at column 1, and a paints two cells over to yield " BA ".

const node = open("a", {
  layout: {
    translate: { x: 2, y: 0 },
  },
});

Describe alternatives you've considered

floating removes the element from flow (siblings collapse), so it can't do an in-place nudge. Post-processing the rendered grid in TS can't see clip regions, backgrounds, or descendant bounds, and info.bounds would still report the un-shifted position—breaking hit-testing and hover. A renderer-side translate keeps bounds and paint in sync.

Additional context

Failing test case on nm/repro/translate (test · diff). Today bounds.x is 0 instead of 2 and the row renders "AB " instead of " BA ". This likely lives in ops.ts:97-120 (the pack layout group has no translate slot) and ops.ts:245-253 (OpenElement.layout has no translate field), with the render-time shift applied where the layout group is decoded (src/clayterm.c:499-516).

Lingua principale
TypeScript
Stelle
42
Fork
2
Merge medio
2g 5h
PR unite (30g)
12

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 bombshell-dev/tty

Tutte le issue di bombshell-dev/tty

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.