Skip to content

feat(todo): add realtime countdown and badge sync - #72

Merged
Turtle-Hwan merged 21 commits into
mainfrom
feat/todo
Aug 8, 2026
Merged

feat(todo): add realtime countdown and badge sync#72
Turtle-Hwan merged 21 commits into
mainfrom
feat/todo

Conversation

@Turtle-Hwan

@Turtle-Hwan Turtle-Hwan commented Jul 30, 2026

Copy link
Copy Markdown
Owner

변경 사항

  • 마감 24시간 이하 Todo에 HH:mm:ss 실시간 카운트다운을 표시하고, 12시간 이하에서는 긴급 색상을 적용합니다.
  • 설정에 저장 실패 시 UI가 어긋나지 않는 접근성 switch와 실제 타이머 미리보기를 추가했습니다.
  • 타이머를 끄면 동일한 미리보기 마감이 D-1 형태로 표시됩니다.
  • custom Todo와 eCampus Todo 상태/인증/설정을 feature hook으로 분리했습니다.
  • popup 탭 badge와 확장 action badge가 동일한 count 포맷과 색상을 사용하도록 통합했습니다.
  • custom/eCampus count 요청을 병렬화하고, 동일한 eCampus 진행 요청과 짧은 성공 캐시를 공유합니다.
  • storage/eCampus 날짜 문자열을 런타임 검증해 잘못된 값이 NaN:NaN:NaN으로 표시되지 않게 했습니다.
  • Chrome API가 없는 웹 미리보기 환경에서도 Todo UI를 확인할 수 있도록 안전한 fallback과 로컬 eCampus 샘플을 추가했습니다.
  • 설정에서 eCampus 계정을 저장하거나 삭제하면 이미 열린 Todo 화면도 즉시 새 계정 상태로 갱신됩니다.
  • eCampus Todo 요청의 non-2xx 응답을 실패로 처리해 일시적인 서버 오류가 마지막 정상 badge count를 지우지 않게 했습니다.
  • 최신 main을 병합해 시간표/content script 및 최신 빌드 구성을 함께 반영했습니다.

배경

Todo 타이머 기능은 설정 미리보기, 저장 실패 처리, 날짜 입력 검증이 빠져 있었고, popup badge와 Todo 탭이 eCampus 데이터를 중복 요청할 수 있었습니다. 외부 입력 경계와 요청 공유 지점을 정리하고, 계정 변경 및 일시적 eCampus 장애 시에도 화면과 badge가 일관되도록 보완했습니다.

Closes #43

검증

  • pnpm exec tsc -b --force
  • pnpm run lint
  • pnpm run test:timetable (10 tests)
  • pnpm run build:local
  • 타이머 켜짐 시 약 23:59:xx 카운트다운 확인
  • 타이머 꺼짐 시 D-1 표시 확인
  • switch의 accessible name과 aria-checked 전환 확인
  • 잘못된 날짜/시간 및 윤년 경계 검증
  • eCampus 진행 중 요청·성공 캐시 공유 확인
  • eCampus 503에서 마지막 정상 count 유지 및 인증 만료 시 eCampus count만 제거 확인
  • 설정의 계정 저장/삭제 알림 구독과 구독 해제 확인
  • 웹 미리보기에서 Todo 목록·타이머·설정 저장 후 즉시 상태 동기화 확인

수동 확인

  • 생성된 dist/를 Chrome에 다시 로드해 실제 MV3 chrome.storage, action badge, service worker 동작 확인

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploying linku with  Cloudflare Pages  Cloudflare Pages

Latest commit: 92039b4
Status:🚫  Build failed.

View logs

@Turtle-Hwan

Copy link
Copy Markdown
Owner Author

@codex plz review

@Turtle-Hwan Turtle-Hwan self-assigned this Aug 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a3d2e1604

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/utils/ecampus/todos.ts Outdated
Comment on lines +72 to +75
export const invalidateECampusTodosCache = () => {
cacheGeneration += 1;
cachedResults.clear();
inFlightLoads.clear();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent invalidated auto-login requests from changing accounts

When the badge refresh is auto-logging in with stored account A while the user saves or logs into account B, this only removes the promise from the maps; the old loadECampusTodosUncached continues executing eCampusLoginAPI and may later clear B's newly stored credentials after A fails authentication or overwrite the shared eCampus cookie with A's session. The generation check occurs only after all of those side effects, so account changes need to abort or serialize the prior authentication attempt, or check the generation before mutating credentials/session state.

Useful? React with 👍 / 👎.

@Turtle-Hwan
Turtle-Hwan marked this pull request as ready for review August 8, 2026 10:52
@Turtle-Hwan
Turtle-Hwan merged commit c2de95a into main Aug 8, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] Todo 실시간 타이머 기능

1 participant