Show the weekdays-only notice after an in-place weekend redirect

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

Direzione di ricerca

Inizia da TaskFlow.Web/src/pages/JournalPage.tsx e leggi come viene inizializzato notificationMsg e come vengono gestiti weekendRedirect e focusTaskId. Poi trova i test Vitest per JournalPage e copri i quattro criteri di accettazione, inclusi la chiusura dell’avviso e l’azzeramento del solo flag di reindirizzamento. Il lavoro è completato quando tutti e quattro i comportamenti superano i test.

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

Descrizione

Follow-up to #404 (merged in #462). Found during that run. Not groomed. Web only.

Problem

/journal/:date redirects a weekend date to the previous Friday when "weekdays only" is on. The redirect is in-place (navigate(..., { replace: true, state: { weekendRedirect: true } }) in TaskFlow.Web/src/pages/JournalPage.tsx), so JournalPage stays mounted. The notice "Weekdays only — redirected to Friday" is read once, in the initial value of useState (notificationMsg), so it does not appear after an in-place redirect. It appears only when the page mounts directly on Friday with weekendRedirect state (for example after a refresh).

Reproduce: turn weekdays-only on, open the journal on a weekday, then navigate to a Saturday (a link, the URL, or the date shortcuts). The page lands on Friday with no notice.

This is not caused by #404, which only made the redirect keep other one-shot state. The user is moved to another day with no explanation.

Change

Show the notice whenever the location carries weekendRedirect, including after an in-place redirect, and keep it dismissible as it is today. Keep clearing the flag so a later refresh does not repeat it, but do not drop other one-shot state (focusTaskId, see docs/FRONTEND.md "Origin state and back link").

Acceptance criteria

  1. An in-place weekend redirect shows "Weekdays only — redirected to Friday".
  2. Mounting directly on Friday with weekendRedirect state still shows it, once.
  3. A later refresh or revisit does not show it again.
  4. A redirect that carries focusTaskId still returns focus to the row (the #404 behavior).
  5. Vitest tests for 1 to 4.

Out of scope

  • Changing the weekdays-only rule or the redirect target.
Lingua principale
C#
Stelle
1
Fork
0
Merge medio
2h 2m
PR unite (30g)
98

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 nevridge/TaskFlow

Tutte le issue di nevridge/TaskFlow

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.