Conversation
Allow manually set mixed-case slugs while keeping generated slugs lowercase. Preserve filesystem slug casing during reconstruct to avoid mismatches after rescans.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates slug handling to preserve mixed-case slugs when explicitly set (and when reconstructing from the filesystem), while keeping generated slugs normalized.
Changes:
- Expanded slug validation to accept uppercase letters while keeping reserved-slug detection case-insensitive.
- Updated filesystem tree reconstruction to keep the on-disk slug casing instead of normalizing directory/file names.
- Added tests covering uppercase/mixed-case slug validation, update behavior, and reconstruct behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/wiki/wiki_test.go | Adds coverage ensuring UpdatePage accepts and preserves a mixed-case slug. |
| internal/core/tree/slug_service_test.go | Adds a test confirming IsValidSlug permits uppercase letters. |
| internal/core/tree/slug_service.go | Adjusts slug validation rules to allow uppercase and improves docstrings. |
| internal/core/tree/node_store_reconstruct_test.go | Updates reconstruct tests to reflect “preserve casing” behavior and adds a mixed-case filename test. |
| internal/core/tree/node_store.go | Changes reconstruct logic to validate and use filesystem names directly (preserving casing). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Enforce case-insensitive slug uniqueness across tree operations and filesystem reconstruction. Reject ambiguous reconstruct states where sibling files differ only by case.
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.
Allow manually set mixed-case slugs while keeping generated slugs lowercase. Preserve filesystem slug casing during reconstruct to avoid mismatches after rescans.