Inline block editor with Are.na sync (feature 1/3)#6
Draft
gndclouds wants to merge 1 commit into
Draft
Conversation
Adds a new "Content" tab on /sites/[id] that lists every block in the site's
Are.na channel and lets the owner edit title, description, and Text-block
content directly. Edits round-trip to Are.na via PUT /v3/blocks/{id} using the
user's OAuth token, then queue a background rebuild so the static site
reflects the change.
- src/lib/arena.ts: ArenaClient.updateBlock + getBlock with rate-limit retry
- src/app/api/sites/[id]/blocks/route.ts: GET editable blocks (live from Are.na)
- src/app/api/sites/[id]/blocks/[blockId]/route.ts: PATCH a single block and
trigger rebuild
- src/components/site-content-editor.tsx: tab UI with per-block draft, save,
discard, and inline error/success states
- src/app/sites/[id]/page.tsx: third "Content" segment in the existing tab
control, renders SiteContentEditor
v1 scope: text-only edits. Image replacement and block reordering are not
covered. Are.na owns authorization on the block; we surface the 401/403 verbatim
when it rejects.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
📝 Changed routes:
Commit 2b70987 (https://tiny-garden-96s48slia-tiny-factories.vercel.app). |
5 tasks
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.
![Screenshot of /sites/[id]](https://images.weserv.nl?url=https://sjc.microlink.io/-rc6HAyphTbS9PncbjRr33gQhgfsO4vpX9ntNnv_Js47CVw4f6TzF42Xzm-YwjAF5ZmAPCp0J1L8TIyRYfAd1A.png&w=600)
Summary
Adds a third Content tab on
/sites/[id]that lets a site owner edit every Are.na block in their channel — title, description, and Text-block content — directly from the dashboard. Edits round-trip to Are.na viaPUT /v3/blocks/{id}using the user's OAuth token, then queue a background rebuild so the static site reflects the change.This is feature 1 of 3 from
docs/features.md.What changed
src/lib/arena.ts—ArenaClient.updateBlock(blockId, patch)andgetBlock(blockId), both with the same rate-limit-aware retry as the rest of the client.src/app/api/sites/[id]/blocks/route.ts—GET: returns editable blocks for a site, sourced live from Are.na so the editor never shows stale build-cache state.src/app/api/sites/[id]/blocks/[blockId]/route.ts—PATCH: forwardstitle/description/contentto Are.na, returns the canonical row, and queues a rebuild viaafter(() => buildSite(id))(skippable with{ rebuild: false }).src/components/site-content-editor.tsx— client component: per-block draft state, save / discard buttons, inline error + "Saved · rebuild queued" feedback, refresh button.src/app/sites/[id]/page.tsx— adds the Content segment to the existing tab control.Scope of v1
titlefor all blocks;descriptionfor Image / Link / Media / Attachment;contentfor Text. Are.na'sPUT /blocks/:iddoes not support image replacement or block reordering, so neither does this PR.Test plan
Open follow-ups (not in this PR)
Made with Cursor