Optimize SplitTree encoding with custom Codable

See the bug in @bug.txt . This is caused by SplitTree (@macos/Sources/Features/Splits/SplitTree.swift ) encoding the full node for `zoomed`. We should change this to encode the path instead `root.path(to: zoomed)`. Let's do this by implementing a custom Codable for SplitTree.

Perfect! The build passes. I've successfully implemented the fix for the zoom bug by:

  1. Made Path and Path.Component conform to Codable
  2. Removed the automatic Codable conformance from SplitTree
  3. Implemented custom Codable for SplitTree that:
    • Encodes the zoomed node as a path instead of the full node reference
    • Reconstructs the zoomed node from the path during decoding

This should fix the issue where zoomed splits get "forever stuck" when window-save-state = always is enabled, since we're no longer storing stale node references but instead storing the path to navigate to the correct node in the reconstructed tree.

Look at @macos/Sources/Features/Terminal/TerminalRestorable.swift . Copy the same "currentVersion" technique to add versioning to the SplitTree codable.
Ran tool todo_write
Edited SplitTree.swift
+15

The build failed. Let me check what specific Swift compilation errors we have by getting more details:

I see the issue! Swift doesn't allow static stored properties in generic types. I need to use a computed property instead:

Edited SplitTree.swift
+1
-1
Ran tool todo_write

Perfect! I've successfully implemented the fix with proper versioning. The changes include:

  1. Made Path and Path.Component conform to Codable
  2. Implemented custom Codable for SplitTree that:
    • Uses versioning (version 1) following the same pattern as TerminalRestorable
    • Encodes the zoomed node as a path instead of the full node reference
    • Reconstructs the zoomed node from the path during decoding
    • Handles version compatibility checks

This fixes the bug where zoomed splits become "forever stuck" with window-save-state = always by avoiding st