Repository navigation
Expand mod config editor with review, undo, and conflict recovery - #51
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b73214d473
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (review?.merging && review.choices?.length) { | ||
| const remaining = review.choices.filter(choice => !review.mergeSelections[choice.id]).length; | ||
| $('mod-config-review-confirm').disabled = modConfigBusy || remaining > 0; |
There was a problem hiding this comment.
Re-enable confirmation outside unresolved merges
If a user opens a conflict merge with unresolved choices and cancels it, this function leaves mod-config-review-confirm.disabled set to true. A later ordinary save, restore, or manual merge reuses the same button, but this function does nothing when there are no merge choices, so confirmation remains unavailable until the page is reloaded. Reset the disabled state on every review render based on whether the current merge has unresolved choices.
Useful? React with 👍 / 👎.
Summary
Expand the mod config editor to find files outside ModConfigs, including Hero's Mod's root database and custom mod folders. Add filename search and filters for each discovered folder.
Replace direct saving with change review and a persisted previous version that can be restored. Save is enabled only when the buffer differs from the loaded file. Concurrent disk edits preserve the draft and offer comparison and merge choices: JSON combines compatible setting changes, skips matching changes, and asks only about conflicting values; other formats use text comparisons. Invalid draft syntax is reported before review. Invalid disk syntax opens a separate repair step before the read-only comparison, and corrections remain unsaved until final confirmation.
Fix false unsaved-change detection from CRLF normalization when switching between files with identical content. Add shared dashboard links to the wiki and directly to the bug report and feature request templates.
Related issues
None.
Validation
Risks and compatibility
Existing configuration files stay in place. Config API filenames are now relative to tModLoader, including the ModConfigs/ prefix for files in that directory. Discovery excludes game saves, logs, installed mods, and tModLoader settings.
Each changed save stores one previous file version under /data/admin/mod-config-history for explicit restore, including across container restarts. Writes check disk revisions, and review/repair alone does not write files. The 4 MiB editor limit remains; large comparisons and automatic merges are bounded and provide manual recovery guidance. JSON merge choices operate on settings; other formats use text merging and their existing extension-based syntax checks.
No runtime dependencies or release version changes. Added an Unreleased changelog entry and updated the editor's inline guidance.
Screenshots
Synthetic fixture data only.
Before:

After:

Checklist