-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implement iOS/macOS secondary ToolbarItems - Shell #30480
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: net10.0
Are you sure you want to change the base?
Implement iOS/macOS secondary ToolbarItems - Shell #30480
Conversation
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 adds support for secondary toolbar items in Shell on iOS/macOS by introducing a new pull-down menu for items marked Secondary
, and also updates the DatePicker
API to allow nullable dates.
- Added
ToSecondarySubToolbarItem
extension andSecondarySubToolbarItem
class - Modified Shell handlers to group secondary items under a menu button with configurable icon
- Changed
DatePicker
properties and event args to useDateTime?
for nullable support
Reviewed Changes
Copilot reviewed 287 out of 1121 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/Controls/src/Core/Compatibility/iOS/Extensions/ToolbarItemExtensions.cs | Added ToSecondarySubToolbarItem extension and SecondarySubToolbarItem class |
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs | Updated UpdateToolbarItems to insert secondary items into a pull-down menu |
src/Controls/src/Core/DatePicker/DatePicker.cs | Changed bindable Date , MinimumDate , MaximumDate and related APIs to nullable DateTime? |
Comments suppressed due to low confidence (1)
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs:391
- Typo:
Viewco
is undefined; this should beViewController
to correctly reference the view controller instance.
break;
@@ -25,6 +27,31 @@ public static UIBarButtonItem ToUIBarButtonItem(this ToolbarItem item, bool forc | |||
return new PrimaryToolbarItem(item, forceName); | |||
} | |||
|
|||
internal static SecondarySubToolbarItem ToSecondarySubToolbarItem(this ToolbarItem item) |
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.
Add automated UI tests in TestCases.HostApp and TestCases.Shared.Tests to cover the new SecondarySubToolbarItem functionality so secondary toolbar menus are validated end-to-end.
Copilot uses AI. Check for mistakes.
@@ -14,17 +14,17 @@ public partial class DatePicker : View, IFontElement, ITextElement, IElementConf | |||
public static readonly BindableProperty FormatProperty = BindableProperty.Create(nameof(Format), typeof(string), typeof(DatePicker), "d"); | |||
|
|||
/// <summary>Bindable property for <see cref="Date"/>.</summary> | |||
public static readonly BindableProperty DateProperty = BindableProperty.Create(nameof(Date), typeof(DateTime), typeof(DatePicker), default(DateTime), BindingMode.TwoWay, | |||
public static readonly BindableProperty DateProperty = BindableProperty.Create(nameof(Date), typeof(DateTime?), typeof(DatePicker), null, BindingMode.TwoWay, |
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.
Changing the Date
bindable property's CLR type from DateTime
to DateTime?
is a public API signature change and may be breaking; ensure this is acceptable for a minor release.
Copilot uses AI. Check for mistakes.
Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.
There are some build errors:
C:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs(395,9): error CS0103: The name 'Viewco' does not exist in the current context [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-ios18.5]
C:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs(397,22): error CS0103: The name 'navRenderer' does not exist in the current context [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-ios18.5]
C:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs(394,29): error CS8600: Converting null literal or possible null value to non-nullable type. [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-ios18.5]
C:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs(402,22): error CS8600: Converting null literal or possible null value to non-nullable type. [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-ios18.5]
C:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs(395,9): error CS0103: The name 'Viewco' does not exist in the current context [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-maccatalyst18.5]
C:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs(397,22): error CS0103: The name 'navRenderer' does not exist in the current context [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-maccatalyst18.5]
C:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs(394,29): error CS8600: Converting null literal or possible null value to non-nullable type. [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-maccatalyst18.5]
C:\a\_work\1\s\src\Controls\src\Core\Compatibility\Handlers\Shell\iOS\ShellPageRendererTracker.cs(402,22): error CS8600: Converting null literal or possible null value to non-nullable type. [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-maccatalyst18.5]
8 Error(s)
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
This PR is an extension for @jfversluis one's #28185 which implements iOS/macOS secondary ToolbarItems for shell pages
Issues Fixed
Fixes #815
Screen.Recording.2025-07-08.at.01.45.07.mov