Skip to content

feat: add Card, SkeletonLoader, and PinInput mobile widgets#193

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/gracious-keller-iMzUI
May 29, 2026
Merged

feat: add Card, SkeletonLoader, and PinInput mobile widgets#193
matt-edmondson merged 2 commits into
mainfrom
claude/gracious-keller-iMzUI

Conversation

@matt-edmondson
Copy link
Copy Markdown
Contributor

Summary

Completes Phase 1 of the mobile UI widgets plan with the remaining "container / loader" group. The earlier form-control and decorator batches (Switch, SegmentedControl, Chip, Stepper, RangeSlider, Avatar, Badge, Rating, PageIndicator) were already merged; this PR adds the last three widgets.

What's new

  • Card (ImGui.Widgets/Card.cs) — a scoped (RAII) shadowed, elevated container used with using (new ImGuiWidgets.Card()) { ... }. Since ImGui is immediate-mode and the card's size isn't known until its content is laid out, the body is drawn onto a foreground draw-list channel and the shadow/fill/border are painted behind it on Dispose. Padding, rounding, and colours resolve from the active theme (no hard-coded hex).
  • SkeletonLoader (ImGui.Widgets/SkeletonLoader.cs) — SkeletonLine, SkeletonRect, and SkeletonCircle shimmer placeholders. A bright band sweeps horizontally across a muted base fill, driven by ImGui.GetTime() so it's frame-rate independent and needs no per-widget state. Colours come from FrameBg / FrameBgHovered.
  • PinInput (ImGui.Widgets/PinInput.cs) — an N-box PIN / one-time-passcode entry with auto-advance and backspace-to-previous navigation. The value is kept left-packed (no gaps) and optionally digit-restricted. The pure string logic is exposed as public, unit-tested helpers NormalizePin and SetPinSlot.

Demo & tests

  • New "Mobile - Containers & Loaders" section in ImGuiWidgetsDemo exercising all three widgets.
  • New ContainerWidgetTests covering NormalizePin / SetPinSlot edge cases (digit stripping, truncation, replace/append, clear-and-shift, out-of-range).
  • Plan doc updated to mark Phases 0 and 1 complete and flag Phase 2 (SwipeableListItem) as next.

Notes

  • The new ImGui.Widgets library compiles cleanly. The test and example projects can't be built/run in the Linux sandbox because the platform apphost pack for this RID isn't available offline; they build and the tests run on the Windows CI.

https://claude.ai/code/session_01MXurQivZo7cHkmJSEaD1DZ


Generated by Claude Code

Completes Phase 1 of the mobile UI widgets plan with the container/loader
group:

- Card: scoped (RAII) shadowed, elevated container. Draws content on a
  foreground draw-list channel and paints the shadow/fill/border behind it
  on dispose, resolving colours from the active theme.
- SkeletonLoader: SkeletonLine/Rect/Circle shimmer placeholders with a
  time-driven sweeping highlight band (frame-rate independent, stateless).
- PinInput: N-box PIN/OTP entry with auto-advance and backspace-to-previous
  navigation. Pure left-pack helpers (NormalizePin, SetPinSlot) are exposed
  for unit testing.

Adds a 'Mobile - Containers & Loaders' demo section and unit tests for the
PIN helpers. Updates the plan doc to mark Phase 1 complete.

https://claude.ai/code/session_01MXurQivZo7cHkmJSEaD1DZ
@matt-edmondson matt-edmondson enabled auto-merge May 29, 2026 04:15
- Remove unnecessary 'using System;' from PinInput (IDE0005).
- Use the SkeletonLoader id to derive a stable per-placeholder sweep
  offset so grouped skeletons shimmer in a staggered wave, which also
  resolves the unused-parameter warning (IDE0060).

https://claude.ai/code/session_01MXurQivZo7cHkmJSEaD1DZ
@matt-edmondson matt-edmondson merged commit 3a47f19 into main May 29, 2026
2 of 3 checks passed
@matt-edmondson matt-edmondson deleted the claude/gracious-keller-iMzUI branch May 29, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants