Skip to content

Commit c915cf1

Browse files
committed
docs: update roadmap
1 parent e744d71 commit c915cf1

File tree

3 files changed

+66
-45
lines changed

3 files changed

+66
-45
lines changed

docs/dev/roadmap/README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
#### 2.2.1. Themis: Course Builder
5050
<details><summary>Status: ~95% MVP ✅</summary>
51-
<p>End-to-end workflow complete, polish pending</p>
51+
<p>End-to-end workflow complete, component refactoring complete, polish pending</p>
5252
</details>
5353

5454
<details><summary>Implemented</summary>
@@ -58,7 +58,9 @@
5858
<li>✅ AI structure generation with web research integration</li>
5959
<li>✅ Structure review interface with editable narratives</li>
6060
<li>✅ <code>localStorage</code> persistence for auto-save/restore</li>
61-
<li>✅ Module generation orchestration (ModuleGenerationList, 897 lines)</li>
61+
<li>✅ Module generation orchestration (ModuleGenerationList refactored: 896→441 lines)</li>
62+
<li>✅ <strong>NEW:</strong> Component breakdown (ProgressSummary, ModuleCard, ArcSection, ModulePreviewModal)</li>
63+
<li>✅ <strong>NEW:</strong> Centralized store utilities (moduleStoreHelpers.ts)</li>
6264
<li>✅ Course-aware module generation API endpoint (193 lines)</li>
6365
<li>✅ Course context integration in prompt factory</li>
6466
<li>✅ CourseOverview component for final review and export (1462 lines)</li>
@@ -197,10 +199,10 @@
197199
> [!NOTE]
198200
> The 5 most significant or important tasks to tackle next.
199201
200-
1. **[Steer Claude towards British English](Rhea-MVP.md#112-other-tasks)** (Rhea 1.1.2.1) - Ensure all AI-generated content uses British spellings and phrasing
201-
2. **[Add Course XML Schema and Validator](Themis-MVP.md#2-mvp-milestones)** (Themis 2.6) - Define course-level XML schema wrapping multiple modules
202-
3. **[Implement Export Functionality](Themis-MVP.md#2-mvp-milestones)** (Themis 2.7) - XML export for complete course (Theia integration)
203-
4. **[Radically improve module-to-module coherence](Themis-MVP.md#2-mvp-milestones)** (Themis 2.5) - Insert interstitial step for generating module overviews first
202+
1. **[Radically improve module-to-module coherence](Themis-MVP.md#2-mvp-milestones)** (Themis 2.1) - Insert interstitial step for generating module overviews first, build learner knowledge context
203+
2. **[Add Course XML Schema and Validator](Themis-MVP.md#2-mvp-milestones)** (Themis 2.2) - Define course-level XML schema wrapping multiple modules
204+
3. **[Implement Export Functionality](Themis-MVP.md#2-mvp-milestones)** (Themis 2.3) - XML export for complete course (Theia integration)
205+
4. **[Steer Claude towards British English](Rhea-MVP.md#112-other-tasks)** (Rhea 1.1.2.1) - Ensure all AI-generated content uses British spellings and phrasing
204206
5. **[Add Dark Mode to UI](Rhea-MVP.md#112-other-tasks)** (Rhea 1.1.2.2) - User-selectable light/dark/system theme with dark palettes
205207

206208
---
@@ -209,9 +211,9 @@
209211
> [!NOTE]
210212
> 6 most recent achievements in this codebase
211213
212-
1. **[Themis: Complete Module Generation Workflow](Themis-MVP.md#49-complete-module-generation-workflow-steps-5-6--completed-2025-10-25)** (2025-10-25) - End-to-end course generation complete: ModuleGenerationList (897 lines), course-aware API endpoint (193 lines), CourseOverview (1462 lines), SSE streaming, and Theia export integration
213-
2. **[Rhea: Palette System Overhaul](Rhea-MVP.md#21-overhaul-palette-system--completed-2025-10-25)** (2025-10-25) - Complete refactor establishing single source of truth at `src/lib/config/palettes/`, build-time CSS generation, 56 files converted, 2,817 insertions
214-
3. **[Theia: Course Structure Upload (JSON)](Theia-MVP.md#412-course-structure-upload-json--completed-2025-10-24)** (2025-10-24) - Complete JSON upload workflow with validation, drag-and-drop interface, and round-trip capability (Themis → export → upload → continue). Theia branding with magenta/cyan palette (2,417 lines)
215-
4. **[Theia: Content Preview & Export complete](Theia-MVP.md#411-core-export-functionality--completed-2025-10-23)** (2025-10-23) - Production-ready export system with Markdown/HTML/JSON formats, configurable detail levels, and selective section export (2,813 lines)
216-
5. **[Architectural refactoring complete](Rhea-MVP.md#411-architectural-refactoring-2025-10-20--completed)** (2025-10-20) - 670+ lines eliminated via factories, utilities, and centralized configurations
217-
6. **[Themis arc-based structure complete](Themis-MVP.md#47-reimplement-the-module-overview-generation-based-on-thematic-arcs--completed)** - Six-step workflow with thematic organizational layer between courses and modules
214+
1. **[Themis: Component Refactoring Complete](Themis-MVP.md#411-break-over-large-themis-components-into-subcomponents--completed-2025-10-27)** (2025-10-27) - Split 896-line ModuleGenerationList into focused components (ProgressSummary, ModuleCard, ArcSection, ModulePreviewModal) and centralized store utilities. Main component reduced 51%, improved maintainability and testability.
215+
2. **[Themis: Complete Module Generation Workflow](Themis-MVP.md#410-complete-module-generation-workflow-steps-5-6--completed-2025-10-25)** (2025-10-25) - End-to-end course generation complete: ModuleGenerationList (897 lines), course-aware API endpoint (193 lines), CourseOverview (1462 lines), SSE streaming, and Theia export integration
216+
3. **[Rhea: Palette System Overhaul](Rhea-MVP.md#21-overhaul-palette-system--completed-2025-10-25)** (2025-10-25) - Complete refactor establishing single source of truth at `src/lib/config/palettes/`, build-time CSS generation, 56 files converted, 2,817 insertions
217+
4. **[Theia: Course Structure Upload (JSON)](Theia-MVP.md#412-course-structure-upload-json--completed-2025-10-24)** (2025-10-24) - Complete JSON upload workflow with validation, drag-and-drop interface, and round-trip capability (Themis → export → upload → continue). Theia branding with magenta/cyan palette (2,417 lines)
218+
5. **[Theia: Content Preview & Export complete](Theia-MVP.md#411-core-export-functionality--completed-2025-10-23)** (2025-10-23) - Production-ready export system with Markdown/HTML/JSON formats, configurable detail levels, and selective section export (2,813 lines)
219+
6. **[Architectural refactoring complete](Rhea-MVP.md#411-architectural-refactoring-2025-10-20--completed)** (2025-10-20) - 670+ lines eliminated via factories, utilities, and centralized configurations

docs/dev/roadmap/Themis-MVP.md

Lines changed: 51 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,7 @@
2929
- [ ] 1.1.2.5. Allow "invisible" arcs
3030
- 1.1.2.5.1. Arcs can be defined as consisting of exactly 1 module each
3131
- 1.1.2.5.2. In this scenario, the UI should obscure any reference to Arcs whilst still preserving them in the data structure
32-
- [ ] 1.1.2.6. `ModuleGenerationList.svelte` is 895 lines; split it into smaller components:
33-
- 1.1.2.6.1. `ArcSection.svelte`: arc header + module list
34-
- 1.1.2.6.2. `ModuleCard.svelte`: individual module with status/actions
35-
- 1.1.2.6.3. `ModulePreviewModal.svelte`: preview functionality
36-
- 1.1.2.6.4. `ProgressSummary.svelte`: statistics and progress bar
37-
- [ ] 1.1.2.7. Fix Duplicate Store Updates
38-
- 1.1.2.7.1. The pattern of finding and updating modules is repeated multiple times
39-
- 1.1.2.7.1.1. lines 74-82
40-
- 1.1.2.7.1.2. lines 195-211
41-
- 1.1.2.7.1.3. lines 221-236
42-
- 1.1.2.7.2.Extract to a utility
43-
- [ ] 1.1.2.8. Timeout values (`src/routes/api/themis/module/+server.ts:52`) should be extracted to constants
32+
- [ ] 1.1.2.6. Timeout values (`src/routes/api/themis/module/+server.ts:52`) should be extracted to constants
4433
- [ ] 1.1.2.9. Fix Race Condition in SSE Stream Cleanup
4534
- 1.1.2.9.1. In `ModuleGenerationList.svelte:160-162`, the reader is removed from `activeReaders` in a `finally` block but, if `onDestroy` runs concurrently with a completing stream, the `reader.cancel()` call might fail or leave streams in an inconsistent state.
4635
- [ ] 1.1.2.10. Fix SSE Parsing Vulnerability
@@ -63,20 +52,19 @@
6352
---
6453

6554
## 2. MVP Milestones
66-
- [ ] 2.1. Break over-large `/Themis` components into subcomponents
67-
- [ ] 2.2. Radically improve module-to-module coherence at generation
68-
- 2.2.1. **IMPORTANT:** confer with user to understand requirements
69-
- 2.2.2. Insert interstitial step: generating module overviews first, allowing later generation of full module spec
70-
- 2.2.3. Cumulatively build a reference snipped on what learners will already know by the time a module starts, then pass that snippet to Metis
71-
- 2.2.4. Separate all prompt snippets into separate files for increased visibility to devs
72-
- [ ] 2.3. Add Course XML Schema and Validator 📋 PENDING
55+
- [ ] 2.1. Radically improve module-to-module coherence at generation
56+
- 2.1.1. **IMPORTANT:** confer with user to understand requirements
57+
- 2.1.2. Insert interstitial step: generating module overviews first, allowing later generation of full module spec
58+
- 2.1.3. Cumulatively build a reference snipped on what learners will already know by the time a module starts, then pass that snippet to Metis
59+
- 2.1.4. Separate all prompt snippets into separate files for increased visibility to devs
60+
- [ ] 2.2. Add Course XML Schema and Validator 📋 PENDING
7361
- Define course-level XML schema wrapping multiple modules
7462
- Validation for complete course structure
7563
- Include course narratives and metadata
7664
- **Why eleventh:** Ensures exported courses meet quality standards
7765
- **Status:** Not yet started - will reuse existing validation patterns
7866
- **Note:** Current export uses Theia service which handles course-to-markdown/HTML conversion
79-
- [ ] 2.4. Implement Export Functionality 📋 PENDING
67+
- [ ] 2.3. Implement Export Functionality 📋 PENDING
8068
- XML export for complete course
8169
- PDF export option (stretch goal)
8270
- Individual module file exports
@@ -97,43 +85,59 @@
9785

9886
## 4. Work Record
9987
### 4.1. Completed Milestones
100-
- [x] 4.1. Create Hub Dashboard and Navigation Structure ✅ COMPLETED
88+
- [x] 4.1.1. Break over-large `/Themis` components into subcomponents ✅ COMPLETED (2025-10-27)
89+
- **Branch:** `themis/refactor/split-large-components`
90+
- **Commit:** `e744d71`
91+
- **Summary:** Split 896-line ModuleGenerationList.svelte into focused, reusable components
92+
- **Components Created:**
93+
- ProgressSummary.svelte (86 lines): Overall generation progress display
94+
- ModulePreviewModal.svelte (141 lines): XML preview modal
95+
- ModuleCard.svelte (221 lines): Individual module display with actions
96+
- ArcSection.svelte (140 lines): Collapsible arc container
97+
- moduleStoreHelpers.ts (80 lines): Centralized store update utilities
98+
- **Impact:**
99+
- Main component reduced from 896 to 441 lines (51% reduction)
100+
- Eliminated duplicate store update patterns
101+
- Improved maintainability and testability
102+
- Better component composition and reusability
103+
- **Why completed:** Addresses roadmap tasks 1.1.2.6 and 1.1.2.7, establishing foundation for future improvements
104+
- [x] 4.1.2. Create Hub Dashboard and Navigation Structure ✅ COMPLETED
101105
- Created hub dashboard at `/` with cards for "Generate Module" and "Generate Course"
102106
- Moved existing module generator to `/module/new`
103107
- Added breadcrumb navigation in layout for all routes
104108
- Hub-based architecture allows parallel workflows
105109
- **Why first:** Foundation for organizing module vs. course workflows
106-
- [x] 4.2. Create Course Types and Stores ✅ COMPLETED
110+
- [x] 4.1.3. Create Course Types and Stores ✅ COMPLETED
107111
- Defined TypeScript interfaces in `src/lib/types/course.ts`
108112
- CourseData interface with logistics, learners, structure, and modules
109113
- ModuleSlot interface with status tracking, objectives, topics
110114
- Created Svelte stores in `src/lib/courseStores.ts`
111115
- Auto-save to localStorage on course changes
112116
- Derived stores for computed values (totalModuleWeeks)
113117
- **Why second:** Type-safe state management for course workflow
114-
- [x] 4.3. Build CourseConfigForm Component (Step 1) ✅ COMPLETED
118+
- [x] 4.1.4. Build CourseConfigForm Component (Step 1) ✅ COMPLETED
115119
- Created `src/lib/course/CourseConfigForm.svelte`
116120
- Comprehensive form with course identity, logistics, learner configuration
117121
- Validation for all inputs (weeks, cohort size, dates, etc.)
118122
- Disabled SSR for localStorage compatibility
119123
- Reactive statements ensure nested objects exist before access
120124
- **Why third:** User input collection for course parameters
121-
- [x] 4.4. Build ModuleStructurePlanner Component (Step 2) ✅ COMPLETED
125+
- [x] 4.1.5. Build ModuleStructurePlanner Component (Step 2) ✅ COMPLETED
122126
- Created `src/lib/course/ModuleStructurePlanner.svelte`
123127
- Visual timeline bar showing proportional week allocation
124128
- Add/remove modules with validation
125129
- Auto-suggest feature based on course duration
126130
- Week budget tracking with overflow detection
127131
- Module ordering and duration management
128132
- **Why third:** High-level course structure before AI generation
129-
- [x] 4.5. Create /api/course/structure Endpoint ✅ COMPLETED
133+
- [x] 4.1.6. Create /api/course/structure Endpoint ✅ COMPLETED
130134
- Created `src/routes/api/course/structure/+server.ts`
131135
- Uses Claude Sonnet 4.5 to generate detailed module structure
132136
- Accepts course parameters and module skeleton
133137
- Returns course narrative, module objectives/topics, progression narrative
134138
- Web search tool integration for research
135139
- **Why third:** AI-powered course structure generation
136-
- [x] 4.6. Build CourseStructureReview Component (Step 3) ✅ COMPLETED
140+
- [x] 4.1.7. Build CourseStructureReview Component (Step 3) ✅ COMPLETED
137141
- Created `src/lib/course/CourseStructureReview.svelte`
138142
- Auto-generation on component mount
139143
- Loading state with spinner during 30-60 second generation
@@ -143,7 +147,7 @@
143147
- Regenerate button for fresh AI suggestions
144148
- Saves refined data back to course store
145149
- **Why third:** Review and refine AI-generated course structure before module generation
146-
- [x] 4.7. Reimplement the Module Overview Generation Based on Thematic Arcs ✅ COMPLETED
150+
- [x] 4.1.8. Reimplement the Module Overview Generation Based on Thematic Arcs ✅ COMPLETED
147151
- Introduced "arcs" as thematic organizational layer between courses and modules
148152
- Created Arc interface with theme, arcThemeNarrative, and arcProgressionNarrative fields
149153
- Built ArcStructurePlanner component for defining broad thematic arcs
@@ -154,14 +158,14 @@
154158
- Implemented backward compatibility migration for existing module-only courses
155159
- Arcs support thematic independence with temporal sequencing
156160
- **Why completed:** Arcs provide the thematic organizational structure needed for coherent course narratives while maintaining module-level detail
157-
- [x] 4.8. Add localStorage Persistence ✅ COMPLETED
161+
- [x] 4.1.9. Add localStorage Persistence ✅ COMPLETED
158162
- Auto-save course progress to localStorage ✅
159163
- Restore course on page reload ✅
160164
- "Clear course" functionality ✅
161165
- Save/load multiple courses ✅
162166
- **Completed:** Implemented via `persistedStore()` utility in refactoring Phase 4
163167
- **Location:** `src/lib/stores/themisStores.ts` using `src/lib/utils/state/persistenceUtils.ts`
164-
- [x] 4.9. Complete Module Generation Workflow (Steps 5-6) ✅ COMPLETED (2025-10-25)
168+
- [x] 4.1.10. Complete Module Generation Workflow (Steps 5-6) ✅ COMPLETED (2025-10-25)
165169
- **Step 5 - Module Generation:**
166170
- ModuleGenerationList component with arc-grouped display
167171
- SSE streaming for real-time generation feedback
@@ -175,20 +179,20 @@
175179
- Theia export integration (Markdown/HTML)
176180
- Workflow navigation and reset functionality
177181
- **Why completed:** Completes the end-to-end Themis MVP workflow from configuration to export
178-
- [x] 4.11. Create /api/themis/module Endpoint ✅ COMPLETED (2025-10-25)
182+
- [x] 4.1.11. Create /api/themis/module Endpoint ✅ COMPLETED (2025-10-25)
179183
- Created `src/routes/api/themis/module/+server.ts` (193 lines)
180184
- Accepts module slot data with course context
181185
- Calls existing module generation logic with course-aware prompts
182186
- Returns XML module spec via SSE streaming
183187
- Supports retry logic and validation
184188
- **Status:** Complete - API layer for course-aware module generation
185-
- [x] 4.12. Extend Module Generation with Course Context ✅ COMPLETED (2025-10-25)
189+
- [x] 4.1.12. Extend Module Generation with Course Context ✅ COMPLETED (2025-10-25)
186190
- Added `buildCourseAwareModulePrompt()` to metisPromptFactory
187191
- Includes course narrative, arc progression, and preceding modules in prompts
188192
- Maintains backward compatibility with standalone module generation
189193
- XML injection prevention via escapeXml utilities
190194
- **Status:** Complete - reuses existing module generation with course awareness
191-
- [x] 4.13. Build CourseOverview Component (Step 6) ✅ COMPLETED (2025-10-25)
195+
- [x] 4.1.13. Build CourseOverview Component (Step 6) ✅ COMPLETED (2025-10-25)
192196
- Created `src/lib/components/themis/CourseOverview.svelte` (1462 lines)
193197
- Displays complete course with metadata, narratives, and all generated modules
194198
- Arc-grouped collapsible sections with module previews
@@ -202,3 +206,18 @@
202206
#### 4.2.1. Record of Past Deadlines
203207

204208
#### 4.2.2. Record of Other Completed Tasks
209+
- [x] 4.2.2.1. `ModuleGenerationList.svelte` is 895 lines; split it into smaller components ✅ COMPLETED (2025-10-27)
210+
- Created `ArcSection.svelte`: arc header + module list (140 lines)
211+
- Created `ModuleCard.svelte`: individual module with status/actions (221 lines)
212+
- Created `ModulePreviewModal.svelte`: preview functionality (141 lines)
213+
- Created `ProgressSummary.svelte`: statistics and progress bar (86 lines)
214+
- Refactored main component from 896 to 441 lines
215+
- **Branch:** `themis/refactor/split-large-components`
216+
- **Addresses:** Original task 1.1.2.6
217+
- [x] 4.2.2.2. Fix Duplicate Store Updates ✅ COMPLETED (2025-10-27)
218+
- Created `moduleStoreHelpers.ts` utility (80 lines)
219+
- Extracted repeated module update patterns into centralized functions
220+
- Functions: `updateModuleStatus()`, `updateModuleWithGeneratedData()`, `updateModuleWithError()`
221+
- Eliminated duplicate code across ModuleGenerationList
222+
- **Branch:** `themis/refactor/split-large-components`
223+
- **Addresses:** Original task 1.1.2.7

src/lib/styles/palettes.generated.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Generated Palette CSS Variables
33
*
44
* AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
5-
* Generated: 2025-10-26T20:33:47.803Z
5+
* Generated: 2025-10-27T18:10:20.464Z
66
* Source: scripts/generatePaletteCss.js
77
*
88
* This file is automatically generated from TypeScript palette definitions

0 commit comments

Comments
 (0)