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

Đang mở Phù hợp với người mới
#463 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
frontend, testing

Hướng nghiên cứu

Bắt đầu với TaskFlow.Web/src/pages/JournalPage.tsx và đọc cách notificationMsg được khởi tạo cũng như cách weekendRedirect và focusTaskId được xử lý. Sau đó, tìm các bài kiểm thử Vitest cho JournalPage và kiểm thử đủ bốn tiêu chí chấp nhận, bao gồm đóng thông báo và chỉ xóa cờ chuyển hướng. Hoàn tất khi cả bốn hành vi đều vượt qua kiểm thử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
C#
Star
1
Fork
0
Merge trung bình
2 giờ 2 phút
Pull request đã merge (30 ngày)
98

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nevridge/TaskFlow

Tất cả issue của nevridge/TaskFlow

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.