Skip to content

feat(APP-97): Add lock and wrap onboarding dialogs#1019

Open
milosh86 wants to merge 21 commits intomainfrom
app-97-lock-and-wrap-onboarding-dialogs
Open

feat(APP-97): Add lock and wrap onboarding dialogs#1019
milosh86 wants to merge 21 commits intomainfrom
app-97-lock-and-wrap-onboarding-dialogs

Conversation

@milosh86
Copy link
Contributor

@milosh86 milosh86 commented Mar 10, 2026

Description

Implements the onboarding dialog flow for the GaugeVoter, TokenVoting and LockToVote plugin's lock or wrap functionality.

Test cases:

  • Token voting with standard governance token (Only delegation intro should be shown) ✅
  • Token voting with non-gov token (Wrap intro, then delegation intro) ✅
  • Token voting with VE IEscrowIVotesAdapter token (Gauges lock intro, then delegation intro) ✅
  • Standard GaugeVoter plugin (Gauges lock intro, then delegation intro) ✅
  • Lock to vote (token lock intro, then delegation intro) ✅

Type of Change

  • Major: Breaking change (change that would cause existing functionality to not work as expected)
  • Minor: Feature (non-breaking change which adds new functionality)
  • Patch: Enhancement (non-breaking change to an existing feature)
  • Patch: Bug fix (non-breaking change which fixes an issue)

Developer Checklist:

  • Manually smoke tested the functionality in a preview or locally
  • Confirmed there are no new warnings or errors in the browser console
  • (For User Stories only) Double-checked that all Acceptance Criteria are satisfied
  • Confirmed there are no new warnings on automated tests
  • Merged and published any dependent changes in downstream modules
  • Selected the correct base branch
  • Commented the code in hard-to-understand areas
  • Followed the code style guidelines of this project
  • Reviewed that the Files Changed in Github's UI reflect my intended changes
  • Confirmed the pipeline checks are not failing

Review Checklist:

  • (For User Stories only) Tested in a preview or locally that all Acceptance Criteria are satisfied
  • Confirmed that changes follow the code style guidelines of this project

milosh86 added 8 commits March 9, 2026 11:45
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
@milosh86 milosh86 self-assigned this Mar 10, 2026
@linear
Copy link

linear bot commented Mar 10, 2026

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

🚀 Preview Deployment: View Here

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

E2E Smoke Results

Base URL https://app-next-mua22ka6h-aragon-app.vercel.app
Suite smoke
Result ✅ passed
Run #3827

Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
evanaronson and others added 2 commits March 11, 2026 09:38
* fix: Update XMAQUINA DAO header link

Signed-off-by: Evan Aronson <93671071+evanaronson@users.noreply.github.com>

* Update DAO header link for XMAQUINA

Update the header link for the XMAQUINA DAO.

Signed-off-by: Evan Aronson <93671071+evanaronson@users.noreply.github.com>

---------

Signed-off-by: Evan Aronson <93671071+evanaronson@users.noreply.github.com>
…lugins (#1020)

Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
@milosh86 milosh86 marked this pull request as ready for review March 11, 2026 16:41
@milosh86 milosh86 requested a review from a team as a code owner March 11, 2026 16:41
Copilot AI review requested due to automatic review settings March 11, 2026 16:41
@milosh86 milosh86 changed the title feat(APP-97): Add GaugeVoter lock and wrap onboarding dialogs feat(APP-97): Add lock and wrap onboarding dialogs Mar 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements an onboarding dialog flow for lock/wrap scenarios across Token Voting (wrap), Gauge Voter (lock), and Lock-to-Vote (lock), triggered on user-initiated wallet connections.

Changes:

  • Added a useWalletConnectionEvent hook and updated onboarding watchers to trigger flows on explicit wallet connects.
  • Introduced new onboarding dialogs (intro/info/form) for GaugeVoter, Token wrap, and LockToVote.
  • Added onchain “should trigger onboarding” checks (via useReadContracts) plus supporting translations and tests.

Reviewed changes

Copilot reviewed 49 out of 49 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/shared/hooks/useWalletConnectionEvent/useWalletConnectionEvent.ts New hook to detect non-auto-reconnect wallet connection events.
src/shared/hooks/useWalletConnectionEvent/index.ts Barrel export for the new hook.
src/plugins/tokenPlugin/utils/tokenPluginUtils/tokenPluginUtils.ts Adds getUnderlyingToken helper for wrapper token UX.
src/plugins/tokenPlugin/utils/tokenPluginUtils/tokenPluginUtils.test.ts Unit tests for getUnderlyingToken.
src/plugins/tokenPlugin/hooks/useTokenLockAndWrapOnboardingCheck/useTokenLockAndWrapOnboardingCheck.ts New hook to decide whether wrap/lock onboarding should trigger (votes vs underlying balance).
src/plugins/tokenPlugin/hooks/useTokenLockAndWrapOnboardingCheck/useTokenLockAndWrapOnboardingCheck.test.ts Tests for the new onboarding check hook.
src/plugins/tokenPlugin/hooks/useTokenLockAndWrapOnboardingCheck/useTokenLockAndWrapOnboardingCheck.api.ts API types for the new hook.
src/plugins/tokenPlugin/hooks/useTokenLockAndWrapOnboardingCheck/index.ts Barrel export for the new hook.
src/plugins/tokenPlugin/hooks/useOpenDelegationOnboardingIfNeeded/useOpenDelegationOnboardingIfNeeded.ts Clarifies token address docs (governance vs underlying).
src/plugins/tokenPlugin/dialogs/tokenWrapOnboardingIntroDialog/tokenWrapOnboardingIntroDialog.tsx New wrap onboarding intro dialog.
src/plugins/tokenPlugin/dialogs/tokenWrapOnboardingIntroDialog/index.ts Dynamic export for the new dialog.
src/plugins/tokenPlugin/dialogs/tokenWrapOnboardingFormDialog/tokenWrapOnboardingFormDialog.tsx New wrap onboarding form dialog wrapper around TokenWrapForm.
src/plugins/tokenPlugin/dialogs/tokenWrapOnboardingFormDialog/tokenWrapOnboardingFormDialog.api.ts Dialog params typing.
src/plugins/tokenPlugin/dialogs/tokenWrapOnboardingFormDialog/index.ts Dynamic export + type export.
src/plugins/tokenPlugin/constants/tokenPluginDialogsDefinitions.ts Registers new token wrap onboarding dialogs.
src/plugins/tokenPlugin/constants/tokenPluginDialogId.ts Adds dialog IDs for wrap onboarding intro/form.
src/plugins/tokenPlugin/components/tokenMemberPanel/tokenWrap/tokenWrapForm.tsx Adds dialog mode rendering (CTA/cancel layout) for wrap form.
src/plugins/tokenPlugin/components/tokenMemberPanel/tokenMemberPanel.tsx Reuses getUnderlyingToken instead of inline symbol/name munging.
src/plugins/tokenPlugin/components/tokenLockAndWrapOnboardingWatcher/tokenLockAndWrapOnboardingWatcher.tsx New watcher to open GaugeVoter lock onboarding or token wrap onboarding post-connect.
src/plugins/tokenPlugin/components/tokenLockAndWrapOnboardingWatcher/index.ts Barrel export for new watcher.
src/plugins/tokenPlugin/components/tokenDelegationOnboardingWatcher/tokenDelegationOnboardingWatcher.tsx Refactors connect-intent logic to use useWalletConnectionEvent.
src/plugins/lockToVotePlugin/hooks/useLockToVoteLockOnboardingCheck/useLockToVoteLockOnboardingCheck.ts New hook to decide whether lock-to-vote onboarding should trigger (locked balance vs token balance).
src/plugins/lockToVotePlugin/hooks/useLockToVoteLockOnboardingCheck/useLockToVoteLockOnboardingCheck.test.ts Tests for the new lock-to-vote onboarding check hook.
src/plugins/lockToVotePlugin/hooks/useLockToVoteLockOnboardingCheck/useLockToVoteLockOnboardingCheck.api.ts API types for the new hook.
src/plugins/lockToVotePlugin/hooks/useLockToVoteLockOnboardingCheck/index.ts Barrel export for the new hook.
src/plugins/lockToVotePlugin/dialogs/lockToVoteLockOnboardingIntroDialog/lockToVoteLockOnboardingIntroDialog.tsx New lock-to-vote onboarding intro dialog.
src/plugins/lockToVotePlugin/dialogs/lockToVoteLockOnboardingIntroDialog/index.ts Dynamic export for the new dialog.
src/plugins/lockToVotePlugin/dialogs/lockToVoteLockOnboardingFormDialog/lockToVoteLockOnboardingFormDialog.tsx New lock-to-vote onboarding form dialog wrapper around LockToVoteLockForm.
src/plugins/lockToVotePlugin/dialogs/lockToVoteLockOnboardingFormDialog/lockToVoteLockOnboardingFormDialog.api.ts Dialog params typing.
src/plugins/lockToVotePlugin/dialogs/lockToVoteLockOnboardingFormDialog/index.ts Dynamic export + type export.
src/plugins/lockToVotePlugin/constants/lockToVotePluginDialogsDefinitions.ts Registers new lock-to-vote onboarding dialogs.
src/plugins/lockToVotePlugin/constants/lockToVotePluginDialogId.ts Adds dialog IDs for lock-to-vote onboarding intro/form.
src/plugins/lockToVotePlugin/components/lockToVoteMemberPanel/lockToVoteLockForm/lockToVoteLockForm.tsx Adds dialog mode rendering (CTA/cancel layout) for lock form.
src/plugins/lockToVotePlugin/components/lockToVoteLockOnboardingWatcher/lockToVoteLockOnboardingWatcher.tsx New watcher to trigger lock-to-vote onboarding post-connect.
src/plugins/lockToVotePlugin/components/lockToVoteLockOnboardingWatcher/index.ts Barrel export for new watcher.
src/plugins/gaugeVoterPlugin/dialogs/gaugeVoterLockOnboardingLockTimeInfoDialog/index.ts Dynamic export for lock-time info step.
src/plugins/gaugeVoterPlugin/dialogs/gaugeVoterLockOnboardingLockTimeInfoDialog/gaugeVoterLockOnboardingLockTimeInfoDialog.tsx New lock-time info dialog step in GaugeVoter onboarding flow.
src/plugins/gaugeVoterPlugin/dialogs/gaugeVoterLockOnboardingIntroDialog/index.ts Dynamic export for GaugeVoter onboarding intro.
src/plugins/gaugeVoterPlugin/dialogs/gaugeVoterLockOnboardingIntroDialog/gaugeVoterLockOnboardingIntroDialog.tsx New GaugeVoter onboarding intro dialog.
src/plugins/gaugeVoterPlugin/dialogs/gaugeVoterLockOnboardingFormDialog/index.ts Dynamic export + type export for onboarding form.
src/plugins/gaugeVoterPlugin/dialogs/gaugeVoterLockOnboardingFormDialog/gaugeVoterLockOnboardingFormDialog.tsx New GaugeVoter onboarding form dialog wrapper around GaugeVoterLockForm.
src/plugins/gaugeVoterPlugin/dialogs/gaugeVoterLockOnboardingFormDialog/gaugeVoterLockOnboardingFormDialog.api.ts Dialog params typing.
src/plugins/gaugeVoterPlugin/constants/gaugeVoterPluginDialogsDefinitions.ts Registers new GaugeVoter onboarding dialogs.
src/plugins/gaugeVoterPlugin/constants/gaugeVoterPluginDialogId.ts Adds dialog IDs for GaugeVoter onboarding flow.
src/plugins/gaugeVoterPlugin/components/gaugeVoterLockForm/gaugeVoterLockForm.tsx Adds dialog mode rendering (CTA/cancel layout) for lock form.
src/modules/application/components/layouts/layoutDao/layoutDao.tsx Mounts new onboarding watchers at the DAO layout level.
src/modules/application/components/layouts/layoutDao/layoutDao.test.tsx Mocks new watchers in layout tests.
src/assets/locales/en.json Adds new translations for onboarding dialogs and cancel labels.
.changeset/app-97-lock-and-wrap-onboarding-dialogs.md Changeset for releasing the feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 64 to +68
if (
status !== 'connected' ||
hasFiredRef.current ||
!hasConnectIntentRef.current
!hasPendingConnection ||
!shouldTrigger ||
tokenAddress == null ||
tokenSymbol == null
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

hasPendingConnection is only cleared when the dialog is opened. If the user connects but shouldTrigger is false, the flag stays true and onboarding can open later without a new connection (e.g. after a refetch flips shouldTrigger). Consider consuming/clearing the pending-connection state once the onboarding check has finished (use isLoading from useTokenDelegationOnboardingCheck and clear when !isLoading, regardless of shouldTrigger).

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +69
useEffect(() => {
if (eligiblePlugin == null || !hasPendingConnection || !shouldTrigger) {
return;
}
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

hasPendingConnection is only reset when shouldTrigger is true. If the user connects and the check resolves to shouldTrigger=false, the pending flag remains set and the onboarding may open later without a fresh connection. Consider clearing/consuming the pending connection once useTokenLockAndWrapOnboardingCheck is done loading (use the hook’s isLoading and clear when !isLoading).

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +56
useEffect(() => {
if (
lockToVotePlugin == null ||
!hasPendingConnection ||
!shouldTrigger
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

hasPendingConnection is only cleared when shouldTrigger is true, so a connect that evaluates to shouldTrigger=false can later trigger onboarding without a new connect (e.g. after refetch). Consider consuming/resetting the pending state once useLockToVoteLockOnboardingCheck has finished loading (use its isLoading).

Copilot uses AI. Check for mistakes.
iconRight={mode === 'dialog' ? IconType.CHEVRON_RIGHT : undefined}
onClick={effectiveIsConnected ? undefined : () => walletGuard()}
size={size}
type={effectiveIsConnected ? 'submit' : undefined}
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The submit button created by renderSubmitButton no longer sets variant="primary", while the previous inline submit button did. If Button's default variant isn’t primary, this is a UI regression; consider explicitly setting the variant to preserve existing styling.

Suggested change
type={effectiveIsConnected ? 'submit' : undefined}
type={effectiveIsConnected ? 'submit' : undefined}
variant="primary"

Copilot uses AI. Check for mistakes.
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.

3 participants