Post view

merged…
osebo48d ago

I want a view that shows the last response with the link to a PR and merge button if it's available on the home page

4 repliesoldestnewest
Osebotfable-5-148d ago

Plan: add a "Last reply" view to the home page, toggled next to the existing Everyone | Yours / status filters (?view=replies, so it's shareable and survives a no-JS submit).

In that view each thread renders as a card instead of a title row:

  • title + the usual meta line (status, author, workspace, age)
  • the latest post in the thread (author avatar/name, kind, age) with its markdown body rendered like on the thread page, clipped to a max height with a fade and an "Open thread" link
  • the thread's PR pills + Merge button, reusing the existing MergePrs panel from the thread page (live state from /api/threads/[id]/prs, Merge = two-tap, members only, disabled while running). It loads lazily when the card scrolls into view so a long home page doesn't fan out into dozens of GitHub calls at once.

Data: listThreads gains a lastPost extra (one correlated subquery) and GET /api/threads returns lastPost + prs so the live filter/search path keeps working in the new view. The title-only view is unchanged and stays the default.

Osebotfable-5-148d ago

Code is in and typechecks (commit bb1d03b, not pushed yet). What landed:

  • Home page toggle Titles | Last reply (right end of the filter row, ?view=replies). Switching never refetches — both views render the same rows.
  • Reply card = title + meta line, the thread's newest post rendered as markdown (clamped to 240px with a fade; "Show more" appears only when it actually overflows; "Open thread" deep-links to #post-<id>), then the Pull requests panel.
  • The panel is the existing MergePrs from the thread page, so behaviour is identical: live state badge (CI passing / conflicts / draft / blocked / merged…), two-tap Merge for members, disabled while running. New lazy prop fetches /api/threads/[id]/prs only when the card scrolls near the viewport; threads already merged skip GitHub entirely.
  • Data: listThreads has a lastPost extra (one correlated subquery, body clipped to 2000 chars server-side), lib/merge.ts threadsPullRequests() batches the PR lookup for a whole list, and GET /api/threads returns both.

Taking mockup screenshots now (the app can't run in the sandbox — no DB/OAuth), then pushing.

Osebotfable-5-148d agothreadide@bb1d03b

Done — pushed to thread/c1836fcc (bb1d03b).

What you get: on the home page, a Titles | Last reply switch at the right end of the filter row (/?view=replies). In "Last reply" each thread is a card: title + the usual meta line, the newest post rendered as markdown (clamped with a fade; "Show more" only when it really overflows; "Open thread" deep-links to that post), then the Pull requests panel — same MergePrs as the thread page, so same badges (CI passing / conflicts / draft / blocked / merged) and the same two-tap Merge for workspace members, disabled while Claude is running. Threads already marked merged show their PR links with a static "merged" pill and skip GitHub.

How it's wired (for whoever touches this next)

  • lib/data.ts listThreads → lastPost extra (one correlated subquery; body clipped to 2000 chars server-side, truncated flag).
  • lib/merge.ts threadsPullRequests(ids) batches the PR-meta lookup for the whole list; withPullRequests(rows) attaches prs. threadPullRequests(id) is now a thin wrapper.
  • GET /api/threads returns lastPost + prs, so live search/filters keep working in the new view. Switching views never refetches (view is excluded from the browser's fetch key).
  • MergePrs got lazy (IntersectionObserver, fetches /prs only when a card scrolls near) and onMerged (client-filtered lists refetch after a merge).
  • Shared components/markdown.tsx (extracted from post.tsx) and components/clamped-body.tsx.

Interpretation calls — shout if you want these flipped:

  1. "Last response" = the newest post by anyone (labelled with author + kind), not "Claude's last post". Easy to change to agent-only if you'd rather always see Claude's summary.
  2. Opt-in view; Titles stays the default. Could default to Last reply or remember the choice in localStorage.
  3. Home page only; the workspace page keeps the title list.

Verified: tsc --noEmit clean; layout checked via mockup on the real stylesheet at 900px and 390px (attached). Not run against a live DB/GitHub here (sandbox can't run the app) — worth loading /?view=replies once on the preview.

Home page, "Last reply" view at 900px (mockup on real globals.css): latest post + PR pills + Merge per thread
Home page, "Last reply" view at 900px (mockup on real globals.css): latest post + PR pills + Merge per thread
Same view at 390px: view switch drops to its own row, cards stack
Same view at 390px: view switch drops to its own row, cards stack
Osebot48d ago

Merged threadide #75 by @osebo (merge, 1dfd95f).