Skip to content

Commit d7d71b9

Browse files
committed
Preserve snapshot metadata after review
1 parent a5f7397 commit d7d71b9

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

internal/ui/snapshot_editor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,13 @@ func buildEditedSnapshot(original *snapshot.Snapshot, m *SnapshotEditorModel) *s
836836
Version: original.Version,
837837
CapturedAt: original.CapturedAt,
838838
Hostname: original.Hostname,
839+
Shell: original.Shell,
839840
Git: original.Git,
841+
Dotfiles: original.Dotfiles,
840842
DevTools: original.DevTools,
841843
MatchedPreset: original.MatchedPreset,
842844
CatalogMatch: original.CatalogMatch,
845+
Health: original.Health,
843846
}
844847

845848
// Build lookup maps for original snapshot items (for macOS prefs matching)

internal/ui/snapshot_editor_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ func makeTestSnapshot() *snapshot.Snapshot {
2626
Taps: []string{"homebrew/core"},
2727
Npm: []string{"typescript", "eslint"},
2828
},
29+
Shell: snapshot.ShellSnapshot{
30+
OhMyZsh: true,
31+
Theme: "robbyrussell",
32+
Plugins: []string{"git", "helm", "kubectl"},
33+
},
2934
MacOSPrefs: []snapshot.MacOSPref{
3035
{Domain: "com.apple.dock", Key: "autohide", Value: "1", Desc: "Auto-hide Dock"},
3136
{Domain: "com.apple.finder", Key: "ShowPathbar", Value: "1", Desc: "Show path bar"},
@@ -34,10 +39,17 @@ func makeTestSnapshot() *snapshot.Snapshot {
3439
UserName: "Test User",
3540
UserEmail: "test@example.com",
3641
},
42+
Dotfiles: snapshot.DotfilesSnapshot{
43+
RepoURL: "https://github.com/test/dotfiles",
44+
},
3745
DevTools: []snapshot.DevTool{
3846
{Name: "go", Version: "1.24.0"},
3947
{Name: "node", Version: "20.0.0"},
4048
},
49+
Health: snapshot.CaptureHealth{
50+
FailedSteps: []string{},
51+
Partial: false,
52+
},
4153
}
4254
}
4355

@@ -362,8 +374,11 @@ func TestBuildEditedSnapshotPreservesMetadata(t *testing.T) {
362374

363375
assert.Equal(t, snap.Version, edited.Version)
364376
assert.Equal(t, snap.Hostname, edited.Hostname)
377+
assert.Equal(t, snap.Shell, edited.Shell)
365378
assert.Equal(t, snap.Git, edited.Git)
379+
assert.Equal(t, snap.Dotfiles, edited.Dotfiles)
366380
assert.Equal(t, snap.DevTools, edited.DevTools)
381+
assert.Equal(t, snap.Health, edited.Health)
367382
}
368383

369384
func TestBuildEditedSnapshotAllSelected(t *testing.T) {

0 commit comments

Comments
 (0)