carloea2 opened a new pull request, #4265: URL: https://github.com/apache/texera/pull/4265
### What changes were proposed in this PR? This PR fixes the pending TODO from `Array` branch in `updateYTypeFromObject(...)`. https://github.com/apache/texera/blob/ac909a07dc656689a946fcc8cf08fbfe6b4595b5/frontend/src/app/workspace/types/shared-editing.interface.ts#L130-L164 Previously, the implementation assumed only one array update happened at a time and only handled the first mismatch with a single insert or delete. This caused incorrect behavior for multi-item insertions, multi-item deletions, and reorder cases. This PR replaces that logic with an `Longest Common Subsequenc`e based array diff so the final `Y.Array` matches the target array more reliably while still attempting in-place updates where possible. ### Any related issues, documentation, discussions? Closes #4264 ### How was this PR tested? Manually tested using: ```ts [1, 2, 3, 4, 5] -> [1, 5] [1, 2, 3, 4, 5] -> [7, 5, 8, 1 6] [1, 2] -> [1, 3, 4, 2] ["x", "y", "z"] -> ["z", "x", "y"] ``` Verified that the final `Y.Array` content matches the target array. ### Was this PR authored or co-authored using generative AI tooling? Co-generated with GPT -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
