The long form post composer should feel confined to the current post container…

merged…
osebo28d ago

The long form post composer should feel confined to the current post container it should feel larger like this
IMG_8815.png

5 repliesoldestnewest
Osebotfable-5-128d ago

Reading the reference (Substack's article editor): no boxed form, the whole page IS the post being written. Top row = Cancel … status pill … action; then author avatar + name; a big serif Title; the body typed straight onto the page background; the tools live in a bar at the bottom.

Plan for /<slug>/write (components/write-post.tsx + the write block in app/globals.css):

  • Drop the "Write a post / in <ws>" page head and the grey .compose-panel well. The editor sits in the post's own frame: author row (Avatar + login, same .who metrics as a post), bare serif title, bare body textarea with the .post .body type (serif 18px) that grows with the text and starts tall (viewport-based), no fill, no resize handle.
  • Top bar: Cancel (left), draft status as a small dot pill in the middle ("Draft saved" / "Saving…"), Publish / Publish & run (right).
  • Bottom sticky dock (like the reply .compose-dock): Write | Preview seg, word count, Ask Osebot + model, Image, tag, Discard draft.
  • Preview swaps the textarea for the rendered post in the same frame, so writing and preview line up.
  • Same POST /api/threads payload, draft persistence and two-tap discard; app/[workspace]/write/page.tsx passes the current user for the author row.

Then static mockup screenshots at 390px and ~900px (the app can't run in the sandbox), commit, push, PR description.

Osebotfable-5-128d agothreadide@283b262

Done on thread/5a5bbc25 (threadide 283b262). The write page is now drawn as the post itself, after the Substack screenshot: no "Write a post" heading, no grey well.

/<slug>/write at 390px with a title and body typed in

What changed

  • Top bar: Cancel on the left, the draft state as a dot pill in the middle (faint = nothing stored, yellow "Saving draft…", green "Draft saved"), Publish / Publish & run on the right. Cancel still keeps the draft.
  • Author row: your avatar + login, "in <workspace>", in the same metrics a published post's .who line uses (the route now passes the signed-in user).
  • Title: bare serif at h2 size (34px, 28px on phones). It is a one-row textarea that grows, so a long title wraps instead of scrolling out of view in an input; Enter jumps to the body, newlines are stripped.
  • Body: typed straight onto the page in the post's own type (serif 18px / 1.55), no fill, no resize handle. It grows with the text from a tall viewport-based minimum (max(320px, 100vh - 420px)), so the page scrolls like reading the post will.
  • Dock: a sticky bottom bar like the reply composer's, with Write | Preview, Ask Osebot (+ model, off by default as before), Image, the tag select, and the word count + Discard draft at the right. Preview swaps the body for the rendered post in the same frame.
  • Same POST /api/threads payload, same localStorage draft, same two-tap discard.

Files: components/write-post.tsx (JSX + title/body grow), app/globals.css (the form.write-post block, replaced wholesale), app/[workspace]/write/page.tsx (page head gone, author prop).

Checked: tsc clean; the real component rendered with react-dom/server against the live globals.css and screenshotted at 390px light (empty + filled) and 1100px dark (attached). Not clicked through in the running app (can't run it in the sandbox), so the autosize and Enter-to-body behaviours are code-reviewed only.

Left out on purpose: the reference's formatting glyphs (link, list, quote, undo). We have no rich-text controls, markdown stays the format; the Image chip is the one insert tool.

/<slug>/write at 390px, empty: Cancel / Draft pill / Publish, author row, Title, body placeholder, dock
/<slug>/write at 390px, empty: Cancel / Draft pill / Publish, author row, Title, body placeholder, dock
/<slug>/write at 1100px in dark mode beside the sidebar
/<slug>/write at 1100px in dark mode beside the sidebar
oseboasked Osebot28d ago

There are conflicts

Osebotfable-5-128d agothreadide@ab00be1

Conflicts resolved: main is merged into thread/5a5bbc25 (threadide ab00be1, PR #178).

What conflicted: one hunk in components/write-post.tsx. PR #177 (inline images at the remembered caret) changed the write page's image button to <AttachImages … chips={false} onError={setError} /> and switched the payload to images.forPost, while this branch moved that same line into the new bottom dock. I kept this branch's dock layout (tag select in the tools row) and took main's chipless, error-reporting image button and images.forPost. Nothing else overlapped (app/globals.css and the page merged cleanly).

Checked: npx tsc --noEmit clean after the merge; branch now differs from main in just the three write-page files (144+/72-). GitHub was still computing mergeable for #178 when I last polled (it reports "unknown" for a minute after a push), but the local merge against origin/main tip b4fd881 is clean, so the Merge button should be green now.

Gotcha for next time: the sandbox checkout was sitting on main's tip, not the branch (as in gotchas/sandbox-branch-may-sit-on-main); I reset to the remote branch before merging.

Osebot28d ago

Merged threadide #178 by @osebo (merge, 77bc4ae).