Skip to content

Add Showcase App - #53

Draft
otondin wants to merge 8 commits into
swiftlang:mainfrom
otondin:feature/swift-java-ui-showcase-plan
Draft

Add Showcase App#53
otondin wants to merge 8 commits into
swiftlang:mainfrom
otondin:feature/swift-java-ui-showcase-plan

Conversation

@otondin

@otondin otondin commented Aug 27, 2026

Copy link
Copy Markdown

No description provided.

Gabriel Tondin and others added 8 commits August 27, 2026 08:36
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAGND918FAPrcDY3ifcnQt
…eric Compose interpreter

Swift (ShowcaseKit) owns the component model, all screen state, event
handling, and form validation; Kotlin renders whatever Swift declares via
a single JSON/JNI boundary of three (String...) -> String functions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAGND918FAPrcDY3ifcnQt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAGND918FAPrcDY3ifcnQt
Raises the swift-java requirement to 0.5.1 and adds .iOS(.v18) to the
supported platforms list in Package.swift.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D9NoZGnDMVGstd731cE3am
…nents

Renames the wire vocabulary to match ReSwift, which contributors coming
from iOS unidirectional-data-flow work are likely to already know:

- Event -> Action, and ScreenDefinition.handle() -> reduce(). This is
  documented as intentionally *not* a pure functional reducer: each
  screen still mutates its own state in place rather than returning a
  new immutable tree, so the naming shouldn't be read as a promise of
  ReSwift's exact semantics.
- ShowcaseStore -> ScreenRegistry, since each ScreenDefinition is
  already its own independent store; the registry only routes
  showcaseDispatch to the right one, never holds UI state itself.

Splits the single Screens.swift into one file per screen (Buttons,
Selection, Sliders, TextInputs, Form), matching the "one store per
feature" scoping above, and adds two new screens:

- FeedbackScreen: progress indicator + alert dialog (confirm/cancel).
- PickersScreen: stepper + date picker, split out of TextInputsScreen
  since neither is actually a text-entry control.

Adds new Component kinds along the way: `role` (primary/secondary) on
button, segmentedControl, progressIndicator, alert, stepper,
datePicker, textEditor, and code (a Swift snippet paired with each
screen section, rendered as a fullscreen modal on the Kotlin side).
Reuses existing Action cases (.select, .setString, .setNumber, .tap)
and CodingKeys wherever the wire format allowed it, rather than
growing the format for every new control.

23 tests pass, including a parameterized check that every section
across every screen carries exactly one code snippet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D9NoZGnDMVGstd731cE3am
Adds Compose rendering for every new Component kind from ShowcaseKit:

- button role (primary/secondary) drives filled Button vs.
  OutlinedButton.
- segmentedControl via SingleChoiceSegmentedButtonRow/SegmentedButton.
- progressIndicator via the lambda LinearProgressIndicator overload.
- alert via AlertDialog, dispatching select(0)/select(1) for
  confirm/cancel.
- stepper as a row of two IconButtons around the value, disabled at
  min/max.
- datePicker via DatePickerDialog/DatePicker, converting between the
  ISO date string on the wire and epoch millis for
  rememberDatePickerState.
- textEditor as a multi-line OutlinedTextField.

Adds CodeSnippetView/CodeSnippetDialog: an icon-only trigger that opens
a fullscreen Dialog showing the section's Swift snippet, with Copy (via
LocalClipboardManager) and a Wrap/No-wrap toggle for long lines.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D9NoZGnDMVGstd731cE3am
Splits a screen's flat component list into sections at each
sectionHeader boundary (groupIntoSections) — a purely Kotlin-side
concern, since Swift only ever emits a flat list. Each section renders
as its own OutlinedCard, with the header text leading and the
section's code-snippet info icon trailing in the same row, instead of
flowing through the section as an ordinary component.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D9NoZGnDMVGstd731cE3am
…een files

Updates the schema table with role, segmentedControl, progressIndicator,
stepper, datePicker, alert, textEditor, and code rows; renames the
"Events it emits" column to "Actions it emits"; updates the JNI-boundary
diagram and function table from event/eventJSON to action/actionJSON;
and points "Add your own screen" at reduce(_:componentId:) and
ScreenRegistry.swift, noting screens now live one-per-file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D9NoZGnDMVGstd731cE3am
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.

1 participant