Create Are.na blocks and channels from tiny.garden (feature 2/3)#7
Draft
gndclouds wants to merge 1 commit into
Draft
Create Are.na blocks and channels from tiny.garden (feature 2/3)#7gndclouds wants to merge 1 commit into
gndclouds wants to merge 1 commit into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
📝 Changed routes:
Commit a48cb57 (https://tiny-garden-m3d2u1lkl-tiny-factories.vercel.app). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Extends tiny.garden from a read+edit surface into a full read/edit/create surface for Are.na. Users can:
/site/new(no need to bounce through Are.na's UI to start a site)./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 iscursor/inline-block-editorso the create-block composer plugs into the editor that PR 1 introduces. Merge order: PR 1 → PR 2.What changed
src/lib/arena.ts—createChannel,createTextBlock,createLinkBlock,createImageBlockFromUrl, plus an internalwrite()helper that reuses the existing rate-limit-aware retry for any write verb.src/app/api/channels/route.ts— addsPOSTalongside the existingGET. Body:{ title, status?: "public" | "closed" | "private" }. Returns the canonical channel as Are.na reports it.src/app/api/sites/[id]/blocks/route.ts— addsPOSTalongside the editor'sGET. 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-inenableCreateprop 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.tsx— Add 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
docs/features.mdopen questions.Test plan
/site/newclick + New channel, fill title + visibility, submit → channel exists on Are.na, picker proceeds to template selection with it pre-selected.Open follow-ups (not in this PR)
Made with Cursor