fix: reorganize settings UI, fix content priority resolution, and eliminate CAS warnings (#281, #282, #283, #284)#285
Open
undead2146 wants to merge 7 commits intodevelopmentfrom
Open
Conversation
- Move 'Check for updates on startup' from Appearance to Updates section (#281) - Move 'Settings File Location' from Appearance to new Data Directories section (#282) - Make version widget clickable to copy version to clipboard (#283) - Fix FullCopyStrategy to use ContentTypePriority for proper mod file precedence (#284) The content priority fix ensures mod files correctly override base game files, resolving the issue where the camera mod had no effect in-game.
- Add source.path marker file creation in ContentStorageService after CAS storage - Update ContentManifestPool to handle CAS-ONLY marker gracefully - Prevents 'Could not resolve source path' warnings for downloaded content
Camera mods are not functional and should not be downloadable until properly fixed. Removing from registry to prevent user confusion.
… hash The tooltip now explicitly states that clicking copies the full version including git hash, not just the displayed short version.
… cleanup safety - Add SourcePathFileName constant to FileTypes.cs and replace hardcoded strings - Add priority mappings for all ContentTypes (MapPack, LanguagePack, etc.) - Throw exceptions for meta types that shouldn't be in workspaces - Fix recursive directory deletion to only remove directories created in current invocation - Prevents destruction of pre-existing valid source.path data
… appearance Add style overrides to keep background transparent on hover and press, ensuring the version widget looks identical to the original TextBlock.
073f8a3 to
5ab0a40
Compare
Contributor
|
please fix the hover effect when you are hovering a button |
Member
Author
@mnoserat |
Contributor
i will send a video on discord |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR resolves four GitHub issues related to settings UI organization, content priority , and CAS storage warnings.
Changes
Settings UI Reorganization
Moved "Check for updates on startup" setting from Appearance section to Updates section where it logically belongs
Moved "Settings File Location" configuration from Appearance section to a new "Data Directories" section for better
organization
Version Widget Enhancement
Made the version widget in the bottom-right corner clickable
Content Priority Fix
Fixed mods not taking effect in-game due to incorrect file priority resolution
FullCopyStrategywas sorting by enum value instead of content type priorityContentTypePriority.GetPriority()for proper orderingCAS Storage Warning Fix
source.pathmarker file creation after CAS storageContentManifestPoolto handle CAS-ONLY marker gracefullyRelated Issues
Closes #281
Closes #282
Closes #283
Closes #284
Greptile Summary
This PR addresses four GitHub issues: settings UI reorganization (#281, #282), a clickable version widget (#283), a content priority fix (#284), and CAS storage warning elimination. The core logic fixes are solid —
ContentTypePriorityis now exhaustively mapped andFullCopyStrategycorrectly uses semantic priority ordering. However, two issues remain:"CAS-ONLY"magic string: The sentinel value written byContentStorageServiceand compared inContentManifestPoolis hardcoded in both places rather than extracted to a shared constant inFileTypes.cs(which this same PR already uses forSourcePathFileName).StoreCasContentAsynccatch block: The PR addsDirectory.CreateDirectory(contentDir)+File.WriteAllTextAsync(..., "CAS-ONLY", ...)to the CAS storage happy path, but the catch block's comment and cleanup logic were not updated — the newly createdcontentDiris not removed on failure, leaving an orphan directory.crgn,crzh,dczh) are removed fromGenPatcherContentRegistrywith no mention in any of the referenced issues or the PR description.Confidence Score: 3/5
ContentTypePriorityexhaustiveness, CAS warning suppression) are correct and well-tested by the backup/restore cleanup logic inStoreManifestOnlyAsync. The UI changes are clean. Score is reduced by: (1) the unexplained deletion of threeGenPatcherContentRegistryentries with user-visible impact, and (2) the incomplete catch-block cleanup inStoreCasContentAsyncwhich could leave orphan directories on disk.Important Files Changed
SourcePathFileName = "source.path"constant. Good extraction, but"CAS-ONLY"sentinel value should also be added here as a constant._fallback throws ArgumentOutOfRangeException to catch future unmapped additions. Resolves the previous thread concern entirely.StoreCasContentAsyncand adds thorough backup/restore cleanup logic toStoreManifestOnlyAsync. Two issues: (1) "CAS-ONLY" is a hardcoded magic string that should be a constant in FileTypes.cs; (2) the catch block inStoreCasContentAsyncdoes not clean up the newly createdcontentDir.nullsuccess instead of treating it as a real directory path. UsesStringComparison.OrdinalIgnoreCasewhich is good, but the"CAS-ONLY"literal should be a shared constant.OrderBy(item.Manifest.ContentType)(enum integer ordering) withOrderBy(ContentTypePriority.GetPriority(...))(semantic priority ordering). Comment updated to reflect correct priority values.Sequence Diagram
sequenceDiagram participant CS as ContentStorageService participant FS as FileSystem participant CAS as CasReferenceTracker participant MP as ContentManifestPool Note over CS,MP: StoreCasContentAsync (happy path) CS->>FS: StoreContentFilesAsync (CAS hash storage) CS->>CAS: TrackManifestReferencesAsync CS->>FS: WriteAllTextAsync(manifest.json) CS->>FS: CreateDirectory(contentDir) CS->>FS: WriteAllTextAsync(source.path, "CAS-ONLY") Note over CS,MP: Later — GetContentDirectoryAsync MP->>FS: ReadAllTextAsync(source.path) FS-->>MP: "CAS-ONLY" MP-->>MP: sourcePath == "CAS-ONLY" → return null (no warnings) Note over CS,MP: StoreCasContentAsync (failure path — gap) CS->>FS: WriteAllTextAsync(manifest.json) ✓ CS->>FS: CreateDirectory(contentDir) ✓ CS->>FS: WriteAllTextAsync(source.path, "CAS-ONLY") ✗ throws CS->>FS: DeleteFileIfExists(manifest.json) CS->>CAS: UntrackManifestAsync Note over FS: contentDir orphaned (not cleaned up)Comments Outside Diff (2)
GenHub/GenHub/Features/Content/Services/ContentStorageService.cs, line 301-323 (link)Failure cleanup in
StoreContentAsyncdoes not cover the newly written CAS-ONLY markerThe
StoreManifestOnlyAsyncpath received careful rollback logic (backup + restore or delete ofsource.path), but the equivalent cleanup is missing fromStoreContentAsync. IfWriteAllTextAsync(sourcePathFile, "CAS-ONLY", ...)at line 296 succeeds and a subsequent step throws (unlikely in current code, but fragile if the method grows), thecontentDirand itssource.pathfile will be left on disk even though the manifest JSON has been deleted.For consistency with the rollback strategy applied in
StoreManifestOnlyAsync, consider adding symmetric cleanup here:Prompt To Fix With AI
GenHub/GenHub/Features/Content/Services/ContentStorageService.cs, line 301-319 (link)contentDirnot cleaned up in CAS catch blockThis PR newly adds
Directory.CreateDirectory(contentDir)(line 294) andFile.WriteAllTextAsync(sourcePathFile, "CAS-ONLY", ...)(line 296) inside the happy path ofStoreCasContentAsync. However, the catch block only cleans upmanifestPathand untracks CAS references — it does not removecontentDiror the partially-writtensource.pathfile.Concrete failure scenario:
File.WriteAllTextAsync(manifestPath, ...)succeeds (line 289).Directory.CreateDirectory(contentDir)succeeds (line 294) — directory may be newly created.File.WriteAllTextAsync(sourcePathFile, "CAS-ONLY", ...)throws (line 296), e.g. due to a disk error.manifestPathis deleted, CAS references are untracked — butcontentDir(now empty) is left on disk as an orphan.On a subsequent re-store attempt,
Directory.CreateDirectorywould succeed on the pre-existing empty dir, and the write would be retried — so this is non-blocking. But the comment in the catch block says "only manifest file needs cleanup", which is no longer accurate after this PR adds thecontentDircreation.Consider mirroring the cleanup done in
StoreManifestOnlyAsyncfor consistency:Prompt To Fix With AI
Prompt To Fix All With AI
Last reviewed commit: 151027f
Context used: