The dropdown was position:absolute inside a scrollable container with
overflow-y:auto, causing it to be clipped. Now uses createPortal to
render to document.body with position:fixed, escaping the dialog's
overflow. Also adds proper CSS for menu items (font-size 12px, aligned
icon+text, compact padding) via .wikilink-menu--filter modifier.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use prop-driven data-title-hidden attribute in BreadcrumbBar when rawMode or
diffMode is true. This avoids the timing issue where the useEffect DOM mutation
fired after paint with a null ref, causing the title to never appear.
The IntersectionObserver-based scroll detection is preserved for normal editor
mode (title shows in breadcrumb when title section scrolls out of view).
The SelectContent had overflow-y-auto which caused the browser to handle
scrolling instead of Radix UI's internal scroll mechanism. This made the
SelectScrollDownButton (chevron ▼) non-functional. Changing to
overflow-hidden lets Radix's Viewport manage scrolling, making the
scroll buttons work as intended.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Types created via "Create Type" now appear in the sidebar immediately,
even before any notes of that type exist. The buildDynamicSections
function now adds all active (non-trashed/archived) type definitions
from typeEntryMap to the active types set, using name === entry.title
guard to avoid duplicate entries from lowercase aliases.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implement silent background cleanup of notes that have been in trash
for more than 30 days, fulfilling the promise already shown in the
Trash view UI.
Safety model (all 5 checks must pass per file):
- _trashed: true in frontmatter
- _trashed_at present and parseable as date
- Date strictly >30 days ago
- File exists on disk
- File path inside vault root
Uses trash::delete (OS trash) with fs::remove_file fallback.
Triggers on app launch and window focus (max once/hour).
Audit log at .laputa/purge.log. Dry-run mode for testing.
Also fixes pre-commit hook to read CodeScene thresholds from
.codescene-thresholds instead of hardcoded values, matching the
ratchet mechanism documented in CLAUDE.md.
ADR-0042 documents the safety model.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added isMarkdown check to isInboxEntry so .yml, .json, and binary files
no longer appear in the Inbox. All other views (All Notes, Archive,
Trash, Sections, Views) already filter by markdown. FOLDERS still shows
all file types.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a .yml file is opened in the raw editor, the breadcrumb bar now
shows the YAML `name` field (e.g., "Active Projects") instead of the
filename. Falls back to filename if no name field is present.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Native <input type="date"> replaced with styled Calendar + Popover component
that matches Laputa's design language. Date values serialize to ISO strings.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
In Changes view, the note list now shows:
- Filesystem filename (e.g. `my-note.md`) instead of the note title
- Change type icon on the right: · (modified), + (added/untracked), − (deleted), R (renamed)
- Clicking a file auto-triggers diff mode via the existing diffToggleRef
Other views (Inbox, All Notes, types, folders) are unaffected.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a scoped wildcard CSS override on .editor__blocknote-container
that sets transition: none and animation: none on all child elements.
Only affects the editor internals — app-wide UI (dialogs, sidebar,
breadcrumb, icon buttons) retains its animations.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove unused entries/selection/onSelect props from TypesSection caller.
Add kind narrowing guard for selection.type access in NoteList.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The OpenAI and Google AI key fields were unused — no feature reads them.
Removes the UI section, KeyField component, and all related state/storage
code across frontend (types, hooks, mock handlers, tests) and Rust backend.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add title and sidebar_label mappings to contentToEntryPatch so editing
these frontmatter fields in the raw editor immediately updates the note
list, breadcrumb bar, sidebar sections, and inspector.
Also trigger reloadViews() when .yml view files are saved, so sidebar
view names update without a full vault reload.
ADR-0043 documents the reactive update model.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The cache's git helper functions (collect_md_paths_from_diff,
collect_md_paths_from_porcelain, git_uncommitted_files) filtered for
.md files only. This meant .yml view files created by save_view were
never detected by the incremental cache update, so they didn't appear
in vault entries until a full rescan.
Renamed the helpers to collect_paths_from_diff/collect_paths_from_porcelain
and replaced the .md filter with a hidden-segment filter, matching the
behavior of scan_all_files which already includes all non-hidden files.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The buildDynamicSections now includes type definitions with 0 instances.
Update the 'does not show section for type with zero active entries' test
to assert the new intended behavior: types with 0 notes appear in the
sidebar as long as their Type definition entry exists (not trashed/archived).
The 'selects result on Enter' test could fail intermittently because
fireEvent.keyDown(window) fired before the useEffect re-registered
the keyboard handler after results loaded. Wrapping in act() ensures
effects are flushed before the event dispatches.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The frontend already supported body content filtering in Views, but the
Rust backend evaluate_condition() was missing the "body" field mapping.
This adds the mapping from "body" to entry.snippet and comprehensive
tests for contains, not_contains, combined filters, and is_empty.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CheckCircle button in breadcrumb bar toggles _organized property
- Green filled icon when organized, gray outline when not
- Command palette: "Mark as Organized" / "Mark as Unorganized"
- _organized hidden from Properties panel
- Handler follows favorite toggle pattern with optimistic updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Inbox now uses an explicit _organized frontmatter property instead of
inferring organization from relationships. This is simpler and gives
users direct control over inbox membership.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Matches the existing pattern in VIEWS and FOLDERS sections. The button
triggers onCreateNewType which opens the CreateTypeDialog.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous approach used reload_vault_entry + addEntry wrapped in a
try/catch, which silently swallowed failures and left the .yml file
invisible in the FOLDERS view. Replace with reloadVault() which does a
full rescan and is guaranteed to include the new/deleted file.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Right-click a file in the Changes view to discard its uncommitted changes.
Shows a confirmation dialog before executing. Handles modified (git checkout),
untracked (delete), and deleted (git restore) files. Includes path traversal
safety checks in the Rust backend.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Uses the existing check_claude_cli Tauri command to detect the claude
binary at app startup and shows a status badge — green/neutral when
found, orange warning when missing with a click-to-install link.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds 'body' as a built-in filter field that searches note snippet text
(case-insensitive). Visually separated from property fields in the
FilterBuilder dropdown with a separator. Combines with other filters via AND.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Properties panel shows Status/Date/URL slots as muted clickable rows when
not already present. Relationships panel shows Belongs to/Related to/Has
slots. Clicking a slot adds the property and auto-focuses the value field.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reorders Inspector sections to: Properties → Relationships → Backlinks → Info → History.
Extracts NoteInfoPanel into its own component with Info icon matching other section headers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Aligns relationship button label with the "Add property" pattern used
elsewhere in the Inspector panel.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Patches @blocknote/core SuggestionMenu plugin to fix multi-character
trigger detection. The original code used textBetween(from - len, from)
which included text before the trigger, causing [[ to only match at
line starts. Fixed to textBetween(from - (len - 1), from).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shows "Create a new vault" (empty + git init), "Open existing vault"
(folder picker), and "Get started with a template" (Getting Started
vault). Adds create_empty_vault Rust command for the new-vault flow.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
extractVaultTypes now also reads entries where isA === 'Type' and adds
their title, so "New <Type>" commands appear as soon as a Type is
defined — not only after an instance of that type exists.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Minimalist vault separate from demo-vault-v2, designed to introduce
new users to Laputa's key features: types, relationships, views,
wiki-links, and git sync.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Parse _list_properties_display from type file frontmatter and render
property/relationship values as chips below note snippets. Add a
SlidersHorizontal config popover in the note list header (sectionGroup
views only) with checkboxes and drag-to-reorder via dnd-kit. Changes
are saved back to the type file's frontmatter immediately.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update channel (Stable/Canary) was redundant since builds are flat.
Removed the UI dropdown, canary update logic in useUpdater, and
update_channel field from Settings type (TS + Rust). Release channel
(Alpha/Beta/Stable) remains as the sole selector.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
After saving a view, the .yml file wasn't appearing in the FOLDERS note
list until a full vault reload. Now we call reload_vault_entry to get a
fresh VaultEntry, add/update it in the entries state, and reload the
folder tree — making the file visible immediately in FOLDERS.
Same for delete: removeEntry + reloadFolders ensures the file disappears
from FOLDERS without requiring a vault reload.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The demo vault path was resolved at build time via Vite's `define` config,
baking the CI runner's absolute path (/Users/runner/work/...) into the
JavaScript bundle. Fresh installs showed "Vault not found" with that path.
Now __DEMO_VAULT_PATH__ is only injected in dev mode. Production Tauri builds
resolve the Getting Started vault path at runtime via get_default_vault_path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies typing [[ in a view filter value field triggers the wikilink
autocomplete dropdown and that selecting a note inserts [[note-title]].
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Typing [[ in a filter value input now shows a note autocomplete dropdown,
matching the same visual style used in the editor and Properties panel.
Selecting a note inserts [[note-title]] as the filter value.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Emoji buttons inside the EmojiPicker defaulted to type="submit", causing
premature form submission when selecting an emoji inside the Create/Edit
View dialog. The form submitted with the stale (empty) icon state before
the emoji selection could update it, resulting in views always saving
with icon: null regardless of the user's emoji choice.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Date properties are stored as YAML strings (e.g. "2024-03-15"), not
Unix timestamps. Parse string values via Date.parse so before/after
operators work correctly. Also handles numeric Unix timestamps.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace native HTML elements with design system components:
- Operator <select> → shadcn Select dropdown
- Field <input>+<datalist> → shadcn Select with all available fields
- Value input → shadcn Select (when suggestions available) or Input
- Date input (type="date") for before/after operators
- Remove button → shadcn Button variant="ghost"
- AND/OR toggle → shadcn Button variant="outline" with rounded-full
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Views are vault content, not app config — they should be visible in
FOLDERS, git-tracked, and portable. Adds one-time migration that moves
existing .yml files from .laputa/views/ to views/ on first scan.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Opens the Create View dialog in edit mode with pre-populated fields
(name, icon, filters). Saving updates the existing .yml file.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added optional `emoji` prop to NavItem. When a view has an icon (emoji)
set in its definition, it renders that emoji instead of the default
Funnel icon. Views with no icon still fall back to the funnel.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Plain text values now use substring matching on wikilink stems so
"Monday" matches [[Monday Ideas]], [[Monday Recap]], etc. Wikilink
syntax values ([[...]]) still use exact stem matching. any_of/none_of
remain exact match only.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set min-width to 600px, max-height to 80vh. The filters section now
scrolls when it grows past the available space while the header (icon +
name) and footer (Cancel / Create) stay pinned.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removed the `compact` prop from view NavItems so they render with the
same icon size (16px), font size (13px), and vertical padding (6px) as
SectionHeader items. Views and sections now align visually.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The border-b was on the SECTIONS header div only, creating a visible
separator between the header and its type entries. Wrapped both header
and sortable entries in a single border-b container so the divider
appears between SECTIONS and FOLDERS instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remote analysis reports hotspot 9.56 and average 9.33, which is below
the ratcheted thresholds of 9.72/9.34. Reset to baseline minimums so
pushes aren't blocked by score drift on the remote.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wrapper div used padding '8px 0' instead of '4px 6px 0' — now matches
the other three group headers for consistent left indent.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Filename hint now only shows when title is focused (was always visible when
slug ≠ filename, causing "path always shown" bug).
2. Vault-relative path computation handles trailing slashes and symlink-resolved
paths via lastIndexOf fallback on vault directory name.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The textarea auto-resize was not reliably expanding for wrapped titles because
scrollHeight could be stale on the first read (e.g. during tab switches).
Added CSS field-sizing: content as the primary solution, plus requestAnimationFrame
and ResizeObserver fallbacks for older WebKit versions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VIEWS and SECTIONS headers now match FAVORITES/FOLDERS style: all caps text,
left chevron toggle, and collapsable groups. Adds border separators between
all groups and persists collapsed state in localStorage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add `release_channel` to Settings (Rust + TypeScript)
- Add channel selector in Settings panel (alpha/beta/stable)
- Pass `release_channel` as PostHog person property on identify
- Add `isFeatureEnabled()` helper: alpha always true, beta/stable
use PostHog flags with hardcoded fallback defaults
- Update `useFeatureFlag` to delegate to PostHog-backed evaluation
(localStorage overrides still work for dev/QA)
- Create ADR-0042 (supersedes ADR-0017)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Better React-specific error tracking with component stack traces
and error boundary support.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Converted the title field from <input> to <textarea> with auto-resize
so long titles wrap naturally onto multiple lines. The textarea grows
to fit content (via scrollHeight) and shrinks back when text is
removed. Added resize:none and overflow:hidden in CSS to suppress
the drag handle and scrollbar.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two bugs fixed in TitleField:
1. Vault-relative path was always visible for subdirectory notes. Now
only appears when the title input is focused, hidden on blur.
2. Both bare filename and vault-relative path rendered simultaneously.
Now the filename hint is suppressed when the path is visible, so
only one line shows (e.g. `docs/adr/0001-tauri-stack`). Also
strips the .md extension from the displayed path.
Root-level notes continue to show no path (unchanged).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a type section is selected in the sidebar, the row now uses the
type's accent color: light-tinted background, filled Phosphor icon,
colored label text, and solid-color badge with white text. Matches
the visual treatment of main sections (Inbox, All Notes). Types with
no custom color fall back to the default muted palette.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
parseScalar() returned all non-boolean values as strings, causing
contentToEntryPatch() to map _favorite_index: 2 → favoriteIndex: null
(typeof "2" !== "number"). Every editor autosave then reset the
in-memory favorite index, breaking drag-to-reorder persistence.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Cmd+D toggles favorite on the active note (same as star button)
- Registered in command palette as "Add/Remove from Favorites"
- Label adapts based on current favorite state
- Added test for Cmd+D shortcut
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Icon picker: replaced text Input with EmojiPicker popup
2. Create button: added missing .yml extension to filename
3. Field list: include relationships alongside properties
4. Nested filters: FilterBuilder now supports AND/OR groups
with recursive nesting (Airtable/Notion-style)
5. Autocomplete: field and value inputs use datalist for
type-ahead suggestions (type values, status values, etc.)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ml-auto to the BreadcrumbActions container so buttons stay
anchored to the right regardless of whether the title is visible
(display:none when at top of note, display:flex when scrolled).
Previously, buttons shifted from left to right when scrolling
because the hidden title div wasn't taking up flex space.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remote average code health dropped to 9.34 after recent changes,
creating a ratchet deadlock (threshold 9.37 > actual 9.34).
Reset threshold to current score so the ratchet can resume.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace useRef with useState for the prevTitle comparison — this is
the canonical React pattern for clearing derived state when props change,
and ensures React properly schedules the re-render.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CreateViewDialog with FilterBuilder for constructing filter conditions
(field/operator/value rows). Wire onCreateView and onDeleteView in App.tsx
with Tauri command integration. Sidebar VIEWS section shows "+" button
for discoverability even when empty, and delete buttons on hover.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
FAVORITES section in sidebar (hidden when empty) with drag-to-reorder
via dnd-kit. Star button in breadcrumb bar toggles _favorite frontmatter.
_favorite_index controls display order, updated on reorder. Both keys
hidden from Properties panel via SKIP_KEYS.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Write operations now use underscore-prefixed canonical keys (_archived,
_trashed, _trashed_at). Read operations accept both old keys (Archived,
archived, Trashed, trashed, Trashed at, trashed_at) and new keys via
serde aliases, ensuring backward compatibility without migration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Notes in subdirectories now display their vault-relative path
(e.g. docs/adr/0001-tauri-stack.md) as small muted text below
the title field. Root-level notes show no path. Note list entries
do not display any path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Title is already shown as a separate UI element above the editor,
so the H1 in the body was a visual duplicate. New notes now have
an empty editor body. Daily notes and type entries also no longer
get an H1 inserted.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Vault scanner now includes all files (not just .md). Each VaultEntry has a
fileKind field ("markdown", "text", or "binary") that controls how the
frontend handles it:
- Folder view shows all file kinds; other views (All Notes, type sections)
continue to show only markdown files
- Text files (.yml, .json, .txt, .py, etc.) open in the raw CodeMirror editor
- Binary files (.png, .jpg, .pdf, etc.) appear grayed out and are not clickable
- Non-markdown files use filename as title, skip frontmatter parsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ViewDefinition/ViewFile types, extend SidebarSelection with 'view'
kind. Client-side filter evaluation in viewFilters.ts with full operator
support. VIEWS section in sidebar (hidden when empty). Wire view loading
through useVaultLoader, NoteList, and filterEntries pipeline.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Search results now display the VaultEntry title (from frontmatter)
when available, falling back to the filename-based title from the
search backend when no VaultEntry match is found.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace unreliable filesystem ctime/mtime with git log timestamps.
A single batch `git log` walks the full commit history to extract
created_at (oldest commit) and modified_at (newest commit) for each
.md file. Falls back to filesystem dates for non-git vaults and
uncommitted files. Cache version bumped to 10 for full rescan.
ADR 0039 documents the decision.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The tsc -b build (stricter than --noEmit) requires all VaultEntry
fields to be present in mock-entries.ts and useNoteCreation.ts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds FAVORITES sidebar section backed by _favorite and _favorite_index
frontmatter properties. Star button in breadcrumb bar toggles favorite
state. Drag-to-reorder updates _favorite_index on all affected notes.
Section auto-hides when empty.
ADR 0038 documents the decision to use frontmatter for portability.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Type sections are now flat rows — clicking selects the section and loads
the note list. Removed chevrons, inline child lists, and "+" buttons.
Added note count chip to each section header. FOLDERS section expand/
collapse is unchanged.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
reloadVault() only reloaded entries, not folders — new folders didn't
appear in the sidebar until app reload. Add reloadFolders() to
useVaultLoader and call it from handleCreateFolder.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cmd+I is the standard italic shortcut in text editors. The AI panel
was overriding it, breaking italic formatting. Reassigned to
Cmd+Option+I (CmdOrCtrl+Alt+I in Tauri menu) which is free.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the user clicks "+" in the note list while a type section is
selected (e.g. Projects), the new note now gets that type pre-set in
its frontmatter. Previously, all notes were created as generic "Note"
type regardless of the selected section.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With titleBarStyle: "Overlay" in Tauri, 100vh in WKWebView includes the
overlaid title bar area, making the app-shell taller than the visible
viewport. The 30px StatusBar (including the Commit button) was pushed
below the visible area and clipped by overflow:hidden. Using height:100%
chains from html→body→#root→app-shell to correctly constrain to the
visible viewport.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Halve the editor min-width from 800px to 400px so the window can be
resized narrower. Add a container query that reduces horizontal padding
from 40px to 16px when the editor panel is under 600px wide, keeping
content readable without wasting space on padding.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The commit button was inside ChangesBadge which returned null when
modifiedCount was 0, hiding the button entirely. Extract it into a
standalone CommitButton component that is always visible in the
status bar with a "Commit" text label for discoverability.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Files with malformed YAML (e.g. Notion exports containing unescaped
double quotes inside double-quoted strings) caused gray_matter to return
Pod::Null instead of a parsed Hash. This silently reset all frontmatter
fields to defaults, making trashed/archived notes appear in Inbox.
Add a line-by-line fallback parser that extracts simple key:value pairs
when gray_matter fails, so critical fields (Trashed, Archived, type)
are never lost. Bump cache version to 9 to force rescan.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The commit button inside ChangesBadge was being clipped by overflow:hidden
on the left status bar div when many badges were visible or at high zoom.
Removing the overflow constraint ensures the commit button is always visible.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BlockNote's serializer outputs `*` for bullet lists and inserts ` `
HTML entities around inline code within bold text. Both cause meaningless
git diffs. Fix by post-processing in compactMarkdown:
- Normalize `*` bullet markers to `-` (standard convention)
- Decode HTML entities like ` ` back to literal characters
- Skip normalization inside fenced code blocks
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Folder selection now recursively includes notes from subfolders
2. + button creates a new folder with inline rename (Tauri command + UI)
3. Note list items show full path when note is in a subdirectory
4. Remove flat vault migration banner and all related code (Rust commands,
hook, component, smoke test) — subfolders are now first-class
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add position: relative and zIndex: 10 to the StatusBar footer to
establish a proper stacking context, so the vault menu dropdown
(zIndex: 1000) renders above the sidebar instead of behind it.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remote CodeScene scores (9.60/9.37) were below over-ratcheted thresholds
(9.84/9.38). Floor thresholds to actual remote values.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
updateEntry's .map() always returned a new array even when no entry matched,
causing unnecessary state changes. During note creation, addEntry uses
startTransition (deferred) while markContentPending calls updateEntry
synchronously — the entry doesn't exist yet, so the no-op .map() produced a
new reference that cascaded into "Maximum update depth exceeded" (which
surfaced as React error #185 in the production WKWebView build).
The fix makes updateEntry bail out (return prev) when no entry was changed,
preventing the spurious state update. Also removes the defensive try-catch
from the previous fix attempt and cleans up an unnecessary setToastMessage
dependency.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The inline badgeStyle (background: var(--muted)) was overriding the
Tailwind activeBadgeClassName (bg-primary) because inline styles have
higher specificity. Fixed by not falling back to badgeStyle when
activeBadgeClassName is provided and the item is active.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wraps the note creation flow in try-catch so errors in title
generation, template resolution, or tab opening are logged to
console instead of crashing the app.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bug 1: Wikilink autocomplete now always inserts the vault-relative path
as the target (e.g. [[docs/adr/0001-tauri-stack|Title]]) instead of
just the filename. This ensures wikilinks are unambiguous and resolve
correctly across subfolders after reload.
Bug 2: unique_dest_path now excludes the source file from collision
checks, preventing false positives where a note's own file is treated
as a naming conflict (causing silent -2 suffix renames).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace React state (useState + re-render) with direct DOM manipulation
for the breadcrumb title visibility. IntersectionObserver now toggles a
data-title-hidden attribute on the bar element, and CSS handles shadow
+ title visibility. This avoids re-rendering the heavy BlockNote editor
on every scroll intersection change.
Fixes: shadow always appears when title is hidden (CSS-driven, no race),
scroll is smooth (zero React re-renders during scroll).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The left div in the status bar had no width constraint, causing items
at the end (commit button, Pulse) to overflow behind the right div
when the window is narrow or zoom is high.
Fixes:
- Add flex:1 + minWidth:0 + overflow:hidden to the left div
- Add flexShrink:0 to the right div so it stays visible
- Move ChangesBadge (with commit button) before SyncBadge so it
appears earlier and is less likely to be clipped
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
round(9.8457, 2) → 9.85 which exceeds the actual score, causing
the threshold to be unreachable. Use math.floor to truncate instead:
9.8457 → 9.84, 9.3884 → 9.38.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Actual scores are 9.8457/9.3884 — previous thresholds 9.85/9.39
were above the actual values due to rounding up.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All chips (type, status, date, tags, boolean, color, text, URL) now use
h-6 (24px) with inline-flex + items-center, and PropertyRow has min-h-7
(28px) so every row aligns regardless of property type.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The auto-ratchet rounded 9.845→9.85 and 9.388→9.39, creating thresholds
higher than the actual scores. Fix by rounding down.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies that editing the type field in the raw editor (Cmd+\) immediately
updates the Properties panel type selector without navigation or reload.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When editing type/status/color/icon in the raw editor (Cmd+\), changes
now immediately flow into the reactive VaultEntry state, updating the
Properties panel, note list, and sidebar without save/reload.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the app regains focus, checks git diff for renames (--diff-filter=R).
If renamed .md files are found, shows a non-blocking banner with "Update
wikilinks" and "Ignore" buttons. The update reuses the existing vault-wide
wikilink replacement logic from rename.rs.
New Tauri commands: detect_renames, update_wikilinks_for_renames.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- resolveEntry: add path-suffix matching so [[docs/adr/0031-foo]] resolves
to entries in subdirectories (Pass 1, before filename match)
- Inspector backlinks: replace hardcoded /Laputa/ regex with generic
path-suffix matching via targetMatchesEntry helper
- Autocomplete preFilter: also match against file path so searching
subfolder names (e.g. "adr") surfaces nested notes
- Add relativePathStem utility for vault-relative path extraction
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move FilterPills and InboxFilterPills from the top (below header) to
a floating position at the bottom of the note list. When position is
"bottom", pills are absolutely positioned with a gradient background
(transparent → card color) to create a "floating above content"
effect. Pills are centered with gap-2 and wrap to multiple lines.
Matches the ui-design.pen "Filter Pills Bar" frame.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When opening a vault without a .git directory, a blocking modal prevents
app use until the user either creates a repository (git init + add +
commit) or chooses another vault. The check runs via is_git_repo Tauri
command; browser mode fails open.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add FolderTree component tests (render, expand, collapse, select,
highlight) and folder filtering tests in noteListHelpers (path
matching, sibling exclusion, archive/trash filtering).
ADR-0033 documents the decision to scan all subdirectories and
expose folder tree navigation, superseding ADR-0006's scanning
constraint.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Build FolderTree component that renders the vault's directory
structure below the TYPES sections. Integrates with SidebarSelection
to filter the note list by folder path. Styled to match the
ui-design.pen "Folder Tree Sidebar" frame with Phosphor folder
icons, blue highlight for selected folder, and indented children
with guide lines. Wire folder data from useVaultLoader → App → Sidebar.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Properties panel now detects frontmatter state (valid/empty/none/invalid):
- No frontmatter: shows "Initialize properties" button that adds type+title
- Invalid YAML: shows warning with "Fix in editor" button (toggles raw mode)
- Valid frontmatter: unchanged behavior
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extend the Rust vault scanner to index .md files in all visible
subdirectories (hidden dirs excluded). Add FolderNode struct and
list_vault_folders Tauri command that returns the directory tree.
On the frontend, add FolderNode type, extend SidebarSelection with
{ kind: 'folder'; path: string }, and add isInFolder() filtering
in noteListHelpers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tauri's default dragDropEnabled=true intercepts HTML5 DnD events at the
webview level, preventing BlockNote's block handle drag-to-reorder from
receiving dragstart/dragover/drop events. Setting dragDropEnabled=false
lets all drag events flow through standard HTML5 DnD, which BlockNote
expects.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use IntersectionObserver on the title section to detect when it
scrolls out of view. When hidden, the breadcrumb bar morphs to
display "<type> › <emoji> <title>" on the left and gains a subtle
shadow to separate it from the content below.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire up @codemirror/lang-markdown with a custom HighlightStyle to
highlight headings, bold, italic, strikethrough, links, lists,
blockquotes, and inline code in the raw CodeMirror editor. The custom
frontmatter plugin is kept for YAML highlighting; its heading
decoration is removed in favour of the language-based parser.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Load JetBrains Mono (regular weight) from Google Fonts and set it as the
primary font for the CodeMirror raw editor, replacing Berkeley Mono.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Match all property value chips (Status, Date, Tags) to the Type chip's
padding (4px 8px) and border-radius (rounded-md). Fix URL and text values
to use consistent padding and constrain overflow with max-w-full + truncate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New feature commits (Cmd+Shift+I, NoteWindow→App reuse, sidebar sections)
reduced code health by ~0.001. Thresholds adjusted to match current baseline.
Ratchet will auto-raise them again as code quality improves.
Remove title, breadcrumb path, word count, note status indicators, and
bottom border from the breadcrumb bar. Keep only right-aligned action
buttons (search, diff, raw, AI, archive, trash, properties). The bar
remains as a drag region and button host.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Match the note list header height (52px) across all panel headers for
consistent horizontal alignment. Previously breadcrumb bar, inspector
header, and AI panel header were 45px.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add Cmd+Shift+I keyboard shortcut in useAppKeyboard for toggling the
properties/inspector panel
- Change default inspectorCollapsed to true (panel closed on fresh install)
- Add shortcut hint "⌘⇧I" to Properties button tooltips in breadcrumb
bar and inspector header
- Show shortcut in command palette for "Toggle Properties Panel"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Note windows now render the main App component with panels defaulted to
hidden (editor-only view, inspector collapsed). This gives note windows
full feature parity: zoom, all keyboard shortcuts, properties editing,
and panel toggles — eliminating the maintenance burden of a separate shell.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Apply zero vertical padding when sections are collapsed so they sit flush
against each other, matching the density of main nav items. Expanded
sections retain 4px vertical padding for breathing room.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generate a commit message from modified files (e.g. "Update winter-2026"
or "Update 12 notes") and pre-fill the CommitDialog textarea so users can
commit immediately or edit the suggestion.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a note has no emoji icon, the NoteIcon area was occupying horizontal
space in the title row, pushing the title text to the right. Fix: render
NoteIcon in a separate div above the title row when no emoji is set, so
the title starts flush with the left margin. When an emoji is present,
the original inline-left layout is preserved.
Changes badge shows GitDiff icon with orange count badge, Pulse badge
sits next to it. Commit & Push is accessible via icon button beside
Changes. Sidebar is now cleaner with only nav filters and sections.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Apply theme CSS variables to the editor scroll area so the title section
uses the same max-width as the BlockNote editor. Add matching margin-left
to the title row/separator for body text alignment. Move NoteIcon inside
the title row unconditionally so top margin is constant regardless of
emoji presence.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add relative z-10 to ResizeHandle so it stacks above adjacent panel
content that was capturing pointer events due to DOM order.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Editor (400px), note list (220px), sidebar (180px), and inspector
(240px) now have CSS min-width constraints. Window minWidth set to
800px in Tauri config. Flex-shrink ratios create cascade order:
editor shrinks first, then note list, then sidebar.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:29:57 +02:00
689 changed files with 29951 additions and 4604 deletions
Mark a Laputa task as done: add completion comment, move to In Review, then self-dispatch the next task.
Run this after Phase 1 (Playwright) and Phase 2 (native app QA) both pass **and `git push origin main` has succeeded**.
⚠️ A task is NOT done until the push succeeds. If the push is blocked by the pre-push hook (clippy, tests, CodeScene, build):
- Read the error
- Fix it (never use `--no-verify`)
- Commit the fix and push again
- Repeat until push exits with code 0
## Steps
**1. Add completion comment to the task**
Summarize what was done — this is the context Luca and Brian will read in Todoist:
```bash
curl -s -X POST "https://api.todoist.com/api/v1/comments"\
-H "Authorization: Bearer $TODOIST_API_KEY"\
-H "Content-Type: application/json"\
-d '{
"task_id": "$ARGUMENTS",
"content": "✅ Implementation complete.\n\n**What changed:** [brief summary of the implementation]\n**ADR:** [if an ADR was created, reference it here; otherwise omit]\n**Playwright:** all tests pass\n**Native QA:** tested with pnpm tauri dev — [describe what was tested and what was observed]"
}'
```
**2. Move task to In Review**
```bash
curl -s -X POST "https://api.todoist.com/api/v1/tasks/$ARGUMENTS/move"\
-H "Authorization: Bearer $TODOIST_API_KEY"\
-H "Content-Type: application/json"\
-d '{"section_id": "6g3XjX33FF4Vj86M"}'
```
**3. Pick the next task**
Run `/laputa-next-task` to get the next task and start working on it immediately.
If there are no tasks, `/laputa-next-task` will wait 10 minutes and retry automatically. Do NOT exit — stay alive and let it loop.
6. For To Rework tasks: read the ❌ QA failed comment — it tells you exactly what to fix
7. Output: task ID, title, and full description so you can start working immediately
If no tasks are available in either section → wait 10 minutes and try again (loop forever):
```bash
while true;do
# ... check tasks ...
if no_tasks;then
sleep 600# 10 minutes
else
break# got a task, proceed
fi
done
```
Do NOT exit when there are no tasks. Keep looping until a task appears. This keeps Claude Code alive permanently — the watchdog is a safety net only, not the primary dispatcher.
**CodeScene Code Health** — the pre-commit and pre-push hooks enforce:
- Hotspot Code Health ≥ 9.5 (most-edited files)
- Average Code Health ≥ 9.31 (project-wide, ALL files)
## 1. Task Workflow
**Both gates block commit/push.** If either fails: extract hooks, split large components, reduce function complexity. Never add `// eslint-disable`, `#[allow(...)]`, or `as any` to pass the gate. Check both scores via MCP CodeScene after every significant change:
-`hotspot_code_health.now` ≥ 9.5
-`code_health.now` ≥ 9.31 (average — do NOT ignore this one)
### 1a. Pick up a task
If Average Code Health is below 9.0, you must fix regressions before pushing — even in files you didn't directly modify, if your changes indirectly affected complexity.
Run `/laputa-next-task` — fetches next task (To Rework first, then Open), moves to In Progress, returns full description.
**Boy Scout Rule (Robert C. Martin):** Leave every file you touch better than you found it. When working on any task:
1. Before modifying a file, check its CodeScene health: `mcp__codescene__code_health_review`
2. If the file has issues (complexity, duplication, large functions), fix them as part of your work
3. After your changes, verify the file's score is higher than before: `mcp__codescene__code_health_score`
4. The goal: every commit either maintains or raises the overall average. No commit should lower it.
- Read task description and all comments fully
- For To Rework: the ❌ QA failed comment tells you exactly what to fix
- Check `docs/adr/` for relevant architecture decisions before structural choices
- Add a comment: `🚀 Starting work on this task. [Brief description of approach]`
This is not optional — it's how we incrementally raise the codebase quality with every task.
### 1b. Implement
## ⛔ BEFORE FIRING laputa-task-done — Two-phase QA
- Work on `main` branch — **no branches, no PRs, ever**
- Commit every 20–30 min: `feat:`, `fix:`, `refactor:`, `test:`, `docs:`
- **⛔ NEVER use --no-verify**
- For UI tasks: open `ui-design.pen` first, study visual language, design in light mode
### Phase 1: Playwright (you do this)
### 1c. When done
Write a test in `tests/smoke/<slug>.spec.ts` that covers every acceptance criterion. The test must fail before your fix and pass after. Run it:
**Phase 1 — Playwright (only for core user flows):**
Write smoke test in `tests/smoke/<slug>.spec.ts` only if feature touches: vault open, note create/save/delete, search, wikilink navigation, git commit/push, conflict resolution. Do NOT write Playwright tests for cosmetic changes — use Vitest instead. Suite must stay under **10 minutes**.
```bash
pnpm dev --port 5201&
@@ -40,95 +34,112 @@ sleep 3
BASE_URL="http://localhost:5201" npx playwright test tests/smoke/<slug>.spec.ts
```
**If your task touches filesystem, git, AI, MCP, or any native Tauri command**: also test with `pnpm tauri dev` against `~/Laputa` (not demo vault). Use `osascript` keyboard events — no mouse, no `cliclick`.
### Phase 2: Native QA (Brian does this after push)
Brian installs the release build and runs keyboard-only QA. Phase 1 must pass first or the task goes to To Rework.
Fire done signal only after Phase 1 passes — **two steps, both required**:
**Phase 2 — Native app QA:**
```bash
# 1. Move task to In Review on Todoist
curl -s -X POST "https://api.todoist.com/api/v1/tasks/<task_id>/move"\
-H "Authorization: Bearer $TODOIST_API_KEY"\
-H "Content-Type: application/json"\
-d '{"section_id": "6g3XjX33FF4Vj86M"}'
# 2. Notify Brian
openclaw system event --text "laputa-task-done:<task_id>" --mode now
Use `osascript` for keyboard interactions. Write result as Todoist comment (✅ or ❌). **⚠️ WKWebView:** `osascript keystroke` blocked inside editor — rely on Playwright for text input features.
Tauri v2 + React + TypeScript desktop app. Reads a vault of markdown files with YAML frontmatter.
After both phases pass, run `/laputa-done <task_id>` → moves to In Review, notifies Brian, self-dispatches next task.
- **Push directly to main** — no PRs ever. The pre-push hook runs all checks.
- **⛔ NEVER open a PR** — branches diverge and cause rebase churn.
### Commits & pushes
- Push directly to `main` — no PRs, no branches
- Pre-push hook runs full check suite (build + tests + Playwright + CodeScene)
- **A task is NOT done until `git push origin main` succeeds.** If the hook blocks: read the error, fix it (clippy, tests, CodeScene, build), commit the fix, push again. Never use `--no-verify`.
- **⛔ NEVER use --no-verify**
- Commit every 20–30 min: `feat:`, `fix:`, `refactor:`, `test:`, `docs:`
## TDD (mandatory)
### TDD (mandatory)
Red → Green → Refactor → Commit. One cycle per commit. For bugs: write a failing regression test first, then fix. Exception: pure CSS/layout with no logic.
Red → Green → Refactor → Commit. One cycle per commit. For bugs: write failing regression test first, then fix. Exception: pure CSS/layout changes.
**Test quality (Kent Beck's Desiderata):**every test must be Isolated (no shared state), Deterministic (no flakiness), Fast, Behavioral (tests behavior not implementation), Structure-insensitive (refactoring doesn't break it), Specific (failure points to exact cause), Predictive (all pass = production-ready). Fix flaky/non-deterministic tests before adding new ones. E2E tests over unit tests for user flows.
**Test quality (Kent Beck's Desiderata):**Isolated · Deterministic · Fast · Behavioral · Structure-insensitive · Specific · Predictive. Fix flaky tests before adding new ones. Prefer E2E over unit tests for user flows.
## ⛔ Docs — Keep docs/ in sync
### Code health (mandatory)
After adding a Tauri command, new component/hook, data model change, or new integration: update `docs/ARCHITECTURE.md`, `docs/ABSTRACTIONS.md`, and/or `docs/GETTING-STARTED.md` in the same commit. Use Mermaid for diagrams (not ASCII). Exception: spatial wireframe layouts.
Pre-commit and pre-push hooks enforce **Hotspot Code Health** and **Average Code Health** ≥ thresholds in `.codescene-thresholds`. Both gates block commit/push. Thresholds are a **ratchet** — only go up, auto-updated after each successful push. Never add `// eslint-disable`, `#[allow(...)]`, or `as any`.
## Architecture Decision Records (ADRs)
**Before every commit:**
-`mcp__codescene__code_health_review` — check file before touching
-`mcp__codescene__code_health_score` — verify score is higher after changes
ADRs live in `docs/adr/`. Before making an architectural choice, check existing ADRs there first.
**Boy Scout Rule:** every file you touch must leave with a higher score. If Average drops below 9.0, fix regressions before pushing.
**When to create one**: storage strategy, new dependency, platform support, core abstraction change, cross-cutting concern. Use `/create-adr` for the full template and instructions.
**Timing**: create the ADR **in the same commit as the code** that implements the decision — never before, never after. An ADR committed without the corresponding code is invalid.
### Architecture Decision Records (ADRs)
**When your work supersedes an existing ADR**: do not edit the existing file — use `/create-adr` which covers the superseding flow.
ADRs live in `docs/adr/`. Check before structural choices. Create the ADR**in the same commit as the code**. Never edit existing ADRs — create a new one that supersedes. Use `/create-adr` for template.
**Do not create ADRs for**: bug fixes, UI styling, refactors, or test additions.
**When to create one:** new dependency, storage strategy, platform target, core abstraction change, cross-cutting pattern. **Not for:** bug fixes, UI styling, refactors, test additions.
## Design File (UI tasks)
### Keep docs/ in sync
1. Open `ui-design.pen` first — study existing frames for visual language.
2. Design in light mode. Create `design/<slug>.pen` for the task.
3. On merge to main: merge frames into `ui-design.pen`, delete `design/<slug>.pen`.
After Tauri command, new component/hook, data model change, or new integration: update `docs/ARCHITECTURE.md`, `docs/ABSTRACTIONS.md`, and/or `docs/GETTING-STARTED.md` in the same commit.
## ⛔ Never modify the user vault for testing
---
`~/Laputa/` is Luca's real vault. **Never create, edit, or delete notes there for testing purposes.**
## 3. Product Rules
Use the demo vault for all testing:
- Playwright / Vitest: use the fixtures in `tests/` or `demo-vault-v2/`
-`pnpm tauri dev` manual testing: open `demo-vault-v2/` as the vault, not `~/Laputa/`
- If a test genuinely requires the real vault (e.g. verifying git history), read only — never write
### User vault (`~/Laputa/`)
Any commit that touches `~/Laputa/` content is a bug. If you accidentally created test notes there, delete them before committing.
Default to `demo-vault-v2/`. If you must use `~/Laputa/` for testing: **never commit changes** — always run `cd ~/Laputa && git checkout -- . && git clean -fd` when done.
## Vault Retrocompatibility
### UI design
Every feature that depends on vault files must auto-bootstrap: check if file/folder exists on vault open, create with defaults if missing (silent, idempotent). Register with the central `Cmd+K → "Repair Vault"` command.
1. Open `ui-design.pen` first — study existing frames for visual language
2. Design in light mode. Create `design/<slug>.pen` for the task
3. On completion: merge frames into `ui-design.pen`, delete `design/<slug>.pen`
## Keyboard-First + Menu Bar (mandatory)
### UI components — mandatory rules
Every feature must be reachable via keyboard. Every new command palette entry must also appear in the macOS menu bar (File / Edit / View / Note / Vault / Window). This is a QA requirement.
**Always use shadcn/ui components.** Never use raw HTML form elements (`<input>`, `<select>`, `<button>`, native `<input type="date">`, etc.) for user-facing UI. Every interactive element must use the shadcn/ui equivalent:
## macOS / Tauri Gotchas
| Need | Use |
|---|---|
| Text input | `Input` from shadcn/ui |
| Dropdown/select | `Select` from shadcn/ui |
| Date picker | `Calendar` + `Popover` from shadcn/ui (NOT native `<input type="date">`) |
| Button | `Button` from shadcn/ui |
| Autocomplete/combobox | Reuse existing combobox components from the app (check `src/components/`) |
| Wikilink picker | Reuse the wikilink autocomplete component already used in the editor and Properties panel |
| Emoji picker | Reuse the emoji picker component already used for note/type icons |
| Color picker | Reuse the color swatch picker used for type customization |
| Toggle/switch | `Switch` or `ToggleGroup` from shadcn/ui |
| Dialog/modal | `Dialog` from shadcn/ui |
-`Option+N` → special chars on macOS. Use `e.code` or `Cmd+N`.
- Tauri menu accelerators: `MenuItemBuilder::new(label).accelerator("CmdOrCtrl+1")`.
-`app.set_menu()` replaces the ENTIRE menu bar — include all submenus.
-`mock-tauri.ts` silently swallows Tauri calls — not a substitute for native app testing.
**When in doubt:** search `src/components/` for an existing component that does what you need before building a new one. The app already has many reusable pieces — use them.
## QA Scripts
**Visual language:** all new UI must feel native to Laputa. Take inspiration from `ui-design.pen` and existing components. If something looks like a browser default, it's wrong.
---
## 4. Reference
### macOS / Tauri gotchas
-`Option+N` → special chars on macOS. Use `e.code` or `Cmd+N`
- Tauri menu accelerators: `MenuItemBuilder::new(label).accelerator("CmdOrCtrl+1")`
-`app.set_menu()` replaces the ENTIRE menu bar — include all submenus
-`mock-tauri.ts` silently swallows Tauri calls — not a substitute for native testing
Prefer Mermaid for all diagrams (`flowchart`, `sequenceDiagram`, `classDiagram`, `stateDiagram-v2`). ASCII only for spatial wireframe layouts. GitHub renders Mermaid natively.
Prefer Mermaid (`flowchart`, `sequenceDiagram`, `classDiagram`, `stateDiagram-v2`). ASCII only for spatial wireframe layouts.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.