Skip to content

feat(contracts): Allow network editing with caution messaging on contract detail page#171

Open
NUMBER72857 wants to merge 1 commit into
Tx-wat:mainfrom
NUMBER72857:feat/87-network-editing-caution
Open

feat(contracts): Allow network editing with caution messaging on contract detail page#171
NUMBER72857 wants to merge 1 commit into
Tx-wat:mainfrom
NUMBER72857:feat/87-network-editing-caution

Conversation

@NUMBER72857
Copy link
Copy Markdown

Summary

Users can now change a contract's network directly from the detail page. A contextual warning dialog explains the impact on duplicate detection and alert history before the change is committed.

Changes

  • components/NetworkEditField.tsx:
    • Inline edit toggle — shows read-only view with Edit button, or select input
    • alertdialog warning with network-specific caution message before save
    • onNetworkChange(network) callback only fires after explicit confirmation
    • disabled prop for use while parent is saving
  • __tests__/NetworkEditField.test.tsx: 8 tests covering all states and interactions

Integration in app/contracts/[id]/page.tsx

import { NetworkEditField } from '@/components/NetworkEditField';

<NetworkEditField
  currentNetwork={contract.network}
  onNetworkChange={async (net) => {
    await updateContract(contract.id, { network: net });
  }}
/>

Closes #87

…wat#87)

- NetworkEditField: inline edit mode with network select; shows alertdialog
  warning before confirming network change
- CAUTION_MESSAGES: per-network explanations of duplicate-detection and alert
  context side-effects
- 'Keep current' dismisses without saving; 'Switch to X' calls onNetworkChange
- disabled prop hides Edit button (e.g. during save operations)
- 8 tests: render, edit mode, warning content, keep-current, confirm, disabled, cancel

Closes Tx-wat#87
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@NUMBER72857 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Allow network editing with caution messaging

2 participants