Skip to content

Fix 8 frontend bugs from deep code review#13

Open
ppastabtw wants to merge 1 commit into
mainfrom
fix/frontend-bugs
Open

Fix 8 frontend bugs from deep code review#13
ppastabtw wants to merge 1 commit into
mainfrom
fix/frontend-bugs

Conversation

@ppastabtw

Copy link
Copy Markdown
Collaborator

Summary

  • Stuck SCANNING state: Wrapped async setTimeout in transitionFromSkeletonsToResults with try/catch so render errors fall back to IDLE instead of leaving the popup stuck with skeleton loaders
  • ICS DTEND:null: Fall back to startDate + 1 hour in ICS generator when toDate() returns null for unparseable endTime, preventing invalid .ics files
  • AM/PM time display: Added normalizeTimeStr() in dateTime.js to convert AM/PM strings to 24h format before ISO parsing, fixing raw-string fallback display
  • Settings button dead after failed click: Removed { once: true } so the listener persists if chrome.tabs.create() fails silently
  • End-before-start Google Calendar URL: Added guard in resolveEndDate to clamp to startDate + 1 hour when the resolved end date is before start
  • ICS multi-byte fold breakage: Rewrote foldLine to use TextEncoder for byte-accurate folding per RFC 5545 (75 octets, not 75 characters)
  • Theme initialization race: Removed the self-executing IIFE from theme.js — both popup.js and settings.js already handle theme loading explicitly
  • Deferred poll cleanup: Added deferredTimeoutId tracking in scanPolling.js so clearAll() can cancel deferred polls on popup close

Test plan

  • All 188 unit tests pass (npm test)
  • Verify popup scan flow: scan page → results load → no stuck skeleton state
  • Verify settings button works on repeated clicks
  • Download .ics file for event with edge-case times (e.g., unparseable endTime)
  • Check AM/PM time strings display correctly in event cards
  • Test theme switching in popup and settings page (no flicker)
  • Verify events with non-ASCII titles (CJK, emoji) produce valid .ics downloads

🤖 Generated with Claude Code

- Wrap async setTimeout in transitionFromSkeletonsToResults with try/catch to prevent UI stuck in SCANNING state
- Fall back to startDate+1h in ICS generator when endTime parsing fails, preventing DTEND:null in .ics files
- Add normalizeTimeStr() in dateTime.js to handle AM/PM time strings before ISO parsing
- Remove { once: true } from settings button listener so it survives failed tab creation
- Clamp end-before-start dates in calendarUrl.js resolveEndDate to startDate+1h
- Rewrite ICS foldLine to use TextEncoder for byte-accurate folding per RFC 5545
- Remove racing theme IIFE from theme.js (popup.js and settings.js already handle initialization)
- Track deferred poll timeouts in scanPolling.js so clearAll() can cancel them

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant