Skip to content

Conversation

@vargaat
Copy link
Collaborator

@vargaat vargaat commented Nov 21, 2025

What's new?

  • To-do widget now respects the newStudentToDoScreen feature flag and uses the new To-do data source if the flag is on.
  • Updated ExperimentalFeature to use shared UserDefaults via app group. This was needed for the widget to be able to read the flag states written by the app.
  • Added an extra flag for the To-do interactor to always hide completed items for the widget.

refs: MBL-19376
builds: Student
affects: Student
release note: none

test plan:

  • To-do widget should show the same items as the new calendar.
  • Turning off the dev feature flag should revert widget to its previous version.

Screenshots

BeforeAfter

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 6 commits November 21, 2025 11:07
- Made TodoInteractor and TodoGroupViewModel public for widget access
- Added alwaysExcludeCompleted parameter to TodoInteractor
- Refactored TodoModel to work with grouped data instead of flat items
- Updated TodoWidgetProvider to use TodoInteractor instead of manual filtering
- Removed redundant flatten/regroup logic from widget

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

Co-Authored-By: Claude <[email protected]>
Move alwaysExcludeCompleted to be the first parameter for better readability at call sites.

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

Co-Authored-By: Claude <[email protected]>
The widget now respects ExperimentalFeature.newStudentToDoScreen to match
the main app's todo screen behavior. When disabled, restores the original
calendar-based filtering to minimize regression risk.

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

Co-Authored-By: Claude <[email protected]>
ExperimentalFeature was using UserDefaults.standard which is not shared
between the main app and widget extensions. This caused the widget to
always use the old todo behavior regardless of the feature flag state.

Now uses UserDefaults with app group suite name, matching SessionDefaults.

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

Co-Authored-By: Claude <[email protected]>
Make shortDayMonthFormatter respect the calendar's timezone so that
dates are formatted consistently in tests and production.

Extend unit tests with new functionality.

refs: MBL-19376
builds: Student
affects: Student
release note: none

test plan:
- To-do widget should show the same items as the new calendar.
- Turning off the dev feature flag should revert widget to its previous version
@vargaat vargaat self-assigned this Nov 21, 2025
@claude
Copy link

claude bot commented Nov 21, 2025

Claude Code Review

Updated: 2025-11-21

No critical issues found

Summary:

  • Feature flag support correctly implemented with shared UserDefaults for widget access
  • TodoInteractor properly exposed with public access and new alwaysExcludeCompleted parameter
  • Comprehensive test coverage added for new filtering behavior
  • Backward compatibility maintained via feature flag branching
  • Badge count logic correctly excludes completed items regardless of visibility setting

@inst-danger
Copy link
Contributor

inst-danger commented Nov 21, 2025

Warnings
⚠️ This pull request will not generate a release note.
⚠️ One or more files are below the minimum test coverage 50%
⚠️ The total test coverage is below the minimum 90%

Affected Apps: Student

Builds: Student

MBL-19376

Coverage New % Master % Delta
Canvas iOS 81.16% 81.06% 0.1%
Horizon/Horizon/Sources/Features/Dashboard/SkillsHighlightsWidget/Data/ProficiencyLevel.swift 0% 0% 0%
Horizon/Horizon/Sources/Features/Notebook/Common/View/HighlightWebView/HighlightWebFeature.swift 0% 0% 0%
Horizon/Horizon/Sources/Features/Notebook/Common/View/HighlightWebView/EnableZoom.swift 0% 0% 0%
Horizon/Horizon/Sources/Common/Domain/GetCoursesInteractor.swift 38.16% 38.16% 0%
Horizon/Horizon/Sources/Features/LearningObjects/Assignment/SubmissionComment/Data/CommentAttachment.swift 0% 0% 0%
Horizon/Horizon/Sources/Common/Data/HModuleStatus.swift 0% 0% 0%
Horizon/Horizon/Sources/Common/Utilities/Double+.swift 0% 0% 0%
Horizon/Horizon/Sources/Features/Session/SessionInteractor.swift 32% 33.33% -1.33%
Horizon/Horizon/Sources/Features/Account/Notifications/Domain/NotificationSettingsInteractor.swift 0% 0% 0%
Horizon/Horizon/Sources/Features/Assist/AssistFlashCard/View/AssistFlashCardViewModel.swift 0% 0% 0%

Generated by 🚫 dangerJS against ed54998

@inst-danger
Copy link
Contributor

inst-danger commented Nov 21, 2025

Builds

Commit: Merge branch 'feature/MBL-19375-todo-filters' into feature/MBL-19376-Sync-todo-widget-content-with-todo-screen (14db4c5)
Build Number: 834
Built At: Nov 24 17:39 CET (11/24 09:39 AM MST)

Student

@vargaat vargaat changed the title [MBL-19376][S] Sync To-do widget content with To-do screen [MBL-19376][S] To-do - Sync widget content with in-app screen Nov 24, 2025
…Sync-todo-widget-content-with-todo-screen

# Conflicts:
#	Core/Core/Features/Todos/Model/TodoInteractor.swift
@claude
Copy link

claude bot commented Nov 24, 2025

Claude Code Review

Updated: 2025-11-24

Critical Issues Found

  • Breaking API change in TodoInteractorLive.init(): Parameter order changed from (env:, sessionDefaults:) to (alwaysExcludeCompleted:, sessionDefaults:, env:). This will cause compilation failures in any existing code calling this initializer directly. All call sites must be updated (already done in diff, but document carefully).

  • Date formatting regression risk in DateExtensions: Added timeZone assignment to shortDayMonthFormatter. This is correct for consistency, but verify widget display renders correctly in different timezones, especially around midnight boundaries where day grouping occurs.

  • Incomplete feature flag scope: ExperimentalFeature.isEnabled now uses app group shared defaults for all flags, but only newStudentToDoScreen is checked for widget compatibility. Ensure no other flags depend on isolated app-only storage.

Observations

  • Widget interactor initialization happens after session setup - correct sequencing
  • alwaysExcludeCompleted correctly bypasses user's showCompleted filter in widget context
  • Badge count calculation remains independent of exclusion flag - prevents UI inconsistency
  • Test coverage added for new filtering behavior
  • Model data structure change (items to groups) consistently applied throughout widget code

✅ Approved

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