Skip to content

markup: digit-only attribute values pass check+build then blank the window at runtime #425

Description

@donpark

An attribute value that consists only of digits (e.g. placeholder="32") passes every build-time gate — native check (including the subset checker), native build, markup check --strict, markup dump — but the runtime view builder's value tokenizer aborts the whole view with expected text, leaving an empty window. No build-time diagnostic points at the cause; the app is blank and the only clue is a single startup log line.

Discovered in a real app: placeholder="32" on a bitrate text-field produced a blank window; changing the value to e.g. 32 rendered. Any all-digits attribute value triggers it.

Repro

From a clean native init app (TypeScript core), replace src/app.native with:

<column gap="12" padding="16">
  <text-field text="{value}" label="Digits placeholder" placeholder="32" />
</column>

src/core.ts (boilerplate, any valid Model works):

import { utf8Bytes } from "@native-sdk/core";

export interface Model {
  readonly value: Uint8Array;
}

export function initialModel(): Model {
  return { value: utf8Bytes("") };
}

export type Msg = { readonly kind: "noop" };

export function update(model: Model, _msg: Msg): Model {
  return model;
}

Build and run:

native build && ./zig-out/bin/<appname>

Expected: the text field renders with placeholder 32.

Actual: the window is blank. Stdout shows one line at startup and nothing else:

markup view failed to build (2:3): expected text

Control

The same file with placeholder="e.g. 32" builds, checks, and renders correctly (no markup view failed line). So the tokenizer treats an all-digit attribute value as a non-text token and fails; any non-digit prefix works around it.

Environment

  • native 0.10.1 (064ca98), CLI reports native 0.10.1 (commit 064ca98, automation protocol 0x51f7889bbe3305e7)
  • macOS 26.6.2 (arm64)
  • Zig 0.16.0, Node v24.20.0

Notes

  • Same bug family as @native-sdk/core/text fails the subset checker's integer proofs once TextEditState is a Model field #406 (numeric values tripping a validation layer while the other layers accept them), but different layer: this one is the runtime view builder's value tokenizer, and its failure mode is a silent blank window rather than a build error.
  • Two layers disagree: the static parser/checker accept all-digit values, so the only failure signal is one runtime log line. Either the static checker should reject all-digit attribute values, or (better) the runtime tokenizer should accept them the way the static parser does.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions