fix(kits): add missing delete button to single kit edit modal#106
fix(kits): add missing delete button to single kit edit modal#106
Conversation
The single kit's monolithic template was missing a delete button in the edit modal, unlike the multi kit which had Update | Delete | Cancel. Add the delete button and a parity test to prevent future drift. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pull Request Review - PR #106SummaryThis PR adds a missing delete button to the single kit's edit modal and introduces a feature parity test to prevent future drift between kit templates. The change addresses issue #56 and ensures consistency across kits. ✅ Strengths1. Excellent Problem Identification
2. Strong Test Coverage
3. Clean Implementation
4. Good Documentation
💡 Observations & Suggestions1. Test Pattern Consistency (Minor) path := fmt.Sprintf("system/%s/templates/resource/template.tmpl.tmpl", kit)2. Limited Scope (Question, not blocker) 3. Test Robustness (Enhancement idea)
This is probably fine for the current use case, but a more robust approach might check for larger context strings. Not required for this PR, but worth considering for future iterations. 4. Feature Matrix Documentation (From issue #56) 🔒 Security & PerformanceNo security concerns identified:
Performance:
📋 Code QualityStrengths:
Minor style notes:
✅ Final RecommendationAPPROVE with minor suggestions This is a solid PR that:
The implementation is clean and the test strategy is sound. The suggestions above are minor enhancements, not blockers. Suggested follow-up work (not required for this PR):
Great work on catching this inconsistency and adding preventive measures! 🎉 Review generated by Claude Code |
There was a problem hiding this comment.
Pull request overview
Adds missing delete action to the single kit resource edit modal and introduces a guardrail test to prevent CRUD UI feature drift between kits.
Changes:
- Add a Delete button to the single kit edit modal (to match the multi kit’s Update | Delete | Cancel pattern).
- Add
TestKitFeatureParityto ensure key CRUD UI hooks are present in both multi and single monolithic resource templates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
internal/kits/system/single/templates/resource/template.tmpl.tmpl |
Adds the missing edit-modal delete button in the single kit template. |
internal/kits/kits_parity_test.go |
Adds a required-features template smoke test intended to prevent kit UI regressions. |
| name string | ||
| pattern string | ||
| }{ | ||
| {"delete button in edit modal", `lvt-click="delete"`}, |
There was a problem hiding this comment.
The test case labeled "delete button in edit modal" only checks for lvt-click="delete", which already exists in the table delete button. This means the test would still pass even if the edit modal delete button were missing (the regression this PR is trying to catch). Use a more specific pattern that uniquely identifies the edit modal delete button (e.g., lvt-data-id="{{.EditingID}}" and/or the lvt-confirm="Are you sure you want to delete this text).
| {"delete button in edit modal", `lvt-click="delete"`}, | |
| {"delete button in edit modal", `lvt-data-id="{{.EditingID}}"`}, |
| // TestKitFeatureParity verifies that multi and single kit monolithic templates | ||
| // contain the same critical UI features. This catches regressions where a kit | ||
| // template drifts from the expected feature set. |
There was a problem hiding this comment.
The doc comment says this test verifies the kits "contain the same" features / "feature parity", but the implementation only checks that a fixed set of required patterns exist in each template; it does not compare the templates to each other or detect extra/missing features beyond the required set. Consider updating the comment (or the test name) to reflect that this is a required-features smoke test, or extend the test to actually assert parity.
| // TestKitFeatureParity verifies that multi and single kit monolithic templates | |
| // contain the same critical UI features. This catches regressions where a kit | |
| // template drifts from the expected feature set. | |
| // TestKitFeatureParity is a smoke test that ensures the multi and single kit | |
| // monolithic templates all include a shared set of critical UI features. This | |
| // catches regressions where a kit template loses a required feature. |
| templatePath := "system/%s/templates/resource/template.tmpl.tmpl" | ||
|
|
||
| kits := []string{"multi", "single"} | ||
|
|
||
| // Features that both CRUD kits must have in their monolithic template. |
There was a problem hiding this comment.
The PR description indicates this change "Closes #56", but #56's acceptance criteria/tasks also call for auditing all three kits (including simple) and adding a kit feature matrix README. This PR currently only updates single-kit template behavior and adds a multi/single required-features test. Either adjust the PR description/linked issue status, or expand coverage to include the remaining kit(s)/documentation if you intend to close the full issue.
- Use edit-modal-specific pattern (lvt-data-id="{{.EditingID}}") instead
of generic lvt-click="delete" that also matches table delete button
- Clarify test doc comment: this is a required-features smoke test
- Use fmt.Sprintf instead of strings.Replace for path formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Review: Fix Missing Delete Button in Single Kit Edit ModalSummaryThis PR adds a missing delete button to the single kit's monolithic template edit modal and introduces a parity test to prevent future drift between multi and single kit templates. The changes address issue #56. ✅ Code Quality & Best PracticesStrengths:
Minor suggestions:
🐛 Potential IssuesNo major issues found. The implementation is solid. Minor observations:
⚡ Performance ConsiderationsNo performance concerns. The test:
🔒 Security ConcernsNo security issues identified. The changes:
The 🧪 Test CoverageExcellent test coverage: ✅ New parity test (
✅ Test runs for both ✅ PR description indicates full test suite passes (28 packages, 0 failures) Recommendations:
📝 Additional ObservationsCommit messages: Follow conventional commit format nicely ( Pattern matching specificity: The evolution from first to second commit shows good iteration:
Code consistency: The added delete button at ✨ Overall AssessmentRecommendation: ✅ APPROVE This is a well-executed bug fix with appropriate test coverage. The parity test is a valuable addition that will prevent similar issues in the future. The code follows project conventions, commit messages are clear, and the implementation is consistent with existing patterns. Before merging:
Nice work! The iterative improvements based on feedback (commit 2) demonstrate good attention to detail. |
Summary
template.tmpl.tmpledit modal, matching the multi kit'sUpdate | Delete | Cancelpatternkits_parity_test.go) that verifies both multi and single kit templates contain all critical CRUD UI featuresPartially addresses #56
Test plan
go test ./internal/kits/ -run TestKitFeatureParity— parity test passes for both kitsgo test ./...— full suite passes (28 packages, 0 failures)🤖 Generated with Claude Code