SPEC_ANSWERHUB_FRONTEND.md

AnswerHub frontend redesign + rename — spec

⚠️ Built, and partly superseded by SPEC_ACCOUNTS.md. The restyle shipped. But the account pages this spec styles no longer exist: register, magic-login, 2FA-code and the local login form were removed when identity moved to accounts.siao.ai. /answerhub/login is now a redirect, not a page, and the two-factor-and-magic-login test file is deleted. The sign-in page to style is Logto's, and its CSS lives at git-siao-ai/logto/sign-in-experience.css. Everything about submissions, blog, knowledge-base and admin styling still holds.

What this covers: the AnswerHub rename and frontend restyle — shared tokens, page structure, what was cut from nav. Visual only.

For what is built or deployed, see ClaudeDocs/HANDOFF.md — status deliberately does not live here. Lives in the apps-siao-ai repo, on top of the already-complete Lwopan migration backend (SPEC_LWOPAN_MIGRATION.md, tickets 01–09, all done and tested). This spec covers the restyle only — no new backend behavior, no new information architecture. Full decision trail: NOTES_APPS.md ch.7.

Problem Statement

The Lwopan migration shipped fully working backend logic (accounts, 2FA, magic login, submissions with likes/comments, admin moderation, blog, knowledge base, search) but the frontend built alongside it is bare-bones: plain HTML <input>/<textarea> elements, one shadcn Button, no shared navigation, no visual identity, and the temporary name "Lwopan" was never meant to be permanent. The owner wants a real name and a real visual pass before this goes further — asked to compare it after seeing the working-but-unstyled version and confirmed "後端完整,前端完全沒有" (backend complete, frontend basically absent).

Solution

Rename the product to AnswerHub(答案庫), permanently retiring "Lwopan" as a label (the /lwopan route prefix and internal identifiers are a separate, later cleanup — not part of this spec, see Out of Scope). Cut blog and knowledge base from the navigable product entirely for now — the backend code stays, but neither appears in the UI or nav. Restyle every existing page using the same page structure the old ~/Lwopan/learning-platform app had (hero homepage with search, existing upload/detail/profile/settings layouts) — this is a visual system change, not an information-architecture redesign. Adopt SiaoHub's exact color token system (paper/ink light theme, dark-mode counterpart, sage-green accent) by overwriting apps-siao-ai's existing shadcn oklch tokens, so the whole family shares one palette rather than each app maintaining its own. Add a shared header/nav across all AnswerHub pages, replace raw HTML form elements with shadcn's Input/Textarea/Card, and drop every remnant of Liquid Glass (decorative blurred background shapes included).

User Stories

  1. As a visitor, I want to land on AnswerHub's homepage and see a hero section with the product name and a search bar, so that I immediately understand what this product does and can start looking for an answer right away — matching the old app's homepage structure, not a blank or list-only page.
  2. As a visitor, I want prominent "新增解答" and "我的解答" actions on the homepage, so that both core actions (contribute, manage mine) are one click away without hunting through a nav menu.
  3. As a visitor or logged-in user, I want a consistent header on every AnswerHub page showing the product name, my login state, and a way back to the main list, so that I never lose my place navigating between upload, detail, profile, and settings pages.
  4. As a user, I want the login, register, magic-login, 2FA-code, and settings forms to use styled inputs (not raw unstyled HTML elements), so that the product feels like one coherent piece of software instead of a developer scaffold.
  5. As a user, I want submission cards, the submission detail page, and the admin review list to visually read as related, so the product feels designed rather than assembled from independent pages.
  6. As a visitor, I want light and dark mode to both look intentional (not just an inverted default), matching the SiaoHub token system's existing light/dark pair.
  7. As the owner, I want the same color tokens shared between apps-siao-ai and siaohub rather than two palettes to keep in sync, so that a future palette tweak is one edit, not two.
  8. As the owner, I want blog and knowledge base completely absent from AnswerHub's navigation and homepage, so the product's surface area matches what's actually being offered right now (answers only), not what the backend happens to support.
  9. As a visitor, I want the search bar on the homepage to be present and usable (dispatches a query) even though it returns no live results yet, so the interface doesn't look broken or half-finished — consistent with ticket 09's "search unavailable" state.
  10. As a developer maintaining this later, I want the visual restyle to not have changed any backend contract (API routes, Prisma schema, auth flow), so that the full existing Playwright test suite's behavioral assertions (what happens on submit, what status codes come back) keep passing without logic changes — only text/selector updates where the DOM changed.

Implementation Decisions

Testing Decisions

Out of Scope

Further Notes