Commit Graph

85 Commits

Author SHA1 Message Date
lucaronin
b239de3719 fix: prevent crash when opening notes
Move setActiveTabPath after tab content is loaded to prevent Editor's
useEffect from firing before the tab exists in the tabs array. Add
try/catch around editor.replaceBlocks for defensive error handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:52:10 +01:00
lucaronin
829cd2ad95 feat: add vault switcher in status bar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:45:31 +01:00
lucaronin
2f59d1d6c8 perf: single editor instance with document swapping
Replace per-tab BlockNote instances with one shared editor that swaps
content via replaceBlocks(). Cached blocks per tab path make subsequent
switches instant — only first open parses markdown. Cache entries are
cleaned up when tabs close.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:38:57 +01:00
lucaronin
0714184e3c perf: keep tab editors mounted for instant switching (Obsidian pattern)
Instead of unmounting/remounting BlockNoteTab on every tab switch
(via key={activeTabPath}), render all open tabs simultaneously and
toggle visibility with CSS display:none/block. This eliminates
editor recreation and markdown re-parsing on switch. Also adds a
loading skeleton for new tabs and uses a ref for tabs to avoid
stale closures in handleSelectNote.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:32:57 +01:00
lucaronin
b74771aa8f perf: fix resize jank with RAF throttle and React.memo on Sidebar
Add requestAnimationFrame throttling to ResizeHandle so mouse move
events are batched per frame instead of triggering setState on every
pixel. Wrap Sidebar in React.memo so it skips re-rendering when only
the parent wrapper div width changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:14:50 +01:00
lucaronin
2f6bc97cf5 perf: memoize Editor component and wikilink suggestion items
Wrap Editor in React.memo to prevent re-renders from parent width
changes. Memoize the base wikilink items array with useMemo so it
only recomputes when entries change, not on every keystroke.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:14:43 +01:00
lucaronin
60f2a545f1 perf: virtualize NoteList with react-virtuoso and add useMemo
Replace plain .map() rendering with Virtuoso for virtual scrolling of
9000+ notes. Add useMemo to all filtering/sorting chains (filtered,
sorted, searched, typeCounts, displayed). Use entry.snippet directly
instead of computing snippets from allContent. Wrap NoteList in
React.memo to prevent unnecessary re-renders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:14:36 +01:00
lucaronin
f613335f97 feat: add snippet field to frontend types and mock data
Add snippet: string to VaultEntry TypeScript interface to match the
Rust backend. Update mock data with snippets for all entries. Add
.laputa-cache.json to .gitignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:14:29 +01:00
lucaronin
1f8740e4af feat: add native macOS title bar with transparent overlay
- Use titleBarStyle: Transparent for native window frame on top
- Add paddingTop: 38px to Sidebar to make room for title bar
- Keep solution simple: native traffic lights + dragging work out-of-the-box
- Removed custom traffic lights and drag handlers
2026-02-17 16:55:23 +01:00
lucaronin
517148f2a6 feat: replace sidebar header with native macOS title bar (38px) 2026-02-17 16:39:23 +01:00
lucaronin
348b028e2a fix: use dynamic color-coding for active note states based on type 2026-02-17 14:24:13 +01:00
lucaronin
a7b6726964 feat: update sidebar colors and spacing - accent colors, increased gaps 2026-02-17 14:12:56 +01:00
lucaronin
0b3d190644 feat: sidebar redesign - chevron right, remove section badges, align groups 2026-02-17 13:47:48 +01:00
lucaronin
5c7c06705f feat: update Sidebar to match design - traffic lights, wrench icon, proper indentation 2026-02-17 13:45:09 +01:00
lucaronin
f9d9bdabf7 refactor: decompose Inspector.tsx into EditableValue, DynamicPropertiesPanel, and frontmatter utils 2026-02-17 12:12:32 +01:00
lucaronin
47deb6f3b7 refactor: extract useVaultLoader and useNoteActions hooks from App.tsx 2026-02-17 12:10:21 +01:00
lucaronin
e805970c17 refactor: extract wikilink utils and DiffView from Editor.tsx 2026-02-17 12:08:03 +01:00
lucaronin
27e1d71488 refactor: extract DiffView into its own file from Editor.tsx 2026-02-17 12:07:23 +01:00
lucaronin
3572d0238b test: add Editor.tsx unit tests
- Empty state rendering with keyboard shortcut hints
- Tab bar rendering and switching between tabs
- Close tab interaction
- Breadcrumb bar with note type, title, and word count
- New note button in tab bar
- BlockNote editor rendering
- Modified indicator and diff toggle button
- Inspector panel integration
2026-02-17 11:59:21 +01:00
lucaronin
0c2cfe13bf test: add App.tsx integration tests
- Renders four-panel layout with sidebar, note list, editor
- Loads and displays vault entries from mock data
- Shows empty state when no note is selected
- Keyboard shortcut Cmd+S shows toast
- Verifies default sidebar selection (All Notes)
2026-02-17 11:59:17 +01:00
lucaronin
ddb2ca0783 fix: update tests to match redesigned UI
- Remove Sidebar tests for removed elements (app title, search bar)
- Update Inspector tests: header is now 'Properties' not 'Inspector'
- Fix status pill test to check inline styles instead of old CSS class
- Update relationship tests to use frontmatter-based rendering
- Fix 'no relationships' test to use content without relationship keys
2026-02-17 11:56:17 +01:00
lucaronin
fe997b8d4d feat: redesign v2 — inspector layout fix, editor scroll, diff moved to breadcrumb bar
- Fix editor scroll (min-height: 0 + overflow)
- Properties panel extends full height
- Moved Diff button to git-branch icon in breadcrumb bar
- Minor CSS fixes for app layout
2026-02-17 11:31:23 +01:00
lucaronin
d8b91522bb Remove dark mode — force light mode only
- Remove .dark CSS variables block from index.css
- Remove theme toggle state and Cmd+Shift+T shortcut from Sidebar
- Remove dark class initialization from main.tsx
- Hardcode BlockNote theme to 'light' in Editor
- shadcn dark: classes left in place (harmless, no-op without .dark class)
2026-02-17 11:03:23 +01:00
lucaronin
6989f44031 feat: migrate to shadcn/ui
Install Tailwind CSS v4 + shadcn/ui with Radix UI primitives. Migrate all
UI components (Sidebar, NoteList, Editor tabs, Inspector, dialogs, palette)
from BEM CSS to Tailwind utility classes and shadcn components (Button,
Input, Dialog, Badge, etc.). Map theme system to shadcn CSS variables while
preserving BlockNote editor styles untouched. Remove 8 old CSS files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:56:44 +01:00
lucaronin
4d33435bfd Revert "feat: block numbers + active block highlight (onSelectionChange)"
This reverts commit c9b999279d.
2026-02-16 14:50:29 +01:00
lucaronin
c9b999279d feat: block numbers + active block highlight (onSelectionChange) 2026-02-16 14:49:30 +01:00
lucaronin
8fc759da99 fix: remove vertical nesting lines for cleaner list appearance 2026-02-16 14:24:15 +01:00
lucaronin
59d1bf8e8e feat: kitchen-sink mock note with all markdown features for visual testing 2026-02-16 14:12:56 +01:00
lucaronin
78fedc92e7 fix: align list nesting vertical lines with bullet center via ::before left offset 2026-02-16 14:07:02 +01:00
lucaronin
94cd8bdcc1 feat: title separator, centered editor, handle spacing, list line alignment 2026-02-16 13:50:21 +01:00
lucaronin
fd021b2c1a fix: side menu handles horizontal layout for better vertical alignment with headings 2026-02-16 09:27:28 +01:00
lucaronin
94936f2f27 fix: override BlockNote default line-height 1.5 on .bn-block-outer with theme value 2026-02-16 09:17:03 +01:00
lucaronin
711f3c7bc4 feat: add bulletGap and checkbox gap controls in theme.json 2026-02-16 08:54:11 +01:00
lucaronin
16f8056991 fix: bullet/checkbox vertical alignment with text line, heading margins on block-outer 2026-02-16 08:52:18 +01:00
lucaronin
6e1a98ad6c fix: heading handle alignment (padding on block-outer), bullet/checkbox/list CSS targeting 2026-02-16 08:33:15 +01:00
lucaronin
6ef354e639 fix: heading margins on .bn-block wrapper so drag handles stay vertically aligned 2026-02-16 08:24:49 +01:00
lucaronin
4c211e09bc fix: editor content survives theme HMR + bullet marker styling + indent control 2026-02-16 08:21:23 +01:00
lucaronin
405d5f39fc feat: comprehensive theme.json config with live hot-reload for editor styling 2026-02-16 08:04:06 +01:00
lucaronin
9afc13811e merge: blocknote-poc into main 2026-02-16 07:55:46 +01:00
lucaronin
9a9769334e feat: proper wiki-links as custom BlockNote inline content with suggestion menu
- Custom 'wikilink' inline content type via createReactInlineContentSpec
- Extended BlockNote schema with wikilink spec
- Suggestion menu triggered by [[ showing all vault entries
- Markdown round-trip: [[target]] → placeholder tokens → wikilink inline content
- Click handler on .wikilink elements for navigation
- Removed old hack (regex preprocessing to wikilink.internal URLs + DOM click interception on <a> tags)
- Added .wikilink CSS styles
- Passed entries prop from App.tsx to Editor for suggestion menu
2026-02-15 19:50:23 +01:00
lucaronin
4284ed3221 fix: working wiki-link click interception via capture-phase handler on container 2026-02-15 19:41:39 +01:00
lucaronin
465e40a6a8 fix: remove href from wikilink anchors to prevent browser navigation, use onclick instead 2026-02-15 19:35:31 +01:00
lucaronin
c3693c94a4 fix: intercept wikilink clicks at document level to prevent browser navigation 2026-02-15 19:32:34 +01:00
lucaronin
0f5b444740 feat: render wiki-links as clickable links in BlockNote editor
Pre-process markdown to convert [[target]] → markdown links with
a wikilink.internal URL before feeding to BlockNote. Click handler
intercepts these links and navigates to the target note.
2026-02-15 19:28:29 +01:00
lucaronin
fdd7a248b2 Editor UX: zero horizontal shift for headings and bullets (Bear-style)
Three CSS fixes for the codemirror-live-markdown live preview:

1. Remove header underlines (border-bottom: none on .cm-heading-line)
2. Heading markers (## etc) positioned absolutely in left gutter area
   so they never push heading text horizontally when revealed
3. List bullets always occupy fixed width (font-size: 1em, not collapsed),
   showing • when inactive and source char (-) when active

Verified via Playwright: 0px horizontal shift on both headings and bullets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 19:18:08 +01:00
lucaronin
1e95174197 feat: replace CodeMirror 6 with BlockNote editor (PoC)
- Swap CM6 editor with BlockNote block-based editor
- Strip YAML frontmatter before passing to BlockNote, keep separate
- Intercept link clicks for wikilink navigation
- Remove all @codemirror/*, @lezer/*, codemirror-live-markdown deps
- Remove frontmatterHide.ts (no longer needed)
- Update Editor.css: remove .cm-* styles, add BlockNote container styles
- Tab bar, diff toggle, inspector panel unchanged
2026-02-15 19:14:55 +01:00
lucaronin
81fe9418ce Replace custom live preview with codemirror-live-markdown library
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 18:40:33 +01:00
lucaronin
a15982bc37 Add commit and push functionality with dialog
Sidebar shows "Commit & Push" button when uncommitted changes exist.
Clicking opens a commit message dialog. After committing, auto-pushes and
shows success/error toast. Modified files count refreshes after commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 13:00:10 +01:00
lucaronin
1eccaf7f76 Add diff view toggle for modified files in editor
Editor tab bar shows Edit/Diff toggle button when viewing a modified file.
Diff view renders git diff output with green (added), red (removed), and
gray (context) line coloring. Uses `get_file_diff` Tauri command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 12:58:00 +01:00
lucaronin
ab31076464 Add modified files view with Changes filter in sidebar
New "Changes" sidebar filter shows vault-wide uncommitted changes via
`get_modified_files` Tauri command (git status --porcelain). NoteList shows
modified files with M/A/D/? status indicators. Badge on sidebar shows count.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 12:56:28 +01:00