Functional parity with linux

This commit is contained in:
Will Temple
2026-05-15 13:31:59 -07:00
parent 861bf63621
commit 67400f1499
17 changed files with 2221 additions and 458 deletions

View File

@@ -1,7 +1,16 @@
use ruin_app::prelude::*;
use tracing_subscriber::EnvFilter;
#[ruin_runtime::async_main]
async fn main() -> ruin_app::Result<()> {
let _ = tracing_subscriber::fmt()
.with_env_filter(
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")),
)
.with_target(true)
.without_time()
.try_init();
let title = "RUIN Counter";
App::new()

View File

@@ -90,21 +90,12 @@ fn TaskBoard() -> impl IntoView {
}
});
let all_label = if matches!(filter.get(), TaskFilter::All) {
"● All"
} else {
"○ All"
};
let open_label = if matches!(filter.get(), TaskFilter::OpenOnly) {
"● Open"
} else {
"○ Open"
};
let done_label = if matches!(filter.get(), TaskFilter::CompletedOnly) {
"● Completed"
} else {
"○ Completed"
};
let all_label = filter_label(matches!(filter.get(), TaskFilter::All), "All");
let open_label = filter_label(matches!(filter.get(), TaskFilter::OpenOnly), "Open");
let done_label = filter_label(
matches!(filter.get(), TaskFilter::CompletedOnly),
"Completed",
);
let task_rows = visible_ids.with(|ids| {
ids.iter()
.map(|task_id| {
@@ -466,6 +457,14 @@ fn move_task(tasks: &Signal<Vec<Task>>, task_id: u64, direction: MoveDirection)
});
}
fn filter_label(active: bool, label: &str) -> String {
if active {
format!("[x] {label}")
} else {
format!("[ ] {label}")
}
}
fn seed_tasks() -> Vec<Task> {
vec![
Task {

View File

@@ -268,6 +268,7 @@ fn RuntimeIoExample(server_addr: SocketAddr) -> impl IntoView {
};
eprintln!("example05: {message}");
let _ = save_status.set(Some(message));
flush_reactive_updates();
}
}));
}