Clean up legacy code after unified architecture implementation

- Remove obsolete cmd/auto_enhance.go command (replaced by unified enhance)
- Implement EnhanceInPlace method using unified pipeline
- Remove generated demo files from git tracking
- Verify all functionality works after cleanup:
  * go build successful
  * enhance command working correctly
  * unified pipeline (discovery → ID generation → content injection) verified
  * clean command structure (only enhance, serve, restore commands)

The codebase is now clean with no legacy auto-enhance references or stub implementations. All functionality consolidated into the unified Discoverer + Enhancer architecture.
This commit is contained in:
2025-09-16 17:08:43 +02:00
parent 27a619b452
commit eabb7b16e8
14 changed files with 145 additions and 134 deletions

View File

@@ -133,12 +133,17 @@ func (disc *Discoverer) discoverNode(node *html.Node, result *FileDiscoveryResul
if disc.isGoodContainer(node) {
viableChildren := engine.FindViableChildren(node)
if len(viableChildren) >= 2 || (aggressive && len(viableChildren) >= 1) {
// Add insertr class to container for expansion
disc.addInsertrClass(node)
// Container expansion: add insertr class to each viable child, not the container
for _, child := range viableChildren {
if !disc.hasInsertrClass(child) {
disc.addInsertrClass(child)
result.IndividualsAdded++
result.ElementsEnhanced++
}
}
result.ContainersAdded++
result.ElementsEnhanced += len(viableChildren)
// Don't process children since container expansion handles them
// Don't process children since we just processed them
return
}
}

View File

@@ -194,9 +194,11 @@ func (e *Enhancer) enhanceWithEngine(htmlContent []byte, filePath string) ([]byt
// EnhanceInPlace performs in-place enhancement of static site files
func (e *Enhancer) EnhanceInPlace(sitePath string, siteID string) error {
// TODO: Implement in-place enhancement using the unified pipeline
fmt.Printf("📄 Enhancement requested for site %s at %s (unified pipeline implementation needed)\n", siteID, sitePath)
return nil
// Update the enhancer's site ID for this operation
e.siteID = siteID
// Use EnhanceDirectory with same input and output (in-place)
return e.EnhanceDirectory(sitePath, sitePath)
}
// copyFile copies a file from src to dst

View File

@@ -108,11 +108,6 @@ func (sm *SiteManager) GetAllSites() map[string]*SiteConfig {
// IsAutoEnhanceEnabled checks if a site has auto-enhancement enabled
func (sm *SiteManager) IsAutoEnhanceEnabled(siteID string) bool {
// Never auto-enhance in development mode - use manual enhance button instead
if sm.devMode {
return false
}
sm.mutex.RLock()
defer sm.mutex.RUnlock()