Skip to content

Extract services from SharedAddressData#59

Merged
ssweber merged 13 commits intomainfrom
dev
Jan 18, 2026
Merged

Extract services from SharedAddressData#59
ssweber merged 13 commits intomainfrom
dev

Conversation

@ssweber
Copy link
Owner

@ssweber ssweber commented Jan 18, 2026

Changes

Extractions:

  • FileMonitor — File modification detection now in dedicated class
  • NicknameIndexService — O(1) nickname lookups extracted to service

Consolidation:

  • Moved INTERLEAVED_TYPE_PAIRS to constants.py as single source of truth
  • Multi-row block logic moved from blocktag.py → block_service.py
  • blocktag.py now handles single-comment parsing only

Feature:

  • Preserve original CDV header when saving dataview files

Impact

  • shared_data.py: 1050 → 953 lines
  • blocktag.py: 459 → 273 lines
  • Added ~250 lines across new focused services
  • Full test coverage for extracted services

ssweber and others added 13 commits January 16, 2026 21:18
Move nickname reverse index logic into dedicated service class for better
separation of concerns. SharedAddressData now delegates to the service
via thin wrapper methods.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Store and restore the original header line from CDV files instead of
reconstructing it. This ensures any metadata in the header is preserved
through load/save cycles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move file monitoring logic into dedicated FileMonitor class for better
separation of concerns. SharedAddressData now owns a FileMonitor instance
and delegates via thin wrapper methods.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move file monitoring logic into dedicated FileMonitor class for better
separation of concerns. SharedAddressData now owns a FileMonitor instance
and delegates via thin wrapper methods.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Step 3a: Consolidated paired type constants to models/constants.py
- Added INTERLEAVED_TYPE_PAIRS and INTERLEAVED_PAIRS as canonical sources
- Deleted PAIRED_BLOCK_TYPES from blocktag.py
- Updated dependency_service.py and dataview_editor/window.py to import from constants

Step 3b: Moved multi-row block logic from blocktag.py to block_service.py
- find_paired_tag_index() - Find matching open/close tag
- find_block_range_indices() - Get (start, end) range
- compute_all_block_ranges() - Compute all block ranges
- validate_block_span() - Validate block doesn't cross memory types
- blocktag.py now contains only single-comment parsing operations

Step 3c: Deleted duplicate find_paired_row implementations
- Removed unused BlockService.find_interleaved_pair_idx()
- Kept RowDependencyService.find_paired_row() (efficient addr_key lookup)
- Kept view_builder.find_paired_row() (already uses constants)

Step 3d: Renamed for clarity
- auto_update_paired_tag() -> auto_update_matching_block_tag()
- Clarifies it handles open/close tag pairing, not T/TD type pairing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verify that CDV headers with column widths (e.g., 0,0,0,559,653,...)
are preserved correctly during save/load round-trips.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ssweber ssweber merged commit 567ed1b into main Jan 18, 2026
3 checks passed
@ssweber ssweber deleted the dev branch January 18, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant