Skip to content

Create Are.na blocks and channels from tiny.garden (feature 2/3)#7

Draft
gndclouds wants to merge 1 commit into
cursor/inline-block-editorfrom
cursor/arena-create-blocks-channels
Draft

Create Are.na blocks and channels from tiny.garden (feature 2/3)#7
gndclouds wants to merge 1 commit into
cursor/inline-block-editorfrom
cursor/arena-create-blocks-channels

Conversation

@gndclouds
Copy link
Copy Markdown
Member

Summary

Extends tiny.garden from a read+edit surface into a full read/edit/create surface for Are.na. Users can:

  • Create a new Are.na channel from inside /site/new (no need to bounce through Are.na's UI to start a site).
  • Create new Text / Link / Image-from-URL blocks in their channel from the Content tab on /sites/[id]. The new block is pushed to Are.na and a rebuild is queued automatically.

This is feature 2 of 3 from docs/features.md. Stacks on top of #6 — base is cursor/inline-block-editor so the create-block composer plugs into the editor that PR 1 introduces. Merge order: PR 1 → PR 2.

What changed

  • src/lib/arena.tscreateChannel, createTextBlock, createLinkBlock, createImageBlockFromUrl, plus an internal write() helper that reuses the existing rate-limit-aware retry for any write verb.
  • src/app/api/channels/route.ts — adds POST alongside the existing GET. Body: { title, status?: "public" | "closed" | "private" }. Returns the canonical channel as Are.na reports it.
  • src/app/api/sites/[id]/blocks/route.ts — adds POST alongside the editor's GET. Body shapes: { type: "text", content, title? }, { type: "link", url, title?, description? }, { type: "image", url, title?, description? }. Queues a rebuild on success.
  • src/components/site-channel-picker.tsx — opt-in enableCreate prop that adds a + New channel inline composer with title + visibility selector.
  • src/app/site/new/page.tsx — turns on `enableCreate` for the new-site flow.
  • src/components/site-content-editor.tsxAdd block composer above the block list with type tabs (Text / Link / Image), title/description fields, and inline error feedback. On success the composer clears and the list refreshes.

Scope of v1

  • Image blocks: URL-based only. Are.na fetches the URL server-side and creates the Image block. Direct file uploads (browser → blob → Are.na) are explicitly out of scope for v1 — flagged in docs/features.md open questions.
  • Authorization is the same model as PR 1: site ownership is checked locally; Are.na enforces channel/block permissions and we surface its errors verbatim.

Test plan

  • On /site/new click + New channel, fill title + visibility, submit → channel exists on Are.na, picker proceeds to template selection with it pre-selected.
  • On a site's Content tab, open Add block, add a Text block → block appears on Are.na, list refreshes, rebuild runs.
  • Add a Link block with a URL → Are.na resolves the link, rebuild reflects it.
  • Add an Image block with an image URL → Are.na creates an Image block (not a Link) and the image renders in the rebuilt site.
  • Try to create a block in a channel you don't have write access to → error surfaces inline from Are.na.

Open follow-ups (not in this PR)

  • Direct file upload for images (browser → blob → Are.na).
  • Drafts that live in tiny.garden before being pushed to Are.na (would be the first time we store user content; called out as an open question in the feature doc).
  • Block reordering inside a channel.

Made with Cursor

Builds on the inline block editor to make tiny.garden a full read/edit/create
surface for Are.na, not just a viewer. Users can:

- Create a new Are.na channel from inside the New Site flow, without leaving
  the app.
- Create new Text / Link / Image-from-URL blocks in their channel from the
  Content tab on /sites/[id], with the result pushed to Are.na and a rebuild
  queued.

Changes
- src/lib/arena.ts: ArenaClient.createChannel, createTextBlock,
  createLinkBlock, createImageBlockFromUrl + a shared write() helper that
  reuses the rate-limit retry pattern.
- src/app/api/channels/route.ts: POST handler alongside the existing GET
  (channel listing), forwarding to Are.na with title + status validation.
- src/app/api/sites/[id]/blocks/route.ts: POST handler creates a block in
  the site's channel (text/link/image) and queues a rebuild via after().
- src/components/site-channel-picker.tsx: opt-in "+ New channel" inline form
  with public/closed/private visibility selector (enableCreate prop).
- src/app/site/new/page.tsx: enables the create button on the channel picker.
- src/components/site-content-editor.tsx: "Add block" composer above the
  list with type tabs (text/link/image), inline error feedback, and refresh
  after success.

v1 scope: image blocks accept a URL (Are.na fetches it server-side); direct
file uploads are not in this PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tiny-garden Ready Ready Preview, Comment May 11, 2026 8:25pm

Request Review

@gndclouds
Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant