Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use same components between proposal builder and sablier stream proposal builder #2646

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

mudrila
Copy link
Contributor

@mudrila mudrila commented Dec 20, 2024

Changes

This PR eliminates "Stream Sablier Builder" set of custom components and leverages existing ProposalBuilder in order to streamline and standardize UI / UX.
Since "Stream Sablier Builder" was initially build as "copy-paste" adaptation of ProposalBuilder eventually UX diverged over time.

Addressed issues

After merging #2647 into this PR - it will also solve following issues / requests:

Testing

  1. Navigate to proposal creation form
  2. In 2nd browser window - navigate to Sablier proposal creation form (there's no UX path, so you need to manually hit proper path: /proposals/new/sablier/metadata)
  3. Verify that UI / UX identical for replicated elements (proposal metadata form, UI controls like cancelling proposal creation, page title / breadcrumbs, proposal streams form)
  1. Navigate to DAO's Proposal Templates page (from the Dashboard: "Create Proposal" -> "Browse Templates")
  2. Verify that new section with "Pre-configured Templates" available for any DAO on any chain. It should have 3 templates: "Transfer", "Airdrop Tokens", "Create Sablier Stream"
  3. Verify that "Transfer" template correctly opens "Send Assets Modal", filling and submitting form should navigate to "Create Proposal With Actions" form, where "Send Assets" action will be added in the actions list
  4. Verify that "Airdrop Tokens" template correctly opens respective modal, filling and submitting form should navigate to "Create Proposal With Actions" form, where "Airdrop" action will be added in the actions list
  5. Verify that "Create Sablier Stream" navigates to "Create Sablier Proposal" form

@mudrila mudrila added bug Something isn't working enhancement New feature or request labels Dec 20, 2024
@mudrila mudrila self-assigned this Dec 20, 2024
Copy link

netlify bot commented Dec 20, 2024

Deploy Preview for decent-interface-dev ready!

Name Link
🔨 Latest commit afdb67d
🔍 Latest deploy log https://app.netlify.com/sites/decent-interface-dev/deploys/677cf4534922e50008f11ed6
😎 Deploy Preview https://deploy-preview-2646.app.dev.decentdao.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@adamgall adamgall left a comment

Choose a reason for hiding this comment

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

Thanks for the additional context @mudrila!

The UI on /proposals/new/sablier/metadata doesn't look identical to /proposals/new/metadata, there are a handful of differences. Maybe some or all of these are expected?

difference /proposals/new/metadata /proposal/new/sablier/metadata
Page title "Create Proposal" "Create Proposal Template"
Title subtext "A short title for this proposal" "A short title for this proposal template"
Description subtext "Add a brief description, markdown supported" "Markdown syntax supported"
Preview card/section Includes general proposal information Includes Sablier-specific information

Nitpick on Naming

Not a change that was introduced in this PR, but I think calling the Sablier page "Create Proposal Template" isn't correct.

We're not creating a template here, we're using an existing template to create a proposal.

So maybe rename the new Sablier proposal workflow/page just "Create Proposal.

This would change the full breadcrumb from:

  • "Your DAO / Proposal Templates / Create Proposal Template", to
  • "Your DAO / Proposal Templates / Create Proposal"

which IMO is in line with the breadcrumb and page title for the original Create Proposal flow (at /proposals/new/metadata): "Your DAO / All Proposals / Create Proposal".

Comment on lines 63 to 65
export type ProposalTemplate = {
transactions: CreateProposalTransaction[];
} & CreateProposalMetadata;
Copy link
Contributor

Choose a reason for hiding this comment

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

probably too much to ask here. But would love If we didn't need that union type in the form for Sablier

Copy link
Member

@adamgall adamgall Jan 7, 2025

Choose a reason for hiding this comment

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

FWIW this isn't a union type, it's an intersection type
https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I wanted to get a better type safety but that leads to more usually-not-necessary conditional checks and type casting. I don't mind adding that(and actually would love to) though thought it will be better to do that in separate PR - this one is already pretty big 😅
But whatever works for me - just let me know your preference @adamgall @Da-Colon

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry @adamgall I was refering to the union type this is used.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah @mudrila totally can be another PR.

@mudrila
Copy link
Contributor Author

mudrila commented Jan 7, 2025

Thanks for the additional context @mudrila!

The UI on /proposals/new/sablier/metadata doesn't look identical to /proposals/new/metadata, there are a handful of differences. Maybe some or all of these are expected?

difference /proposals/new/metadata /proposal/new/sablier/metadata
Page title "Create Proposal" "Create Proposal Template"
Title subtext "A short title for this proposal" "A short title for this proposal template"
Description subtext "Add a brief description, markdown supported" "Markdown syntax supported"
Preview card/section Includes general proposal information Includes Sablier-specific information

Nitpick on Naming

Not a change that was introduced in this PR, but I think calling the Sablier page "Create Proposal Template" isn't correct.

We're not creating a template here, we're using an existing template to create a proposal.

So maybe rename the new Sablier proposal workflow/page just "Create Proposal.

This would change the full breadcrumb from:

  • "Your DAO / Proposal Templates / Create Proposal Template", to
  • "Your DAO / Proposal Templates / Create Proposal"

which IMO is in line with the breadcrumb and page title for the original Create Proposal flow (at /proposals/new/metadata): "Your DAO / All Proposals / Create Proposal".

Oh dang - that definitely just a lack of proper conditional rendering - it is supposed to reflect page title, title subtext, description subtext from the "Create Proposal" UI. But yeah - the summary and streams creation are supposed to be slightly different (same components - different content). I'll fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants