93 94 95 96 contract detail improvements#157
Open
summer-0ma wants to merge 5 commits into
Open
Conversation
- Extract formatting logic for thresholds and function names into formatRuleSummary() - Use consistent formatting across list and detail views - Simplify rule display in contract detail page and RuleBuilder
- Detect unsaved changes when closing edit modal - Show confirmation dialog before discarding changes - Allow users to keep editing or confirm discard
- Show friendly error message instead of immediate redirect - Provide button to navigate back to contracts list - Improve UX for missing or deleted contracts
- Add comprehensive tests for formatRuleSummary helper - Cover delete flow, rule editing, missing contract behavior - Test metadata rendering and alert history display - Enable vitest globals for test compatibility
|
@summer-0ma 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contract Detail Experience Improvements
This PR implements four focused improvements to the contract detail page and rule management experience, addressing UX, refactoring, and testing concerns.
Changes Implemented
#93: Add rule summary formatting helper
formatRuleSummary()helperlib/format.ts- NewformatRuleSummary()functionapp/contracts/[id]/page.tsx- Updated to use formattercomponents/RuleBuilder.tsx- Updated to use formatter#94: Add cancel warning for unsaved rule edits
hasUnsavedChanges()function compares current edits with saved rulesapp/contracts/[id]/page.tsx#95: Add focused empty state when contract lookup fails
app/contracts/[id]/page.tsx#96: Add contract details page tests
__tests__/ContractDetail.test.tsx- New test suite (7 tests, all passing)vitest.config.ts- Enabled globals for test compatibilityTesting
All changes have been tested:
Files Modified
lib/format.ts- AddedformatRuleSummary()helperapp/contracts/[id]/page.tsx- Implemented all UX improvements and empty statecomponents/RuleBuilder.tsx- Updated to use formatting helper__tests__/ContractDetail.test.tsx- New comprehensive test suitevitest.config.ts- Enabled test globalsCloses
Closes #93
Closes #94
Closes #95
Closes #96