You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.5 KiB
Markdown
42 lines
1.5 KiB
Markdown
+++
|
|
title = "Implement Browse page (/browse) — paginated quote list with author/tag filter controls"
|
|
priority = 5
|
|
status = "todo"
|
|
ticket_type = "task"
|
|
dependencies = ["04f865", "1e6a09", "0d987f", "2c5a57", "d3d502", "fc2f51", "0fbdd5"]
|
|
+++
|
|
|
|
<context>
|
|
The `quotesdb` UI is a Yew (Rust → Wasm) single-page app compiled by Trunk and hosted on Cloudflare Pages. It communicates with the backend API via `fetch` calls. Source lives in `src/bin/ui/`. Run with `trunk serve` for local development.
|
|
|
|
The Browse page displays a paginated list of all quotes with optional author and tag filters.
|
|
</context>
|
|
|
|
<goal>
|
|
Implement the Browse page component (`src/bin/ui/pages/browse.rs`):
|
|
1. Read `?page`, `?author`, `?tag` from the URL query string
|
|
2. Fetch quotes from `GET /api/quotes` with the query parameters
|
|
3. Render each quote with the `QuoteCard` component
|
|
4. Render the `Pagination` component with prev/next navigation (update URL query params on page change)
|
|
5. Render the `TagFilter` component and an author text input for filtering
|
|
6. Render `ErrorDisplay` on error
|
|
</goal>
|
|
|
|
<constraints>
|
|
- URL query parameters are the source of truth for current page and filters — use yew-router location hooks to read/write them.
|
|
- Changing a filter should reset to page 1.
|
|
- The author filter is a free-text input (case-insensitive match on the API side).
|
|
</constraints>
|
|
|
|
<validation>
|
|
From the `quotesdb/` directory:
|
|
|
|
```sh
|
|
trunk build
|
|
```
|
|
</validation>
|
|
|
|
<commit>
|
|
`feat(quotesdb): implement Browse page — paginated list with filters`
|
|
</commit>
|