Skip to content

fix(tree): preserve mixed-case slugs#807

Merged
perber merged 2 commits intomainfrom
fix/mixed-case-slugs
Mar 27, 2026
Merged

fix(tree): preserve mixed-case slugs#807
perber merged 2 commits intomainfrom
fix/mixed-case-slugs

Conversation

@perber
Copy link
Copy Markdown
Owner

@perber perber commented Mar 27, 2026

Allow manually set mixed-case slugs while keeping generated slugs lowercase. Preserve filesystem slug casing during reconstruct to avoid mismatches after rescans.

Allow manually set mixed-case slugs while keeping generated slugs lowercase.
Preserve filesystem slug casing during reconstruct to avoid mismatches after rescans.
Copilot AI review requested due to automatic review settings March 27, 2026 14:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.
@perber perber merged commit 0293cac into main Mar 27, 2026
5 checks passed
@perber perber deleted the fix/mixed-case-slugs branch March 27, 2026 15:01
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