Skip to content

spec(wikibase-schema-editor): extend spec with schema listing#111

Merged
DaxServer merged 1 commit intomainfrom
wikibase-editor-schemas
Aug 4, 2025
Merged

spec(wikibase-schema-editor): extend spec with schema listing#111
DaxServer merged 1 commit intomainfrom
wikibase-editor-schemas

Conversation

@DaxServer
Copy link
Owner

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Aug 4, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Updated design and requirements documents to introduce a schema selection interface as the initial view in the schema editor, allowing users to choose or create schemas.
    • Added details on displaying schema metadata, handling empty states, and transitioning to the main editor.
    • Expanded implementation tasks to cover building and integrating the new schema selection workflow.

Walkthrough

The documentation for the Wikibase Schema Editor was updated to introduce a schema selection interface as the initial user workflow. This includes a new SchemaSelector component, updated component hierarchy, new TypeScript interfaces, a new requirement, and additional implementation tasks describing the schema selection, creation, and integration process.

Changes

Cohort / File(s) Change Summary
Design Document Update
.kiro/specs/wikibase-schema-editor/design.md
Introduced SchemaSelector as the initial interface and component in the hierarchy. Added new TypeScript interfaces for schema metadata and selection state. Expanded implementation phases and technical decisions to cover schema selection, creation, and API integration.
Requirements Update
.kiro/specs/wikibase-schema-editor/requirements.md
Added Requirement 9, specifying the need for a schema selection interface, listing existing schemas, and providing a "Create New Schema" option with related acceptance criteria.
Task List Expansion
.kiro/specs/wikibase-schema-editor/tasks.md
Added tasks 29–33 to cover SchemaSelector component development, schema metadata display, selection workflow, new schema creation, and integration as the initial view, each with associated tests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SchemaSelector
    participant WikibaseSchemaEditor
    participant API

    User->>SchemaSelector: Open Schema Editor
    SchemaSelector->>API: Fetch all schemas (loadAllSchemas)
    API-->>SchemaSelector: Return schema list
    SchemaSelector->>User: Display schema list and "Create New Schema" button
    alt User selects existing schema
        User->>SchemaSelector: Select schema
        SchemaSelector->>API: Fetch schema (loadSchema)
        API-->>SchemaSelector: Return schema data
        SchemaSelector->>WikibaseSchemaEditor: Pass selected schema
        WikibaseSchemaEditor->>User: Show main editor with schema
    else User clicks "Create New Schema"
        User->>SchemaSelector: Click "Create New Schema"
        SchemaSelector->>WikibaseSchemaEditor: Initialize new schema
        WikibaseSchemaEditor->>User: Show main editor with new schema
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

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-schemas

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

🔭 Outside diff range comments (1)
.kiro/specs/wikibase-schema-editor/requirements.md (1)

106-119: Align metadata fields and define completion status in Requirement 9

Acceptance-criterion #2 currently reads:

2. WHEN existing schemas are found THEN the system SHALL display a list of available schemas with their names, creation dates, and completion status

Observations:

  • The UI/data model includes both createdAt and updatedAt (see frontend/src/shared/types/wikibase-schema.ts).
  • “Completion status” isn’t defined—leverage Requirement 8’s completeness validation.

Please update .kiro/specs/wikibase-schema-editor/requirements.md (lines 113–114) as follows:

-2. WHEN existing schemas are found THEN the system SHALL display a list of available schemas with their names, creation dates, and completion status
+2. WHEN existing schemas are found THEN the system SHALL display a list of available schemas with their names, **creation & last-modified dates**, and **completion status**
+   • Completion status MUST be computed as: **isComplete = all required mappings are satisfied** (per Requirement 8 completeness validation)

This change aligns the requirement with the design/docs and removes ambiguity around how “completion status” is derived.

🧹 Nitpick comments (5)
.kiro/specs/wikibase-schema-editor/tasks.md (1)

172-202: Add explicit tasks for error/loading states & API composable usage

The new task block focuses on happy-path flows. Given past guidelines (“Handle errors and loading states reactively” & “Use useApi composable”), consider appending sub-tasks to ensure:

  1. Graceful handling of network errors/timeouts in SchemaSelector (spinner, retry, toast).
  2. Usage of the useApi composable rather than direct Treaty invocation, to stay compliant with frontend-setup rules.
  - Implement SchemaSelector component with schema list display
