generated from coulomb/repo-seed
refactor: complete post-migration cleanup
Implemented all cleanup items from CLEANUP_REPORT.md: Legacy Code Removal: - Removed document-controls-legacy.js wrapper - Updated 4 test files to use DocumentControls directly - Updated scripts/list_components.py acronym mappings - Updated tests/test_component_listing.py expectations Archive and Organization: - Moved relicts/ to docs/prototypes/ with README explaining history - Moved MIGRATION_STATUS.md to docs/migration/ - Removed IMPLEMENTATION_NOTES.md legacy references Test Verification: - All 68 JavaScript tests passing (Jest) - All 3 Python component tests passing - No breaking changes to functionality The codebase is now cleaner with no legacy wrappers or empty directories. Migration is complete and documented. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -99,7 +99,6 @@ class MyControl extends ControlBase {
|
||||
#### With TestDrive-JSUI System
|
||||
- **Component Discovery**: Listed by `scripts/list_components.py`
|
||||
- **TDD Testing**: Validated by `tests/test_component_listing.py`
|
||||
- **Legacy Support**: `DocumentControlsLegacy` maintains backward compatibility
|
||||
|
||||
#### With MarkiTect md-render
|
||||
- **Plugin Integration**: Ready for deployment via Makefile targets
|
||||
@@ -116,7 +115,6 @@ class MyControl extends ControlBase {
|
||||
#### Automated Testing
|
||||
- Component listing tests ensure discovery
|
||||
- Integration tests validate interaction patterns
|
||||
- Legacy tests maintain backward compatibility
|
||||
|
||||
### Performance Considerations
|
||||
|
||||
|
||||
37
docs/prototypes/README.md
Normal file
37
docs/prototypes/README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# TestDrive-JSUI Prototypes
|
||||
|
||||
This directory contains historical HTML prototypes from the development of the control system architecture.
|
||||
|
||||
## Files
|
||||
|
||||
- **AllControlsRudimentary.html** - Early prototype showing all control panels
|
||||
- **ControlFooter.html** - Footer control prototype
|
||||
- **DebugControlContent.html** - Reference implementation for enhanced ControlBase behavior
|
||||
- **StatusPsychadelic.html** - Status control visual prototype
|
||||
|
||||
## Historical Context
|
||||
|
||||
These prototypes were created during the development of the enhanced ControlBase architecture (documented in `IMPLEMENTATION_NOTES.md`). They served as reference implementations for:
|
||||
|
||||
- Icon-only collapsed state
|
||||
- Expand/drag functionality
|
||||
- Bottom-left corner resize
|
||||
- Collapse with position restoration
|
||||
- Header toggle for content visibility
|
||||
|
||||
## Status
|
||||
|
||||
These files are **archived for historical reference only**. The implemented code is now in:
|
||||
- `js/controls/control-base.js` - Base control class
|
||||
- `js/controls/edit-control.js` - Edit panel
|
||||
- `js/controls/debug-control.js` - Debug panel
|
||||
- `js/controls/status-control.js` - Status indicator
|
||||
- `js/controls/contents-control.js` - Table of contents
|
||||
|
||||
## Notes
|
||||
|
||||
The DebugControlContent.html prototype was specifically referenced in the IMPLEMENTATION_NOTES.md as the source for the advanced panel behavior patterns that were implemented in the ControlBase class.
|
||||
|
||||
---
|
||||
|
||||
*Archived: December 16, 2025*
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Legacy wrapper for DocumentControls
|
||||
*
|
||||
* This file provides backward compatibility for tests that reference
|
||||
* DocumentControlsLegacy. It simply re-exports the current DocumentControls
|
||||
* implementation with the legacy name.
|
||||
*/
|
||||
|
||||
const { DocumentControls } = require('./document-controls.js');
|
||||
|
||||
// Re-export as legacy name for backward compatibility
|
||||
const DocumentControlsLegacy = DocumentControls;
|
||||
|
||||
// Export for use in tests and other modules
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = { DocumentControlsLegacy };
|
||||
}
|
||||
|
||||
// Export for browser use
|
||||
if (typeof window !== 'undefined') {
|
||||
window.DocumentControlsLegacy = DocumentControls;
|
||||
}
|
||||
@@ -33,10 +33,10 @@ describe('Button Functionality and DOM Events', () => {
|
||||
|
||||
mockSection = document.querySelector('.section');
|
||||
|
||||
// Load components - using legacy component for backward compatibility
|
||||
require('../components/document-controls-legacy.js');
|
||||
if (global.DocumentControlsLegacy) {
|
||||
documentControls = new global.DocumentControlsLegacy(document.getElementById('content'));
|
||||
// Load components
|
||||
require('../components/document-controls.js');
|
||||
if (global.DocumentControls) {
|
||||
documentControls = new global.DocumentControls(document.getElementById('content'));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ runner.describe('DocumentControls Component Extraction', () => {
|
||||
|
||||
runner.it('should load extracted DocumentControls component', () => {
|
||||
// Load the extracted component
|
||||
delete require.cache[require.resolve('../components/document-controls-legacy.js')];
|
||||
delete require.cache[require.resolve('../components/document-controls.js')];
|
||||
|
||||
try {
|
||||
const module = require('../components/document-controls-legacy.js');
|
||||
runner.expect(module.DocumentControlsLegacy).toBeTruthy();
|
||||
const module = require('../components/document-controls.js');
|
||||
runner.expect(module.DocumentControls).toBeTruthy();
|
||||
|
||||
// Set global for other tests
|
||||
global.ExtractedDocumentControls = module.DocumentControlsLegacy;
|
||||
global.ExtractedDocumentControls = module.DocumentControls;
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to load extracted DocumentControls: ${error.message}`);
|
||||
}
|
||||
|
||||
@@ -19,18 +19,18 @@ runner.describe('Full Component Integration Tests', () => {
|
||||
const sectionModule = require('../core/section-manager.js');
|
||||
const domModule = require('../components/dom-renderer.js');
|
||||
const debugModule = require('../components/debug-panel.js');
|
||||
const controlsModule = require('../components/document-controls-legacy.js');
|
||||
const controlsModule = require('../components/document-controls.js');
|
||||
|
||||
runner.expect(sectionModule.SectionManager).toBeTruthy();
|
||||
runner.expect(domModule.DOMRenderer).toBeTruthy();
|
||||
runner.expect(debugModule.DebugPanel).toBeTruthy();
|
||||
runner.expect(controlsModule.DocumentControlsLegacy).toBeTruthy();
|
||||
runner.expect(controlsModule.DocumentControls).toBeTruthy();
|
||||
|
||||
// Set globals for other tests
|
||||
global.ExtractedSectionManager = sectionModule.SectionManager;
|
||||
global.ExtractedDOMRenderer = domModule.DOMRenderer;
|
||||
global.ExtractedDebugPanel = debugModule.DebugPanel;
|
||||
global.ExtractedDocumentControls = controlsModule.DocumentControlsLegacy;
|
||||
global.ExtractedDocumentControls = controlsModule.DocumentControls;
|
||||
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to load extracted components: ${error.message}`);
|
||||
|
||||
@@ -18,12 +18,12 @@ runner.describe('Real User Functionality Tests', () => {
|
||||
const sectionModule = require('../core/section-manager.js');
|
||||
const domModule = require('../components/dom-renderer.js');
|
||||
const debugModule = require('../components/debug-panel.js');
|
||||
const controlsModule = require('../components/document-controls-legacy.js');
|
||||
const controlsModule = require('../components/document-controls.js');
|
||||
|
||||
const { SectionManager } = sectionModule;
|
||||
const { DOMRenderer } = domModule;
|
||||
const { DebugPanel } = debugModule;
|
||||
const { DocumentControlsLegacy } = controlsModule;
|
||||
const { DocumentControls } = controlsModule;
|
||||
|
||||
// Setup DOM container
|
||||
const container = document.createElement('div');
|
||||
@@ -34,7 +34,7 @@ runner.describe('Real User Functionality Tests', () => {
|
||||
const sectionManager = new SectionManager();
|
||||
const domRenderer = new DOMRenderer(sectionManager, container);
|
||||
const debugPanel = new DebugPanel();
|
||||
const documentControls = new DocumentControlsLegacy();
|
||||
const documentControls = new DocumentControls();
|
||||
|
||||
// Setup document controls
|
||||
documentControls.create();
|
||||
@@ -96,11 +96,11 @@ runner.describe('Real User Functionality Tests', () => {
|
||||
// Setup similar to above
|
||||
const sectionModule = require('../core/section-manager.js');
|
||||
const domModule = require('../components/dom-renderer.js');
|
||||
const controlsModule = require('../components/document-controls-legacy.js');
|
||||
const controlsModule = require('../components/document-controls.js');
|
||||
|
||||
const { SectionManager } = sectionModule;
|
||||
const { DOMRenderer } = domModule;
|
||||
const { DocumentControlsLegacy } = controlsModule;
|
||||
const { DocumentControls } = controlsModule;
|
||||
|
||||
const container = document.createElement('div');
|
||||
container.innerHTML = '<div id="markdown-content"></div>';
|
||||
@@ -108,7 +108,7 @@ runner.describe('Real User Functionality Tests', () => {
|
||||
|
||||
const sectionManager = new SectionManager();
|
||||
const domRenderer = new DOMRenderer(sectionManager, container);
|
||||
const documentControls = new DocumentControlsLegacy();
|
||||
const documentControls = new DocumentControls();
|
||||
|
||||
documentControls.create();
|
||||
|
||||
@@ -195,12 +195,12 @@ runner.describe('Real User Functionality Tests', () => {
|
||||
const sectionModule = require('../core/section-manager.js');
|
||||
const domModule = require('../components/dom-renderer.js');
|
||||
const debugModule = require('../components/debug-panel.js');
|
||||
const controlsModule = require('../components/document-controls-legacy.js');
|
||||
const controlsModule = require('../components/document-controls.js');
|
||||
|
||||
const { SectionManager } = sectionModule;
|
||||
const { DOMRenderer } = domModule;
|
||||
const { DebugPanel } = debugModule;
|
||||
const { DocumentControlsLegacy } = controlsModule;
|
||||
const { DocumentControls } = controlsModule;
|
||||
|
||||
const container = document.createElement('div');
|
||||
container.innerHTML = '<div id="markdown-content"></div>';
|
||||
@@ -209,7 +209,7 @@ runner.describe('Real User Functionality Tests', () => {
|
||||
const sectionManager = new SectionManager();
|
||||
const domRenderer = new DOMRenderer(sectionManager, container);
|
||||
const debugPanel = new DebugPanel();
|
||||
const documentControls = new DocumentControlsLegacy();
|
||||
const documentControls = new DocumentControls();
|
||||
|
||||
documentControls.create();
|
||||
|
||||
|
||||
@@ -52,8 +52,7 @@ class ComponentAnalyzer:
|
||||
'CssProcessor': 'CSSProcessor',
|
||||
'JsEngine': 'JSEngine',
|
||||
'ApiClient': 'APIClient',
|
||||
'UrlHandler': 'URLHandler',
|
||||
'DocumentControlsLegacy': 'DocumentControlsLegacy'
|
||||
'UrlHandler': 'URLHandler'
|
||||
}
|
||||
|
||||
component_name = acronym_mappings.get(component_name, component_name)
|
||||
|
||||
@@ -35,7 +35,7 @@ class TestComponentListing:
|
||||
'EditControl': 'js/controls/edit-control.js',
|
||||
'DebugControl': 'js/controls/debug-control.js',
|
||||
'DebugPanel': 'js/components/debug-panel.js',
|
||||
'DocumentControlsLegacy': 'js/components/document-controls-legacy.js',
|
||||
'DocumentControls': 'js/components/document-controls.js',
|
||||
'SectionManager': 'js/core/section-manager.js',
|
||||
'DOMRenderer': 'js/components/dom-renderer.js'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user