Skip to content

refactor ui - #10

Merged
chenyan2002 merged 2 commits into
mainfrom
ui
Oct 22, 2026
Merged

chenyan2002 merged 2 commits into
mainfrom
ui

Conversation

@chenyan2002

@chenyan2002 chenyan2002 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

WIT types mapped to Web Awesome controls (src/form.ts)

Argument forms now use Web Awesome controls chosen for each type, instead of plain browser inputs:

WIT type Control
bool wa-switch showing true/false
integers, floats wa-number-input without steppers, limited to the type's range (64-bit values are range-checked when parsed) and sized to its largest value
string, char wa-input (narrow for char)
enum, variant Row of buttons (wa-radio-group) for up to 4 short cases, otherwise wa-select
option<T> none | some buttons, with the inner field under some
result<T, E> ok | err buttons, tinted green or red with the theme's success/danger colours
flags wa-checkbox-group
list<u8> Bytes editor: a wa-textarea with a text | hex switch and a byte count. Text is sent as its UTF-8 bytes; hex takes 48 69, with spaces, commas and 0x allowed. Switching converts the contents, and bytes that aren't valid UTF-8 stay hex. The value is a Uint8Array, as in jco
other number lists wa-tag-input: type or paste 1, 2, 3; a value out of range stays in the box with its error
other lists One row per item with a remove button, plus "Add item"
resources wa-select of live instances, plus "New mock …" where offered
  • Dropdowns are as wide as their longest label, not the whole card.
  • Records, tuples and export arguments use a flowing layout: short fields sit side by side and wrap, while strings, lists, options and nested types take a row of their own.
  • Errors show as a red border with the message below. Values filled in by Random stay italic.
  • Draft model: unchanged, apart from new list helpers (removeItem, setTextItems) in src/draft.ts.

@chenyan2002
chenyan2002 merged commit 3d0c70f into main Oct 22, 2026
1 check passed
@chenyan2002
chenyan2002 deleted the ui branch October 22, 2026 23:05
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