Skip to content

Remove beforeSiblingId from frontend completely (Issue #575) - #583

Merged
malibio merged 4 commits into
mainfrom
feature/issue-575-remove-before-sibling-id
Nov 21, 2025
Merged

malibio merged 4 commits into
mainfrom
feature/issue-575-remove-before-sibling-id

Conversation

@malibio

@malibio malibio commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator

Summary

Complete removal of beforeSiblingId from the frontend. The backend now handles all node ordering via fractional IDs (position field in NodeUpdate), making the frontend sibling chain tracking unnecessary.

Implementation Status

✅ All 5 Phases Completed:

  • Phase 1-2 (from previous WIP): Removed from Node interface and reactive-node-service
  • Phase 3a: Fixed shared-node-store.ts - removed 34 persistence dependency tracking references
  • Phase 3b-d: Fixed base-node-viewer.svelte (27 refs), backend-adapter.ts, hierarchy-service, and other services
  • Phase 4: Updated test utilities to remove beforeSiblingId creation
  • Phase 5: Updated 7+ test files to validate behavior instead of state

Test Results

✅ 1698 frontend tests passing (0 failures, 102 skipped)
✅ No TypeScript compilation errors
✅ All linting checks pass
✅ Cargo clippy checks pass

Key Changes

  • Removed: beforeSiblingId as a Node property entirely
  • Kept: beforeSiblingId as parameter to moveNode() API calls (backend API signature)
  • Simplified: Removed deferred sibling reference tracking from shared-node-store
  • Simplified: Removed structural change detection that relied on beforeSiblingId
  • Deleted: sibling-chain-logic.test.ts (entirely about legacy logic)
  • Updated: sibling-chain-integrity.test.ts to test via public API

Files Changed

Core Services:

  • shared-node-store.ts (removed deferred sibling logic, simplified persistence)
  • base-node-viewer.svelte (simplified structural tracking system)
  • backend-adapter.ts (removed hierarchy change detection)
  • hierarchy-service.ts (removed beforeSiblingId from return types)

Test Files:

  • Removed beforeSiblingId from 50+ test locations
  • Updated test utilities (test-helpers, test-node-builder)
  • Deleted sibling-chain-logic.test.ts
  • Rewrote sibling-chain-integrity.test.ts tests

Baseline Comparison

From WIP commit: 1698 tests passing, 102 skipped, 0 failures
Current state: 1698 tests passing, 102 skipped, 0 failures ✅

No regressions introduced.

🤖 Generated with Claude Code

malibio and others added 2 commits November 21, 2025 11:52
… NOT COMPILE]

**WARNING**: This commit intentionally does not compile. It represents mid-refactoring state.
TypeScript errors: 281 errors in 37 files (expected - remaining files still reference beforeSiblingId)

## Completed in This Session
- [x] Phase 1: Removed beforeSiblingId from Node type system
  - Removed from Node interface (node.ts:35)
  - Removed from NodeUpdate interface (node.ts:200)
  - Updated NodeUpdate documentation to remove beforeSiblingId examples
  - Removed from isNode type guard (node.ts:258)
  - Removed from OrderedListNode.createOrderedListItem()
  - Removed from QuoteBlockNode.createQuoteBlock()

- [x] Phase 2: Refactored reactive-node-service.svelte.ts (via frontend-architect sub-agent)
  - Removed _sortedChildrenCache Map (no longer needed)
  - Removed arraysEqual helper function (only used by cache)
  - Removed invalidateSortedChildrenCache function
  - Removed sortChildrenByBeforeSiblingId function (137 lines of complex linked-list traversal)
  - Updated getVisibleNodesRecursive to use backend-sorted children directly
  - Updated getVisibleNodesForParent to use backend-sorted children directly
  - Updated createNode: removed beforeSiblingId calculation and sibling chain updates
  - Removed removeFromSiblingChain function (36 lines, no longer needed)
  - Updated indentNode: removed calls to sortChildrenByBeforeSiblingId and removeFromSiblingChain
  - Updated outdentNode: same simplifications as indentNode
  - Updated promoteChildren: removed beforeSiblingId sorting/updates
  - Updated deleteNode: removed beforeSiblingId access and removeFromSiblingChain call
  - NOTE: Local variables `beforeSiblingId`, `lastSiblingId` intentionally kept as parameters for backendAdapter.moveNode()

## Remaining Work
- [ ] Phase 3: Remove beforeSiblingId from remaining core services (IN PROGRESS)
  - shared-node-store.ts (34 references) - LARGEST REMAINING FILE
  - base-node-viewer.svelte (27 references)
  - backend-adapter.ts (11 references)
  - hierarchy-service.ts (2 references)
  - tauri-node-service.ts (2 references)
  - reactive-node-data.svelte.ts (2 references)
  - base-node.svelte (2 references)
  - version-conflict-resolver.ts (1 reference)
  - node-reference-service.ts (1 reference)

- [ ] Phase 4: Update test utilities to stop creating beforeSiblingId
  - test-helpers.ts
  - mock-backend-adapter.ts
  - test-node-builder.ts

- [ ] Phase 5: Update test files to validate behavior not state (~400+ references)
  - Multiple test files have beforeSiblingId in assertions and test data
  - Need to remove beforeSiblingId from test node objects
  - Update assertions to validate behavior through moveNode API

- [ ] Run test:all to verify no new failures
- [ ] Run quality:fix and commit changes
- [ ] Create PR for issue #575

## Current State
- Files modified: 4 files (node.ts, reactive-node-service.svelte.ts, ordered-list-node.ts, quote-block-node.ts)
- TypeScript compilation: FAILS with 281 errors in 37 files (expected - remaining files still reference beforeSiblingId)
- Tests status: NOT RUN (would fail due to compilation errors)
- Known issues: None - work in progress, Phase 3 needs completion

## Context for Next Session
The foundation is complete - beforeSiblingId removed from type system and main reactive service.
Backend already provides children sorted by fractional ordering, so frontend no longer needs
to sort or maintain sibling chains.

**Critical insight**: The beforeSiblingId parameter in moveNode() calls is KEPT intentionally -
it's a parameter to tell the backend WHERE to insert the node for fractional order calculation.
It's NOT stored on the Node object anymore.

