Skip to content

Nullable date/time pickers with opt-in clear button - #40

Merged
nord- merged 18 commits into
masterfrom
feature/nullable-pickers
Jul 6, 2026
Merged

nord- merged 18 commits into
masterfrom
feature/nullable-pickers

Conversation

@nord-

@nord- nord- commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • LabeledDatePicker.Date (DateTime?) and LabeledTimePicker.Time (TimeSpan?) are now nullable, default null, rendering an empty field — leaning on MAUI 10's native nullable picker support so the existing TwoWay binding is unchanged
  • New opt-in ShowClearButton on both controls: a ✕ shown inside the border when a value is set and the control is enabled, tapping it clears the value
  • Demo app updated to showcase the empty start state, clear button, and Required validation on a nullable time
  • Updated NuGet dependencies (MAUI 10.0.41 → 10.0.80, CommunityToolkit.Maui/Mvvm, migrated NiceEntry.Tests off the deprecated xunit metapackage to xunit.v3)
  • Fixed all JetBrains inspectcode findings across the solution (honest nullable annotations, redundant qualifiers/usings, obsolete Frame/ListView demo styles removed)

Breaking change

Date/Time default changes from today's date/midnight to null. Consumers binding to non-nullable view-model properties need to switch to DateTime?/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.md
  • docs/superpowers/plans/2026-07-03-nullable-pickers.md

Test plan

  • dotnet build NiceEntry.sln — 0 errors, 0 warnings
  • dotnet test NiceEntry.Tests/NiceEntry.Tests.csproj — 10/10 passing
  • dotnet format --verify-no-changes and jb inspectcode clean
  • Manual device verification (Android/iOS): empty start state, Android OK/Cancel semantics, iOS commit-on-Done, clear button visibility/tap, theme switching, screen reader announcement — checklist in the plan doc

Rickard Nord added 15 commits July 3, 2026 16:56
- 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
Copilot AI review requested due to automatic review settings July 3, 2026 16:20
@nord- nord- added the major label Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 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.Date and LabeledTimePicker.Time nullable with default null, leveraging MAUI 10 nullable picker support.
  • Add ShowClearButton to both pickers and implement an in-border ✕ that clears the value back to null.
  • 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.

@nord- nord- left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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:

  1. 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.UpdateSemanticDescription sä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är View ä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. En major-release bör inte publiceras med checklistan okörd — kör den på Android + iOS, eller merga uttryckligen med ett uppföljningsärende.

  2. <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 lokal dotnet 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).

Comment thread NiceEntry/LabeledDatePicker.xaml Resolved
Comment thread NiceEntry/LabeledTimePicker.xaml Resolved
Comment thread NiceEntryDemoApp/MainPage.xaml Resolved
…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.
@nord-

nord- commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Uppföljning på review-fyndet i https://github.com/nord-/NiceEntry/pull/40#pullrequestreview-4635649843 (commit b770497):

  • ✕-fontstorlek, död Error-bindning i demo: åtgärdade, se trådsvar per fynd.
  • <Version>1.6.1</Version> → bumpad till 2.0.0 i NiceEntry.csproj för att matcha denna breaking-change-release (CI skriver ändå över med tagg-versionen vid publicering, men lokal dotnet pack blir nu korrekt).

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.
@nord-
nord- merged commit 7eca0e4 into master Jul 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants