diff --git a/quotesdb/.nbd/tickets/0d987f.md b/quotesdb/.nbd/tickets/0d987f.md index d2f014e..42d086b 100644 --- a/quotesdb/.nbd/tickets/0d987f.md +++ b/quotesdb/.nbd/tickets/0d987f.md @@ -1,7 +1,7 @@ +++ title = "Implement shared QuoteCard component — displays text, author, source, date, tags" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["93515e", "0fbdd5"] +++ diff --git a/quotesdb/.nbd/tickets/0fbdd5.md b/quotesdb/.nbd/tickets/0fbdd5.md index 7ada38f..db58420 100644 --- a/quotesdb/.nbd/tickets/0fbdd5.md +++ b/quotesdb/.nbd/tickets/0fbdd5.md @@ -1,7 +1,7 @@ +++ title = "Write src/bin/ui/style.css — full stylesheet for all UI pages and components" priority = 6 -status = "todo" +status = "done" ticket_type = "task" dependencies = ["dc3d2b"] +++ diff --git a/quotesdb/.nbd/tickets/1a274d.md b/quotesdb/.nbd/tickets/1a274d.md index 2a27a91..645f832 100644 --- a/quotesdb/.nbd/tickets/1a274d.md +++ b/quotesdb/.nbd/tickets/1a274d.md @@ -1,7 +1,7 @@ +++ title = "Implement Home page (/) — fetch and display random quote, 'Browse all' link" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["04f865", "1e6a09", "0d987f", "fc2f51", "0fbdd5"] +++ diff --git a/quotesdb/.nbd/tickets/1ba523.md b/quotesdb/.nbd/tickets/1ba523.md index ac73edc..46c5e53 100644 --- a/quotesdb/.nbd/tickets/1ba523.md +++ b/quotesdb/.nbd/tickets/1ba523.md @@ -1,7 +1,7 @@ +++ title = "Implement Submit page (/submit) — quote creation form, display returned auth_code on success" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["04f865", "1e6a09", "fc2f51", "0fbdd5"] +++ diff --git a/quotesdb/.nbd/tickets/2c5a57.md b/quotesdb/.nbd/tickets/2c5a57.md index 8a40b2c..2e16709 100644 --- a/quotesdb/.nbd/tickets/2c5a57.md +++ b/quotesdb/.nbd/tickets/2c5a57.md @@ -1,7 +1,7 @@ +++ title = "Implement pagination component — prev/next buttons, current page indicator, total pages" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["93515e", "0fbdd5"] +++ diff --git a/quotesdb/.nbd/tickets/5cdbd9.md b/quotesdb/.nbd/tickets/5cdbd9.md index f53e698..a60bb6c 100644 --- a/quotesdb/.nbd/tickets/5cdbd9.md +++ b/quotesdb/.nbd/tickets/5cdbd9.md @@ -1,7 +1,7 @@ +++ title = "Implement Browse page (/browse) — paginated quote list with author/tag filter controls" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["04f865", "1e6a09", "0d987f", "2c5a57", "d3d502", "fc2f51", "0fbdd5"] +++ diff --git a/quotesdb/.nbd/tickets/5f1112.md b/quotesdb/.nbd/tickets/5f1112.md index 45f814c..ec981bc 100644 --- a/quotesdb/.nbd/tickets/5f1112.md +++ b/quotesdb/.nbd/tickets/5f1112.md @@ -1,7 +1,7 @@ +++ title = "Implement Quote detail page (/quotes/:id) — view, edit form with auth prompt, delete with auth prompt" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["04f865", "1e6a09", "0d987f", "f850c6", "fc2f51", "0fbdd5"] +++ diff --git a/quotesdb/.nbd/tickets/b3ef98.md b/quotesdb/.nbd/tickets/b3ef98.md index 659d6cb..24fcd7c 100644 --- a/quotesdb/.nbd/tickets/b3ef98.md +++ b/quotesdb/.nbd/tickets/b3ef98.md @@ -1,7 +1,7 @@ +++ title = "Implement Author page (/author/:name) — paginated list of quotes by a single author" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["04f865", "1e6a09", "0d987f", "2c5a57", "d3d502", "fc2f51", "0fbdd5"] +++ diff --git a/quotesdb/.nbd/tickets/d3d502.md b/quotesdb/.nbd/tickets/d3d502.md index 48244ca..d5fffb0 100644 --- a/quotesdb/.nbd/tickets/d3d502.md +++ b/quotesdb/.nbd/tickets/d3d502.md @@ -1,7 +1,7 @@ +++ title = "Implement tag filter component — tag input/select for browse and author pages" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["93515e", "0fbdd5"] +++ diff --git a/quotesdb/.nbd/tickets/f850c6.md b/quotesdb/.nbd/tickets/f850c6.md index 7ccda64..ef3125a 100644 --- a/quotesdb/.nbd/tickets/f850c6.md +++ b/quotesdb/.nbd/tickets/f850c6.md @@ -1,7 +1,7 @@ +++ title = "Implement auth code modal/prompt component — dialog requesting X-Auth-Code before edit or delete" priority = 5 -status = "in_progress" +status = "done" ticket_type = "task" dependencies = ["93515e", "5379eb", "0fbdd5"] +++ diff --git a/quotesdb/src/bin/ui/main.rs b/quotesdb/src/bin/ui/main.rs index a061d4b..bb03325 100644 --- a/quotesdb/src/bin/ui/main.rs +++ b/quotesdb/src/bin/ui/main.rs @@ -2,13 +2,28 @@ //! //! Compiled to WebAssembly via Trunk targeting `wasm32-unknown-unknown`. //! Runs the Yew single-page application with client-side routing. +//! +//! All functional code is gated on `wasm32` — yew, web-sys, and wasm-bindgen +//! are wasm32-only crates unavailable on native targets. + +#[cfg(target_arch = "wasm32")] +mod api; +#[cfg(target_arch = "wasm32")] +mod components; +#[cfg(target_arch = "wasm32")] +mod pages; +#[cfg(target_arch = "wasm32")] +mod storage; +#[cfg(target_arch = "wasm32")] use yew::prelude::*; +#[cfg(target_arch = "wasm32")] use yew_router::prelude::*; /// Application routes matching the frontend route definitions in the design spec. /// /// Routes map to page components. The `NotFound` variant catches all unmatched paths. +#[cfg(target_arch = "wasm32")] #[derive(Clone, Routable, PartialEq)] pub enum Route { /// Home page — displays a random quote. @@ -33,6 +48,7 @@ pub enum Route { } /// Route switch function — maps each `Route` variant to its page component. +#[cfg(target_arch = "wasm32")] fn switch(routes: Route) -> Html { match routes { Route::Home => html! { }, @@ -54,6 +70,7 @@ fn switch(routes: Route) -> Html { /// /// Wraps the entire application in a `BrowserRouter` and renders the /// route-switched page components via `Switch`. +#[cfg(target_arch = "wasm32")] #[function_component(App)] fn app() -> Html { html! { @@ -72,11 +89,15 @@ fn app() -> Html { } } +/// WASM entry point — called by the Trunk-generated JS bootstrap. +#[cfg(target_arch = "wasm32")] fn main() { yew::Renderer::::new().render(); } -mod api; -mod components; -mod pages; -mod storage; +/// Stub entry point for native targets. +/// +/// The UI binary is only meaningful when compiled for wasm32 via Trunk. +/// This stub satisfies the Rust binary requirement on other targets. +#[cfg(not(target_arch = "wasm32"))] +fn main() {}