Skip to content

Mark config as changed when entering raw mode#3

Merged
fullstackjam merged 1 commit intomainfrom
claude/fix-raw-mode-errors-flYFt
Apr 22, 2026
Merged

Mark config as changed when entering raw mode#3
fullstackjam merged 1 commit intomainfrom
claude/fix-raw-mode-errors-flYFt

Conversation

@fullstackjam
Copy link
Copy Markdown
Contributor

Summary

Updated the change detection logic in ConfigEditor to properly track when the user enters raw mode, ensuring the config is marked as having unsaved changes.

Key Changes

  • Modified the hasChanges derived state to include rawMode as a condition
  • This ensures that switching to raw mode is treated as a modification, preventing accidental loss of the mode state if the user navigates away

Implementation Details

The hasChanges flag now evaluates to true when:

  • Creating a new config (isNew)
  • The initial snapshot is empty
  • Raw mode is active (newly added)
  • The current snapshot differs from the initial snapshot

This change ensures users are prompted to save their changes when they've switched to raw mode, even if they haven't modified the underlying configuration content.

https://claude.ai/code/session_01BfBFGMfN6H4FbsrMREGTJ4

hasChanges excluded rawJson edits because captureSnapshot() only reads
visual editor state. Adding rawMode to the derived check keeps the save
button active whenever the raw textarea is open.

https://claude.ai/code/session_01BfBFGMfN6H4FbsrMREGTJ4
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullstackjam fullstackjam merged commit 3fc9551 into main Apr 22, 2026
5 checks passed
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.

2 participants