- Rust Frontmatter struct now parses both 'type' (new) and 'Is A'/'is_a' (legacy),
with 'type' taking precedence via resolve_type()
- Added migrate_is_a_to_type() vault-wide migration (runs on startup, also exposed as Tauri command)
- Frontend: buildNoteContent and resolveNewType now emit 'type:' in YAML
- Inspector SKIP_KEYS hides 'is_a', 'Is A', 'type', 'title' from property list
(TypeRow already renders the type with its dedicated UI)
- frontmatterToEntryPatch handles both 'type' and legacy 'is_a' keys
- Mock data updated: all YAML content uses 'type:' instead of 'is_a:'/'Is A:'
- Tests updated to expect 'type:' in generated frontmatter
Product decision: internal VaultEntry field stays as `isA` (TS) / `is_a` (Rust)
to minimize blast radius. The user-facing change is the YAML key and inspector.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The editor was not persisting changes to disk. Edits would be lost
when closing and reopening a note.
Changes:
- Add save_note_content Tauri command (Rust) with read-only file check
- Add save_note_content mock handler for browser testing
- Add useAutoSave hook with 500ms debounce and flush-on-tab-switch
- Wire up BlockNote onChange → markdown serialization → auto-save
- Add restoreWikilinksInBlocks utility (reverse of injectWikilinks)
to convert wikilink nodes back to [[target]] before markdown export
- Extract shared walkBlocks helper to eliminate code duplication
- Suppress onChange during programmatic content swaps (tab switching)
- 12 new frontend tests + 5 new Rust tests (all 469 + 174 passing)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci: auto-release workflow on merge to main
Rewrite .github/workflows/release.yml to trigger on every push to main
instead of manual tag pushes. The workflow now:
- Computes version as 0.YYYYMMDD.GITHUB_RUN_NUMBER
- Builds aarch64-apple-darwin and x86_64-apple-darwin in parallel
- Merges them into a universal binary using lipo
- Creates a universal .dmg and signed updater tarball
- Generates latest.json with per-arch and universal platform entries
- Publishes a GitHub Release with auto-generated release notes
- Updates a GitHub Pages release history site (gh-pages branch)
Product decisions:
- Universal binary approach: copy arm64 .app as base, lipo the main
executable, keep everything else from arm64 (shared frameworks are
architecture-independent). This is the standard Tauri pattern.
- Per-arch updater tarballs are also uploaded so the Tauri updater can
download the correct arch-specific build (smaller download).
- Release notes are auto-generated from git log since last tag.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci: github pages with release history
Use peaceiris/actions-gh-pages@v4 to deploy a release history site.
The page fetches releases.json (also deployed) and renders each release
with date, notes, and download links for .dmg files.
This handles the gh-pages branch creation automatically on first run.
The page is available at https://refactoringhq.github.io/laputa-app/
Product decision: used fetch() to load releases.json at runtime instead
of inlining it, which is cleaner and avoids shell escaping issues with
release note content. The releases.json is deployed alongside index.html.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: in-app update notification UI
Replace the old window.confirm updater with a proper React-based
update notification system:
- useUpdater hook now exposes state machine (idle → available →
downloading → ready) and actions (startDownload, openReleaseNotes,
dismiss)
- UpdateBanner component renders at the top of the app shell:
- "Available" state: shows version, Release Notes link, Update Now
button, dismiss X
- "Downloading" state: animated spinner, progress bar with percentage
- "Ready" state: Restart Now button to apply the update
- Silently checks on startup after 3s delay; fails silently on
network errors or 404
- Release Notes link opens the GitHub Pages release history site
Product decisions:
- Banner at top of app (not a modal) — non-intrusive, visible but
not blocking. User can dismiss and continue working.
- Progress bar shows during download so user knows it's working.
- Separate "Restart Now" state after download so user controls when
the app restarts (they may have unsaved work).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: updater component tests
Rewrite useUpdater hook tests and add UpdateBanner component tests:
Hook tests (10 cases):
- Starts in idle state
- Does nothing when not in Tauri
- Checks for updates after 3s delay
- Stays idle when no update available
- Transitions to available when update found
- Handles missing release body gracefully
- Stays idle on network error (fails silently)
- Dismiss returns to idle
- openReleaseNotes opens correct URL
- startDownload transitions through downloading to ready
Component tests (10 cases):
- Renders nothing when idle
- Renders nothing on error
- Shows version and buttons when available
- Update Now calls startDownload
- Release Notes calls openReleaseNotes
- Dismiss button works
- Shows progress bar during download
- Shows 0% at start of download
- Shows restart button when ready
- Restart button calls restartApp
All 457 tests pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* design: auto-build-release wireframes
Copy ui-design.pen as base. Frames to be added for:
1. Update notification banner (visible state) — horizontal bar at
top of app shell with version text, Release Notes link, Update
Now button, and dismiss X
2. Update download progress state — spinner icon, progress bar with
percentage, downloading text
3. "Restart to apply" state — green accent, version text, Restart
Now button
Note: Pencil editor was not available during this session. The base
design file is committed; frames will be added when the editor is
accessible. The implemented component (UpdateBanner.tsx) serves as
the source of truth for the design.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: update ARCHITECTURE.md with release/update system
Add comprehensive documentation for:
- Release pipeline (4-phase workflow: version → build → release → pages)
- Versioning scheme (0.YYYYMMDD.RUN_NUMBER)
- Universal binary strategy (lipo merge)
- Updater endpoint and latest.json manifest
- In-app update UI state machine
- GitHub Pages release history site
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: rustfmt formatting
* fix: rustfmt build.rs
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Changed view mode shortcuts from Alt+1/2/3 to Cmd+1/2/3 (Alt+N produces
special chars on macOS, e.g. Alt+1 → '¡')
- menu.rs: use MenuItemBuilder with .accelerator() instead of appending
shortcut text to label (was purely decorative, not registered with OS)
- Shortcuts now: CmdOrCtrl+1 editor-only, +2 editor+list, +3 all panels
- Create menu.rs module with View submenu
- Items: Editor Only (⌥1), Editor + Notes (⌥2), All Panels (⌥3)
- Emits 'menu-event' to frontend, handled by useViewMode hook
- Menu only created on desktop builds (#[cfg(desktop)])
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refactor settings.rs to expose testable internal functions (get_settings_at,
save_settings_at) and add integration tests for file I/O roundtrips, whitespace
trimming, directory creation, and malformed JSON handling. Coverage for
settings.rs improved from 46% to 91%. Overall Rust coverage now 86.2% (above
85% threshold). Also add coverage/ to .gitignore.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New github.rs module with three commands:
- github_list_repos: lists user's repos via GitHub API (paginated)
- github_create_repo: creates a new repo with auto_init
- clone_repo: git clone with HTTPS+token auth, configures remote
Also extends Settings with github_token field (Rust + TypeScript),
and adds GithubRepo type to shared types.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New settings module with get_settings/save_settings Tauri commands.
Settings stored as JSON in app config dir. Handles missing config file
(returns defaults), trims whitespace from keys, filters empty strings.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Install @tauri-apps/plugin-updater + plugin-process (npm + cargo)
- Configure tauri.conf.json: updater endpoint pointing to GitHub Releases,
signing pubkey, createUpdaterArtifacts enabled
- Register updater + process plugins in Rust (desktop-only, #[cfg(desktop)])
- Add updater:default + process:default capabilities
- Add useUpdater hook: checks for updates 3s after startup, shows native
confirm dialog, downloads+installs+relaunches on accept
- Silently catches errors so update failures never block the app
- Add comprehensive tests for the useUpdater hook (5 test cases)
Product decision: Using window.confirm() for the update dialog rather than
a custom React modal. This keeps the implementation simple and the native
dialog is appropriate for a system-level action like app restart. Can be
upgraded to a custom UI later if desired.
Private key generated at ~/.tauri/laputa.key — NOT committed.
For CI: set TAURI_SIGNING_PRIVATE_KEY + TAURI_SIGNING_PRIVATE_KEY_PASSWORD
as GitHub Secrets.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add get_file_diff_at_commit Rust command to show diff at a specific commit
- Make shortHash in GitHistoryPanel a clickable button that opens DiffView
- Show author name below commit message (small, muted)
- Remove disabled "View all revisions" button
- Wire onLoadDiffAtCommit through Editor → Inspector → App.tsx
- Add mock handler for get_file_diff_at_commit in browser mode
- Fix pre-existing missing `order` field on trashed mock entries
- Update Inspector tests for new behavior
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend implementation for renaming a note:
- Updates H1 heading and title frontmatter to new name
- Renames file using slugified new title
- Scans all vault .md files and replaces [[OldTitle]] → [[NewTitle]]
in both content and frontmatter (preserves pipe aliases)
- Returns new path and count of updated files
Well-factored with extracted helpers: build_wikilink_pattern,
replace_wikilinks_in_content, collect_md_files, update_h1_title,
update_note_title_in_content, frontmatter_has_title_key, to_path_stem.
All 147 tests pass including 7 new rename tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add `order: number | null` to VaultEntry (TS) and VaultEntry (Rust)
- Add order to Frontmatter struct and SKIP_KEYS in vault.rs
- Update all mock Type documents with order values (0-10)
- Add order: null to all non-Type mock entries and test fixtures
- Install @dnd-kit/core, @dnd-kit/sortable, @dnd-kit/utilities
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds purge_trash(vault_path) that scans all .md files, reads the
"Trashed at" frontmatter date, and deletes files older than 30 days.
Registered as a Tauri command and called automatically on app startup
(defaults to ~/Laputa vault). Includes 7 tests covering boundary
conditions, nested dirs, and datetime formats.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added trashed (boolean) and trashedAt (timestamp) to TypeScript VaultEntry
- Added 'trash' filter to SidebarSelection union type
- Added trashed/trashed_at fields to Rust VaultEntry struct and Frontmatter parser
- Added 3 trashed mock entries for visual testing (recently trashed,
30+ days old, and dropped experiment)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add archived field to both TypeScript VaultEntry interface and Rust
VaultEntry struct. Parse Archived frontmatter field in Rust backend.
Add archived mock entries (Website Redesign, Twitter Thread Experiment)
for visual testing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add icon (string|null) and color (string|null) to VaultEntry interface
- Update Rust VaultEntry struct and frontmatter parsing to read icon/color
- Add icon/color to SKIP_KEYS so they don't appear as relationships
- Set mock data: Recipe type → cooking-pot/orange, Book type → book-open/green
- Update all test files with the new required fields
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The editor's useCreateBlockNote was missing the uploadFile callback,
so BlockNote had no handler for image uploads (drag-drop, paste, or
toolbar button). Images now convert to data URLs for immediate display.
In Tauri mode, uploaded images are also persisted to the vault's
attachments/ directory via a new save_image backend command.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Tauri command for AI chat via reqwest:
- ai_chat module with send_chat() using Anthropic Messages API
- ANTHROPIC_API_KEY from environment variable
- Proper error handling for missing key, API errors, parse failures
- Unit tests for request building and response extraction
- Mock handler added to mock-tauri.ts for browser testing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add "type" folder to infer_type_from_folder() mapping
- When a VaultEntry has isA set (and it's not "Type"), automatically
add a "Type" relationship (e.g., "[[type/project]]") to the
relationships map, making the type property a navigable link
- Handle both plain string isA ("Project") and wikilink isA
("[[type/project]]") correctly
- Add 5 new tests for the Type relationship feature
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert internal vault functions from &str to &Path for vault_path
parameter (run_git, cache_path, git_head_hash, git_changed_files,
git_uncommitted_new_files, load_cache, write_cache, to_relative_path,
finalize_and_cache, update_same_commit, update_different_commit).
String-heavy args reduced from 67% to 47%.
Split 5 large test functions into smaller focused tests to eliminate
Large Assertion Blocks findings. Extract parse_test_entry() and
parse_big_project_rels() helpers to reduce test boilerplate.
Code Health: 7.78 -> 8.54
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split consecutive assertion lines with blank lines and comments
to stay within CodeScene's 4-consecutive-assert threshold.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract to_relative_path(), parse_files_at(), finalize_and_cache(),
update_same_commit(), update_different_commit(). The main function
is now 20 lines of thin orchestration.
Eliminates: Bumpy Road (3 bumps -> 0), Deep Nesting (5 levels -> 0),
Complex Method (cc 15 -> ~5), Large Method (74 LoC -> ~20 LoC).
Code Health: 6.92 -> 7.78
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
parse_md_file: extract infer_type_from_folder(), resolve_is_a(),
parse_created_at(), extract_fm_and_rels(), read_file_metadata().
Reduces from 83 LoC to ~25 LoC thin orchestration.
git_changed_files: extract collect_md_paths_from_diff() and
collect_md_paths_from_porcelain() as iterator-based helpers.
Eliminates Bumpy Road (2 bumps -> 0) and Deep Nesting (4 levels -> 2).
Code Health: 6.35 -> 6.92
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract run_git() to eliminate duplicated Command boilerplate.
Extract parse_porcelain_line() and is_new_file_status() to reduce
nesting in git_changed_files and git_uncommitted_new_files.
Rewrite git_uncommitted_new_files as a flat iterator chain.
Simplify git_head_hash to a one-liner using run_git.
Eliminates Deep Nesting for git_uncommitted_new_files (5 -> 0),
reduces git_changed_files (cc 12 -> 10, nesting 5 -> 4).
Code Health: 5.61 -> 6.35
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract collect_until(), skip_until(), is_markdown_formatting() from
the nested loops in strip_markdown_chars. Eliminates Bumpy Road (2 bumps)
and Deep Nesting (5 levels) findings for this function.
Code Health: 5.38 -> 5.61
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split needs_yaml_quoting into has_yaml_special_chars() and
starts_as_yaml_collection() helpers. Use matches! macro for
reserved words. Flatten nested if in apply_field_update with
tuple pattern match.
Code Health: 9.24 -> 9.68 (+0.44). Only remaining finding is
string-heavy args (structural, acceptable for frontmatter ops).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract split_frontmatter(), prepend_new_frontmatter(), apply_field_update(),
format_yaml_field(), and is_list_continuation(). The main function is now a
thin orchestrator with no nesting.
Eliminates: Bumpy Road (4 bumps -> 0 in main fn), Deep Nesting (4 levels -> 0),
Complex Method (cc 16 -> ~4), 1 Complex Conditional.
Code Health: 7.84 -> 9.24 (+1.40)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract needs_yaml_quoting(), quote_yaml_string(), format_list_item(),
format_yaml_number(), and needs_key_quoting() from inline conditionals.
Reduces to_yaml_value cc from 17 to ~5 and format_yaml_key cc from 5 to 2.
Eliminates 3 of 4 Complex Conditional findings.
Code Health: 6.89 -> 7.84 (+0.95)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Four new tests covering the bug where only belongs_to/related_to were
recognized while Has, Topics, Events, Notes, Owner, etc. were missed:
- Many generic field types populate the relationships HashMap
- Single wikilink strings vs arrays both parse correctly
- All SKIP_KEYS (Is A, aliases, status, cadence, etc.) are excluded
- Mixed arrays with wikilinks and plain strings keep only wikilinks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a `relationships: HashMap<String, Vec<String>>` field to VaultEntry
that captures ALL frontmatter fields containing wikilinks (e.g. Has,
Topics, Events, Notes, Buckets, Highlights). Handles both single string
and array values. Known non-relationship keys (Is A, aliases, Status,
etc.) are skipped.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add VaultEntry.snippet field (first ~160 chars of content, markdown-stripped).
Implement scan_vault_cached() with git-based incremental caching:
- Writes .laputa-cache.json to vault dir
- On same HEAD: returns cached entries + uncommitted new files
- On different HEAD: re-parses only changed files via git diff
- Falls back to full scan when git unavailable or cache corrupt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace mock git history with real `git log` data via new `get_file_history`
Tauri command. Adds git.rs module with commands for file history, modified files,
file diff, commit, and push (all registered, later tasks wire up the UI).
Updates GitCommit type to include shortHash field.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Scaffold Vite + React + TypeScript frontend
- Add Tauri v2 backend with Rust
- Implement list_vault command: recursively scans .md files, parses
YAML frontmatter (Is A, aliases, Belongs to, Related to, Status,
Owner, Cadence), extracts title from H1 or filename
- 10 passing Rust tests for frontmatter parsing and vault scanning
- Configure Vitest and Playwright (test infrastructure)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>