Skip to content

feat(drafts): drafts list and public shared-draft pages - #108

Open
douglance wants to merge 1 commit into
siwe/draftsfrom
siwe/drafts-pages
Open

feat(drafts): drafts list and public shared-draft pages#108
douglance wants to merge 1 commit into
siwe/draftsfrom
siwe/drafts-pages

Conversation

@douglance

Copy link
Copy Markdown
Contributor

Adds /drafts (own drafts: open in the form, publish, copy share link, delete) and /drafts/shared/[slug] (public read plus the mark-submitted form). Between them these cover the eight draft routes the UI previously never called.

SignInGate

Extracted from ProfileEditor rather than copying its connect-then-sign-in preamble into a second page. Gating at the boundary means both surfaces can assume a session exists instead of each carrying its own early returns, and ProfileEditor loses ~45 lines plus four now-unused session fields. The siwe-sign-in and siwe-error testids move with the markup, so the existing profile spec is unaffected.

Markdown plugin ordering is load-bearing here

The shared view renders draft markdown through getProposalPreviewRehypePlugins(), which orders rehypeRaw before rehypeSanitize. This body is authored by anyone who can create a draft and the page is public and unauthenticated, so sanitizing before raw HTML is expanded would let raw HTML through unsanitized.

Note components/proposal/ProposalDetail.tsx uses the opposite order inline. Out of scope for this PR — it renders on-chain proposal descriptions — but worth a look.

Confirmations

Publish and delete confirm on the row itself rather than in a dialog, so it's never ambiguous which draft is about to change. Both are irreversible.

Verified: lint clean, tsc clean, 1251 unit tests, build emits /drafts static and /drafts/shared/[slug] on demand.

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
tally-zero Ready Ready Preview Aug 27, 2026 6:10pm

Request Review

Adds /drafts (own drafts: open in the form, publish, copy share link,
delete) and /drafts/shared/[slug] (public read plus the mark-submitted
form). Between them these cover the eight draft routes the UI previously
never called.

Extracts SignInGate from ProfileEditor rather than copying its
connect-then-sign-in preamble into a second page. Gating at the boundary
means both surfaces can assume a session exists instead of each carrying
its own early returns, and ProfileEditor loses ~45 lines along with four
now-unused session fields. The siwe-sign-in and siwe-error testids move
with the markup, so the existing profile spec is unaffected.

The shared view renders draft markdown through
getProposalPreviewRehypePlugins(), which orders rehypeRaw before
rehypeSanitize. That ordering is load-bearing here: the body is authored
by anyone who can create a draft and this page is public and
unauthenticated, so sanitizing before raw HTML is expanded would let raw
HTML through unsanitized.

Publish and delete confirm on the row itself rather than in a dialog, so
it is never ambiguous which draft is about to change. Both are
irreversible.

Verified: lint clean, tsc clean, 1251 unit tests, build emits /drafts
static and /drafts/shared/[slug] on demand.
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