Commit Graph

41 Commits

Author SHA1 Message Date
Luca Rossi
68d28bc556 test: add asserting wikilink navigation E2E test — screenshot.spec.ts test had no expect() calls (#180)
Co-authored-by: Test <test@test.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-02 23:55:57 +01:00
lucaronin
ad10550872 fix: remove unused fileBuffer variable in e2e test 2026-02-23 23:15:32 +01:00
lucaronin
7a58291700 test+design: add E2E drag-drop tests and design wireframes
E2E tests cover:
- Drag & drop image into editor inserts image block with data URL
- Drop zone overlay appears during image drag
- Non-image file drops are correctly ignored

Design file shows three states: idle, drag-over (dashed border +
overlay label), and after-drop (image block inserted inline).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 23:15:32 +01:00
lucaronin
1b22a12dcb test: add E2E tests for settings GitHub OAuth flow
Playwright tests verify:
- Connected state shows username and disconnect button
- Login with GitHub button appears after disconnecting
- No token input field is present

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 23:06:46 +01:00
lucaronin
9226d0c66e test: add E2E tests for vault picker local options
Playwright tests verify the vault menu shows all three add-vault
options (open local folder, create new vault, connect GitHub) with
correct testids and visual appearance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:01:42 +01:00
lucaronin
1a57793337 test: update E2E test for Cmd+S save + add design file
- E2E test now verifies Cmd+S shortcut shows a save toast
- Added design/editor-save-bug.pen wireframe

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 19:55:05 +01:00
lucaronin
6c2e1b7607 fix: replace broken auto-save with explicit Cmd+S save
Removes the debounced auto-save (useAutoSave hook) which was causing the
editor to reload previous content. Replaces it with explicit save on
Cmd+S (⌘S), consistent with the git-based UX of the app.

- Removed useAutoSave hook and its debounce mechanism
- Added useSaveNote hook for direct persist-to-disk
- Added useEditorSave hook that manages pending content buffer + save
- Cmd+S now persists the current editor content immediately
- Rename-before-save: saves pending content before rename to prevent
  the "Failed to rename note" error
- Updated E2E test to verify Cmd+S behavior
- 471 tests passing, code health gates passed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 19:53:36 +01:00
lucaronin
d5fbff07ad fix: resolve TypeScript build errors and add E2E test
- Fix type annotations in App.tsx (setTabs callback)
- Cast restoreWikilinksInBlocks result in Editor.tsx for BlockNote compatibility
- Fix vi.fn() mock types in useAutoSave.test.ts
- Add E2E test verifying editor loads and renders note content
- Update .claude-done with editor-save-bug summary

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:01:48 +01:00
lucaronin
fc5a97ee91 test(e2e): add Playwright tests for sidebar collapse states
- Verifies default 3-panel layout
- Collapse button hides sidebar
- Alt+1 editor-only, Alt+2 editor+notes, Alt+3 restore all
- Uses JS-dispatched keyboard events (macOS Alt produces special chars)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 08:36:07 +01:00
lucaronin
ee00c2ca58 test: add Playwright e2e tests for rename tab feature
Tests double-click → inline edit → Enter saves, and Escape cancels.
Both tests pass with visual screenshot verification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 19:30:42 +01:00
lucaronin
01c89f3646 test: regression tests for flushSync-in-lifecycle editor bug
Add unit test verifying content blocks are applied via deferred microtask
(not synchronously in useEffect). Convert debug E2E test into a proper
regression test that checks editor content appears after clicking a note
and no flushSync errors are logged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:07:30 +01:00
lucaronin
102a7233d2 wip: initial fix attempt for editor content not appearing on first load 2026-02-21 17:04:11 +01:00
lucaronin
311c5e434b feat: archive notes — filter sidebar, hide archived, relationship indicators 2026-02-21 16:44:09 +01:00
lucaronin
cdf203de1a fix: use stable asset URLs for image uploads (blob URL fix) 2026-02-21 13:08:29 +01:00
lucaronin
deea70a098 fix: use stable asset URLs for image uploads instead of ephemeral blob URLs
Blob URLs are session-scoped and don't survive page reloads — images
would break on Cmd+Shift+R. Now uploadFile awaits save_image (which
persists to vault/attachments/) and returns a convertFileSrc asset URL
that the Tauri webview can resolve indefinitely.

- Editor.tsx: await save_image → convertFileSrc for Tauri mode;
  FileReader.readAsDataURL fallback for browser dev mode
- tauri.conf.json: enable assetProtocol with scope ["**"]
- mock-tauri.ts: save_image returns a plausible file path
- E2E test: expect data: URLs in browser dev mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:06:04 +01:00
lucaronin
e02db50533 fix: use blob URLs for image uploads instead of data URLs
The uploadFile callback was converting images to data URLs via FileReader,
which caused images to get stuck on "Loading..." in the editor. Switched
to URL.createObjectURL() which returns a lightweight blob URL immediately.
The Tauri vault-save path is now fully fire-and-forget so it never blocks
the URL return.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 11:00:41 +01:00
lucaronin
4b843f94f6 feat: Allow to create new types 2026-02-21 10:32:36 +01:00
lucaronin
5e738f1e2b test: add E2E tests for image upload in editor
Verifies that the slash menu Image option works and that no
upload-related errors occur when inserting an image block.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 10:15:58 +01:00
lucaronin
333df92bc9 test: add E2E tests for create new type feature
6 Playwright tests covering the full flow:
- Create Type dialog opens from + button on Types section
- Create button disabled when name is empty
- Creating a type adds it to sidebar and opens it in editor
- Custom types appear in Create Note dialog type selector
- Can create instances of custom types
- Cancel closes dialog without side effects

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 09:46:02 +01:00
lucaronin
4e4cffe6a3 fix: ensure editor has full width regardless of title/content length
The BlockNote editor container (.bn-container) had no explicit width,
so it sized based on content. With short or empty document titles,
the editor collapsed to a very small width.

Fix: set width: 100% on .bn-container and .bn-editor so the editor
always fills available space. Added margin: 0 auto on .bn-editor to
keep the 760px text column centered.

Also adds an E2E test verifying editor width stays above 300px.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 09:39:37 +01:00
lucaronin
399b8b58a0 feat: add mock AI chat panel
Replaces Inspector panel when activated via Sparkle button in editor
info bar. Includes context pills, message list with typing indicator,
quick action pills (Summarize/Expand/Fix grammar), model selector,
and mock responses with 1200ms delay. E2E test covers full flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:06:51 +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
e3dc38e58e Fix tauri.conf.json: remove invalid titleBarStyle overlay 2026-02-15 13:45:24 +01:00
lucaronin
582e33542d Add comprehensive E2E tests for all core flows (M5 Task 5)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:27:32 +01:00
lucaronin
6d07b7afe3 Refine visual polish: blue accent states, tab hover, editor hints (M5 Task 4)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:26:58 +01:00
lucaronin
343b075b07 Add keyboard shortcuts: Cmd+N, Cmd+S, Cmd+W, Cmd+P (M5 Task 3)
Cmd+N opens create note dialog, Cmd+S shows save toast,
Cmd+W closes active tab, Cmd+P opens quick open palette.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:19:38 +01:00
lucaronin
218a13b859 Add quick open palette with fuzzy search (M5 Task 2)
Cmd+P opens a VS Code-style search palette overlay with fuzzy matching
across all note titles. Arrow keys to navigate, Enter to select, Esc to close.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:17:38 +01:00
lucaronin
7b9d52d970 Add create note dialog with type selector (M5 Task 1) 2026-02-14 21:14:16 +01:00
lucaronin
1a2068562a Add clickable wikilinks that navigate between notes
- [[wikilinks]] rendered as styled blue text with brackets hidden
- Brackets revealed when cursor is on the wikilink line (reveal-on-focus)
- Clicking a wikilink opens the linked note in a new tab
- Navigation matches by title or alias (case-insensitive)
- Uses CM6 Facet to pass navigation callback to widget DOM listeners
- Add Playwright test verifying wikilink styling and click navigation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:32:37 +01:00
lucaronin
daa7d4d0c1 Add wikilinks: render [[links]] as styled clickable elements
Wikilinks are detected via regex, rendered as styled spans with hidden
brackets, and navigate to the linked note on click. Uses mousedown
instead of click to catch the event before CM6 removes the widget.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:30:45 +01:00
lucaronin
94530e9161 Hide YAML frontmatter in editor, reveal on cursor entry
- Add frontmatterHide extension using CM6 StateField for cross-line replacement
- Frontmatter (--- ... ---) collapsed to small "---" indicator when cursor is outside
- Cursor entering the frontmatter block reveals full YAML content
- Editor places cursor after frontmatter on note load so it starts hidden
- Add Playwright test verifying frontmatter is hidden by default

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:24:57 +01:00
lucaronin
eb87c0d223 Add tab bar with open/close/switch for multi-note editing
- Replace single selectedNote with tabs state in App (open/close/switch)
- Tab bar above editor: title + x close button, active tab highlighted
- Clicking note opens new tab or switches to existing
- Closing active tab switches to adjacent tab
- Fix race condition: editor re-creates when tab content loads async
- Add Playwright test verifying multi-tab behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:15:44 +01:00
lucaronin
72bc90e3be Add live preview with reveal-on-focus for markdown syntax
- Implement Obsidian/Bear-style live preview via CM6 ViewPlugin + decorations
- Headings: ## markers hidden, text rendered large — revealed on cursor line
- Bold/italic: ** and * markers hidden, text styled — revealed on cursor line
- Links: [text](url) rendered as styled text — revealed on cursor line
- Inline code: backticks hidden, content styled with monospace — revealed on cursor line
- Horizontal rules rendered as styled <hr> elements
- Add Playwright test verifying reveal-on-focus behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:11:47 +01:00
lucaronin
bc2dd10f9e Add CodeMirror 6 editor with dark theme and note selection
- Install CM6 packages (state, view, lang-markdown, theme-one-dark, commands, language)
- Replace Editor placeholder with real CodeMirror 6 instance
- Add realistic markdown content to all mock entries in mock-tauri.ts
- Wire up note selection: clicking a note in NoteList loads its content in the editor
- Dark theme matching app colors, line numbers, active line highlighting, line wrapping
- Update NoteList with selected state styling
- Update Playwright screenshot test to capture editor with note selected

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:07:23 +01:00
lucaronin
05550e8a11 Add type filter pills to note list
Pill bar below search: All | Projects | Notes | Events | People |
Experiments | Procedures | Responsibilities. Clicking a pill filters
the displayed entries by isA type. "All" resets the filter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:48:59 +01:00
lucaronin
b343330cb7 Add sort by last modified and search bar to note list
Default sort: last modified descending (pinned entity stays first
in entity view). Search bar at top filters by title substring
(case-insensitive).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:46:44 +01:00
lucaronin
085b9089f3 Add note list filtering by sidebar selection
- All Notes → show everything
- People/Events filters → show entities of that type
- Section group header → show all entities of that type
- Specific entity → pinned at top with green border + children
- Topic → show entries whose relatedTo references that topic
- Wikilink reference matching (belongsTo/relatedTo → path stem)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:44:39 +01:00
lucaronin
3f89d31720 Add sidebar filters (All Notes, People, Events, Favorites, Trash) 2026-02-14 19:38:38 +01:00
lucaronin
3871cb5ba1 Add sidebar section groups (PROJECTS, EXPERIMENTS, RESPONSIBILITIES, PROCEDURES)
Each section is collapsible with expand/collapse toggle, shows entity count,
and has a + button. Entities are clickable. SidebarSelection type introduced
for managing navigation state across filters, section groups, entities, and topics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:35:10 +01:00
lucaronin
e72d66ae64 Add Tauri mock layer for browser testing and visual verification workflow 2026-02-14 18:54:27 +01:00
lucaronin
7d5c48c2a8 Add unit and E2E tests for all panel components
- Vitest tests for Sidebar, NoteList, Inspector (7 tests)
- Playwright E2E tests verifying four-panel layout renders (2 tests)
- All tests passing: cargo test (10), pnpm test (7), pnpm test:e2e (2)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 18:25:11 +01:00