Skip to content

Improve snapshot comparison viewer UX#7202

Merged
andypalmi merged 6 commits into
mainfrom
feat/snapshot-compare-ux-improvements
May 6, 2026
Merged

Improve snapshot comparison viewer UX#7202
andypalmi merged 6 commits into
mainfrom
feat/snapshot-compare-ux-improvements

Conversation

@andypalmi
Copy link
Copy Markdown
Contributor

@andypalmi andypalmi commented May 5, 2026

Closes #7201

Summary

  • Wire changes now render one badge per node instead of a single comma-joined pill, making individual targets visually distinct
  • Diff viewer line backgrounds now extend to the full scroll width (previously short lines had a narrower background than long ones)
  • "N unchanged lines" expand button now spans the full horizontal width of the diff panel
  • "Simple view" button replaced with a options menu with two persistent settings:
    • Simple view — hides position (x/y) changes
    • Expand all — expands all property panels on navigation (default: on); toggling it off collapses live panels immediately
  • Both settings saved to localStorage

Test plan

  • Open snapshot comparison, compare two snapshots that have wire changes — verify each connected node appears as its own badge
  • Find a property with a long diff line — verify all line backgrounds extend to the same width and the "N unchanged lines" button spans full width
  • Click — verify dropdown shows "Simple view" and "Expand all" with correct checkmarks
  • Toggle "Simple view" on — verify position changes are hidden and button border turns blue
  • Toggle "Expand all" off — verify open panels collapse immediately
  • Reload page and reopen comparison — verify both settings are restored from localStorage

How it looked before

Screenshot 2026-05-05 at 23 24 24 Screenshot 2026-05-05 at 23 25 22

How it looks after

Screenshot 2026-05-05 at 23 16 48 Screenshot 2026-05-05 at 23 17 00 Screenshot 2026-05-05 at 23 18 11 Screenshot 2026-05-05 at 23 21 16

- Replace "Simple view" button with a "…" options menu containing
  "Simple view" (hides position changes) and "Expand all" (expands all
  property panels by default); both settings persist via localStorage
- Panels now default to expanded; toggling "Expand all" collapses/expands
  live panels immediately
- Wire changes now render one badge per node instead of comma-joined text,
  making individual wire targets visually distinct
- Fix diff viewer background colours not extending to the full scroll width
  on shorter lines when a longer line is present
- Fix "N unchanged lines" button not spanning the full horizontal width
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.60%. Comparing base (9c9214e) to head (2541d52).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7202   +/-   ##
=======================================
  Coverage   76.60%   76.60%           
=======================================
  Files         405      405           
  Lines       20577    20577           
  Branches     4973     4973           
=======================================
  Hits        15762    15762           
  Misses       4815     4815           
Flag Coverage Δ
backend 76.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread frontend/src/components/dialogs/AssetCompareDialog.vue Outdated
Comment thread frontend/src/components/dialogs/AssetCompareDialog.vue Outdated
Comment thread frontend/src/components/dialogs/SnapshotDiffChangePanel.vue Outdated
andypalmi added 2 commits May 5, 2026 22:47
- Replace custom … button + backdrop with ff-kebab-menu / ff-kebab-item,
  getting DotsVerticalIcon, click-outside and teleport for free
- Move hidePositionChanges / expandedByDefault into a new ux-snapshot-diff
  Pinia store with pinia-plugin-persistedstate; prefs now reset on logout
  so they cannot leak across users on a shared browser
- Add useUxSnapshotDiffStore to the account-auth logout $reset() chain
- Remove the now-unused formatWirePort method from SnapshotDiffChangePanel
Remove the hard-coded data-click-exclude="right-drawer" from KebabMenu.vue
and instead expose a menuItemsAttrs prop so callers can pass any extra
attributes to the teleported MenuItems element. Only AssetCompareDialog
sets this — which needs it because the comparison dialog is mounted inside
SnapshotDetailsDrawer (in the right drawer) and the teleported kebab options
were triggering the drawer's v-click-outside handler.
@andypalmi andypalmi enabled auto-merge May 6, 2026 07:42
@cstns cstns self-requested a review May 6, 2026 07:44
:data-el="'kebab-item-' + slugify(label)"
>
<component :is="icon" />
<component :is="icon" class="ff-icon" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should also gate it based on a v-if="icon"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See 2541d52

Comment thread frontend/src/stores/ux-snapshot-diff.js Outdated

export const useUxSnapshotDiffStore = defineStore('ux-snapshot-diff', {
state: () => ({
hidePositionChanges: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A dedicated store isn't warranted for this feature, as its sole purpose would be managing snapshot diff state. Instead, these props can be kept as ephemeral state within the AssetCompareDialog component, using predefined defaults.

A store would be warranted if centralized state management was needed across multiple components

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See 2541d52

- Move hidePositionChanges/expandedByDefault from ux-snapshot-diff
  Pinia store to ephemeral data() in AssetCompareDialog
- Delete ux-snapshot-diff.js store and remove it from account-auth logout chain
- Add v-if="icon" guard to KebabItem to avoid rendering null component
@cstns cstns self-requested a review May 6, 2026 08:18
@andypalmi andypalmi merged commit 341af46 into main May 6, 2026
29 checks passed
@andypalmi andypalmi deleted the feat/snapshot-compare-ux-improvements branch May 6, 2026 13:00
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.

Improve snapshot comparison viewer UX

3 participants