Skip to content

Phase 1b: Per-platform template keying + P0/P1 sizing sweep - #2

Merged
Shewart merged 8 commits into
mainfrom
feat/template-system-v2
Aug 29, 2026
Merged

Shewart merged 8 commits into
mainfrom
feat/template-system-v2

Conversation

@Shewart

@Shewart Shewart commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes out Phase 1b of the ShellUI Native roadmap: the template layer becomes
platform-keyed so adding Avalonia (Phase 2) is a per-template dict entry rather
than a whole parallel registry. Also lands a P0/P1 correctness/consistency sweep
of the existing MAUI templates.

Prerequisite for Phase 2 (Avalonia implementation).

Phase 1b — Template System v2

Problem: ComponentRegistry.GetComponentContent(name) returned a single
MAUI-flavored C# string per component. There was no platform dimension in the
lookup path — Avalonia would have needed either a duplicate registry or install-time
string-mangling of MAUI templates.

Design: per-template Contents dictionary owned by the template class; the
registry stores (Metadata, Contents) bundles so lookup is one hop with no
per-component switch arms to maintain as new platforms are added.

  • All 44 templates migrated from public static string Content => to
    public static IReadOnlyDictionary<NativePlatform, string> Contents { get; }
  • ComponentRegistry.GetComponentContent(name, NativePlatform) — returns
    null for known component + unsupported platform (distinguishable from unknown
    component via new SupportsPlatform / GetSupportedPlatforms)
  • New UnsupportedPlatformException in Core.Models with ComponentName,
    RequestedPlatform, SupportedPlatforms for programmatic callers
  • ComponentInstaller / ComponentManager / InitService all thread
    config.TargetPlatform through and skip components that don't support it,
    with a clear error listing supported platforms
  • Blanket "MAUI-only" install-time warning removed; per-component platform check
    replaces it (silent when the platform IS supported)

P0/P1 sizing + token sweep

Full re-read of every P0 + P1 template looking for the class of drift the Input
component had. Three real bugs found and fixed; everything else surveyed
(Badge, Progress, Alert, Card family, Label, Separator, Switch, Checkbox, Shell,
Dialog/Drawer/Sheet/Popover content boxes) was sized and tokenized correctly.

1. Input height drift — Border had no HeightRequest and used
Padding = (12, 8), so the composite grew to whatever platform-default height
Entry picked (Windows ~44, Android ~48+ with material padding). Rendered
visibly taller than the pickers sitting next to it in the same form row. Now
HeightRequest = 40 and Padding = (12, 0), matching Select / DatePicker /
TimePicker.

2. Primary-blue token drift — InputTemplate focus border and
RadioGroupItemTemplate checked indicator used #3B82F6 (blue-500) while
Button / Checkbox / Switch / Progress all use #2563EB (blue-600) for
the same "primary" role. Standardized on #2563EB.

3. DropdownItem hit target too small — Padding = (8, 10) with no minimum
height → ~34px rows, below iOS 44px / Android 48dp touch guidance. Now
Padding = (12, 12) + MinimumHeightRequest = 40.

4. RadioGroupItem checked-border missing — only the fill flipped color when
a radio became selected; the ring stayed grey. Checkbox had already handled
this. Fixed to match — both stroke and background flip to #2563EB when checked.

Docs

  • COMPONENTS_ROADMAP.md — new Form Sizing
    Contract
    section (per-control height/padding table + rules for future
    controls, menu rows, and icon-shaped controls) and new Design Token
    Contract
    section (every ARGB in use mapped to its role, so drifts like
    the two blues can't sneak back in and Phase 2's Avalonia ResourceDictionary
    extraction is mechanical)
  • ARCHITECTURE.md — documents the platform-keyed
    registry lookup and the SupportsPlatform / GetSupportedPlatforms contract
  • DEVELOPMENT_PLAN.md — new living doc tracking
    branch strategy, phase status, and Phase 1b follow-ups

Test plan

  • dotnet build src/ — 0 warnings, 0 errors
  • dotnet test — 199/199 passing (up from 147; 52 new/updated tests
    covering the platform-keyed registry, UnsupportedPlatformException, and
    regression locks that will fail-loud when Phase 2 adds Avalonia content)
  • TemplateContentTests parameterized over all 44 components on
    NativePlatform.MAUI — every existing MAUI template still compiles identically
  • Every_component_reports_MAUI_as_a_supported_platform — regression lock
  • GetComponentContent_returns_null_for_known_component_but_unsupported_platform —
    verifies the null-return contract for the Avalonia case that will flip once
    Phase 2 adds content
  • Manual visual pass in MAUI.Demo on Windows/Android/iOS heads to confirm
    Input / Select / DatePicker / TimePicker render at the same 40px height side by
    side (not yet automated)
  • Manual shellui-native init --yes && add button input card dialog against
    a fresh dotnet new maui project — needs a workstation with the MAUI workload
    installed

🤖 Generated with Claude Code

Shewart and others added 7 commits August 29, 2026 21:10
…onentManager, and InitService to skip components without templates for the target platform
…r platform-specific content and enhance structure for better maintainability
…d platform-specific content, improving organization and maintainability
…System v2 enhancements, including platform-specific content handling and form sizing contracts
… validate platform-specific content handling and support checks
Records the template-system-v2 branch state, the Input height fix, and the
P0/P1 sweep that landed the primary-blue token unification, DropdownItem hit
target, and RadioGroupItem checked-border fixes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 29, 2026 19:16

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added documentation Improvements or additions to documentation cli core templates labels Aug 29, 2026
The previous `dotnet restore src/` treated `src/` as a project path (MSB1003).
No .sln or .slnx lives in src/ — the solution ShellUI.Native.slnx is at repo
root, and it includes examples/MAUI.Demo which needs the MAUI workload and is
covered by the separate build-examples job in ci.yml.

Mirror ci.yml's approach: restore + build the CLI project + tests project
explicitly, keeping this job workload-free and fast.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the ci label Aug 29, 2026
@Shewart
Shewart merged commit 855e3c8 into main Aug 29, 2026
4 checks passed
Shewart added a commit that referenced this pull request Aug 29, 2026
Updates the roadmap and development plan to reflect the state post-PR #2:

- Phase 1a + 1b now live on main (44 platform-keyed templates, sizing + token
  contracts locked). P0/P1/P2 marked done in COMPONENTS_ROADMAP.md.
- Current Snapshot table now points at feat/p3-navigation-layout as the next
  active branch.
- New Phase 1c section in DEVELOPMENT_PLAN.md scopes the P3 tier (tabs,
  accordion, collapsible, breadcrumb, scroll-area, skeleton), locks
  implementation order to build primitives before composites, and pins the
  branch to the sizing + token contracts.
- Phase 2 (Avalonia) is unblocked but deliberately sequenced after Phase 1c
  to avoid doubling maintenance surface while MAUI is still growing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Shewart
Shewart deleted the feat/template-system-v2 branch October 6, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci cli core documentation Improvements or additions to documentation templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants