Skip to content

Expand mod config editor with review, undo, and conflict recovery - #51

Merged
Crosis47 merged 1 commit into
masterfrom
codex/dashboard-config-discovery
Oct 17, 2026
Merged

Crosis47 merged 1 commit into
masterfrom
codex/dashboard-config-discovery

Conversation

@Crosis47

Copy link
Copy Markdown
Owner

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

  • Passed all 261 dashboard Python tests in the Linux AMD64 container.
  • Passed the dedicated editor browser suite, covering folder filters, syntax validation, dirty-only saving, disk repair, merge choices, undo, concurrent saves, cancellation, and mobile layout.
  • Passed JavaScript syntax checks for app.js and setup.js, and git diff whitespace checks.
  • Exercised the local dashboard preview with real configuration files, saved history, disk edits, syntax repair, and merge/save recovery.
  • Passed the broader dashboard browser fixture with an in-memory correction for an existing baseline assertion: its read-only overview selector also matches the pre-existing restart-postpone-minutes input. That unrelated assertion is unchanged in this PR; the unmodified broader fixture still has this known baseline failure.
  • Local runtime validation used the AMD64 3.7.5 image with the updated application files. A full new image build and native ARM64 validation were not run locally; remote CI results are separate.

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:
Previous mod config editor

After:
Updated mod config editor

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md.
  • I have completed the applicable validation and noted any gaps above.
  • I have updated documentation and changelog entries where needed, or explained why they are not needed.
  • I have removed secrets and private data from the changes, logs, and screenshots.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T05:43:38.940154Z b73214d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread web/app.js
Comment on lines +1915 to +1917
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Crosis47
Crosis47 merged commit 4e8bf33 into master Oct 17, 2026
4 checks passed
@Crosis47
Crosis47 deleted the codex/dashboard-config-discovery branch October 17, 2026 07:46
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.

1 participant