docs: document tweet conversations

This commit is contained in:
2026-07-14 01:28:23 +09:00
parent fa26ce18d7
commit acc4fe841b
3 changed files with 31 additions and 1 deletions
@@ -2,6 +2,10 @@
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
> Subsequent extension: tweet detail and conversation loading are implemented
> by `2026-07-13-tweet-detail-thread.md` and specified by
> `../specs/2026-07-13-tweet-detail-thread-design.md`.
**Goal:** Build a localhost-only TanStack Start reader that loads user timelines and Top/Latest searches through a read-only Bird server boundary.
**Architecture:** First extend the sibling Bird repository with a typed search product option. Then build Twitter Lite as a TanStack Start application whose server functions call Bird, while TanStack Query owns cursor pagination and the browser renders the Mist Instrument interface.
@@ -33,6 +33,7 @@ The product reduces ambient discovery rather than limiting how far a deliberate
- raw X search syntax;
- `Top` and `Latest` search products;
- `filter:follows` search filtering;
- deliberate post detail pages with cursor-paginated visible conversations;
- photos, videos, animated GIFs, quoted posts, article previews, and engagement counts when supplied by Bird;
- infinite cursor pagination;
- explicit retry, empty, error, loading, and end states;
@@ -46,6 +47,7 @@ The product reduces ambient discovery rather than limiting how far a deliberate
- all X mutation operations;
- user autocomplete and typeahead;
- People and Media search products;
- related-post feeds and automatic post discovery;
- a generic relay proxy;
- deployment beyond a personal localhost process.
@@ -105,6 +107,7 @@ TanStack Start supplies the browser/server boundary. Bird is imported only by se
- `/user?target=<handle-or-url>` displays the User tab.
- `/search?q=<query>&product=<Top|Latest>&following=<boolean>` displays the Search tab.
- `/status/:tweetId` displays one selected post and its visible conversation.
- `/` redirects to `/user` without a target.
The target, query, product, and following flag are validated typed search parameters. Cursor state is internal to TanStack Query because it is transport state rather than a user-controlled view setting.
@@ -125,7 +128,7 @@ new TwitterClient({
`TWITTER_RELAY_BASE_URL` is required. `BIRD_PROFILE_NAME` is optional but must be passed explicitly because the Bird library does not read that environment variable itself.
Only two server functions are callable by the application:
Only three server functions are callable by the application:
```ts
type PostPage = {
@@ -144,8 +147,18 @@ searchPosts(input: {
following: boolean
cursor?: string
}): Promise<PostPage>
loadThreadPosts(input:
| { tweetId: string }
| { tweetId: string; conversationId: string; cursor: string }
): Promise<ThreadPage>
```
The status route and `loadThreadPosts` contract are specified in
`2026-07-13-tweet-detail-thread-design.md`. Conversation reads compose Bird's
existing `getTweet()` and `getThreadPaged()` methods; they add no Bird or relay
operation.
Neither function exposes the Bird client, arbitrary method names, arbitrary relay URLs, or mutation operations.
### User Timeline Flow
@@ -174,6 +187,10 @@ The first request fetches 20 posts. An IntersectionObserver sentinel near the li
Flattened pages are deduplicated by post ID while preserving API order. A failed later page leaves all previously loaded posts visible and presents one explicit Retry control. Requests do not retry automatically.
User and search pages preserve API order. Conversation pages preserve Bird's
current order: chronological within a fetched page, with cursor pages appended
in retrieval order.
## Interface Design
### Layout