feat: implement clean TDD-driven editor with enhanced status dialog

- Replace legacy editor with clean object-oriented architecture
- Add comprehensive test-driven Section, SectionManager, and DOMRenderer classes
- Implement four-layer content management with proper action semantics
- Add multiple concurrent section editing capability
- Implement intelligent section splitting with heading detection
- Add enhanced status dialog with repository info, version, and save filename
- Include git commit information and modification status
- Provide actual save filename preview instead of source filename
- Maintain proper section positioning and global reset functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-26 07:51:43 +01:00
parent 5337b26d5e
commit 6447c617fd
3 changed files with 1441 additions and 8 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -101,7 +101,7 @@ def detect_execution_mode():
def should_use_associated_files():
"""Determine if commands should use associated files behavior."""
return detect_execution_mode() == 'interactive'
from .document_manager import DocumentManager
# DocumentManager removed - using CleanDocumentManager directly in commands
from .serializer import ASTSerializer
from .cache_service import CacheDirectoryService
from .ast_service import ASTService

View File

@@ -16,7 +16,7 @@ from typing import Dict, Any
from markitect.plugins.base import CommandPlugin, PluginMetadata, PluginType
from markitect.plugins.decorators import register_plugin
from markitect.document_manager import DocumentManager
# DocumentManager removed - using CleanDocumentManager directly
from markitect.serializer import ASTSerializer
@@ -1659,7 +1659,7 @@ def md_list_command(ctx, output_format, names_only):
@click.option('--css', type=click.Path(),
help='Custom CSS file to include')
@click.option('--edit', is_flag=True,
help='Open in live edit mode with preview')
help='Open in interactive edit mode with stable section editing')
@click.option('--editor-theme', default='github',
type=click.Choice(['github', 'monokai', 'tomorrow', 'dark']),
help='Editor theme for live edit mode (default: github)')
@@ -1704,17 +1704,20 @@ def md_render_command(ctx, input_file, output, template, css, edit, editor_theme
ensure_publication_directory(pub_dir)
output_path = pub_dir / get_output_filename(input_path)
# Initialize document manager
doc_manager = DocumentManager(config.get('db_manager'))
# Initialize clean document manager
from markitect.clean_document_manager import CleanDocumentManager
doc_manager = CleanDocumentManager(config.get('db_manager'))
# Render the file
if edit:
# Live edit mode - generate HTML with editing capabilities
# Edit mode - generate HTML with editing capabilities
result = doc_manager.render_file(input_file, str(output_path),
template=template, css=css,
edit_mode=True, editor_theme=editor_theme,
edit_mode=True,
editor_theme=editor_theme,
keyboard_shortcuts=keyboard_shortcuts)
click.echo(f"✓ Rendered with editing capabilities to: {output_path}")
click.echo(f"✓ Rendered with interactive editing capabilities to: {output_path}")
if config.get('verbose', False):
click.echo(f"Editor theme: {editor_theme}")