Shelf: deleting your only pinboard while it's open leaves the shelf on an empty board

Aperta Adatta ai principianti
#25 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Leggi l’effetto di fallback e handleBoardEditorDelete in src/renderer/src/shelf/shelf-app/shelf-app.tsx, poi riproduci il flusso di eliminazione in pnpm demo. Verifica che, eliminando la bacheca aperta, venga selezionata History sia quando è l’ultima bacheca sia quando ne restano altre, e che la prima bacheca creata venga comunque aperta. Il lavoro è completato quando sia l’eliminazione sia la creazione funzionano come descritto.

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

Descrizione

bug good first issue

If you delete the pinboard you're looking at and it was your last one, the shelf stays on it. No tab is selected and it says "This pinboard is empty", even though History still has items. Pressing Tab or clicking History gets you back.

To reproduce in the app: create your first pinboard (it opens), then delete it (right-click its tab → Delete… → Delete pinboard).

To reproduce in pnpm demo, which starts with three pinboards: open Replies, then delete Snippets, Brand and Replies.

Deleting the open pinboard while others remain already works: the shelf goes back to History.

Where to look
  • src/renderer/src/shelf/shelf-app/shelf-app.tsx: the effect under // If the open board is deleted, fall back to history. Its boards.length && check skips the fallback when no pinboards are left
  • handleBoardEditorDelete in the same file, which deletes the board but doesn't touch the open one

Simply dropping boards.length && looks like the fix, but check that creating your first pinboard still opens it. handleBoardEditorSave switches to the new board as soon as it's created, and the list of boards reloads separately, so for a moment the new board may not be in boards yet. Going back to History in handleBoardEditorDelete when the deleted board is the open one avoids that.

Done when
  • Deleting the open pinboard goes back to History with its tab selected, whether or not other pinboards are left
  • Creating a pinboard still opens it, both your first one and when you already have others
  • You've checked both in pnpm demo or the app

Suggested pull request title: fix(shelf): go back to history when the open pinboard is deleted


New to OpenPaste? CONTRIBUTING.md covers setup, the code conventions and the checks to run before a pull request (pnpm typecheck, pnpm test, pnpm format, pnpm cleaner). Leave a comment if you're picking this up so nobody doubles up.


Generated by Claude Code

Lingua principale
TypeScript
Stelle
0
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 alexsilver8/openpaste

Tutte le issue di alexsilver8/openpaste

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.