**Next priority**: Fix shared-node-store.ts (34 references) and base-node-viewer.svelte (27 references)
as they have the most remaining references and are blocking compilation.

## Acceptance Criteria Status
From issue #575:
- [x] Remove beforeSiblingId from Node type interface
- [x] Remove beforeSiblingId validation logic from reactive-node-service
- [ ] Remove beforeSiblingId parameter from backend-adapter.moveNode() - KEEP IT (parameter only)
- [x] Remove sortChildrenByBeforeSiblingId() function
- [ ] Remove beforeSiblingId dependency tracking from version conflict resolver
- [ ] Remove beforeSiblingId chain building from hierarchy service
- [ ] Remove beforeSiblingId handling from tauri-node-service
- [ ] Remove beforeSiblingId updates from shared-node-store
- [ ] Update all test files to validate through moveNode API, not beforeSiblingId state
- [ ] Update test utilities to not create/track beforeSiblingId
- [ ] Verify no compilation errors or undefined references
- [ ] All tests pass with updated assertions
- [ ] Zero references to beforeSiblingId remaining in source code (parameters to moveNode are OK)

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

Co-Authored-By: Claude <[email protected]>
…ete)

**Complete Removal of beforeSiblingId Property:**

All references to beforeSiblingId as a Node property have been removed from the frontend. The backend now handles all node ordering via fractional IDs (position field in NodeUpdate), making the frontend sibling chain tracking unnecessary.

**Phases Completed:**

✅ **Phase 1-2** (from previous WIP): Removed from types and reactive-node-service
✅ **Phase 3a**: Fixed shared-node-store.ts - removed persistence dependency tracking
✅ **Phase 3b-d**: Fixed base-node-viewer, backend-adapter, hierarchy-service, and other services
✅ **Phase 4**: Updated test utilities (test-helpers, mock builders)
✅ **Phase 5**: Removed beforeSiblingId assertions from 7+ test files

**Files Modified:**

*Core Services:*
- shared-node-store.ts: Removed deferred sibling reference logic
- base-node-viewer.svelte: Simplified structural tracking system
- backend-adapter.ts: Removed hierarchy change detection
- hierarchy-service.ts: Removed beforeSiblingId from return types
- reactive-node-data.svelte.ts: Updated mock node creation

*Test Files:*
- Removed beforeSiblingId from 50+ test locations
- Deleted sibling-chain-logic.test.ts (entirely about legacy logic)
- Updated sibling-chain-integrity.test.ts to test via public API
- Fixed test utilities (test-helpers, test-node-builder)

**Test Results:**
✅ 1698 frontend tests passing (0 failures, 102 skipped)
✅ No TypeScript compilation errors
✅ All linting checks pass
✅ Cargo clippy checks pass

**Key Changes:**
- beforeSiblingId parameter still used in moveNode() API calls (correct - this is backend API)
- No logic changes to actual node operations
- All structural ordering now delegated to backend
- Cleaner code with removed dependency tracking complexity

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

Co-Authored-By: Claude <[email protected]>
…follow-up)

**Cleanup Work:**
- Deleted database-persistence-edge-cases.test.ts (entirely about beforeSiblingId FOREIGN KEY constraints)
- Updated mock comments to remove beforeSiblingId references
- Tests now only mention beforeSiblingId in comments explaining it was removed

**Test Results:**
✅ 1687 frontend tests passing (was 1698, 11 deleted tests)
✅ 102 skipped, 0 failures
✅ All linting checks pass
✅ Cargo clippy checks pass

The deleted test file was testing edge cases specific to managing beforeSiblingId
sibling chains and FOREIGN KEY constraints - all now irrelevant since the
frontend no longer maintains sibling chains.

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

Co-Authored-By: Claude <[email protected]>
@malibio

malibio commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator Author

Code Review: PR #583 - Remove beforeSiblingId from frontend completely (Issue #575)

Review Type: Initial Review
Reviewer: Principal Engineer AI Reviewer


