Skip to content

feat(pages): add FindPagesByTitle and GET /api/pages/by-title endpoint#1103

Merged
perber merged 2 commits into
mainfrom
feature/wiki-links-backend-lookup
Jun 4, 2026
Merged

feat(pages): add FindPagesByTitle and GET /api/pages/by-title endpoint#1103
perber merged 2 commits into
mainfrom
feature/wiki-links-backend-lookup

Conversation

@perber

@perber perber commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Adds case-insensitive title-based page lookup to the TreeService. Required as the resolution backbone for upcoming [[Title]] wiki-link syntax.

Adds case-insensitive title-based page lookup to the TreeService.
Required as the resolution backbone for upcoming [[Title]] wiki-link syntax.
Copilot AI review requested due to automatic review settings June 2, 2026 14:26

Copilot AI 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.

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.FindPagesByTitle plus unit tests.
  • Added a FindByTitleUseCase and response DTO (matches + count) for title lookup.
  • Registered GET /api/pages/by-title on 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.

Comment thread internal/core/tree/tree_service.go
…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.
@perber
perber merged commit 654a10e into main Jun 4, 2026
8 checks passed
@perber
perber deleted the feature/wiki-links-backend-lookup branch June 4, 2026 14:32
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