Skip to content

feat(editor): add [[WikiLink]] autocomplete, i18n foundation for UI strings#1127

Merged
perber merged 3 commits into
mainfrom
worktree-feat+wikilink-autocomplete
Jun 4, 2026
Merged

feat(editor): add [[WikiLink]] autocomplete, i18n foundation for UI strings#1127
perber merged 3 commits into
mainfrom
worktree-feat+wikilink-autocomplete

Conversation

@perber

@perber perber commented Jun 4, 2026

Copy link
Copy Markdown
Owner

No description provided.

…trings

- Adds wikiLinkCompletionSource that triggers on [[ and inserts [[Title]]
- Splits buildCompletionOptions into buildMarkdownLinkOptions / buildWikiLinkOptions to avoid duplication
- Registers both sources in MarkdownCodeEditor's override array
- Creates src/locales/en/editor.json as first UI-string namespace (i18n foundation)
- Updates WikiLinkDisambiguationDialog to use i18next.t() instead of hardcoded strings
- Adds unit tests for hasSuppressedExternalPrefix, buildMarkdownLinkOptions, buildWikiLinkOptions
- Adds e2e tests: autocomplete triggers, filtering, insertion, preview rendering
Copilot AI review requested due to automatic review settings June 4, 2026 16:02

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 WikiLink ([[...]]) autocomplete support to the Markdown editor and lays initial groundwork for UI string internationalization by moving the WikiLink disambiguation dialog copy into i18next resources.

Changes:

  • Add an editor i18n namespace (English) and wire it into the i18next resource bundle.
  • Add a new CodeMirror completion source for [[WikiLink]] and enable it alongside existing markdown-link completion.
  • Add unit tests for completion option builders and Playwright E2E coverage for WikiLink autocomplete behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ui/leafwiki-ui/src/locales/en/editor.json Adds English strings for the WikiLink disambiguation dialog.
ui/leafwiki-ui/src/lib/i18n.ts Registers the new editor namespace with i18next resources.
ui/leafwiki-ui/src/features/wikilinks/WikiLinkDisambiguationDialog.tsx Switches dialog title/description to i18n-backed strings.
ui/leafwiki-ui/src/features/editor/MarkdownCodeEditor.tsx Enables the new WikiLink completion source in editor autocompletion overrides.
ui/leafwiki-ui/src/features/editor/internalLinkCompletion.ts Implements WikiLink range detection and completion options; exports helpers for testing.
ui/leafwiki-ui/src/features/editor/internalLinkCompletion.test.ts Adds unit tests for suppressed-prefix logic and completion option mapping.
e2e/tests/wikilinks.spec.ts Adds E2E tests for WikiLink autocomplete, insertion, and preview rendering.
e2e/pages/EditPage.ts Adds page-object helpers for autocomplete dropdown interaction and editor content retrieval.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui/leafwiki-ui/src/features/editor/internalLinkCompletion.ts
Comment thread ui/leafwiki-ui/src/features/editor/internalLinkCompletion.test.ts Outdated
Comment thread e2e/tests/wikilinks.spec.ts Outdated
perber added 2 commits June 4, 2026 18:12
Replace partial closing wiki-link brackets during completion so selecting a match cannot leave an extra trailing bracket.

Clarify the mailto suppression test and let the wikilinks E2E helper preserve intentionally empty content updates.
Replace three unnecessary template literals with single-quoted strings so the wikilinks E2E spec passes the repository quote rule in CI.
@perber
perber force-pushed the worktree-feat+wikilink-autocomplete branch from 388e269 to 23ebe43 Compare June 4, 2026 17:02
@perber
perber merged commit b2b15c8 into main Jun 4, 2026
9 checks passed
@perber
perber deleted the worktree-feat+wikilink-autocomplete branch June 4, 2026 17:13
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