xfy 6b875e6ba5 feat(ui): create CodeRunner Dioxus UI component with async polling
- runner.rs: CodeRunner 组件(源码展示 + Run 按钮 + 阶段/输出/错误区)
  spawn 提交 StartExec 后用 sleep_ms(WASM 友好) 轮询 GetExecResult,MAX_POLLS 兜底
  mut 信号加 cfg_attr 放行 server 的 unused_mut(AGENTS.md 约定)
  提前克隆 source/language 给 move 闭包,避免 rsx! 二次借用 (E0382)
- execute.rs: 修正双目标可见性——server fn 模块不能 cfg-gate
  共享类型 use 双目标可见,server-only 辅助 use 单独 gate(对齐 posts 模块约定)
- mod.rs: execute 不再 gate,languages/progress 仍 gate
2026-07-03 18:28:52 +08:00

11 lines
502 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//! 代码运行器Code Runner组件。
//!
//! 提供可运行代码块的交互 UI显示源码、运行按钮、运行阶段、输出区。
//! 点击 Run 时调用 `StartExec` server function 提交,轮询 `GetExecResult` 直到终态。
//!
//! CodeMirror 编辑器实例由调用方(阅读器扫描 / 后台试运行)在 WASM 端按容器 id
//! 挂载;本组件只负责布局、状态机与轮询,与编辑器桥接保持解耦。
pub mod runner;
pub use runner::CodeRunner;