Skip to content

Conversation

petkybenedek
Copy link
Contributor

@petkybenedek petkybenedek commented Oct 7, 2025

What's new?

Selections stay highlighted in Split View on the following screens:

  • Assignments
  • Grades
  • Quizzes
  • To-Do
  • Notifications
  • Inbox

This PR introduces a SwiftUI-idiomatic approach to indicate selection with Environment Values. This eliminates the need of passing down parameters in the View Hierarchy.

refs: MBL-18172
builds: Student, Teacher
affects: Student, Teacher
release note: Selections on iPad now stay highlighted.

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

refs: MBL-18172
builds: Student, Teacher
affects: Student, Teacher
release note: Split View selections now stay highlighted.
# Conflicts:
#	Core/Core/Features/Assignments/AssignmentList/View/AssignmentListScreen.swift
@petkybenedek petkybenedek self-assigned this Oct 7, 2025
@inst-danger
Copy link
Contributor

inst-danger commented Oct 7, 2025

Warnings
⚠️ One or more files are below the minimum test coverage 50%
⚠️ The total test coverage is below the minimum 90%

Release Note:

Split View selections now stay highlighted.

Affected Apps: Student, Teacher

Builds: Student, Teacher

MBL-18172

Coverage New % Master % Delta
Canvas iOS 79.8% 79.8% 0%
Core/Core/Common/Extensions/Combine/SubjectExtensions.swift 0% 0% 0%
Core/Core/Features/Planner/Model/API/APICalendarEventSubAssignment.swift 0% 0% 0%
Core/Core/Features/Enrollments/GetEnrollments.swift 48.81% 48.81% 0%
Horizon/Horizon/Sources/Features/LearningObjects/Assignment/AssignmentDetails/View/LTIQuiz/OnAppear.swift 0% 0% 0%
Horizon/Horizon/Sources/Common/View/EmbeddedWebPage/HEmbeddedWebPageContainerViewModel.swift 0% 0% 0%
Horizon/Horizon/Sources/Features/LearningObjects/Assignment/AssignmentDetails/View/LTIQuiz/DidSubmitQuiz.swift 0% 0% 0%
Horizon/Horizon/Sources/Features/Inbox/Attachment/AttachmentViewModel.swift 0% 0% 0%
Horizon/Horizon/Sources/Features/Notebook/Common/Data/UpdateRedwoodNote.swift 0% 0% 0%
Horizon/Horizon/Sources/Features/LearningObjects/Assignment/AssignmentDetails/Data/SubmissionProperties.swift 0% 0% 0%
Horizon/Horizon/Sources/Common/Data/LearningObjectType.swift 0% 0% 0%

Generated by 🚫 dangerJS against b587026

@inst-danger
Copy link
Contributor

inst-danger commented Oct 7, 2025

Builds

Commit: Remove unnecessary trailing lambda (b587026)
Build Number: 569
Built At: Oct 15 16:11 CEST (10/15 08:11 AM MDT)

Student
Teacher

refs:
builds:
affects:
release note:

test plan:
refs:
builds:
affects:
release note:

test plan:
@petkybenedek petkybenedek marked this pull request as ready for review October 8, 2025 08:48
@vargaat vargaat requested a review from Copilot October 15, 2025 12:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements selection highlighting in Split View for multiple screens in the Student and Teacher apps. The solution introduces a SwiftUI-based environment value approach to track and display selected items when the split view is not collapsed.

Key changes:

  • Added environment value-based selection tracking system using isItemSelected
  • Updated existing button styles to support selection highlighting through environment values
  • Modified view models to track selected item IDs and pass them to views

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Selection.swift New file introducing environment value system for selection tracking
TintedContextButton.swift Refactored to use environment values instead of parameter-based highlighting
InboxMessageView.swift Updated to use new button style and selection environment
InboxViewModel.swift Added selectedMessageID tracking
InboxView.swift Added selection highlighting to message cells
GradeListViewModel.swift Added selectedAssignmentID tracking and updated assignment selection handling
GradeListScreen.swift Updated to pass selectedAssignmentID to AssignmentListView
AssignmentListScreenViewModel.swift Added selectedAssignmentID tracking
AssignmentListView.swift Added selection highlighting to all assignment cells
AssignmentListScreen.swift Updated to pass selectedAssignmentID and contains commented debug code
CollapsibleListRow.swift Added selection highlighting support
ActivityStreamViewController.swift Added UIKit-based selection restoration after table view reload
TodoListViewController.swift Added UIKit-based selection restoration after table view reload
QuizListViewController.swift Added UIKit-based selection restoration after table view reload
GradeListViewModelTests.swift Updated test to match new assignment selection signature

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 37 comments.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment on lines +32 to +33
navigateToDetailsAction: @escaping (URL?, String) -> Void,
whatIfModel: GradeListWhatIfModel? = nil, selectedAssignmentID: String? = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

How about replacing the whole navigateToDetailsAction & selectedAssignmentID with a @Published property selectedAssignmentID on screen viewModel. and you can pass that property to this view as @Binding. Having an action and a property referring to the same thing seems difficult to maintain. And you get even more SwiftUI-friendly way of handling state.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can say the same about other list views as well: InboxView and GradeListScreen

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