Skip to content

Comments

feat(wikibase-schema-editor): integrate schema deletion#117

Merged
DaxServer merged 2 commits intomainfrom
wikibase-editor-task32
Aug 6, 2025
Merged

feat(wikibase-schema-editor): integrate schema deletion#117
DaxServer merged 2 commits intomainfrom
wikibase-editor-task32

Conversation

@DaxServer
Copy link
Owner

Addresses Task 32 of #66

@coderabbitai
Copy link

coderabbitai bot commented Aug 6, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added the ability to delete schemas directly from the schema selection interface, including a confirmation dialog to prevent accidental deletions and a success message upon completion.
  • UI Improvements

    • Updated the schema selection layout: the "Create New Schema" button is now positioned in the header, and each schema card features a dedicated delete button with improved styling and transitions.
  • Documentation

    • Updated requirements and task documentation to reflect the new schema deletion functionality and revised acceptance criteria.

Walkthrough

This 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

Cohort / File(s) Change Summary
Task Documentation Update
.kiro/specs/wikibase-schema-editor/tasks.md
Updated task #32 to focus on integrating schema deletion into the selection workflow, replaced subtasks to cover deletion confirmation and feedback, and marked the task as completed.
Global Component Declaration
frontend/components.d.ts
Added the PrimeVue Dialog component to the global Vue components interface, enabling its usage throughout the frontend.
SchemaSelector Component Enhancement
frontend/src/features/wikibase-schema/components/SchemaSelector.vue
Added schema deletion functionality with confirmation dialog and feedback, refactored schema loading logic, repositioned the "Create New Schema" button, and updated UI layout and styling for schema cards.
Editor Component Cleanup
frontend/src/features/wikibase-schema/components/WikibaseSchemaEditor.vue
Removed unused imports (loadSchema and createFrontendError), with no other logic 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
Loading

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wikibase-editor-task32

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a85bdb and 296136d.

📒 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}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript or JavaScript files
Do not use dotenv; Bun automatically loads .env files
Use Bun.serve() for HTTP servers and WebSockets instead of express
Use bun:sqlite for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of ws
Prefer Bun.file over node:fs's readFile/writeFile
Use Bun.$ (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 of webpack or esbuild for 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.ts
  • frontend/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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 handling

Criterion 7 only mandates a confirmation dialog. It should also cover:

  1. Success feedback (toast/snackbar, list refresh)
  2. Error handling when deletion fails (network error, foreign-key constraint, etc.)
  3. 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 story

The 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 criterion

Acceptance 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 clicks

Specifying 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 task

Task 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 failure

Adding subtasks will ensure end-to-end completeness.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 296136d and a030db3.

📒 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-references

The 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.

@DaxServer DaxServer merged commit 590237b into main Aug 6, 2025
5 of 6 checks passed
@DaxServer DaxServer deleted the wikibase-editor-task32 branch August 6, 2025 17:54
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.

1 participant