feat(wikibase-schema-editor): integrate schema deletion#117
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis change integrates schema deletion functionality into the schema selection workflow. It updates the SchemaSelector component to support deleting schemas with confirmation and feedback, adjusts UI layout, and refactors schema loading logic. Related documentation and type declarations are updated accordingly, while unused imports are removed from the editor component. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SchemaSelector
participant ConfirmDialog
participant SchemaAPI
participant Notification
User->>SchemaSelector: Clicks delete on a schema
SchemaSelector->>ConfirmDialog: Show confirmation dialog
ConfirmDialog-->>User: User confirms deletion
ConfirmDialog->>SchemaSelector: Confirmed
SchemaSelector->>SchemaAPI: deleteSchema(projectId, schemaId)
SchemaAPI-->>SchemaSelector: Deletion result
SchemaSelector->>Notification: Show success message
SchemaSelector->>SchemaAPI: loadSchemas()
SchemaAPI-->>SchemaSelector: Updated schema list
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related PRs
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.kiro/specs/wikibase-schema-editor/tasks.md(1 hunks)frontend/components.d.ts(1 hunks)frontend/src/features/wikibase-schema/components/SchemaSelector.vue(3 hunks)frontend/src/features/wikibase-schema/components/WikibaseSchemaEditor.vue(0 hunks)
💤 Files with no reviewable changes (1)
- frontend/src/features/wikibase-schema/components/WikibaseSchemaEditor.vue
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
**/*.{ts,tsx,js,jsx}: Usebun <file>instead ofnode <file>orts-node <file>for running TypeScript or JavaScript files
Do not use dotenv; Bun automatically loads .env files
UseBun.serve()for HTTP servers and WebSockets instead ofexpress
Usebun:sqlitefor SQLite instead ofbetter-sqlite3
UseBun.redisfor Redis instead ofioredis
UseBun.sqlfor Postgres instead ofpgorpostgres.js
Use built-inWebSocketinstead ofws
PreferBun.fileovernode:fs's readFile/writeFile
UseBun.$(e.g.,Bun.$ls``) instead of execa for running shell commands
Files:
frontend/components.d.ts
**/*.{html,ts,tsx,css}
📄 CodeRabbit Inference Engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Use
bun build <file.html|file.ts|file.css>instead ofwebpackoresbuildfor building HTML, TypeScript, or CSS files
Files:
frontend/components.d.ts
🧠 Learnings (11)
📚 Learning: applies to src/**/*.vue : use primevue as the ui library in all vue components...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.vue : Use PrimeVue as the UI library in all Vue components
Applied to files:
frontend/components.d.ts
📚 Learning: applies to src/**/*.vue : use vue 3 with composition api and <script setup lang="ts"> in all vue com...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.vue : Use Vue 3 with Composition API and <script setup lang="ts"> in all Vue components
Applied to files:
frontend/components.d.tsfrontend/src/features/wikibase-schema/components/SchemaSelector.vue
📚 Learning: applies to src/**/*.vue : props and emits must use explicit typescript interfaces...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.vue : Props and emits must use explicit TypeScript interfaces
Applied to files:
frontend/components.d.ts
📚 Learning: applies to src/**/*.{ts,vue} : type safety everywhere...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.{ts,vue} : Type safety everywhere
Applied to files:
frontend/components.d.ts
📚 Learning: applies to src/**/*.vue : use auto-imports for vue, pinia, composables, and utilities...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.vue : Use auto-imports for Vue, Pinia, composables, and utilities
Applied to files:
frontend/components.d.ts
📚 Learning: applies to src/**/*.vue : prefer composables over methods in vue components...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.vue : Prefer composables over methods in Vue components
Applied to files:
frontend/src/features/wikibase-schema/components/SchemaSelector.vue
📚 Learning: applies to src/**/*.{vue,ts} : use useapi composable (elysia eden) for all api calls...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.{vue,ts} : Use useApi composable (Elysia Eden) for all API calls
Applied to files:
frontend/src/features/wikibase-schema/components/SchemaSelector.vue
📚 Learning: applies to src/**/*.vue : use v-memo, shallowref, markraw, and suspense for performance optimization...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.vue : Use v-memo, shallowRef, markRaw, and Suspense for performance optimization
Applied to files:
frontend/src/features/wikibase-schema/components/SchemaSelector.vue
📚 Learning: applies to src/**/*.vue : build reusable, well-structured components...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.vue : Build reusable, well-structured components
Applied to files:
frontend/src/features/wikibase-schema/components/SchemaSelector.vue
📚 Learning: applies to src/composables/**/*.ts : use composables for logic that is not global state...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/composables/**/*.ts : Use composables for logic that is not global state
Applied to files:
frontend/src/features/wikibase-schema/components/SchemaSelector.vue
📚 Learning: applies to src/**/*.{vue,ts} : handle errors and loading states reactively when making api calls...
Learnt from: CR
PR: DaxServer/dataforge#0
File: .cursor/rules/frontend-setup.rule.md:0-0
Timestamp: 2025-07-20T14:13:24.706Z
Learning: Applies to src/**/*.{vue,ts} : Handle errors and loading states reactively when making API calls
Applied to files:
frontend/src/features/wikibase-schema/components/SchemaSelector.vue
🪛 GitHub Actions: Typecheck code
frontend/src/features/wikibase-schema/components/SchemaSelector.vue
[error] 13-13: TypeScript error TS6133: 'showError' is declared but its value is never read.
🔇 Additional comments (6)
frontend/components.d.ts (1)
23-23: LGTM!The Dialog component declaration correctly supports the new confirmation dialog functionality used in the schema deletion flow.
frontend/src/features/wikibase-schema/components/SchemaSelector.vue (4)
71-95: Excellent implementation of schema deletion with user confirmation.The function properly:
- Prevents event bubbling to avoid unintended schema selection
- Uses clear, descriptive confirmation messaging
- Follows the established composables pattern
- Provides user feedback on successful deletion
- Refreshes the schema list after deletion
This implementation aligns well with the retrieved learnings about using composables and proper error handling.
97-109: Good refactoring of schema loading logic.Extracting the schema loading into a dedicated function improves code reusability and follows the DRY principle. The proper loading state management and cleanup ensures a consistent user experience.
116-125: Improved header layout with better action button placement.Moving the "Create New Schema" button to the header provides better visibility and accessibility for the primary action. The flex layout implementation is clean and maintains consistent styling.
156-177: Well-implemented delete functionality with proper UI integration.The delete button implementation includes:
- Appropriate danger styling and iconography
- Proper accessibility attributes
- Clean integration with existing card layout
- Correct event handling to prevent unintended schema selection
The visual design maintains good hierarchy while clearly indicating the destructive nature of the delete action.
.kiro/specs/wikibase-schema-editor/tasks.md (1)
191-195: Task documentation accurately reflects the implemented functionality.The updated task description correctly captures the schema deletion integration work, emphasizing the confirmation dialog and success feedback that were implemented in the SchemaSelector component.
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
.kiro/specs/wikibase-schema-editor/requirements.md (1)
119-120: Acceptance criterion for deletion lacks post-action feedback and failure handlingCriterion 7 only mandates a confirmation dialog. It should also cover:
- Success feedback (toast/snackbar, list refresh)
- Error handling when deletion fails (network error, foreign-key constraint, etc.)
- Undo guidance, if supported.
Without these, the implementation may overlook critical edge cases.
🧹 Nitpick comments (3)
.kiro/specs/wikibase-schema-editor/requirements.md (2)
109-110: Clarify scoping of “delete” action in the user storyThe updated user story now bundles three distinct capabilities (select / create / delete). Consider splitting the delete capability into its own requirement or, at minimum, clarifying whether deletion is a soft-delete (logical flag) or a hard-delete (permanent removal from storage). This impacts API, auditing, and potential undo flows.
114-115: Add safeguards around the new “deletion button” acceptance criterionAcceptance Criterion 2 adds a deletion button but does not specify:
• Permission / role checks (who is allowed to delete?)
• Disabled / hidden state when the schema is in use or locked
• Visual distinction from the “select” action to prevent accidental clicksSpecifying these will reduce UX ambiguity and prevent destructive mistakes.
.kiro/specs/wikibase-schema-editor/tasks.md (1)
191-195: Consider adding backend & store cleanup steps to the deletion taskTask 32 focuses on UI confirmation and feedback, but successful deletion also requires:
• Pinia store state update / cache invalidation
• API endpoint coverage & e2e tests
• Handling optimistic-update rollback on failureAdding subtasks will ensure end-to-end completeness.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.kiro/specs/wikibase-schema-editor/requirements.md(1 hunks).kiro/specs/wikibase-schema-editor/tasks.md(2 hunks)frontend/src/features/wikibase-schema/components/SchemaSelector.vue(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- frontend/src/features/wikibase-schema/components/SchemaSelector.vue
🔇 Additional comments (1)
.kiro/specs/wikibase-schema-editor/tasks.md (1)
177-178: Verify requirement cross-referencesThe task now references Requirements 9.5 and 9.6, but the requirements file enumerates 9.1-9.7 only implicitly. Double-check that the numbering in both documents is aligned to avoid broken traceability in future audits.
Addresses Task 32 of #66