Skip to content

feat: add create proposal#1838

Open
brunod-e wants to merge 3 commits intodevfrom
feat/whitelabel-create-proposal
Open

feat: add create proposal#1838
brunod-e wants to merge 3 commits intodevfrom
feat/whitelabel-create-proposal

Conversation

@brunod-e
Copy link
Copy Markdown
Collaborator

No description provided.

@brunod-e brunod-e self-assigned this Apr 24, 2026
@railway-app
Copy link
Copy Markdown

railway-app Bot commented Apr 24, 2026

This PR was not deployed automatically as @brunod-e does not have access to the Railway project.

In order to get automatic PR deploys, please add @brunod-e to your workspace on Railway.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

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

Project Deployment Actions Updated (UTC)
anticapture Ready Ready Preview, Comment Apr 24, 2026 7:36pm
anticapture-storybook Ready Ready Preview, Comment Apr 24, 2026 7:36pm

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f614d9ef8a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

type: z.literal("custom"),
contractAddress: addressOrEnsSchema,
abi: z.array(z.any()),
functionName: z.string().min(1, "Required"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Allow calldata custom actions to satisfy schema validation

The modal’s “Paste Calldata” path submits a custom action with abi: [] and functionName: "", but the schema unconditionally requires functionName to be non-empty. In practice, once validation runs after adding this action, formState.isValid becomes false and publishing is blocked even though the UI explicitly offers calldata mode. The custom-action schema needs a calldata-compatible branch (e.g., functionName optional when calldata is present).

Useful? React with 👍 / 👎.

Comment on lines +63 to +67
encodeFunctionData({
abi: action.abi,
functionName: action.functionName,
args: resolvedArgs,
}),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use provided calldata for custom actions without ABI

Custom actions are always encoded via encodeFunctionData(...), which assumes a valid ABI/function signature and ignores the calldata field entirely. For actions created via the calldata flow (abi: [], empty function name), this path throws during publish and no transaction is sent. Add a branch that uses action.calldata directly (and action.value for ETH value) when calldata mode is used.

Useful? React with 👍 / 👎.

Comment on lines +136 to +138
const visibleTabs = useMemo(() => {
const tabs = [...PROPOSAL_TABS];
if (isConnected) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude Offchain tab when a DAO has no offchain feed

visibleTabs always starts from PROPOSAL_TABS, so connected users see an Offchain tab even for DAOs where hasOffchain is false. In that state, selecting Offchain still renders onchain data because isOnchain is forced true (activeTab === "onchain" || !hasOffchain), producing a misleading tab/content mismatch. Build tabs conditionally from hasOffchain so unavailable tabs are not shown.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d5f2e26a3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +123 to +127
(values.title ? 1 : 0) +
(values.discussionUrl ? 1 : 0) +
(values.body && values.body !== BODY_PLACEHOLDER ? 1 : 0);
const canPublish =
filledCount === 3 &&
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Allow publishing when discussion URL is intentionally empty

discussionUrl is optional in ProposalFormSchema, but canPublish currently requires filledCount === 3 where one of those three fields is discussionUrl. In practice, a user who fills title/body/actions and leaves the discussion URL blank can never enable the Publish button, which blocks valid proposals. This should not gate publish readiness unless discussion URL is actually a required field.

Useful? React with 👍 / 👎.

Comment on lines +132 to +145
const id = drafts.saveDraft(
{
daoId,
title: values.title,
discussionUrl: values.discussionUrl ?? "",
body: values.body,
actions: values.actions,
},
currentDraftId,
);
setCurrentDraftId(id);
form.reset(values, { keepValues: true, keepDirty: false });
showCustomToast("Draft saved", "success");
if (options?.navigateToDrafts !== false) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent false “Draft saved” success when wallet is disconnected

useDrafts.saveDraft returns an empty ID when no address is present (key is null), but handleSaveDraft still shows a success toast, clears dirty state, and may navigate away. If someone opens this page without a connected wallet (or disconnects mid-session), they get a successful save UX while nothing is actually persisted, causing silent data loss.

Useful? React with 👍 / 👎.

Comment on lines +452 to +455
items={functions.map((fn) => ({
label: fn.name,
value: fn.name,
}))}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve overloaded ABI function identity in custom action select

The function picker uses fn.name as both label and value, so overloaded ABI entries collapse to the same option value and cannot be selected distinctly. In overloaded contracts (e.g., multiple functions with the same name), this makes users unable to target the intended signature and can produce mis-encoded calldata or reverted submissions.

Useful? React with 👍 / 👎.

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