Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: maxjay/patchwork
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: maxjay/patchwork
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/nested-keyed-array-include-unchanged
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Jun 15, 2026

  1. fix: propagate includeUnchanged into nested keyed array diffs

    diffArrayByKey hard-coded false for includeUnchanged when recursing
    into matched element pairs, so a diff() call targeting a child keyed
    array path (e.g. orders[0].lineItems) with includeUnchanged: true
    always returned [] — nested Unchanged ops were never emitted.
    
    Three-part fix:
    - Pass includeUnchanged through to diffNode for element pairs
    - Detect fieldsChanged as any(op !== Unchanged) so Unchanged ops in
      fieldOps don't falsely trigger Replace for an unmodified element
    - For unchanged elements: push nested fieldOps directly to ops so
      path filters can reach children; add flattenOpsForFilter in _diff
      so Replace.changes is also searched when a parent element changed
      but the queried children are unchanged
    
    https://claude.ai/code/session_017H6NzxYAwbmKxHH6QusCdh
    claude committed Jun 15, 2026
    Configuration menu
    Copy the full SHA
    3b3c7ad View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2e5d711 View commit details
    Browse the repository at this point in the history
  3. fix: don't duplicate field-level ops when filtering by child array path

    flattenOpsForFilter recursed into Replace.changes even when the Replace
    op itself already matched the prefix, causing field-level ops to appear
    alongside their parent element op in the results (e.g. changing one
    field on a child item produced both a Replace for the child AND a loose
    Replace for the field).
    
    Replace with filterOpsForPrefixes: include a matching op as-is (its
    .changes are already attached), and only recurse into Replace.changes
    when the Replace itself does NOT match the prefix.
    
    https://claude.ai/code/session_017H6NzxYAwbmKxHH6QusCdh
    claude committed Jun 15, 2026
    Configuration menu
    Copy the full SHA
    9a4d6e6 View commit details
    Browse the repository at this point in the history
Loading