+  - Handle loading / error states with reactive UI feedback
+  - Fetch data via useApi() composable to remain consistent with project standards

Proactive inclusion now prevents re-work during QA.

.kiro/specs/wikibase-schema-editor/design.md (4)

152-160: Expose progress metric or remove isComplete ambiguity

isComplete: boolean hides degree of completion that R8 expects (partial schemas). Either:

  1. Replace with completionPercent: number (0-100) for finer UX (progress bar), or
  2. Document the exact rule that flips the Boolean (all mandatory mappings done).

Choosing now avoids incompatible API versions later.


162-167: Add error field to SchemaSelectionState for robust UX

SchemaSelectionState tracks loading but lacks a place to store fetch errors. Suggest:

   isLoading: boolean
+  error: string | null

This supports toast/dialog messaging without polluting components with ad-hoc refs.


423-428: Reference useApi composable to stay within established conventions

The integration section should explicitly state that backend calls are wrapped via useApi() (Elysia Eden) to satisfy the team-wide rule retrieved from past learnings.

- Use existing `useSchemaApi().loadAllSchemas()`+ Use `const api = useApi()` and its `loadAllSchemas`, `loadSchema`, `createSchema` methods …

This keeps the spec aligned with enforced architectural guidelines.


436-441: Add rollback/error-handling note for create/load failures

While optimistic updates are mentioned, failure scenarios (e.g., new schema creation fails) are not. Briefly describe the rollback strategy (e.g., revert Pinia state, show toast). This prevents undefined behaviour in production.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7a526ca and ee92cf1.

📒 Files selected for processing (3)
  • .kiro/specs/wikibase-schema-editor/design.md (6 hunks)
  • .kiro/specs/wikibase-schema-editor/requirements.md (1 hunks)
  • .kiro/specs/wikibase-schema-editor/tasks.md (1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📚 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:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 Learning: applies to src/**/*.vue : use reactive objects for form state and errors...
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 reactive objects for form state and errors

Applied to files:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 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:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 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:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 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:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 Learning: applies to src/**/*.{vue,ts} : always use backend-inferred types for api data...
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} : Always use backend-inferred types for API data

Applied to files:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 Learning: applies to src/**/*.{vue,ts} : use readonly and shallowreactive for large or expensive data...
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 readonly and shallowReactive for large or expensive data

Applied to files:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 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:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 Learning: applies to src/**/*.{vue,ts} : use pinia stores for 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/**/*.{vue,ts} : Use Pinia stores for global state

Applied to files:

  • .kiro/specs/wikibase-schema-editor/design.md
📚 Learning: applies to src/**/*.vue : use storetorefs for state in 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 storeToRefs for state in components

Applied to files:

  • .kiro/specs/wikibase-schema-editor/design.md

Comment on lines +53 to +63
- Manages schema selection and creation workflow

#### 2. ColumnPalette
#### 2. SchemaSelector
- **Purpose**: Manages schema selection workflow as the initial interface
- **Responsibilities**:
- Fetches existing schemas linked to the current project using existing API
- Displays list of available schemas with metadata (name, dates, completion status)
- Provides "Create New Schema" button that triggers existing initialization code
- Handles schema selection and transitions to main editor
- Shows empty state when no schemas exist

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Specify error & loading management in SchemaSelector responsibilities

Responsibilities list covers data fetching and transitions but omits UX for slow or failed requests. Add:

• Manages `isLoading`, `errorMessage` states and exposes retry capability

This ties directly to SchemaSelectionState.isLoading and aligns with learned guideline: “Handle errors and loading states reactively when making API calls.”

🤖 Prompt for AI Agents
In .kiro/specs/wikibase-schema-editor/design.md around lines 53 to 63, the
responsibilities of SchemaSelector lack mention of handling loading and error
states during API calls. Add a responsibility stating that SchemaSelector
manages isLoading and errorMessage states and provides a retry capability. This
ensures the component handles slow or failed requests reactively, aligning with
the guideline to manage errors and loading states during data fetching.

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