Skip to content

Add Slate.js rich-text editor for notes with task-card embedding#194

Open
SlayterDev wants to merge 9 commits into
mainfrom
claude/slate-markdown-integration-5VnMO
Open

Add Slate.js rich-text editor for notes with task-card embedding#194
SlayterDev wants to merge 9 commits into
mainfrom
claude/slate-markdown-integration-5VnMO

Conversation

@SlayterDev
Copy link
Copy Markdown
Owner

Replaces the plain textarea in NoteForm with a full Slate.js rich-text
editor supporting bold, italic, inline code, headings (H1/H2), bulleted
and numbered lists, code blocks, and keyboard shortcuts (Mod+B/I/`).

New task-card void element lets users embed a live todo card inline
inside a note. Triggered by typing "/" at the start of an empty
paragraph or via the toolbar "Insert Task" button, a command palette
searches pending todos and inserts a linked card that fetches and
renders the todo's status, content, due date, and time estimate.

Content is persisted as serialized Slate JSON (slate_json format).
Legacy notes stored as markdown continue to render via react-markdown
with no changes required.

Search quality is preserved: a new content_plain column stores
plain-text extracted from Slate JSON (server-side via slateUtils.ts),
and the organized_notes search_vector is rebuilt to use
coalesce(content_plain, content, '') so JSON structural keywords never
pollute the full-text search index.

https://claude.ai/code/session_01Gnk7dD1tw9fVFiod5qBsq5

claude and others added 9 commits March 10, 2026 02:47
Replaces the plain textarea in NoteForm with a full Slate.js rich-text
editor supporting bold, italic, inline code, headings (H1/H2), bulleted
and numbered lists, code blocks, and keyboard shortcuts (Mod+B/I/`).

New task-card void element lets users embed a live todo card inline
inside a note. Triggered by typing "/" at the start of an empty
paragraph or via the toolbar "Insert Task" button, a command palette
searches pending todos and inserts a linked card that fetches and
renders the todo's status, content, due date, and time estimate.

Content is persisted as serialized Slate JSON (slate_json format).
Legacy notes stored as markdown continue to render via react-markdown
with no changes required.

Search quality is preserved: a new content_plain column stores
plain-text extracted from Slate JSON (server-side via slateUtils.ts),
and the organized_notes search_vector is rebuilt to use
coalesce(content_plain, content, '') so JSON structural keywords never
pollute the full-text search index.

https://claude.ai/code/session_01Gnk7dD1tw9fVFiod5qBsq5
The content limit for organized notes was raised from 50k to 500k
characters to accommodate serialized Slate JSON. Update the test
boundary to use 500001 characters.

https://claude.ai/code/session_01Gnk7dD1tw9fVFiod5qBsq5
* Add LM Studio as a local LLM provider

Adds LM Studio support using the existing OpenAI SDK with a custom
baseURL (http://localhost:1234/v1), since LM Studio exposes a
fully OpenAI-compatible REST API. Uses json_object response format
(not Structured Outputs) for broad model compatibility, with graceful
tool-call fallback mirroring the Ollama provider.

Changes:
- packages/llm: LMStudioProvider class, updated ProviderType union,
  SettingsConfig, provider-factory, and index exports
- packages/database: add 'lmstudio' to llm_provider enum, add
  lmstudio_base_url column, migration 0019
- apps/api: new /api/v1/lmstudio/models and /health routes
- apps/web: LM Studio provider button, dynamic model list, base URL
  input in Advanced Settings
- .env.example: LM_STUDIO_BASE_URL variable

https://claude.ai/code/session_014vPCcYQRHJpXauLWVzqVvG

* Fix lmstudio route: use fetch instead of openai SDK

apps/api doesn't have openai as a direct dependency.
Replace OpenAI client with a direct fetch to the LM Studio
/v1/models endpoint (OpenAI-compatible), fixing the TS2307
and TS7006 build errors.

https://claude.ai/code/session_014vPCcYQRHJpXauLWVzqVvG

* Address PR review feedback for LM Studio support

- Base URL: users now enter host:port only (e.g. http://localhost:1234);
  the /v1 path is appended automatically by the provider and API route.
  Added a toBaseURL() helper that also handles the case where a user
  has already stored a /v1 URL (backwards compatible).
- Models: added display_name to LMStudioModel type (API route, web
  client) and use it in the SettingsPage dropdown for user-facing labels.
- Updated migration default and schema default to http://localhost:1234.
- Updated .env.example accordingly.

https://claude.ai/code/session_014vPCcYQRHJpXauLWVzqVvG

* LM Studio fixes

---------

Co-authored-by: Claude <noreply@anthropic.com>
* Initial plan

* Fix tag description toggle: preserve user's change after API response

The handleUpdate function was calling setSettings(updated) with the raw API
response. If the API response contained stale/incorrect data (due to race
conditions like concurrent settings updates), the toggle would flip back to off.

Fix:
1. Merge user's intended changes into the API response: setSettings({...updated, ...updates})
   This ensures the toggle stays in the user's chosen state even if the API
   response has stale data from a concurrent update.
2. Add null check for the API response to prevent invalid state if the API
   unexpectedly returns nothing.

Co-authored-by: SlayterDev <1760134+SlayterDev@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SlayterDev <1760134+SlayterDev@users.noreply.github.com>
Co-authored-by: Brad Slayter <SlayterDev@users.noreply.github.com>
Main added 0019_add_lmstudio_provider; renumber our Slate content format
migration (0019_fixed_spot → 0020_fixed_spot) and update the journal.

https://claude.ai/code/session_01Gnk7dD1tw9fVFiod5qBsq5
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.

3 participants