-
Notifications
You must be signed in to change notification settings - Fork 122
[MBL-18172] [S/T] Split View selection highlights #3686
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
base: master
Are you sure you want to change the base?
Conversation
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
Release Note:Split View selections now stay highlighted. Affected Apps: Student, TeacherBuilds: Student, Teacher
|
BuildsCommit: Remove unnecessary trailing lambda (b587026) |
refs: builds: affects: release note: test plan:
refs: builds: affects: release note: test plan:
There was a problem hiding this 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 |
Core/Core/Features/Assignments/AssignmentList/View/AssignmentListScreen.swift
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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.
There was a problem hiding this 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.
navigateToDetailsAction: @escaping (URL?, String) -> Void, | ||
whatIfModel: GradeListWhatIfModel? = nil, selectedAssignmentID: String? = nil |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
What's new?
Selections stay highlighted in Split View on the following screens:
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
Checklist