Skip to content

fix: preserve changes across config editor tabs when saving#43

Merged
pablaber merged 1 commit intomainfrom
claude/38-fix-config-save-across-tabs
Feb 15, 2026
Merged

fix: preserve changes across config editor tabs when saving#43
pablaber merged 1 commit intomainfrom
claude/38-fix-config-save-across-tabs

Conversation

@pablaber
Copy link
Copy Markdown
Owner

Summary

Fixes a bug where editing links on the Links tab, then switching to the General tab and saving, would discard the link changes. Each tab maintained its own isolated copy of the config, so saving from one tab would overwrite changes made on the other.

Changes

  • src/screens/ConfigEditorScreen/ConfigEditorScreen.tsx — Lifted config editing state into a shared draftConfig held by the parent. Both tabs now receive this draft and push their changes back via an onConfigChange callback. The parent's handleSave wraps onSave + onClose so closing happens in one place.
  • src/screens/ConfigEditorScreen/components/GeneralTab.tsx — Added onConfigChange prop and a useEffect that pushes general-tab form state changes to the shared draft so they persist across tab switches.
  • src/screens/ConfigEditorScreen/components/LinksTab.tsx — Added onConfigChange prop and a useEffect that pushes module changes to the shared draft. Removed redundant onClose() call from handleSave (now handled by parent).
  • src/screens/ConfigEditorScreen/ConfigEditorScreen.test.tsx — Added two integration tests verifying cross-tab persistence: saving from General preserves link changes, and saving from Links preserves general changes.
  • src/screens/ConfigEditorScreen/components/GeneralTab.test.tsx — Added onConfigChange mock to default props.
  • src/screens/ConfigEditorScreen/components/LinksTab.test.tsx — Added onConfigChange mock to default props; updated save test to reflect that onClose is no longer called directly by LinksTab.

Issue Reference

Closes #38

Testing

All 84 tests pass, lint is clean, and the production build succeeds.

npm run lint && npm run test && npm run build

Verification

gh pr checkout PRNUM
npm ci
npm run dev
  • Open the app at http://localhost:3541
  • Go to Settings → Links tab → add or edit a link
  • Switch to the General tab → change the background color or search placeholder
  • Click Save on the General tab
  • Verify both the link changes and the general changes are saved
  • Repeat in reverse: edit on General, switch to Links, save from Links — verify both changes persist

This PR was automatically generated by an AI agent (Claude Code). Please review carefully before merging.

@pablaber pablaber merged commit 9f6938f into main Feb 15, 2026
2 checks passed
@pablaber pablaber deleted the claude/38-fix-config-save-across-tabs branch February 15, 2026 21:01
@newtabot newtabot Bot mentioned this pull request Feb 15, 2026
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.

bug: when updating multiple pages in the config (background and links) only one saves

1 participant