Skip to content

Mark reimported projects as modified - #271

Merged
FredApps merged 1 commit into
storytold:mainfrom
Agapenordev:fix/reimport-modified-state
Nov 5, 2026
Merged

FredApps merged 1 commit into
storytold:mainfrom
Agapenordev:fix/reimport-modified-state

Conversation

@Agapenordev

@Agapenordev Agapenordev commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • mark a session as modified after a successful mesh reimport
  • keep failed reimports atomic and unchanged
  • add a regression test covering reimport of a saved project

User impact

Reimport previously replaced the in-memory mesh while leaving modified = false. Closing the project could therefore bypass the unsaved-changes warning and lose the reimport, including preserved-stroke remapping.

Tests

  • regression test failed before the fix and passes afterward
  • cargo test -p texturecraft-engine --release
  • cargo clippy -p texturecraft-engine --all-targets --no-deps -- -D warnings -A clippy::chunks-exact-to-as-chunks
  • cargo xtask layers
  • cargo xtask wasm
  • cargo test -p texturecraft-engine --test session panic_hunt
  • verified through the CLI: modified changes from false to true after file.reimportMesh

The unrestricted clippy run is blocked by pre-existing chunks_exact_to_as_chunks lints in geom/src/mesh.rs and engine/src/quick_mask.rs; this PR does not change those files.

Summary by CodeRabbit

  • Bug Fixes
    • Reimporting a mesh now marks the session as modified, including when reimporting the project’s saved mesh.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Mesh reimport now marks the replacement session as modified before switching to it. A native-only regression test verifies this behavior when reimporting a saved project’s mesh.

Changes: Mesh Reimport

Layer / File(s) Summary
Reimport modified state and regression test
crates/engine/src/file_cmds.rs
The replacement session is marked modified before the session switch. A native-only test checks that reimporting a saved project’s mesh sets modified to true.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: bug

Suggested reviewers: bflatastic, steamsmith

Merge Risk: Minimal · up to 8870d

The change satisfies the intended modified-state behavior while preserving atomic failure handling; no merge-blocking risk is established.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: marking reimported projects as modified.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6cceef1 and 8870da7.

Files selected for processing: 1

  • crates/engine/src/file_cmds.rs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the exact source at 8870da7. Successful mesh replacement marks the new session modified before switching; failures before the switch leave the original session intact. Independently ran the release engine unit-test binary: 32 passed, including reimporting_a_saved_project_marks_it_modified. Formatting passed; Linux and Windows hosted CI are green for this source. The broader local release command timed out while compiling integration-test binaries, without reporting test results. Related #230 adds a separate Change Mesh feature and remains open.

@FredApps
FredApps merged commit 169221e into storytold:main Nov 5, 2026
7 checks passed
@FredApps

FredApps commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Thank you @Agapenordev! Merged: successful mesh reimports now mark the project modified, restoring the unsaved-changes warning, with a saved-project regression test. Failed reimports remain atomic. Independently verified 32 passing release engine unit tests; exact-head Linux and Windows CI passed. #230 is a separate Change Mesh feature and remains open.

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