feat(pages): add FindPagesByTitle and GET /api/pages/by-title endpoint#1103
Merged
Conversation
Adds case-insensitive title-based page lookup to the TreeService. Required as the resolution backbone for upcoming [[Title]] wiki-link syntax.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a case-insensitive, title-based page lookup flow in the backend, wiring a new TreeService query through a pages use case and exposing it via a new GET /api/pages/by-title endpoint to support upcoming [[Title]] wiki-link resolution.
Changes:
- Added
TreeService.FindPagesByTitleplus unit tests. - Added a
FindByTitleUseCaseand response DTO (matches+count) for title lookup. - Registered
GET /api/pages/by-titleon both public and authenticated route groups and wired the use case into wiki route construction.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/wiki/wiki.go | Wires FindByTitleUseCase into the pages routes config. |
| internal/wiki/pages/routes.go | Registers /api/pages/by-title and adds handler + dependency plumbing. |
| internal/wiki/pages/get_page.go | Implements the FindByTitleUseCase and its output types. |
| internal/core/tree/tree_service.go | Adds FindPagesByTitle lookup implementation. |
| internal/core/tree/tree_service_test.go | Adds tests covering matching behavior and case-insensitivity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…results Map iteration is non-deterministic in Go; walking the in-memory tree guarantees a stable depth-first order for disambiguation results. Switches to strings.EqualFold for idiomatic case-insensitive comparison.
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.
Adds case-insensitive title-based page lookup to the TreeService. Required as the resolution backbone for upcoming [[Title]] wiki-link syntax.