Skip to content

Conversation

@tomymaritano
Copy link
Owner

Summary

This PR implements the first phase of the v0.2 roadmap:

1. Full-Text Search (FTS5) 🔍

  • Replace LIKE queries with SQLite FTS5 for fast, ranked search
  • Porter tokenizer for stemming support
  • Prefix matching (mark finds markdown)
  • bm25() relevance ranking

2. Wikilinks with Heading Anchors 🔗

  • Support [[Note#Heading]] syntax
  • Support [[Note#Heading|display]] syntax
  • Store anchors in links table
  • Pass anchor to navigation handler
  • Add heading extraction utilities

3. Cloud Sync Foundation ☁️

  • New @readied/sync-core package with types, queue, and engine
  • SQLite migration for sync fields (device_id, sync_version, last_synced_at)
  • Desktop syncStore (Zustand) for auth and sync state
  • SyncStatusIndicator and LoginModal components

Files Changed

New Packages

  • packages/sync-core/ - Pure TypeScript sync logic

Migrations

  • 008_fts5_index.ts - FTS5 virtual table
  • 009_link_anchors.ts - Link anchor column
  • 010_sync_fields.ts - Sync metadata tables

Desktop Components

  • stores/syncStore.ts - Sync state management
  • components/sync/ - Sync UI components

Test Plan

  • All existing tests pass
  • FTS5 migration creates virtual table
  • Wikilink parsing captures anchors
  • Sync types validate correctly
  • Build succeeds

Next Steps

  • Implement @readied/api (Hono + Neon backend)
  • Add IPC handlers for sync
  • Implement magic link auth flow

Closes #67, #68
Refs #69

🤖 Generated with Claude Code

tomymaritano and others added 5 commits January 6, 2026 10:41
- Add Zustand-based settings store with schema versioning
- Add useTheme hook for dark/light/system theme + accent color
- Add new settings components (SettingGroup, SettingRow, controls)
- Add UpdatesSection for auto-update settings
- Enhance AppearanceSection with theme picker and color presets
- Add CSS variables for CodeMirror theme tokens
- Remove separate settings.html (unified window approach)
- Cross-window settings sync via IPC

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove all box-shadow effects for cleaner, flatter design:
- Context menus (NoteList, Tags)
- Modals (NotebookCreate, NotebookPicker, Settings)
- Panels (Actions, Backlinks)
- Editor header, toolbar, note-list
- Lightbox and global styles

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace LIKE queries with SQLite FTS5 for fast, ranked search:
- Add migration 008_fts5_index with FTS5 virtual table
- Triggers keep FTS index in sync on INSERT/UPDATE/DELETE
- Use bm25() for relevance ranking
- Prefix matching for partial word search ("mark" finds "markdown")
- Porter tokenizer for stemming support

Closes #67

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add support for heading anchors in wikilinks:
- Parse [[Note#Heading]] and [[Note#Heading|display]] syntax
- Store anchor in links table (migration 009_link_anchors)
- Pass anchor via data-anchor attribute to click handler
- Add heading utilities: extractHeadings(), headingToSlug()

Syntax now supported:
- [[Note]] - basic wikilink
- [[Note#Section]] - link to heading
- [[Note|alias]] - aliased link
- [[Note#Section|alias]] - heading with alias

Closes #68

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add core infrastructure for cloud sync:

## New Package: @readied/sync-core
- Types for sync entities, operations, conflicts
- SyncQueue for offline change management
- SyncEngine to orchestrate push/pull operations
- SyncClient interface for API communication
- Zod schemas for validation

## SQLite Migration (010_sync_fields)
- Add device_id, sync_version, last_synced_at to notes/notebooks
- Create sync_queue table for offline changes
- Create sync_metadata table for sync state

## Desktop Components
- syncStore (Zustand) for auth and sync state
- SyncStatusIndicator component
- LoginModal component for magic link auth

Backend API (Hono + Neon) to be implemented separately.

Refs #69

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26512f1529

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 52 to 55
rollupOptions: {
input: {
index: resolve(__dirname, 'src/renderer/index.html'),
settings: resolve(__dirname, 'src/renderer/settings.html'),
},

Choose a reason for hiding this comment

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

P1 Badge Keep a settings entry point in the renderer build

Removing the settings.html entry from the renderer build means the production bundle no longer emits a settings page, but window:openSettings in apps/desktop/src/main/index.ts still calls loadFile('../renderer/settings.html') (and dev replaces the URL with /settings.html). That makes the settings window open to a missing file/404, so the Settings UI won’t render at all when users click the sidebar settings button. Either keep a settings.html build input or update the main-process loader to point at index.html?view=settings.

Useful? React with 👍 / 👎.

Comment on lines +214 to +216
// Escape FTS5 special characters: " * ^ - OR AND NOT ( )
const escaped = query.replace(/["\*\^()]/g, ' ').trim();

Choose a reason for hiding this comment

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

P2 Badge Escape hyphens before building FTS5 queries

The FTS5 query sanitizer claims to escape - but the regex only strips " * ^ ( ). If a user searches for a hyphenated term like foo-bar, prepareFtsQuery produces "foo-bar"*, which SQLite parses as foo - bar and throws no such column: bar, causing the search call to error. This makes search fail for common hyphenated inputs; consider stripping or splitting on - before composing the MATCH query.

Useful? React with 👍 / 👎.

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