Commit graph

7 commits

Author SHA1 Message Date
Helm
175cfa2c61 fix: font size caching + persistence debug logging
Font fix: setChatFontSize() was called in the view factory before
onOpen() created the DOM. querySelector returned null and the call
silently failed. Now stores _chatFontSize field — setChatFontSize()
always caches the value, and onOpen() reapplies it once the container
exists. This fixes the "font resets to default on restart" bug.

Persistence debug: added console.log in onOpen() restore loop and
onClose() save to help diagnose why messages aren't repopulating.
data.json is confirmed written correctly on disk — the debug logs
will reveal whether loadMessages() returns the saved data at all.
2026-07-10 13:38:29 -04:00
Helm
fc5c9c01bf fix: eliminate racing saveData() calls during message restore
When onOpen() restored saved messages, each appendMessage() call
fired a fire-and-forget saveMessages() → saveData(). With N saved
messages, N overlapping saveData() writes raced against each other.
If a stale write landed last, the persisted data could be corrupted
or appear empty on next restart.

Fix: add _restoring flag. Skip saveMessages() inside appendMessage()
while restoring. Do a single clean save after the restore loop.
Also wraps the restore loop in try/catch so a rendering failure
in one message doesn't silently kill the entire restore.
2026-07-10 13:26:57 -04:00
Helm
0cebcf6084 fix: font resize targets correct CSS selector
setChatFontSize was setting --hermes-chat-font-size on
this.containerEl (outer Obsidian view wrapper), but the CSS
default was defined on .hermes-chat-container (inner child).
The child's explicit default overrode the inherited value,
so the font size slider had no visible effect.

Now targets .hermes-chat-container directly.
2026-07-10 13:16:36 -04:00
Helm
a819e7dd2f fix: font resize live-update + chat message persistence
- Font size slider now calls saveSettings() instead of saveData()
  so changes propagate to open views immediately
- Chat messages persist across plugin reload via chatMessages
  array in plugin settings — ChatPersistence interface bridges
  ChatView to Plugin data layer
- Messages auto-save on append and on close
2026-07-10 13:09:00 -04:00
Helm
695a8e0050 feat: markdown rendering + font size slider
- Chat messages now render full markdown via Obsidian's MarkdownRenderer
  (headers, bold, italic, code blocks, lists, links)
- Streaming shows plain text, swaps to rendered markdown on completion
- User messages render instantly as markdown
- New Chat font size slider in plugin settings (10-24px, default 14)
- Live-applies via CSS custom property --hermes-chat-font-size
- No restart needed
2026-07-10 11:58:46 -04:00
Helm
16fb2238dd feat: context capture fix, multi-tab support, slash commands with autocomplete
- Fix context capture timing bug: snapshot active note on chat focus
  instead of at send time (when activeEditor is already null).
  Added workspace active-leaf-change listener to keep context fresh.
- Multi-tab: each ChatView now gets its own ApiClient instance,
  enabling independent sessions per tab. Added 'Open in New Tab'
  command. Removed shared ApiClient from plugin.
- Slash commands: three built-in commands (/prep-session,
  /sync-content, /lint-wiki) plus JSON-configurable custom commands
  in settings. On '/' trigger, shows suggestion dropdown with
  arrow-key navigation, click-to-select, and Escape to close.
- Slash command resolution at send time replaces /trigger with
  full prompt text.
2026-07-10 11:40:40 -04:00
Helm
3b35f59ec8 Initial commit: Obsidian Hermes Chat plugin
- Streaming chat sidebar with OpenAI-compatible API client
- Path-referencing context injection via MCP tools
- Dark theme styling with Obsidian CSS variables
- Settings: gateway URL, API key, context/model toggles
- SSE streaming with fetch timeout protection
- Session continuity via X-Hermes-Session-Id headers
2026-07-10 11:18:23 -04:00