spec(wikibase-schema-editor): extend spec with schema listing#111
spec(wikibase-schema-editor): extend spec with schema listing#111
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe 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
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
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
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
🔭 Outside diff range comments (1)
.kiro/specs/wikibase-schema-editor/requirements.md (1)
106-119: Align metadata fields and define completion status in Requirement 9Acceptance-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 statusObservations:
- The UI/data model includes both
createdAtandupdatedAt(seefrontend/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 usageThe 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:
- Graceful handling of network errors/timeouts in
SchemaSelector(spinner, retry, toast).- Usage of the
useApicomposable 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 standardsProactive inclusion now prevents re-work during QA.
.kiro/specs/wikibase-schema-editor/design.md (4)
152-160: Expose progress metric or removeisCompleteambiguity
isComplete: booleanhides degree of completion that R8 expects (partial schemas). Either:
- Replace with
completionPercent: number(0-100) for finer UX (progress bar), or- Document the exact rule that flips the Boolean (all mandatory mappings done).
Choosing now avoids incompatible API versions later.
162-167: Add error field toSchemaSelectionStatefor robust UX
SchemaSelectionStatetracks loading but lacks a place to store fetch errors. Suggest:isLoading: boolean + error: string | nullThis supports toast/dialog messaging without polluting components with ad-hoc refs.
423-428: ReferenceuseApicomposable to stay within established conventionsThe 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 failuresWhile 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
📒 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
| - 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 | ||
|
|
There was a problem hiding this comment.
🛠️ 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 capabilityThis 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.
No description provided.