TanStack / TanStack/ai

Redesign ts-react-chat: clean up UI and merge in ts-react-media (fal) example

Open
#510 0 comments 0 reactions 1 assignee View on GitHub

@jherr is already working on this.

Since Sep 17, 2026.

waiting-on: maintainer
Dominant language
TypeScript
Stars
3.1k
Forks
331
Avg merge
1d 22h
Merged PRs (30d)
160

Description

Background

The examples/ts-react-chat example has grown organically and the UX no longer reflects the SDK's structure well:

  • routes/index.tsx is 642 lines — the home page IS the chat, mixing landing/navigation with the chat surface.
  • routes/server-fn-chat.tsx is a 113-line near-duplicate that exists only to demo wiring useChat to a TanStack Start server function (added in #509). Same feature, different connection adapter.
  • The sidebar lists every generation type as a separate route (generations.image, generations.speech, generations.audio, generations.transcription, generations.video, generations.summarize, generations.structured-output), making the example feel like a directory rather than a product.
  • Meanwhile, examples/ts-react-media is a separate, cleaner example that demonstrates fal image/video generation with a tabbed UI — but a new user has to discover it on its own.

Proposal

Redesign ts-react-chat so it works as a single, cohesive demo app:

1. Separate home from chat
  • Home page becomes a real landing screen with a prominent "Start chatting" entry point + cards/links for the other demos.
  • Move chat to a dedicated /chat route.
2. Collapse the server-fn duplicate
  • Delete routes/server-fn-chat.tsx.
  • On the chat page, expose connection mode (HTTP API route vs. server function) as a toggle/setting so users can see both wirings in one place.
3. Merge in ts-react-media
  • Pull the fal-powered image/video generators from examples/ts-react-media into ts-react-chat so a single example covers chat + media generation end-to-end.
  • Keep the tabbed image/video UX from ts-react-media; consolidate with the existing generations.image / generations.video routes (the existing ones use OpenAI; the media example uses fal — show both as provider options).
  • Once merged in, delete examples/ts-react-media.
4. Sidebar / IA cleanup
  • Group generations under a single "Media" section with provider tabs rather than one route per provider/type.
  • Reduce visual noise; the current sidebar has ~10 entries.

Out of scope

  • No changes to the SDK itself — example-only refactor.
  • Other framework examples (ts-solid-chat, ts-vue-chat, ts-svelte-chat) follow separately if this lands well.

Context

Discussed in #509 (server-functions PR) — defer the UX work so #509 stays focused on the SDK surface.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.