Exit and Escape go to the launch page when a deck was opened directly

Aperta Adatta ai principianti
#19 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
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia da exitDeck in src/deck-engine/DeckController.tsx, che attualmente chiama navigate(-1) incondizionatamente. Verifica se location.key === "default" identifica una prima voce, quindi invia il visitatore a / in quel caso, mantenendo il messaggio deck-closed sul canale prima di navigare. È completato quando Exit ed Escape da un deck aperto direttamente portano alla pagina di avvio, l'apertura dalla pagina di avvio riporta comunque lì, e i test del motore coprono entrambi i casi.

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

Descrizione

bug

Why

exitDeck in src/deck-engine/DeckController.tsx always calls navigate(-1). A deck is often the first page in its tab: a shared link, a bookmark, a pasted address. In that case there is no earlier entry in the app, and Exit and Escape take the visitor out of the app altogether, to the browser's previous page or to a blank tab. Someone who followed a link to one deck loses the way to the rest.

What changes

  1. exitDeck goes back when the app has an earlier entry, and otherwise goes to the launch page (/). React Router marks the first entry with location.key === "default".
  2. The notes window is still told the deck closed (deck-closed on the channel) before navigating, as now.

Done when

  • Opening /deck/<id> in a fresh tab and pressing Exit, or Escape, lands on the launch page.
  • Opening a deck from the launch page and pressing Exit still returns there.
  • The engine's tests pass, with a test for each case.

Out of scope

  • Letting a host supply its own exit handler.
  • Any change to the bars.
Lingua principale
TypeScript
Stelle
1
Fork
0
Merge medio
30m
PR unite (30g)
9

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 johnfrog76/connected-deck

Tutte le issue di johnfrog76/connected-deck

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.