feat: hide unchanged files when comparing metadata between orgs - #1991
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the “compare metadata between orgs” experience by adding an option to hide unchanged (matching) metadata files so users can focus on the small set of differences, addressing the usability problem described in #1334.
Changes:
- Added a “Hide Unchanged Files” toggle in the metadata comparison sidebar, including a visible/total file count and an empty-state message when everything matches.
- Introduced tree filtering/counting utilities to remove matching files while pruning empty folders.
- Improved the shared
Treecomponent so that when its items list changes and the selected node disappears (e.g. due to filtering), it selects and emits the first remaining leaf node; added tests and Vitest DOM setup for the deploy feature.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| libs/ui/src/lib/tree/Tree.tsx | Adds fallback selection behavior when the selected tree item is filtered out. |
| libs/ui/src/lib/tree/tests/Tree.spec.tsx | Adds coverage for re-emitting selection and fallback selection behavior. |
| libs/features/deploy/vite.config.mts | Adds shared DOM test setup to support new UI tests. |
| libs/features/deploy/src/view-or-compare-metadata/viewOrCompareMetadataUtils.tsx | Adds filterUnchangedFiles and countMetadataFiles helpers for the sidebar filter. |
| libs/features/deploy/src/view-or-compare-metadata/ViewOrCompareMetadataSidebar.tsx | Adds the “Hide Unchanged Files” toggle, file counts, and empty-state messaging; uses filtered tree items. |
| libs/features/deploy/src/view-or-compare-metadata/ViewOrCompareMetadataModal.tsx | Adds label help text for “Hide Unchanged Regions”. |
| libs/features/deploy/src/view-or-compare-metadata/tests/viewOrCompareMetadataUtils.spec.ts | Adds unit tests for filtering and counting utilities. |
| libs/features/deploy/src/view-or-compare-metadata/tests/ViewOrCompareMetadataSidebar.spec.tsx | Adds sidebar behavior tests for filtering, counts, and selection behavior. |
Suppressed comments (1)
libs/ui/src/lib/tree/Tree.tsx:88
- Typo in inline comment: "e.x." should be "e.g." ("for example").
// The selected item is no longer in the tree (e.x. it was filtered out), fall back to the first remaining leaf node.
// Updating the selection re-runs this effect, which is what emits the new selection.
const firstLeafNode = getFirstLeafNodeId(ids, idMap);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
c98464d to
0aff1fa
Compare
Code review summaryAutomated review (Claude Code). Fixes below are pushed as an amend to the PR head. Verdict: clean, well-scoped display-time filter with solid unit coverage. No outstanding decisions. Verified correct: the filter is non-mutating and memoized, and the deploy/export/footer counts correctly continue to use the unfiltered set. Fixed and pushed
Before applying the second fix, confirmed it masks nothing: FETCH already resets loading/status/results for the org being fetched, ( Note: the fix lives in the hook, not |
When comparing metadata across two orgs, the sidebar colors every file green or red, but a retrieve routinely returns hundreds or thousands of components and nearly all of them match. The handful of differences the user opened the modal to find are buried, and the tree had no filter of any kind. Closes #1334
0aff1fa to
e0e98c5
Compare
When comparing metadata across two orgs, the sidebar colors every file green or red, but a retrieve routinely returns hundreds or thousands of components and nearly all of them match. The handful of differences the user opened the modal to find are buried, and the tree had no filter of any kind.
Closes #1334