feat: add Dioxus and GPUI UI prototypes for framework comparison
Dioxus (ui-dioxus/): 2,169 lines, WebView mode (same wry as Tauri), Catppuccin theme, 12 components, agor-core integration, compiles clean. Evolution path — keeps xterm.js, gradual migration from Tauri. GPUI (ui-gpui/): 2,490 lines, GPU-accelerated rendering, alacritty_terminal for native terminal, 17 files, Catppuccin palette, demo data. Revolution path — pure Rust UI, 120fps target, no WebView. Both are standalone (not in workspace), share agor-core backend. Created for side-by-side comparison to inform framework decision.
This commit is contained in:
parent
90c7315336
commit
f3d2ca78ba
34 changed files with 17467 additions and 0 deletions
47
ui-dioxus/src/components/terminal.rs
Normal file
47
ui-dioxus/src/components/terminal.rs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/// Terminal component — demonstrates terminal rendering capability.
|
||||
///
|
||||
/// In the Tauri+Svelte app, terminals use xterm.js (Canvas addon) via WebView.
|
||||
/// Dioxus desktop also uses wry/WebView, so xterm.js embedding IS possible
|
||||
/// via `document::eval()` or an iframe. For this prototype, we render a styled
|
||||
/// terminal area showing mock output to demonstrate the visual integration.
|
||||
///
|
||||
/// A production implementation would:
|
||||
/// 1. Inject xterm.js via `with_custom_head()` in desktop Config
|
||||
/// 2. Use `document::eval()` to create/manage Terminal instances
|
||||
/// 3. Bridge PTY output from PtyManager through DioxusEventSink -> eval()
|
||||
///
|
||||
/// The key insight: Dioxus desktop uses the SAME wry/WebKit2GTK backend as
|
||||
/// Tauri, so xterm.js works identically. No Canvas addon difference.
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use crate::state::{TerminalLine, TerminalLineKind};
|
||||
|
||||
#[component]
|
||||
pub fn TerminalArea(lines: Vec<TerminalLine>) -> Element {
|
||||
rsx! {
|
||||
div { class: "terminal-area",
|
||||
for line in lines.iter() {
|
||||
div { class: "terminal-line",
|
||||
match line.kind {
|
||||
TerminalLineKind::Prompt => rsx! {
|
||||
span { class: "terminal-prompt", "{line.text}" }
|
||||
},
|
||||
TerminalLineKind::Output => rsx! {
|
||||
span { class: "terminal-output", "{line.text}" }
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Blinking cursor
|
||||
div { class: "terminal-line",
|
||||
span { class: "terminal-prompt", "$ " }
|
||||
span {
|
||||
style: "animation: pulse 1s step-end infinite; color: var(--ctp-text);",
|
||||
"\u{2588}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue