WordNav
ui.widgets.Textarea文字体系をまたいだ単語単位のカーソル移動。
BEHAVIOR CONTRACT
単語ジャンプは Unicode の単語境界に従い、ギリシャ文字、キリル文字、絵文字をまたいで動作します。
RECORDED INTERACTION
harness がテキストボックス内で ⌥← を押して単語ごとに移動します。
pub fn buildWordNav(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
const a = cx.allocator;
const c = try col(cx, 12);
try c.appendChild(a, try label(cx, "Word navigation — Alt+←/→ jumps whole Greek/Cyrillic words; double-click selects the word; family emoji is one cluster"));
const ta = try W.Textarea(.{
.label_text = "Mixed-script sample",
.value = WORDNAV_TEXT,
.rows = 3,
.width = 560,
}).mount(scope, cx);
ta.meta.ownership.meta.test_id = "story.wordnav.ta";
try c.appendChild(a, ta);
try c.appendChild(a, try label(cx, "Expected Alt+Right stops (byte offsets): 7 14 27 34 40 46 72 75"));
return c;
}Storybook にあるこの story のコードそのままです(zenit 5f9add5+wip 2026-09-30)。W は ui.widgets のことで、col / row / label は Storybook 内の小さなレイアウトヘルパーです。
TextareaProps
ui.widgets.Textareafn Textarea(props: TextareaProps) TextareaBuilderフィールド
型
デフォルト値
説明
value?[]const u8null—
placeholder?[]const u8null—
label_text?[]const u8null—
helper?[]const u8null—
error_msg?[]const u8null—
rowsu324—
disabledboolfalse—
requiredboolfalse—
readonlyboolfalse—
width?f32null—
on_change?core_ui.HandlerRefnull—
context?*anyopaquenull—
*Node
ui.widgets.Textareamount は *Node を直接返します。親ノードに append してください。