Skip to content

Fix/checkbox glitch#669

Open
gab-az wants to merge 7 commits into
devfrom
fix/checkbox-glitch
Open

Fix/checkbox glitch#669
gab-az wants to merge 7 commits into
devfrom
fix/checkbox-glitch

Conversation

@gab-az

@gab-az gab-az commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Overview

Fixes the Webkit checkbox toggle glitch and brings the component, its spec,
and its Storybook story into mutual conformance. Three commits, each scoped
to one concern.


1. fix(webkit) — stop checkbox jumping vertically on toggle

Context: the control jumped ~3px vertically every time it was checked/
unchecked.

  • Root cause: the root <span> is inline-flex with the default
    vertical-align: baseline. While unchecked it has no in-flow children
    (the native input is absolute), so its baseline is the box's bottom
    edge; on check, the v-if SVG becomes an in-flow flex child and the
    baseline jumps to the icon — shifting the box down on the line.
  • Fix: align-middle on the root makes vertical placement independent
    of content. No effect in flex layouts (e.g. the Disabled row), where
    vertical-align is ignored.
  • Verified: rendered box top is identical checked vs unchecked.

Files: packages/webkit/src/components/inputs/checkbox/checkbox.vue


2. refactor(webkit) — spec conformance (re-author/approve spec + rewrite component)

Context: .specs/checkbox.md had drifted from the shipped component and
its checksum no longer validated, so it could not drive /component-create.

  • Re-authored the spec from the real component (props/events/slots/tokens/
    a11y now match what ships), bumped spec_version 2 → 3, and re-approved
    it with a fresh, valid checksum.
  • Rewrote the component to the canonical styling pattern the spec's
    Constraints require: all utilities inline on the root, variants via
    data-*, dropping the JS class presets (sharedClasses / checkedClasses
    / disabledClasses / iconClasses / rootClasses = computed) and the
    interactive-states preset import.
  • Behavior, tokens, and the align-middle fix are preserved.
  • Verified: validate-spec-compliance passes (props/events/slots match
    1-to-1); pnpm --filter webkit lint clean.

Files: .specs/checkbox.md, packages/webkit/src/components/inputs/checkbox/checkbox.vue


3. docs(storybook) — rebuild checkbox story per storybook-write spec

Context: the story panel and code examples were out of date with the
component.

  • docs.description.component now injects the spec's Purpose + ## Usage
    block verbatim, so the Docs code example matches the real API.
  • Full argTypes for every prop + the update:modelValue event, grouped by
    table.category.
  • Reactive v-model Template (local ref synced from args.modelValue,
    forwards update:modelValue) so the panel checkbox actually toggles and
    the Actions panel logs changes.
  • Stories limited to the spec's list: Default + a Disabled composite showing
    checked and unchecked.
  • No Figma refs, no argTypesRegex, no legacy .args form.

Files: apps/storybook/src/stories/webkit/inputs/Checkbox.stories.js

gab-az added 3 commits June 24, 2026 13:57
The inputs/checkbox root is `inline-flex` with the default
`vertical-align: baseline`. While unchecked it has no in-flow children
(the native input is `absolute`), so its baseline resolves to the box's
bottom edge; on check, the `v-if` SVG becomes an in-flow flex child and
the baseline jumps to the icon, shifting the whole control down ~3px on
the line. Adding `align-middle` makes vertical placement independent of
content, so the box stays put across checked/unchecked. No effect in
flex layouts (e.g. the Disabled story), where vertical-align is ignored.
Re-authored .specs/checkbox.md from the real component (props/events/
slots/tokens/a11y now match what ships) and re-approved it (spec_version
3, fresh checksum) — the previous spec had drifted and its checksum no
longer validated.

Rewrote inputs/checkbox/checkbox.vue to the canonical styling pattern the
spec's Constraints require: all utilities inline on the root with data-*
driven variants, dropping the JS class presets (sharedClasses /
checkedClasses / disabledClasses / iconClasses / rootClasses computed) and
the interactive-states preset import. Behavior, tokens, and the
align-middle fix for the on-toggle vertical jump are preserved; verified
in Storybook (box top identical checked vs unchecked) and lint/spec
compliance pass.
Rewrite Webkit/Inputs/Checkbox to the canonical story shape: inject the
spec's Purpose + ## Usage block into docs.description.component, declare
argTypes for every spec prop/event (grouped by table.category), and add a
reactive v-model Template (local ref synced from args.modelValue, forwards
update:modelValue so the field toggles and the Actions panel logs). Stories
limited to the spec's list — Default + a Disabled composite showing the
checked and unchecked states. No Figma refs, no argTypesRegex, no legacy
.args form.
@gab-az gab-az requested a review from a team as a code owner June 24, 2026 21:36
gab-az added 3 commits June 24, 2026 14:39
Merging dev removed the ./inputs/checkbox export and repointed ./checkbox
at the webkit checkbox component (the old PrimeVue checkbox was deleted in
dev's cleanup). The 3-way merge already corrected the story's actual import
and title to dev's conventions; this fixes the two remaining string
references — the embedded Usage snippet in the story's docs and the spec's
Usage block — to @aziontech/webkit/checkbox, and refreshes the spec
checksum.
Comment thread .specs/checkbox.md
| `value` | `string` | `'undefined'` | no | value. |
| `binary` | `boolean` | `false` | no | binary. |
| `modelValue` | `unknown` | `undefined` | no | Bound value: a boolean in `binary` mode, otherwise the array/value the control reflects. |
| `value` | `unknown` | `undefined` | no | This checkbox's value, added to or removed from the model array when not `binary`. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After update Seems it's updating the type to any and writing 'undefined' inside quotes indicating undefined string.

Type string should default value with '' (empty string).

Comment thread .specs/checkbox.md
| `readonly` | `boolean` | `false` | no | Prevents changes while the control stays focusable. |
| `inputId` | `string` | `undefined` | no | Forwarded to the native input `id`; pair with an external label's `for`. |
| `name` | `string` | `undefined` | no | HTML name for form submission. |
| `tabindex` | `number` | `'undefined'` | no | tabindex. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the type if not current default tabindex 0 should be configured to both types number|undefined but the case it is writing undefined inside string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants