-
Notifications
You must be signed in to change notification settings - Fork 1.7k
integrate user interruptions flow with ignition UI #6763
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: f2caa02 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
c9fae37 to
89c93f8
Compare
ccbb570 to
1be8ca3
Compare
v-next/hardhat-ignition/src/internal/hook-handlers/user-interruptions.ts
Outdated
Show resolved
Hide resolved
v-next/hardhat-ignition/src/internal/hook-handlers/user-interruptions.ts
Outdated
Show resolved
Hide resolved
v-next/hardhat-ignition/src/internal/hook-handlers/user-interruptions.ts
Outdated
Show resolved
Hide resolved
7465849 to
31311ca
Compare
31311ca to
c4b3f9d
Compare
25d6330 to
8fe7584
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates user interruption handling into the Hardhat Ignition UI by introducing custom hooks that manage terminal display updates during user interruptions. The key changes include:
- Refactoring
PrettyEventHandlerto consolidate display updates through a centralized_writeToDisplaymethod that respects user interruptions - Creating user interruption handlers that save/restore cursor position and clear output to prevent UI corruption during prompts
- Removing the obsolete
VerboseEventHandlerclass - Updating the
calculateDeploymentCompleteDisplayfunction signature to accept the result directly from UI state rather than from an event
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| v-next/hardhat-ignition/test/ui/helpers/calculate-deployment-complete-display.ts | Updated tests to pass result directly instead of wrapping it in a DeploymentCompleteEvent |
| v-next/hardhat-ignition/src/internal/ui/verbose-event-handler.ts | Removed entire VerboseEventHandler class (309 lines) |
| v-next/hardhat-ignition/src/internal/ui/helpers/calculate-deployment-complete-display.ts | Changed function signature to accept result from uiState instead of event |
| v-next/hardhat-ignition/src/internal/tasks/deploy.ts | Added registration/unregistration of user interruption handlers with try/finally |
| v-next/hardhat-ignition/src/internal/hook-handlers/user-interruptions.ts | New file implementing cursor save/restore logic for handling user interruptions |
| v-next/hardhat-ignition/src/helpers/pretty-event-handler.ts | Refactored to use centralized display writing with user interruption support and replaced readline with ANSI escape codes |
| v-next/hardhat-ignition/src/helpers.ts | Exported getUserInterruptionsHandlers function |
| v-next/hardhat-ignition-viem/src/internal/viem-ignition-helper.ts | Added hooks parameter and user interruption handler registration |
| v-next/hardhat-ignition-viem/src/internal/hook-handlers/network.ts | Passed hooks to helper constructor |
| v-next/hardhat-ignition-ethers/src/internal/hook-handlers/network.ts | Passed hooks to helper constructor |
| v-next/hardhat-ignition-ethers/src/internal/ethers-ignition-helper.ts | Added hooks parameter and user interruption handler registration |
| .changeset/green-toys-fix.md | Added changeset documenting the feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
resolves #6682