Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Calendar's Code and Optimize UI #39

Closed
othbcq opened this issue Oct 15, 2024 · 0 comments · Fixed by #41
Closed

Refactor Calendar's Code and Optimize UI #39

othbcq opened this issue Oct 15, 2024 · 0 comments · Fixed by #41
Assignees

Comments

@othbcq
Copy link
Contributor

othbcq commented Oct 15, 2024

Description:

This issue addresses the feedback provided by @Plouc314 in the recent pull request review. The goal is to improve the overall code structure, readability, and test coverage of the Calendar feature.

Tasks:

1. CalendarViewModel:

  • Refactor handleRecurringEvents and handleNonRecurringEvents to improve readability and avoid side effects.
  • Replace MutableStateList with StateFlow and use a constant for the ICAL_URL.
  • Introduce an IcalRepository for easier implementation switching (e.g., HTTP, mock).

2. CalendarViewModel Tests (#27)

  • Write unit tests for filtering and sorting events.
  • Test the handling of recurring events, ensuring they are properly processed and displayed.
  • Test multi-day event handling to confirm accurate representation across consecutive days.
  • Ensure edge cases are covered (e.g., events spanning the start or end of the testing period).

3. UI Components:

  • Combine EventListWithResults and EventList into a single modular component.
  • Pass icalEvents directly to CalendarGrid instead of the full viewModel.
  • Create a DateUtils module to group all date-related helper functions for reuse across files and to avoid duplication.
  • Change the "Look Up Event" button to a magnifying glass icon for better clarity and usability. This will make the button more intuitive without disrupting the layout.
@othbcq othbcq self-assigned this Oct 15, 2024
@othbcq othbcq changed the title Refactor Calendar Feature: Refactor Code and Optimize UI Refactor Calendar's Code and Optimize UI Oct 15, 2024
@othbcq othbcq linked a pull request Oct 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant