Repository navigation
Nullable date/time pickers with opt-in clear button - #40
Conversation
… verification list Claude-Session: https://claude.ai/code/session_018RLoG4WSUTeCb6ECpnFGsu
- xunit 2.9.2 (deprecated metapackage) -> xunit.v3 3.2.2 + OutputType Exe - xunit.runner.visualstudio 2.8.2 -> 3.1.5, Microsoft.NET.Test.Sdk 17.12.0 -> 18.7.0 - Microsoft.Maui.Controls/Graphics 10.0.41 -> 10.0.80 - CommunityToolkit.Maui 14.0.1 -> 14.2.0, Mvvm 8.4.0 -> 8.4.2, Logging.Debug 10.0.3 -> 10.0.9 - CLAUDE.md: document the existing NiceEntry.Tests project Claude-Session: https://claude.ai/code/session_018RLoG4WSUTeCb6ECpnFGsu
…er .editorconfig) Claude-Session: https://claude.ai/code/session_018RLoG4WSUTeCb6ECpnFGsu
There was a problem hiding this comment.
Pull request overview
This PR updates NiceEntry’s labeled date/time pickers to support nullable values (rendering empty until selected) and adds an opt-in clear (✕) affordance, while also updating the demo app, dependencies, and solution-wide code style/nullable annotations.
Changes:
- Make
LabeledDatePicker.DateandLabeledTimePicker.Timenullable with defaultnull, leveraging MAUI 10 nullable picker support. - Add
ShowClearButtonto both pickers and implement an in-border ✕ that clears the value back tonull. - Update demo app, documentation, dependencies (MAUI/Toolkit/xunit.v3), and apply various cleanup/inspectcode-driven fixes.
Reviewed changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents nullable picker behavior, clear button, and breaking change notes. |
| NiceEntryDemoApp/ValidatableViewModel.cs | Whitespace/format cleanup. |
| NiceEntryDemoApp/Resources/Styles/Styles.xaml | Removes obsolete Frame/ListView styles; adjusts Shell style setters. |
| NiceEntryDemoApp/Resources/Fonts/FluentUI.cs | Marks generated font file as auto-generated. |
| NiceEntryDemoApp/Platforms/iOS/Program.cs | Cleans up usings/namespace comment formatting. |
| NiceEntryDemoApp/Platforms/iOS/AppDelegate.cs | Cleans up BOM/namespace comment formatting. |
| NiceEntryDemoApp/Platforms/Android/MainApplication.cs | Cleans up BOM/namespace comment formatting. |
| NiceEntryDemoApp/Platforms/Android/MainActivity.cs | Cleans up usings/namespace comment formatting. |
| NiceEntryDemoApp/NiceEntryDemoApp.csproj | Bumps MAUI/Toolkit/logging package versions. |
| NiceEntryDemoApp/MauiProgram.cs | Minor formatting cleanup. |
| NiceEntryDemoApp/MainPage.xaml.cs | Demo VM now starts with nullable date/time and validates nullable time. |
| NiceEntryDemoApp/MainPage.xaml | Enables ShowClearButton and updates examples for pickers. |
| NiceEntryDemoApp/ButtonsPage.xaml.cs | Aligns partial class pattern/formatting. |
| NiceEntryDemoApp/AppShell.xaml.cs | Aligns partial class pattern/formatting. |
| NiceEntryDemoApp/AppShell.xaml | Switches from attached Shell property syntax to direct properties. |
| NiceEntryDemoApp/App.xaml.cs | Aligns partial class pattern/formatting. |
| NiceEntryDemoApp/App.xaml | Removes unused xmlns alias. |
| NiceEntry/Platforms/iOS/EntryBaseNative.cs | Cleans up BOM and adds namespace suppression comment. |
| NiceEntry/Platforms/Android/EntryBaseNative.cs | Cleans up BOM and adds namespace suppression comment. |
| NiceEntry/NiceEntry.csproj | Bumps MAUI Controls version. |
| NiceEntry/NiceButton.cs | Nullable/cleanup updates and Grid API usage adjustments. |
| NiceEntry/LabeledTimePicker.xaml.cs | Makes Time nullable and adds ShowClearButton + clear logic + semantic forwarding. |
| NiceEntry/LabeledTimePicker.xaml | Wraps picker in Grid and adds clear ✕ label with tap gesture. |
| NiceEntry/LabeledPicker.xaml.cs | Minor formatting cleanup. |
| NiceEntry/LabeledEntry.xaml.cs | Minor cleanup; adds nullable-contract suppression comment. |
| NiceEntry/LabeledEntry.xaml | Adds x:FieldModifier rationale comments for SourceGen access. |
| NiceEntry/LabeledDatePicker.xaml.cs | Makes Date nullable and adds ShowClearButton + clear logic + semantic forwarding. |
| NiceEntry/LabeledDatePicker.xaml | Wraps picker in Grid and adds clear ✕ label with tap gesture. |
| NiceEntry/LabeledAutoCompleteEntry.xaml.cs | Cleans up type qualifiers and updates nullable annotations. |
| NiceEntry/Drawing/NotchedBorderDrawing.cs | Adds comment explaining redundant using for linked test compilation. |
| NiceEntry/Drawing/NotchedBorder.cs | Simplifies root grid field into local variable; removes unused using. |
| NiceEntry/Base/TimePickerBase.cs | Removes redundant global:: qualifier usage. |
| NiceEntry/Base/PickerBase.cs | Removes redundant global:: qualifier usage. |
| NiceEntry/Base/NativeEntryHeight.cs | Refactors UITextField initialization to a single expression. |
| NiceEntry/Base/LabelBase.xaml.cs | Adjusts Grid API usage and makes View/Error nullable in CLR surface. |
| NiceEntry/Base/LabelBase.xaml | Adds comment about consumer-provided resources; keeps resource usage. |
| NiceEntry/Base/EntryBase.cs | Removes BOM/leading whitespace. |
| NiceEntry/Base/DatePickerBase.cs | Removes redundant global:: qualifier usage. |
| NiceEntry/Base/BaseLabelExtension.cs | Removes BOM and minor formatting cleanup. |
| NiceEntry/AppHostBuilderExtensions.cs | Removes unused using. |
| NiceEntry.Tests/NiceEntry.Tests.csproj | Migrates to xunit.v3 setup and updates test dependencies. |
| docs/superpowers/specs/2026-07-03-nullable-pickers-design.md | Adds design spec for nullable pickers (needs version sync). |
| docs/superpowers/plans/2026-07-03-nullable-pickers.md | Adds implementation plan (needs version/test existence sync). |
| CLAUDE.md | Updates contributor docs to reflect the existence/purpose of NiceEntry.Tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ting test project
nord-
left a comment
There was a problem hiding this comment.
Granskning av hela intervallet (471b45f..61c90cf) mot spec och plan i docs/superpowers/.
Styrkor: Implementationen följer planen i princip ordagrant — nullable Date/Time utan defaultValueCreator, clear-knappen enligt spec (synlighet = ShowClearButton && värde != null && IsEnabled, omräknad även vid TwoWay-återpropagering och IsEnabled-ändring), semantik-ombindning på inre Element, och den stora städdiffen är genuint mekanisk. Testerna (10/10) går gröna efter xunit.v3-migreringen och PR:en bär major-labeln som release-flödet kräver.
Kvarstående före merge:
-
Manuell verifiering är enda verifieringsvägen för featuren och är fortfarande obockad i PR:ens testplan. Två punkter i planens checklista är reella risker: (a) Android-dubbelannonsering/a11y-skuggning —
LabelBase.UpdateSemanticDescriptionsätter numera beskrivningen på Grid-wrappern (en ViewGroup) samtidigt som samma text binds på inre pickern, vilket kan skugga ✕:ets "Clear"; planen pekar redan ut fixen (hoppa över beskrivningen närViewär en layout) om det reproducerar. (b) ✕:ets träffyta på iOS (~25–30 pt hög, medvetet inte 44 pt) — planpunkt 8 säger omvärdera efter känsla. Enmajor-release bör inte publiceras med checklistan okörd — kör den på Android + iOS, eller merga uttryckligen med ett uppföljningsärende. -
<Version>1.6.1</Version>i NiceEntry.csproj är stale (senaste tagg v1.11.2, denna PR blir 2.0). Ofarligt — CI skriver över med taggversionen — men vilseledande för lokaldotnet pack; kan bumpas till 2.0.0 i förbifarten.
Bedömning: Koden i sig är korrekt och idiomatisk mot repots mönster; inga funktionella buggar hittade. Redo att merga när den manuella checklistan är körd (eller medvetet uppskjuten).
…inding, version Clear button now follows the picker's proxied FontSize instead of a hardcoded 16, avoiding a mismatch/height jump against the picker text. DateSelected in the demo gains the same Required validation as TimeSelected so its Error binding actually populates. Bump package Version to 2.0.0 to match this breaking-change release.
|
Uppföljning på review-fyndet i https://github.com/nord-/NiceEntry/pull/40#pullrequestreview-4635649843 (commit b770497):
Kvarstår innan merge: den manuella verifieringschecklistan (Android a11y-dubbelannonsering, iOS ✕-träffyta) är fortfarande okörd. Jag har inte tillgång till Android/iOS-enhet eller emulator i den här miljön och kan inte köra den själv — behöver köras manuellt innan en major-release publiceras. |
Spec and implementation plan were working documents for this PR, not long-term repo documentation.
Summary
LabeledDatePicker.Date(DateTime?) andLabeledTimePicker.Time(TimeSpan?) are now nullable, defaultnull, rendering an empty field — leaning on MAUI 10's native nullable picker support so the existing TwoWay binding is unchangedShowClearButtonon both controls: a ✕ shown inside the border when a value is set and the control is enabled, tapping it clears the valueRequiredvalidation on a nullable timeNiceEntry.Testsoff the deprecatedxunitmetapackage toxunit.v3)Breaking change
Date/Timedefault changes from today's date/midnight tonull. Consumers binding to non-nullable view-model properties need to switch toDateTime?/TimeSpan?, or set an initial value in the view model to preserve the old behavior. See README for details.Design docs
docs/superpowers/specs/2026-07-03-nullable-pickers-design.mddocs/superpowers/plans/2026-07-03-nullable-pickers.mdTest plan
dotnet build NiceEntry.sln— 0 errors, 0 warningsdotnet test NiceEntry.Tests/NiceEntry.Tests.csproj— 10/10 passingdotnet format --verify-no-changesandjb inspectcodeclean