Skip to content

refactor(swiflowui)!: LabeledField labelPrefix/labelSuffix; Toast numeric guardrails; scoped disabled-vs-inert comments#262

Merged
zzal merged 1 commit into
mainfrom
fix/swiflowui-api-polish
Jul 20, 2026
Merged

refactor(swiflowui)!: LabeledField labelPrefix/labelSuffix; Toast numeric guardrails; scoped disabled-vs-inert comments#262
zzal merged 1 commit into
mainfrom
fix/swiflowui-api-polish

Conversation

@zzal

@zzal zzal commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Audit backlog B10 + B7 (Part-7 Mediums/High).

  • BREAKING — LabeledField(labelPrefix:/labelSuffix:) replaces prefix:/suffix: — the same slots every field control already spells labelPrefix:/labelSuffix:. Renamed clean (no deprecation shim): the split vocabulary is one release old, and a defaulted deprecated overload would be ambiguous with the new one at call sites that pass neither.
  • Toast numeric guardrails: ToastQueue(maxVisible: 0) previously parked every toast in pending and rendered nothing, silently — it now clamps to 1 with a DEBUG swiflowWarn (the DataTable rowHeight guard precedent). ToastItem(duration: ≤0) warns (the timer fires next tick; a one-frame flash is never what the caller meant). Both covered by a new sync-only warn-capturing suite.
  • disabled-vs-inert (B7) resolved as a scoped rule, comments aligned: the code was already consistent — native disabled where form semantics matter (Button, inputs, <fieldset> cascade); inert for controls inside composite widgets (Pagination pagers, Dropdown items) that must leave the tab order without form semantics. Pagination's "project rule" comment and Button's disabled line now state the actual rule.
  • Deliberately skipped: Field<T> overloads for NumberField/Slider — NumberField's doc documents the gap as intentional (Field's validators are string-typed today); adding them means generalizing the Forms validator system, not polishing API.

Whole-package swift test: 1907 tests, 353 suites, green.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

📦 Bundle size

Artifact Baseline This PR Δ
App.wasm 5.06 MB 5.23 MB +3.45%
App.wasm (gzip) 1.80 MB 1.87 MB +3.56%
JS runtime 54.5 KB 54.5 KB +0.00%
JS runtime (gzip) 11.3 KB 11.3 KB +0.00%
Total (gzip) 1.81 MB 1.88 MB +3.54%

✅ Within budget (≤5% growth allowed).

Baseline: Swift 6.3, WASM SDK 6.3-RELEASE, measured 2026-06-18.

…eric guardrails; scoped disabled-vs-inert comments

LabeledField named the same adornment slots prefix:/suffix: while every
field control says labelPrefix:/labelSuffix: — renamed before the split
vocabulary ages past its one release (BREAKING, no behavior change).

ToastQueue(maxVisible: 0) parked every toast in pending forever and
rendered nothing, silently; it now clamps to 1 with a DEBUG warn (the
DataTable rowHeight-guard precedent). ToastItem warns on duration <= 0
(the timer fires next tick — a one-frame flash is never intended).

The 'inert, not disabled' comments claimed an unscoped project rule
that Button and the field chrome don't follow. The actual rule is
scoped and the code already obeys it: native disabled where form
semantics matter (submission exclusion, :disabled UA behavior,
fieldset cascade); inert for controls inside composite widgets that
must leave the tab order without form semantics. Comments now state
that rule at both anchor sites.

NumberField/Slider Field<T> overloads intentionally NOT added: the gap
is documented in NumberField.swift — Field's validators are
string-typed today.

Whole-package swift test: 1907 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zzal
zzal force-pushed the fix/swiflowui-api-polish branch from 7a99482 to bf7116b Compare July 20, 2026 01:22
@zzal
zzal merged commit 63f9ed5 into main Jul 20, 2026
6 checks passed
@zzal
zzal deleted the fix/swiflowui-api-polish branch July 20, 2026 01:31
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