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

Desktop 2.2.2: hideCloseButton on a tab trigger has no stylesheet rule, so the New tab row shows a close button that cannot close it

Aperta Adatta ai principianti
#60,541 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
desktop, frontend

Direzione di ricerca

Inizia da ui/src/navigation/tabs/tabs.tsx:139 e dai fogli di stile delle schede; verifica quale elemento riceve data-hidden e dove viene controllata la sua visibilità. L’issue suggerisce di aggiungere una regola per nascondere quel pulsante di chiusura, quindi di verificare che la riga New tab non mostri più ×. Esamina anche app/src/runtime/plugin/side-region.tsx e app/src/runtime/plugin/panels.tsx se decidi di rendere persistente la chiusura del riquadro vuoto.

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

Descrizione

Environment

  • OpenCode Desktop 2.2.2 (AppImage, Linux x64)

Summary
Tabs.Trigger accepts hideCloseButton, sets data-hidden on the close-button wrapper, but no stylesheet uses that attribute. The close button therefore stays visible on the New tab row, and clicking it does not close the row: the row is dismissed and immediately reopened by the side region's open effect.

Steps to reproduce

  1. Open a session with the right pane visible.
  2. Observe the New tab row in the pane's tab strip: it shows an ×.
  3. Click the ×.

Actual behaviour
The row flickers and stays. The pane never closes.

Expected behaviour
Either the close button is hidden on this row, or clicking it closes the row and the empty pane.

Evidence
ui/src/navigation/tabs/tabs.tsx:139 writes the attribute:

<div data-slot={closeSlot()} data-hidden={local.hideCloseButton ? "" : undefined}>

app/src/runtime/plugin/side-region.tsx:326 passes hideCloseButton, so the attribute is present in the DOM.

A grep across every stylesheet shipped in the 2.2.2 asar returns exactly one rule for that attribute, and it belongs to the session timeline, not to tabs:

[data-hidden] [data-slot=timeline-detail-activity]{

The close button's only visibility rule is the opposite one, which forces it on for the selected trigger:

[data-component=tabs] [data-slot=tabs-trigger-wrapper]:has([data-selected]) [data-slot=tabs-trigger-close-button]{opacity:1}

Because the New tab row is selected, the × renders.

Why closing does not stick
app/src/runtime/plugin/panels.tsx dismissNewTab() removes the entry and, when the strip is empty, calls onEmptied() to close the region. app/src/session/screen.tsx:97 implements that as a side toggle. app/src/runtime/plugin/side-region.tsx then reopens a New tab in the same update, because the pane is still marked as starting empty:

const starting = createMemo(() =>
  tabsOpen() && layout.ready() && props.region.empty() ? props.view.key : undefined,
)
createEffect(on(starting, (key) => key && props.region.openNewTab("side")))

So the close is undone immediately; the user only sees a flicker.

Suggested fix
Add the missing rule, for example:

[data-slot=tabs-trigger-close-button][data-hidden] { display: none; }
Lingua principale
TypeScript
Stelle
221k
Fork
29.6k
Merge medio
7h 41m
PR unite (30g)
510

Preparare l'ambiente

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 anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.