Skip to content

Conversation

@pdoorlocker
Copy link

Summary

This PR implements MediaWiki-style wikilinks ([[note-name]]) in the Haptic editor, enabling quick navigation between notes through an intuitive linking system.

Features

Wikilink Syntax: Type [[ to create links to other notes in your collection

  • Autocomplete: As you type after [[, get suggestions for existing notes
  • Keyboard Navigation: Use arrow keys to navigate suggestions, Enter/Tab to select
  • Click Navigation: Click any wikilink to instantly open the linked note
  • Non-inclusive Marks: Typing after a wikilink continues with normal text, not as part of the link

Implementation Details

  • Created a custom TipTap extension (WikiLink) that handles the [[note-name]] syntax
  • Integrated with existing getAllItems helper to fetch available notes
  • Uses openNote API for navigation, ensuring consistency with existing navigation patterns
  • Stores full file paths internally while displaying clean note names to users
  • Autocomplete UI follows Haptic's design system

Technical Notes

  • Wikilinks are rendered as tags with data-note attribute containing the full path
  • The mark is non-inclusive to prevent extending when typing after links
  • Async path resolution happens after mark creation to maintain responsive typing
  • Click handling uses event capture to intercept navigation

Testing

  • Creating wikilinks with [[ syntax
  • Autocomplete suggestions appear and filter correctly
  • Keyboard navigation in autocomplete works
  • Clicking wikilinks opens the correct note
  • Typing after wikilinks continues as normal text
  • Non-existent notes are handled gracefully

Screenshots

Screenshot 2025-06-19 at 11 24 01 AM Screenshot 2025-06-19 at 11 24 18 AM Screenshot 2025-06-19 at 11 24 20 AM

Fixes #25

@vercel
Copy link

vercel bot commented Jun 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
haptic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2025 3:27pm

@vercel
Copy link

vercel bot commented Jun 19, 2025

@pdoorlocker is attempting to deploy a commit to the chroxify's team Team on Vercel.

A member of the Team first needs to authorize it.

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.

[Feature Request] Wikilinks Support

1 participant