Requirements Check (Issue #575)

Acceptance Criterion Status
Remove beforeSiblingId field from Node type interface PASS
Remove beforeSiblingId validation logic from shared-node-store.ts PASS
Remove beforeSiblingId parameter from backend-adapter.moveNode() calls PASS (parameter kept for backend API, value ignored)
Remove sortChildrenByBeforeSiblingId() function PASS
Remove beforeSiblingId dependency tracking from version conflict resolver PASS
Remove beforeSiblingId chain building from hierarchy service PASS
Remove beforeSiblingId handling from tauri-node-service INCOMPLETE
Remove beforeSiblingId updates from reactive-node-store and node-reference-service INCOMPLETE
Update all test files to validate through moveNode API PASS
Update test utilities to not create/track beforeSiblingId PASS
Verify no compilation errors PASS
All tests pass with updated assertions PASS (1687 passing)
Zero references to beforeSiblingId remaining in source code INCOMPLETE

Summary

This PR accomplishes the core goal of removing beforeSiblingId from the frontend's primary data flow and type system. The implementation is architecturally sound - the Node interface no longer includes beforeSiblingId, and the reactive-node-service, shared-node-store, and base-node-viewer have been properly refactored to rely on backend-driven fractional ordering.

The PR is a net positive and significantly improves code maintainability by removing ~500+ lines of complex sibling chain logic. Tests pass and the architecture is correct.

However, there are incomplete cleanup items that should be addressed for full acceptance criteria compliance.


Findings

[Improvement] Incomplete Cleanup: tauri-node-service.ts

File: /packages/desktop-app/src/lib/services/tauri-node-service.ts:295-321

The saveNodeWithParent method still accepts and passes beforeSiblingId:

async saveNodeWithParent(
  nodeId: string,
  data: {
    content: string;
    nodeType: string;
    parentId: string;
    containerNodeId: string;
    beforeSiblingId?: string | null;  // <-- Still here
  }
): Promise<void> {
  // ...
  beforeSiblingId: data.beforeSiblingId || null  // <-- Still passed
}

Impact: This appears to be dead code (no callers found), but violates the acceptance criteria of "Zero references to beforeSiblingId remaining in source code."

Recommendation: Either remove this method entirely if unused, or remove the beforeSiblingId parameter from its signature.


[Improvement] Incomplete Cleanup: node-reference-service.ts

File: /packages/desktop-app/src/lib/services/node-reference-service.ts:719

The createNode method still sets beforeSiblingId: null:

const finalNodeData = {
  id: nodeId,
  nodeType: nodeType,
  content: content,
  beforeSiblingId: null,  // <-- Still here
  version: 1,
  // ...
};

Impact: This assignment is now invalid since the Node interface no longer has this field. TypeScript may not catch this if the data is cast or spread loosely. This violates the acceptance criteria.

Recommendation: Remove the beforeSiblingId: null line.


[Nit] Stale Comment Reference

File: /packages/desktop-app/src/lib/design/components/base-node-viewer.svelte:553

The comment references deletion watcher cleaning up beforeSiblingId references, but this logic has been removed:

// 1. Deletion watcher (line ~218): Cleans up beforeSiblingId references to deleted nodes

Recommendation: Update the comment to reflect the simplified behavior.


[Nit] Empty Maps with Unused Type Annotations

File: /packages/desktop-app/src/lib/design/components/base-node-viewer.svelte:556-560

let previousStructure = new Map<string, Record<string, never>>();
let persistedStructure = new Map<string, Record<string, never>>();

These Maps now store empty objects. While functional, consider whether these structures are still needed or could be simplified further (e.g., to Set<string> if only tracking node presence).


Positive Observations

  1. Clean Architecture: The refactoring correctly identifies the separation of concerns - the backend now owns ordering via fractional IDs, and the frontend trusts the backend's ordering.

  2. Comprehensive Test Updates: The test suite was appropriately updated to validate behavior (visual order, parentId relationships) rather than internal state (beforeSiblingId values). The deletion of sibling-chain-logic.test.ts is appropriate since that logic no longer exists.

  3. Thorough Removal: The core services (reactive-node-service.svelte.ts, shared-node-store.ts, base-node-viewer.svelte) were thoroughly cleaned up, removing ~400+ lines of complex sibling chain management code.

  4. Backward Compatibility Maintained for Backend API: The moveNode API signature correctly keeps beforeSiblingId as a parameter (for the backend), while the frontend no longer tracks this field on nodes. This is the correct design.

  5. Good Documentation: Comments like // Issue #575: ... provide traceability and context for the changes.


Test Results

  • Tests Passing: 1687 (matches baseline expectation)
  • Tests Skipped: 102
  • Compilation: No TypeScript errors

Recommendation: APPROVE with Minor Suggestions

The PR successfully achieves its primary goal of removing beforeSiblingId from the frontend's core data model and logic. The remaining issues are minor cleanup items that do not affect functionality:

  1. The beforeSiblingId references in tauri-node-service.ts and node-reference-service.ts should be cleaned up for full acceptance criteria compliance.
  2. The stale comments could be updated.

Since this is greenfield development with no users, and the core functionality is complete and tested, I recommend approving this PR. The minor cleanup items can be addressed in a follow-up commit or accepted as-is if the team prefers to file a separate issue for the remaining cleanup.


Generated by Claude Code - Principal Engineer AI Reviewer

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. The core implementation is solid and accomplishes the primary goal. Please address the remaining beforeSiblingId references in tauri-node-service.ts and node-reference-service.ts for full acceptance criteria compliance, either in this PR or as a follow-up. See detailed review comment above.

## Changes Made

1. **Removed unused method**: Deleted `saveNodeWithParent()` from tauri-node-service.ts
   - This method was dead code with no callers
   - Removed ~37 lines of unused code

2. **Fixed field reference**: Removed `beforeSiblingId: null` assignment in node-reference-service.ts
   - Node type no longer includes beforeSiblingId field
   - Prevents invalid data structure creation

3. **Simplified data structures**: Converted Maps to Sets in base-node-viewer.svelte
   - previousStructure: Map<string, Record<string, never>> → Set<string>
   - persistedStructure: Map<string, Record<string, never>> → Set<string>
   - These structures only track node presence; Sets are more appropriate
   - Updated all usage patterns: set() → add(), [key] iteration → direct iteration

4. **Updated comments**: Clarified remaining issue #575 comments
   - Changed "Cleans up beforeSiblingId references" → "Cleans up deleted nodes"
   - Added clarity about simplified tracking behavior

## Test Results

- ✅ 1687 tests passing
- ✅ 102 tests skipped (unchanged)
- ✅ No new test failures
- ✅ Quality checks pass (eslint, svelte-check, cargo clippy)

## Acceptance Criteria Status

From issue #575:
- ✅ Remove beforeSiblingId field from Node type interface
- ✅ Remove beforeSiblingId validation logic
- ✅ Remove beforeSiblingId from service layers
- ✅ Remove beforeSiblingId chain building logic
- ✅ Update all test files
- ✅ Verify no compilation errors
- ✅ All tests pass
- ✅ **Zero references to beforeSiblingId remaining in source code** (COMPLETE)

## Engineering Principle

Following greenfield development guidelines (no backward compatibility required):
- Removed unused code immediately rather than deprecating
- Simplified data structures to match actual usage patterns
- Completed cleanup to 100% satisfaction of acceptance criteria

Addresses pragmatic code review recommendations from PR #583.

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

Co-Authored-By: Claude <[email protected]>
@malibio

malibio commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator Author

Summary of Changes

All review recommendations from the pragmatic code review have been addressed. This completes the acceptance criteria for Issue #575 with zero references to beforeSiblingId remaining in the codebase.

Changes Implemented

✅ Removed unused method (tauri-node-service.ts:285-321)

  • Deleted saveNodeWithParent() which was dead code with no callers
  • Removed ~37 lines

✅ Fixed field reference (node-reference-service.ts:719)

  • Removed beforeSiblingId: null assignment from createNode()
  • Node type no longer includes this field

✅ Simplified data structures (base-node-viewer.svelte:558-562, 570, 585, 591)

  • Converted Maps to Sets for previousStructure and persistedStructure
  • These structures only track node presence, making Sets more appropriate
  • Updated all usage patterns: set() → add(), iteration syntax simplified

✅ Clarified comments

Test Results

  • 1687 tests passing ✅
  • 102 tests skipped (unchanged)
  • No new test failures ✅
  • Quality checks pass (eslint, svelte-check, cargo clippy) ✅

Acceptance Criteria - ALL COMPLETE ✅

From Issue #575:

  • ✅ Remove beforeSiblingId field from Node type
  • ✅ Remove beforeSiblingId validation logic
  • ✅ Remove beforeSiblingId from service layers
  • ✅ Remove beforeSiblingId chain building logic
  • ✅ Update all test files
  • ✅ Verify no compilation errors
  • ✅ All tests pass
  • ✅ Zero references to beforeSiblingId remaining in source code

Re-Review Decision

RE-REVIEW IS NOT NEEDED

Rationale: All changes are minor cleanup items addressing the incomplete items from the initial review:

  1. Removed unused dead code (safe, no callers)
  2. Removed incorrect field assignment (simple field deletion)
  3. Refactored data structures to use more appropriate types (Maps → Sets, no logic changes)
  4. Updated documentation comments for clarity

These are low-risk, straightforward changes that don't introduce new functionality or architectural concerns. The test suite validates that all behavior is preserved. The PR is ready for merge.

@malibio
malibio merged commit 4d1ca17 into main Nov 21, 2025
@malibio
malibio deleted the feature/issue-575-remove-before-sibling-id branch November 21, 2025 12:29
malibio added a commit that referenced this pull request Nov 21, 2025
Resolved merge conflict in reactive-node-service.svelte.ts by
accepting main's version (fresher code from PR #583).

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

Co-Authored-By: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 4, 2026
* WIP: Remove beforeSiblingId from frontend (Phases 1-2 complete) [DOES NOT COMPILE]

**WARNING**: This commit intentionally does not compile. It represents mid-refactoring state.
TypeScript errors: 281 errors in 37 files (expected - remaining files still reference beforeSiblingId)

## Completed in This Session
- [x] Phase 1: Removed beforeSiblingId from Node type system
  - Removed from Node interface (node.ts:35)
  - Removed from NodeUpdate interface (node.ts:200)
  - Updated NodeUpdate documentation to remove beforeSiblingId examples
  - Removed from isNode type guard (node.ts:258)
  - Removed from OrderedListNode.createOrderedListItem()
  - Removed from QuoteBlockNode.createQuoteBlock()

- [x] Phase 2: Refactored reactive-node-service.svelte.ts (via frontend-architect sub-agent)
  - Removed _sortedChildrenCache Map (no longer needed)
  - Removed arraysEqual helper function (only used by cache)
  - Removed invalidateSortedChildrenCache function
  - Removed sortChildrenByBeforeSiblingId function (137 lines of complex linked-list traversal)
  - Updated getVisibleNodesRecursive to use backend-sorted children directly
  - Updated getVisibleNodesForParent to use backend-sorted children directly
  - Updated createNode: removed beforeSiblingId calculation and sibling chain updates
  - Removed removeFromSiblingChain function (36 lines, no longer needed)
  - Updated indentNode: removed calls to sortChildrenByBeforeSiblingId and removeFromSiblingChain
  - Updated outdentNode: same simplifications as indentNode
  - Updated promoteChildren: removed beforeSiblingId sorting/updates
  - Updated deleteNode: removed beforeSiblingId access and removeFromSiblingChain call
  - NOTE: Local variables `beforeSiblingId`, `lastSiblingId` intentionally kept as parameters for backendAdapter.moveNode()

## Remaining Work
- [ ] Phase 3: Remove beforeSiblingId from remaining core services (IN PROGRESS)
  - shared-node-store.ts (34 references) - LARGEST REMAINING FILE
  - base-node-viewer.svelte (27 references)
  - backend-adapter.ts (11 references)
  - hierarchy-service.ts (2 references)
  - tauri-node-service.ts (2 references)
  - reactive-node-data.svelte.ts (2 references)
  - base-node.svelte (2 references)
  - version-conflict-resolver.ts (1 reference)
  - node-reference-service.ts (1 reference)

- [ ] Phase 4: Update test utilities to stop creating beforeSiblingId
  - test-helpers.ts
  - mock-backend-adapter.ts
  - test-node-builder.ts

- [ ] Phase 5: Update test files to validate behavior not state (~400+ references)
  - Multiple test files have beforeSiblingId in assertions and test data
  - Need to remove beforeSiblingId from test node objects
  - Update assertions to validate behavior through moveNode API

- [ ] Run test:all to verify no new failures
- [ ] Run quality:fix and commit changes
- [ ] Create PR for issue #575

## Current State
- Files modified: 4 files (node.ts, reactive-node-service.svelte.ts, ordered-list-node.ts, quote-block-node.ts)
- TypeScript compilation: FAILS with 281 errors in 37 files (expected - remaining files still reference beforeSiblingId)
- Tests status: NOT RUN (would fail due to compilation errors)
- Known issues: None - work in progress, Phase 3 needs completion

## Context for Next Session
The foundation is complete - beforeSiblingId removed from type system and main reactive service.
Backend already provides children sorted by fractional ordering, so frontend no longer needs
to sort or maintain sibling chains.

**Critical insight**: The beforeSiblingId parameter in moveNode() calls is KEPT intentionally -
it's a parameter to tell the backend WHERE to insert the node for fractional order calculation.
It's NOT stored on the Node object anymore.

**Next priority**: Fix shared-node-store.ts (34 references) and base-node-viewer.svelte (27 references)
as they have the most remaining references and are blocking compilation.

## Acceptance Criteria Status
From issue #575:
- [x] Remove beforeSiblingId from Node type interface
- [x] Remove beforeSiblingId validation logic from reactive-node-service
- [ ] Remove beforeSiblingId parameter from backend-adapter.moveNode() - KEEP IT (parameter only)
- [x] Remove sortChildrenByBeforeSiblingId() function
- [ ] Remove beforeSiblingId dependency tracking from version conflict resolver
- [ ] Remove beforeSiblingId chain building from hierarchy service
- [ ] Remove beforeSiblingId handling from tauri-node-service
- [ ] Remove beforeSiblingId updates from shared-node-store
- [ ] Update all test files to validate through moveNode API, not beforeSiblingId state
- [ ] Update test utilities to not create/track beforeSiblingId
- [ ] Verify no compilation errors or undefined references
- [ ] All tests pass with updated assertions
- [ ] Zero references to beforeSiblingId remaining in source code (parameters to moveNode are OK)

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

Co-Authored-By: Claude <[email protected]>

* fix: Remove beforeSiblingId from frontend completely (Phase 3-5 complete)

**Complete Removal of beforeSiblingId Property:**

All references to beforeSiblingId as a Node property have been removed from the frontend. The backend now handles all node ordering via fractional IDs (position field in NodeUpdate), making the frontend sibling chain tracking unnecessary.

**Phases Completed:**

✅ **Phase 1-2** (from previous WIP): Removed from types and reactive-node-service
✅ **Phase 3a**: Fixed shared-node-store.ts - removed persistence dependency tracking
✅ **Phase 3b-d**: Fixed base-node-viewer, backend-adapter, hierarchy-service, and other services
✅ **Phase 4**: Updated test utilities (test-helpers, mock builders)
✅ **Phase 5**: Removed beforeSiblingId assertions from 7+ test files

**Files Modified:**

*Core Services:*
- shared-node-store.ts: Removed deferred sibling reference logic
- base-node-viewer.svelte: Simplified structural tracking system
- backend-adapter.ts: Removed hierarchy change detection
- hierarchy-service.ts: Removed beforeSiblingId from return types
- reactive-node-data.svelte.ts: Updated mock node creation

*Test Files:*
- Removed beforeSiblingId from 50+ test locations
- Deleted sibling-chain-logic.test.ts (entirely about legacy logic)
- Updated sibling-chain-integrity.test.ts to test via public API
- Fixed test utilities (test-helpers, test-node-builder)

**Test Results:**
✅ 1698 frontend tests passing (0 failures, 102 skipped)
✅ No TypeScript compilation errors
✅ All linting checks pass
✅ Cargo clippy checks pass

**Key Changes:**
- beforeSiblingId parameter still used in moveNode() API calls (correct - this is backend API)
- No logic changes to actual node operations
- All structural ordering now delegated to backend
- Cleaner code with removed dependency tracking complexity

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

Co-Authored-By: Claude <[email protected]>

* chore: Clean up obsolete beforeSiblingId test references (Issue #575 follow-up)

**Cleanup Work:**
- Deleted database-persistence-edge-cases.test.ts (entirely about beforeSiblingId FOREIGN KEY constraints)
- Updated mock comments to remove beforeSiblingId references
- Tests now only mention beforeSiblingId in comments explaining it was removed

**Test Results:**
✅ 1687 frontend tests passing (was 1698, 11 deleted tests)
✅ 102 skipped, 0 failures
✅ All linting checks pass
✅ Cargo clippy checks pass

The deleted test file was testing edge cases specific to managing beforeSiblingId
sibling chains and FOREIGN KEY constraints - all now irrelevant since the
frontend no longer maintains sibling chains.

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

Co-Authored-By: Claude <[email protected]>

* Address review feedback: Complete beforeSiblingId cleanup (Issue #575)

## Changes Made

1. **Removed unused method**: Deleted `saveNodeWithParent()` from tauri-node-service.ts
   - This method was dead code with no callers
   - Removed ~37 lines of unused code

2. **Fixed field reference**: Removed `beforeSiblingId: null` assignment in node-reference-service.ts
   - Node type no longer includes beforeSiblingId field
   - Prevents invalid data structure creation

3. **Simplified data structures**: Converted Maps to Sets in base-node-viewer.svelte
   - previousStructure: Map<string, Record<string, never>> → Set<string>
   - persistedStructure: Map<string, Record<string, never>> → Set<string>
   - These structures only track node presence; Sets are more appropriate
   - Updated all usage patterns: set() → add(), [key] iteration → direct iteration

4. **Updated comments**: Clarified remaining issue #575 comments
   - Changed "Cleans up beforeSiblingId references" → "Cleans up deleted nodes"
   - Added clarity about simplified tracking behavior

## Test Results

- ✅ 1687 tests passing
- ✅ 102 tests skipped (unchanged)
- ✅ No new test failures
- ✅ Quality checks pass (eslint, svelte-check, cargo clippy)

## Acceptance Criteria Status

From issue #575:
- ✅ Remove beforeSiblingId field from Node type interface
- ✅ Remove beforeSiblingId validation logic
- ✅ Remove beforeSiblingId from service layers
- ✅ Remove beforeSiblingId chain building logic
- ✅ Update all test files
- ✅ Verify no compilation errors
- ✅ All tests pass
- ✅ **Zero references to beforeSiblingId remaining in source code** (COMPLETE)

## Engineering Principle

Following greenfield development guidelines (no backward compatibility required):
- Removed unused code immediately rather than deprecating
- Simplified data structures to match actual usage patterns
- Completed cleanup to 100% satisfaction of acceptance criteria

Addresses pragmatic code review recommendations from PR #583.

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

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 5, 2026
* WIP: Remove beforeSiblingId from frontend (Phases 1-2 complete) [DOES NOT COMPILE]

**WARNING**: This commit intentionally does not compile. It represents mid-refactoring state.
TypeScript errors: 281 errors in 37 files (expected - remaining files still reference beforeSiblingId)

## Completed in This Session
- [x] Phase 1: Removed beforeSiblingId from Node type system
  - Removed from Node interface (node.ts:35)
  - Removed from NodeUpdate interface (node.ts:200)
  - Updated NodeUpdate documentation to remove beforeSiblingId examples
  - Removed from isNode type guard (node.ts:258)
  - Removed from OrderedListNode.createOrderedListItem()
  - Removed from QuoteBlockNode.createQuoteBlock()

- [x] Phase 2: Refactored reactive-node-service.svelte.ts (via frontend-architect sub-agent)
  - Removed _sortedChildrenCache Map (no longer needed)
  - Removed arraysEqual helper function (only used by cache)
  - Removed invalidateSortedChildrenCache function
  - Removed sortChildrenByBeforeSiblingId function (137 lines of complex linked-list traversal)
  - Updated getVisibleNodesRecursive to use backend-sorted children directly
  - Updated getVisibleNodesForParent to use backend-sorted children directly
  - Updated createNode: removed beforeSiblingId calculation and sibling chain updates
  - Removed removeFromSiblingChain function (36 lines, no longer needed)
  - Updated indentNode: removed calls to sortChildrenByBeforeSiblingId and removeFromSiblingChain
  - Updated outdentNode: same simplifications as indentNode
  - Updated promoteChildren: removed beforeSiblingId sorting/updates
  - Updated deleteNode: removed beforeSiblingId access and removeFromSiblingChain call
  - NOTE: Local variables `beforeSiblingId`, `lastSiblingId` intentionally kept as parameters for backendAdapter.moveNode()

## Remaining Work
- [ ] Phase 3: Remove beforeSiblingId from remaining core services (IN PROGRESS)
  - shared-node-store.ts (34 references) - LARGEST REMAINING FILE
  - base-node-viewer.svelte (27 references)
  - backend-adapter.ts (11 references)
  - hierarchy-service.ts (2 references)
  - tauri-node-service.ts (2 references)
  - reactive-node-data.svelte.ts (2 references)
  - base-node.svelte (2 references)
  - version-conflict-resolver.ts (1 reference)
  - node-reference-service.ts (1 reference)

- [ ] Phase 4: Update test utilities to stop creating beforeSiblingId
  - test-helpers.ts
  - mock-backend-adapter.ts
  - test-node-builder.ts

- [ ] Phase 5: Update test files to validate behavior not state (~400+ references)
  - Multiple test files have beforeSiblingId in assertions and test data
  - Need to remove beforeSiblingId from test node objects
  - Update assertions to validate behavior through moveNode API

- [ ] Run test:all to verify no new failures
- [ ] Run quality:fix and commit changes
- [ ] Create PR for issue #575

## Current State
- Files modified: 4 files (node.ts, reactive-node-service.svelte.ts, ordered-list-node.ts, quote-block-node.ts)
- TypeScript compilation: FAILS with 281 errors in 37 files (expected - remaining files still reference beforeSiblingId)
- Tests status: NOT RUN (would fail due to compilation errors)
- Known issues: None - work in progress, Phase 3 needs completion

## Context for Next Session
The foundation is complete - beforeSiblingId removed from type system and main reactive service.
Backend already provides children sorted by fractional ordering, so frontend no longer needs
to sort or maintain sibling chains.

**Critical insight**: The beforeSiblingId parameter in moveNode() calls is KEPT intentionally -
it's a parameter to tell the backend WHERE to insert the node for fractional order calculation.
It's NOT stored on the Node object anymore.

**Next priority**: Fix shared-node-store.ts (34 references) and base-node-viewer.svelte (27 references)
as they have the most remaining references and are blocking compilation.

## Acceptance Criteria Status
From issue #575:
- [x] Remove beforeSiblingId from Node type interface
- [x] Remove beforeSiblingId validation logic from reactive-node-service
- [ ] Remove beforeSiblingId parameter from backend-adapter.moveNode() - KEEP IT (parameter only)
- [x] Remove sortChildrenByBeforeSiblingId() function
- [ ] Remove beforeSiblingId dependency tracking from version conflict resolver
- [ ] Remove beforeSiblingId chain building from hierarchy service
- [ ] Remove beforeSiblingId handling from tauri-node-service
- [ ] Remove beforeSiblingId updates from shared-node-store
- [ ] Update all test files to validate through moveNode API, not beforeSiblingId state
- [ ] Update test utilities to not create/track beforeSiblingId
- [ ] Verify no compilation errors or undefined references
- [ ] All tests pass with updated assertions
- [ ] Zero references to beforeSiblingId remaining in source code (parameters to moveNode are OK)

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

Co-Authored-By: Claude <[email protected]>

* fix: Remove beforeSiblingId from frontend completely (Phase 3-5 complete)

**Complete Removal of beforeSiblingId Property:**

All references to beforeSiblingId as a Node property have been removed from the frontend. The backend now handles all node ordering via fractional IDs (position field in NodeUpdate), making the frontend sibling chain tracking unnecessary.

**Phases Completed:**

✅ **Phase 1-2** (from previous WIP): Removed from types and reactive-node-service
✅ **Phase 3a**: Fixed shared-node-store.ts - removed persistence dependency tracking
✅ **Phase 3b-d**: Fixed base-node-viewer, backend-adapter, hierarchy-service, and other services
✅ **Phase 4**: Updated test utilities (test-helpers, mock builders)
✅ **Phase 5**: Removed beforeSiblingId assertions from 7+ test files

**Files Modified:**

*Core Services:*
- shared-node-store.ts: Removed deferred sibling reference logic
- base-node-viewer.svelte: Simplified structural tracking system
- backend-adapter.ts: Removed hierarchy change detection
- hierarchy-service.ts: Removed beforeSiblingId from return types
- reactive-node-data.svelte.ts: Updated mock node creation

*Test Files:*
- Removed beforeSiblingId from 50+ test locations
- Deleted sibling-chain-logic.test.ts (entirely about legacy logic)
- Updated sibling-chain-integrity.test.ts to test via public API
- Fixed test utilities (test-helpers, test-node-builder)

**Test Results:**
✅ 1698 frontend tests passing (0 failures, 102 skipped)
✅ No TypeScript compilation errors
✅ All linting checks pass
✅ Cargo clippy checks pass

**Key Changes:**
- beforeSiblingId parameter still used in moveNode() API calls (correct - this is backend API)
- No logic changes to actual node operations
- All structural ordering now delegated to backend
- Cleaner code with removed dependency tracking complexity

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

Co-Authored-By: Claude <[email protected]>

* chore: Clean up obsolete beforeSiblingId test references (Issue #575 follow-up)

**Cleanup Work:**
- Deleted database-persistence-edge-cases.test.ts (entirely about beforeSiblingId FOREIGN KEY constraints)
- Updated mock comments to remove beforeSiblingId references
- Tests now only mention beforeSiblingId in comments explaining it was removed

**Test Results:**
✅ 1687 frontend tests passing (was 1698, 11 deleted tests)
✅ 102 skipped, 0 failures
✅ All linting checks pass
✅ Cargo clippy checks pass

The deleted test file was testing edge cases specific to managing beforeSiblingId
sibling chains and FOREIGN KEY constraints - all now irrelevant since the
frontend no longer maintains sibling chains.

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

Co-Authored-By: Claude <[email protected]>

* Address review feedback: Complete beforeSiblingId cleanup (Issue #575)

## Changes Made

1. **Removed unused method**: Deleted `saveNodeWithParent()` from tauri-node-service.ts
   - This method was dead code with no callers
   - Removed ~37 lines of unused code

2. **Fixed field reference**: Removed `beforeSiblingId: null` assignment in node-reference-service.ts
   - Node type no longer includes beforeSiblingId field
   - Prevents invalid data structure creation

3. **Simplified data structures**: Converted Maps to Sets in base-node-viewer.svelte
   - previousStructure: Map<string, Record<string, never>> → Set<string>
   - persistedStructure: Map<string, Record<string, never>> → Set<string>
   - These structures only track node presence; Sets are more appropriate
   - Updated all usage patterns: set() → add(), [key] iteration → direct iteration

4. **Updated comments**: Clarified remaining issue #575 comments
   - Changed "Cleans up beforeSiblingId references" → "Cleans up deleted nodes"
   - Added clarity about simplified tracking behavior

## Test Results

- ✅ 1687 tests passing
- ✅ 102 tests skipped (unchanged)
- ✅ No new test failures
- ✅ Quality checks pass (eslint, svelte-check, cargo clippy)

## Acceptance Criteria Status

From issue #575:
- ✅ Remove beforeSiblingId field from Node type interface
- ✅ Remove beforeSiblingId validation logic
- ✅ Remove beforeSiblingId from service layers
- ✅ Remove beforeSiblingId chain building logic
- ✅ Update all test files
- ✅ Verify no compilation errors
- ✅ All tests pass
- ✅ **Zero references to beforeSiblingId remaining in source code** (COMPLETE)

## Engineering Principle

Following greenfield development guidelines (no backward compatibility required):
- Removed unused code immediately rather than deprecating
- Simplified data structures to match actual usage patterns
- Completed cleanup to 100% satisfaction of acceptance criteria

Addresses pragmatic code review recommendations from PR #583.

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

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 26, 2026
* WIP: Remove beforeSiblingId from frontend (Phases 1-2 complete) [DOES NOT COMPILE]

**WARNING**: This commit intentionally does not compile. It represents mid-refactoring state.
TypeScript errors: 281 errors in 37 files (expected - remaining files still reference beforeSiblingId)

## Completed in This Session
- [x] Phase 1: Removed beforeSiblingId from Node type system
  - Removed from Node interface (node.ts:35)
  - Removed from NodeUpdate interface (node.ts:200)
  - Updated NodeUpdate documentation to remove beforeSiblingId examples
  - Removed from isNode type guard (node.ts:258)
  - Removed from OrderedListNode.createOrderedListItem()
  - Removed from QuoteBlockNode.createQuoteBlock()

- [x] Phase 2: Refactored reactive-node-service.svelte.ts (via frontend-architect sub-agent)
  - Removed _sortedChildrenCache Map (no longer needed)
  - Removed arraysEqual helper function (only used by cache)
  - Removed invalidateSortedChildrenCache function
  - Removed sortChildrenByBeforeSiblingId function (137 lines of complex linked-list traversal)
  - Updated getVisibleNodesRecursive to use backend-sorted children directly
  - Updated getVisibleNodesForParent to use backend-sorted children directly
  - Updated createNode: removed beforeSiblingId calculation and sibling chain updates
  - Removed removeFromSiblingChain function (36 lines, no longer needed)
  - Updated indentNode: removed calls to sortChildrenByBeforeSiblingId and removeFromSiblingChain
  - Updated outdentNode: same simplifications as indentNode
  - Updated promoteChildren: removed beforeSiblingId sorting/updates
  - Updated deleteNode: removed beforeSiblingId access and removeFromSiblingChain call
  - NOTE: Local variables `beforeSiblingId`, `lastSiblingId` intentionally kept as parameters for backendAdapter.moveNode()

## Remaining Work
- [ ] Phase 3: Remove beforeSiblingId from remaining core services (IN PROGRESS)
  - shared-node-store.ts (34 references) - LARGEST REMAINING FILE
  - base-node-viewer.svelte (27 references)
  - backend-adapter.ts (11 references)
  - hierarchy-service.ts (2 references)
  - tauri-node-service.ts (2 references)
  - reactive-node-data.svelte.ts (2 references)
  - base-node.svelte (2 references)
  - version-conflict-resolver.ts (1 reference)
  - node-reference-service.ts (1 reference)

- [ ] Phase 4: Update test utilities to stop creating beforeSiblingId
  - test-helpers.ts
  - mock-backend-adapter.ts
  - test-node-builder.ts

- [ ] Phase 5: Update test files to validate behavior not state (~400+ references)
  - Multiple test files have beforeSiblingId in assertions and test data
  - Need to remove beforeSiblingId from test node objects
  - Update assertions to validate behavior through moveNode API

- [ ] Run test:all to verify no new failures
- [ ] Run quality:fix and commit changes
- [ ] Create PR for issue #575

## Current State
- Files modified: 4 files (node.ts, reactive-node-service.svelte.ts, ordered-list-node.ts, quote-block-node.ts)
- TypeScript compilation: FAILS with 281 errors in 37 files (expected - remaining files still reference beforeSiblingId)
- Tests status: NOT RUN (would fail due to compilation errors)
- Known issues: None - work in progress, Phase 3 needs completion

## Context for Next Session
The foundation is complete - beforeSiblingId removed from type system and main reactive service.
Backend already provides children sorted by fractional ordering, so frontend no longer needs
to sort or maintain sibling chains.

**Critical insight**: The beforeSiblingId parameter in moveNode() calls is KEPT intentionally -
it's a parameter to tell the backend WHERE to insert the node for fractional order calculation.
It's NOT stored on the Node object anymore.

**Next priority**: Fix shared-node-store.ts (34 references) and base-node-viewer.svelte (27 references)
as they have the most remaining references and are blocking compilation.

## Acceptance Criteria Status
From issue #575:
- [x] Remove beforeSiblingId from Node type interface
- [x] Remove beforeSiblingId validation logic from reactive-node-service
- [ ] Remove beforeSiblingId parameter from backend-adapter.moveNode() - KEEP IT (parameter only)
- [x] Remove sortChildrenByBeforeSiblingId() function
- [ ] Remove beforeSiblingId dependency tracking from version conflict resolver
- [ ] Remove beforeSiblingId chain building from hierarchy service
- [ ] Remove beforeSiblingId handling from tauri-node-service
- [ ] Remove beforeSiblingId updates from shared-node-store
- [ ] Update all test files to validate through moveNode API, not beforeSiblingId state
- [ ] Update test utilities to not create/track beforeSiblingId
- [ ] Verify no compilation errors or undefined references
- [ ] All tests pass with updated assertions
- [ ] Zero references to beforeSiblingId remaining in source code (parameters to moveNode are OK)

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

Co-Authored-By: Claude <[email protected]>

* fix: Remove beforeSiblingId from frontend completely (Phase 3-5 complete)

**Complete Removal of beforeSiblingId Property:**

All references to beforeSiblingId as a Node property have been removed from the frontend. The backend now handles all node ordering via fractional IDs (position field in NodeUpdate), making the frontend sibling chain tracking unnecessary.

**Phases Completed:**

✅ **Phase 1-2** (from previous WIP): Removed from types and reactive-node-service
✅ **Phase 3a**: Fixed shared-node-store.ts - removed persistence dependency tracking
✅ **Phase 3b-d**: Fixed base-node-viewer, backend-adapter, hierarchy-service, and other services
✅ **Phase 4**: Updated test utilities (test-helpers, mock builders)
✅ **Phase 5**: Removed beforeSiblingId assertions from 7+ test files

**Files Modified:**

*Core Services:*
- shared-node-store.ts: Removed deferred sibling reference logic
- base-node-viewer.svelte: Simplified structural tracking system
- backend-adapter.ts: Removed hierarchy change detection
- hierarchy-service.ts: Removed beforeSiblingId from return types
- reactive-node-data.svelte.ts: Updated mock node creation

*Test Files:*
- Removed beforeSiblingId from 50+ test locations
- Deleted sibling-chain-logic.test.ts (entirely about legacy logic)
- Updated sibling-chain-integrity.test.ts to test via public API
- Fixed test utilities (test-helpers, test-node-builder)

**Test Results:**
✅ 1698 frontend tests passing (0 failures, 102 skipped)
✅ No TypeScript compilation errors
✅ All linting checks pass
✅ Cargo clippy checks pass

**Key Changes:**
- beforeSiblingId parameter still used in moveNode() API calls (correct - this is backend API)
- No logic changes to actual node operations
- All structural ordering now delegated to backend
- Cleaner code with removed dependency tracking complexity

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

Co-Authored-By: Claude <[email protected]>

* chore: Clean up obsolete beforeSiblingId test references (Issue #575 follow-up)

**Cleanup Work:**
- Deleted database-persistence-edge-cases.test.ts (entirely about beforeSiblingId FOREIGN KEY constraints)
- Updated mock comments to remove beforeSiblingId references
- Tests now only mention beforeSiblingId in comments explaining it was removed

**Test Results:**
✅ 1687 frontend tests passing (was 1698, 11 deleted tests)
✅ 102 skipped, 0 failures
✅ All linting checks pass
✅ Cargo clippy checks pass

The deleted test file was testing edge cases specific to managing beforeSiblingId
sibling chains and FOREIGN KEY constraints - all now irrelevant since the
frontend no longer maintains sibling chains.

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

Co-Authored-By: Claude <[email protected]>

* Address review feedback: Complete beforeSiblingId cleanup (Issue #575)

## Changes Made

1. **Removed unused method**: Deleted `saveNodeWithParent()` from tauri-node-service.ts
   - This method was dead code with no callers
   - Removed ~37 lines of unused code

2. **Fixed field reference**: Removed `beforeSiblingId: null` assignment in node-reference-service.ts
   - Node type no longer includes beforeSiblingId field
   - Prevents invalid data structure creation

3. **Simplified data structures**: Converted Maps to Sets in base-node-viewer.svelte
   - previousStructure: Map<string, Record<string, never>> → Set<string>
   - persistedStructure: Map<string, Record<string, never>> → Set<string>
   - These structures only track node presence; Sets are more appropriate
   - Updated all usage patterns: set() → add(), [key] iteration → direct iteration

4. **Updated comments**: Clarified remaining issue #575 comments
   - Changed "Cleans up beforeSiblingId references" → "Cleans up deleted nodes"
   - Added clarity about simplified tracking behavior

## Test Results

- ✅ 1687 tests passing
- ✅ 102 tests skipped (unchanged)
- ✅ No new test failures
- ✅ Quality checks pass (eslint, svelte-check, cargo clippy)

## Acceptance Criteria Status

From issue #575:
- ✅ Remove beforeSiblingId field from Node type interface
- ✅ Remove beforeSiblingId validation logic
- ✅ Remove beforeSiblingId from service layers
- ✅ Remove beforeSiblingId chain building logic
- ✅ Update all test files
- ✅ Verify no compilation errors
- ✅ All tests pass
- ✅ **Zero references to beforeSiblingId remaining in source code** (COMPLETE)

## Engineering Principle

Following greenfield development guidelines (no backward compatibility required):
- Removed unused code immediately rather than deprecating
- Simplified data structures to match actual usage patterns
- Completed cleanup to 100% satisfaction of acceptance criteria

Addresses pragmatic code review recommendations from PR #583.

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

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
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