Skip to content

Conversation

@vargaat
Copy link
Collaborator

@vargaat vargaat commented Nov 18, 2025

What's new?

  • Introduced local filtering for todos.
  • Todos now display dates more accurately:
    • All-day events show "All Day".
    • Time range events show full range (e.g., "6:00 - 9:00 AM").
  • Filter preferences are automatically saved and restored across sessions.
  • Refactored swipe to remove gesture into a more generic one with configurable completion behavior. This is used when an already done item is marked as not done and the item is not removed and the gesture should reset to its initial state.

Known Issues

  • There's a CoreData clash between the To-do items and the Calendar since both use the same entity. The issue is that calendar resets entities and this way deletes To-do items as well. We'll fix this later so just ignore this error.

refs: MBL-19375
builds: Student
affects: Student
release note: Added filtering option to the To-do screen.

test plan:

  • Test filtering functionality.
  • Make sure to test all kinds of events: assignments with due date, personal todo, personal event, global calendar event, group event.

Screenshots

Updated To-do ItemsFilter Screen

Checklist

  • Follow-up e2e test ticket created
  • A11y checked
  • Tested on phone
  • Tested on tablet
  • Tested in dark mode
  • Tested in light mode
  • Approve from product

vargaat and others added 17 commits November 5, 2025 14:39
- Create TodoFilterViewModel with Input/Output separation
- Create TodoFilterScreen with InstUI components
- Add unit tests for TodoFilterViewModel
- Update enum raw values to prevent ID collisions
- Integrate with SessionDefaults for filter persistence

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Replace router.route with router.show for type-safe navigation
- Rename onFiltersApplied to onFiltersChanged
- Only invoke callback when filters actually change
- Use viewController environment for dismissal instead of presentationMode
- Add makePreviewViewController factory method to TodoAssembly
- Fix TodoFilterOptions initialization to use .default

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add local filtering logic to TodoFilterOptions and TodoVisibilityOption entities
- Refactor TodoInteractor to always fetch maximum date range and apply filters locally
- Add isCacheExpired() method to determine if API call is needed
- Update TodoListViewModel to show loading state only when cache has expired
- Store coursesStore as property to avoid duplication
- Update tests to pass sessionDefaults parameter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Changes:
- Renamed SwipeToRemove → SwipeAction with configurable SwipeCompletionBehavior (.stayOpen, .reset)
- Added dynamic swipe properties to TodoItemViewModel (background color, text, icon) that update based on done state
- Updated TodoListViewModel to respect filter settings: cells reset when "Show Completed" is enabled, otherwise removed optimistically
- Fixed animation timing to prevent visual glitches during state transitions
- Handle edge case where checkbox + swipe undo should always toggle in place
- Added discussionReply2 icon for undo action
- Improved code organization with MARK comments and proper encapsulation using private(set)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Track filter state when loading todo items with two events:
- todo_list_loaded_default_filter: when default filter is used
- todo_list_loaded_custom_filter: when custom filter is applied

Events include parameters for all filter options:
- filter_personal_todos, filter_calendar_events
- filter_show_completed, filter_favourite_courses
- filter_selected_date_range_past/future

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
refs: MBL-19375
builds: Student
affects: Student
release note: Added filtering option to the To-do screen.

test plan:
- Test filtering functionality.
- Make sure to test all kinds of events: assignments with due date, personal todo, personal event, global calendar event, group event.
@vargaat vargaat self-assigned this Nov 18, 2025
@claude
Copy link

claude bot commented Nov 18, 2025

Claude Code Review

Updated: 2025-11-18

Issues Found

  • Race Condition in Swipe Undo Logic: When an item marked as done via checkbox (3-second delayed removal) is undone via swipe gesture, the swipe callback executes after 0.43s while the removal timer could still be pending. This creates race conditions between the timers. See SwipeAction.swift:206 and TodoListViewModel.swift:39, 163.

  • Task.sleep Error Handling: Using try? await Task.sleep() silently discards errors. Consider explicit handling of sleep interruptions.

  • CoreData Entity Clash: PR acknowledges known clash between To-do and Calendar entities causing To-do deletion. This requires explicit follow-up before production use.

✅ Approved with notes

@inst-danger
Copy link
Contributor

inst-danger commented Nov 18, 2025

Fails
🚫 Build failed, skipping coverage check

Release Note:

Added filtering option to the To-do screen.

Affected Apps: Student

Builds: Student

MBL-19375

Generated by 🚫 dangerJS against 00214e8

@inst-danger
Copy link
Contributor

inst-danger commented Nov 18, 2025

Builds

Commit: Fix swipe action bug and refactor to item-level behavior (00214e8)
Build Number: 791
Built At: Nov 19 09:52 CET (11/19 01:52 AM MST)

Student

Fixes a bug where swipe stays open after undoing a pending removal.
Refactors swipe behavior from list-level to item-level architecture.

- Add isEnabled parameter to SwipeAction modifier
- Move swipe behavior to TodoItemViewModel with computed properties
- TodoInteractor sets filter settings on items at creation
- Update tests to reflect new item-level architecture

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@claude
Copy link

claude bot commented Nov 19, 2025

Claude Code Review

Updated: Wed Nov 19 08:38:37 UTC 2025

Critical Issues

  • Build Failure: Danger reports Student build failure (commit ae711ee). Must resolve before merge.

Known Issues Acknowledged

  • CoreData Entity Clash: PR acknowledges known clash between To-do and Calendar entities causing To-do deletion. Requires explicit follow-up before production use.

Implementation Notes

  • Timer cancellation in handleSwipeCommitted() properly prevents race conditions
  • Swipe gesture refactoring (.reset vs .stayOpen) well-implemented
  • Filter persistence via SessionDefaults correctly encoded/decoded

⚠️ Build failure must be resolved

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.

3 participants