Goal: Create DrawingML classes to model nested content Duration: 2-3 hours Started: Not yet Status: Ready to begin
| Task | Duration | Status | Files | Tests |
|---|---|---|---|---|
| Task 1: Core Drawing Classes | 60 min | ⏳ Pending | 0/4 | - |
| Task 2: Inline Class | 45 min | ⏳ Pending | 0/1 | - |
| Task 3: Anchor Class | 30 min | ⏳ Pending | 0/1 | - |
| Task 4: Graphic Classes | 45 min | ⏳ Pending | 0/3 | - |
| Task 5: Testing | 30 min | ⏳ Pending | - | 0/0 |
| Total | 3.5 hours | 0% | 0/9 | 258/258 |
- Create
lib/uniword/wordprocessingml/drawing.rb - Add inline, anchor attributes
- Add xml mapping with WordProcessingML namespace
- Verify Pattern 0 compliance
- Create
lib/uniword/wp_drawing/extent.rb - Add cx, cy attributes (:integer)
- Add xml mapping with WordProcessingDrawing namespace
- Verify Pattern 0 compliance
- Create
lib/uniword/wp_drawing/doc_properties.rb - Add id, name, descr attributes
- Add xml mapping with WordProcessingDrawing namespace
- Verify Pattern 0 compliance
- Create
lib/uniword/wp_drawing/non_visual_drawing_props.rb - Add basic structure (locks future)
- Add xml mapping with WordProcessingDrawing namespace
- Verify Pattern 0 compliance
- Create
lib/uniword/wp_drawing/inline.rb - Add distance attributes (distT, distB, distL, distR)
- Add extent, doc_properties, non_visual_props, graphic
- Add xml mapping with WordProcessingDrawing namespace
- Verify Pattern 0 compliance
- Update
lib/uniword/wp_drawing.rbwith autoloads - Verify all classes auto-load correctly
- Create
lib/uniword/wp_drawing/anchor.rb - Add all Inline attributes
- Add positioning attributes (positionH, positionV, etc.)
- Add xml mapping with WordProcessingDrawing namespace
- Verify Pattern 0 compliance
- Create
lib/uniword/drawingml/graphic.rb - Add graphic_data attribute
- Add xml mapping with DrawingML namespace
- Verify Pattern 0 compliance
- Create
lib/uniword/drawingml/graphic_data.rb - Add uri, picture attributes
- Add xml mapping with DrawingML namespace
- Verify Pattern 0 compliance
- Check if
lib/uniword/drawingml/picture.rbexists - Create or enhance Picture class
- Add xml mapping with Picture namespace
- Verify Pattern 0 compliance
- Test Drawing instantiation
- Test Inline with all attributes
- Test XML serialization
- Create complete Drawing → Inline → Graphic chain
- Verify namespace handling
- Test round-trip if applicable
- Run baseline tests:
bundle exec rspec spec/uniword/styleset_roundtrip_spec.rb spec/uniword/theme_roundtrip_spec.rb - Verify: 258/258 still passing ✅
-
lib/uniword/wordprocessingml/drawing.rb
-
lib/uniword/wp_drawing/extent.rb -
lib/uniword/wp_drawing/doc_properties.rb -
lib/uniword/wp_drawing/non_visual_drawing_props.rb -
lib/uniword/wp_drawing/inline.rb -
lib/uniword/wp_drawing/anchor.rb
-
lib/uniword/drawingml/graphic.rb -
lib/uniword/drawingml/graphic_data.rb -
lib/uniword/drawingml/picture.rb(or enhance existing)
- Update
lib/uniword/wp_drawing.rb
- StyleSet Round-Trip: 12/12 ✅
- Theme Round-Trip: 29/29 ✅
- Total: 258/258 (100%) ✅
- StyleSet Round-Trip: 12/12 ✅
- Theme Round-Trip: 29/29 ✅
- Total: 258/258 (100%) ✅
- No regressions allowed!
- All classes: Attributes BEFORE xml blocks
- No violations in any file
- NO :string storage for XML content
- All nested content is proper model classes
- Drawing contains Inline/Anchor (not :string)
- Inline contains Extent, DocProperties, etc. (not :string)
- Each class has single responsibility
- No overlapping concerns
- Clear separation between WP Drawing and DrawingML
- Each class defines its own namespace
- Correct namespace used (WordProcessingML, WordProcessingDrawing, DrawingML, Picture)
- No namespace conflicts
- All optional elements use render_nil: false
- All optional attributes use render_nil: false
⚠️ ALWAYS usebundle execwith Ruby commands!- 🚨 Pattern 0: Attributes BEFORE xml (ALWAYS)
- 🏗️ Model-Driven: NO :string for XML content
- 🔧 Namespace: Each class defines its own
- 📦 Mixed Content: Use for elements with nested content
- ✨ Render Nil: Use for optional elements
- ✅ Zero Regressions: Baseline must stay at 258/258
After Session 2B completion:
- Session 2C: Integration (1-2 hours)
- Replace :string in Choice/Fallback with Drawing/Pict
- Test AlternateContent with proper models
- Verify round-trip improvements
- Duration: 45 minutes (vs 2-3 hours estimated)
- Files Created: 3 (TextBoxContent, Pict, Wrap)
- Files Enhanced: 3 (VML Textbox, Shape, vml.rb)
- Tests: 258/258 passing ✅
- Architecture: 100% Pattern 0, Model-driven, MECE ✅