Commit Graph

257 Commits

Author SHA1 Message Date
lucaronin
f805c7d1bf feat: draggable section groups in sidebar
- Wrap sidebar section groups in @dnd-kit sortable context
- Add grip-vertical drag handle visible on hover of section headers
- Sort sections by `order` property from Type document entries
- On drag end, compute new sequential order values and persist to
  each Type document's frontmatter via handleReorderSections
- Add onReorderSections callback from Sidebar → App.tsx → vault

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:29:42 +01:00
lucaronin
1dfbbb8a9e feat: add order property to VaultEntry and install @dnd-kit
- 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>
2026-02-21 17:27:19 +01:00
lucaronin
580ce5bcc0 design: draggable section groups wireframes
Three frames showing drag interaction flow:
1. Default sidebar with grip-vertical drag handles on section headers
2. Mid-drag state with blue drop indicator line and floating section overlay
3. After-drop state showing reordered sections

Order persisted as "order" property in Type document frontmatter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:21:49 +01:00
lucaronin
1071daef7d feat: purge_trash() — auto-delete notes trashed for 30+ days on startup 2026-02-21 17:15:01 +01:00
lucaronin
f4feac3b08 feat: sort notes by property in relationship subsections 2026-02-21 17:14:18 +01:00
lucaronin
af40fba1b0 feat: add purge_trash command to delete stale trashed files
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>
2026-02-21 17:14:02 +01:00
lucaronin
c1102c508a content: add createdAt values and varied statuses to mock data
All MOCK_ENTRIES now have realistic createdAt timestamps (always before
modifiedAt). Stock Screener status changed to 'Paused' for sort-by-status
testing variety.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:12:53 +01:00
lucaronin
74649f29c5 test: add tests for sort notes functionality
Tests for getSortComparator (6 tests):
- Sort by modified date descending
- Sort by created date descending (with fallback)
- Sort by title alphabetically
- Sort by status with priority ordering
- Status sort with modified-date tiebreaker

Tests for NoteList sort controls (6 tests):
- Sort button visible in flat list header
- Sort dropdown per relationship subsection
- Sort menu opens with all options
- Sort order changes on option selection
- Menu closes after selection
- Relationship subsection sorting works

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:12:45 +01:00
lucaronin
5a8952c290 feat: sort notes by property in relationship subsections
Each relationship subsection header now has a sort dropdown control
(ArrowsDownUp icon + current sort label). Users can choose to sort by:
- Modified date (default, newest first)
- Created date (newest first)
- Title (alphabetical A-Z)
- Status (Active > Paused > Done > Finished)

The sort control also appears in the main note list header for flat
list views. Sort preferences are persisted per group in localStorage.

Also updates mock data with varied createdAt/status values for testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:09:29 +01:00
lucaronin
4868972093 design: sort-notes wireframes
Two feature frames added:
- "Sort Notes — picker closed": default state with sort button in subsection header
- "Sort Notes — picker open": dropdown popover with sort options (Modified, Created, Title, Status)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:08:39 +01:00
lucaronin
9a627c7295 fix: editor content not appearing on first load (flushSync lifecycle fix) 2026-02-21 17:08:00 +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
1c0e471839 design: sort-notes wireframes
Shows sort control UI for relationship subsection headers:
- Default state: sort icon + current sort label in header bar
- Open state: dropdown popover with options (Modified, Created, Title, Status)
- Selected option highlighted with check icon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:06: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
8573e9b35d content: add type documents to demo-vault-v2 (mirrors production vault) 2026-02-21 16:50:58 +01:00
lucaronin
11db4f3527 feat: sidebar section groups collapsed by default 2026-02-21 16:47:10 +01:00
lucaronin
311c5e434b feat: archive notes — filter sidebar, hide archived, relationship indicators 2026-02-21 16:44:09 +01:00
lucaronin
07e730f172 feat: customize which type sections are shown in sidebar 2026-02-21 16:41:34 +01:00
lucaronin
4f56873201 test: add tests for sidebar section visibility customization
Tests cover:
- Customize button renders
- Popover opens with toggles for all sections
- Hiding a section removes it and its items from sidebar
- Re-showing a section restores it
- Persistence to/from localStorage
- Hidden sections don't affect top nav (All Notes, Favorites)
- Popover closes on outside click

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:38:35 +01:00
lucaronin
b73bda1aa9 feat: customize which type sections are shown in sidebar
Adds a "Customize sections" button above section groups in the sidebar.
Clicking it opens a popover with per-type toggle switches. Hidden sections
disappear from the sidebar entirely but notes remain accessible via
All Notes and search. Visibility state is persisted in localStorage.

- New useSectionVisibility hook: manages hidden sections set in localStorage
- Sidebar: "Customize sections" button + popover with toggle UI
- Outside-click closes the popover
- allSectionGroups (built-in + custom) filtered by visibility before render

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:37:00 +01:00
lucaronin
41b28a19eb fix: disable native WebKit context menu in Tauri to allow custom right-click menus 2026-02-21 16:36:45 +01:00
lucaronin
a28e4528bd fix: add archived field to all VaultEntry test fixtures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:36:18 +01:00
lucaronin
c0bb2ded0e feat: archive notes UI — filter, sidebar hiding, relationship indicators
- Add Archive filter in sidebar with count badge
- Hide archived notes from section groups and All Notes count
- Exclude archived notes from sectionGroup and topic filtering
- Show (archived) indicator on relationship chips and backlinks
- Show ARCHIVED badge on note list items
- Display 'Archive' header in NoteList when filter is active

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:36:14 +01:00
lucaronin
4d2f96dfab feat: add archived boolean property to VaultEntry
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>
2026-02-21 16:36:06 +01:00
lucaronin
cc3dff7d47 design: archive notes wireframes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:35:59 +01:00
lucaronin
1fa29738e7 design: customize sidebar types wireframes
Three frames showing the feature flow:
1. Button placement — "Customize sections" link above section groups
2. Popover open — toggles for each type section (People & Events OFF)
3. Result — sidebar with hidden sections removed entirely

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:35:34 +01:00
lucaronin
356797d410 feat: tag-pill UI for array properties in inspector 2026-02-21 16:29:48 +01:00
lucaronin
df6aa7241f feat: color and icon customization for sidebar type sections 2026-02-21 16:27:43 +01:00
lucaronin
23daf47353 fix: remove unused getSectionColor function (TS build fix) 2026-02-21 16:26:32 +01:00
lucaronin
527a63b3b5 feat: tag-pill UI for array properties in inspector
Replace vertical EditableList with horizontal TagPillList component.
Array property values now render as inline pill chips with hover X
to remove and a + button to add new items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:26:22 +01:00
lucaronin
b1e15dd5ea feat: implement icon & color customization for types
- Add TypeCustomizePopover component with color swatches (6 accent colors)
  and icon grid (35 curated Phosphor icons)
- Add right-click context menu on sidebar section group headers with
  "Customize icon & color…" option
- Sidebar renders custom icons/colors from type entry frontmatter
- NoteList uses custom icons/colors for type badges and pinned cards
- Wire up onCustomizeType in App.tsx to update type frontmatter
- Add updateEntry to useVaultLoader for instant in-memory updates
- Add --accent-orange-light CSS variable
- typeColors utility now accepts optional custom color key overrides

Product decision: Built-in types can also be customized (override their
defaults), not just custom types. The picker is a simple popover that
appears after right-click → "Customize icon & color…".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:27:33 +01:00
lucaronin
f36cfd1808 feat: add icon and color fields to VaultEntry
- 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>
2026-02-21 13:23:10 +01:00
lucaronin
692bc8edc4 feat: move properties icon to toolbar when inspector panel is closed 2026-02-21 13:16:31 +01:00
lucaronin
fb31c78efd feat: move properties icon to toolbar when panel is closed
When the inspector panel is collapsed, the SlidersHorizontal icon now
appears inline with the other BreadcrumbBar toolbar icons (search, diff,
cursor, AI, more) with no visual separator. The collapsed Inspector
sidebar is no longer rendered — clicking the toolbar icon reopens it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:16:05 +01:00
lucaronin
a7addf127e design: color & icon customization for types wireframes
Four frames added to design/color-icon-for-types.pen:
1. Right-click context menu on sidebar section group headers
2. Icon & color picker popover (color swatches + icon grid)
3. Sidebar with custom icons & colors applied
4. Frontmatter persistence model (icon/color in type YAML)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:14:18 +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
4d90fb5dc0 design: array property tag-pill wireframes
Three frames showing:
- Before: vertical list of plain text items
- After: horizontal wrapped pills with × remove and + add button
- Pill states: normal, hover (darker bg, red ×), + button, add input active

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:19:47 +01:00
lucaronin
e8e2b7f97a design: move-properties-icon wireframes
Shows before/after states:
- Before: Properties icon in separate 40px collapsed panel sliver
- After: Properties icon moved into BreadcrumbBar toolbar icons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:18:14 +01:00
lucaronin
6f35a5ea26 content: add array properties to mock data for tag-pill testing
Added non-wikilink array properties (tags, tools, domains) to mock
frontmatter content so the upcoming tag-pill UI has realistic test data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:17:51 +01:00
lucaronin
722d57843a feat: keyboard navigation between tabs and notes 2026-02-21 12:13:05 +01:00
lucaronin
4c67498cc5 content: enrich all demo-vault-v2 notes with realistic content 2026-02-21 12:01:01 +01:00
lucaronin
b3e7854b90 content: enrich event notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:00:17 +01:00
lucaronin
bf7d5aac32 content: enrich task notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:00:12 +01:00
lucaronin
c75da21e6a content: enrich target notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:00:12 +01:00
lucaronin
5af3171e99 content: enrich month notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:00:06 +01:00
lucaronin
1fa34fe0ff content: enrich year notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:00:05 +01:00
lucaronin
b27800fd92 content: enrich quarter notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:00:05 +01:00
lucaronin
3bbf4dd15d content: enrich project notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 11:59:59 +01:00
lucaronin
6e5c87f321 content: enrich person notes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 11:58:55 +01:00