Commit Graph

50 Commits

Author SHA1 Message Date
Luca Rossi
ee663df4fe feat: darken title bar headers for visual separation from content (#85)
* feat: darken title bar headers for visual separation from content

Add --bg-titlebar (#EDECE9) CSS variable and apply it to all four
header bars (TabBar, SidebarTitleBar, NoteList header, Inspector
header) so the top drag region is subtly darker than the app content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add design file for titlebar-darker task

Single frame showing the three-tier color hierarchy:
title bar (#EDECE9) → sidebar (#F7F6F3) → content (#FFFFFF).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 01:33:19 +00:00
lucaronin
021597566d feat: remove native titlebar, implement custom drag regions
- titleBarStyle: Overlay + hiddenTitle: true — removes native title bar,
  traffic lights float in sidebar area
- Add core:window:allow-start-dragging capability
- Add useDragRegion hook using startDragging() API (more reliable than
  data-tauri-drag-region with Overlay style)
- Apply drag regions: SidebarTitleBar, NoteList header, TabBar empty zone,
  Inspector header
- Increase header heights 45→52px to give traffic lights breathing room
- Open devtools automatically in debug builds
2026-02-25 21:43:16 +01:00
Luca Rossi
8276e4225d Merge pull request #47 from refactoringhq/task/icon-picker-sezioni
feat: expand icon picker to 290 Phosphor icons with search and scroll
2026-02-24 16:00:42 +01:00
lucaronin
b4201487ec feat: expand icon picker with ~290 icons, search, and scrollable grid
- Extract icon registry to src/utils/iconRegistry.ts with 290 curated Phosphor icons
- Add real-time search field that filters icons by name substring
- Show "No icons found" empty state when search yields no results
- Scrollable icon grid (240px max height) for browsing all icons
- Add teal and pink accent colors to the palette (8 total)
- Widen popover from 264px to 280px for better search field fit
- Update tests: search filtering, empty state, icon count validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:36:11 +01:00
lucaronin
45b48e654c feat: add Changes view for pending modifications
Clicking "N pending" in the status bar or the "Changes" nav item in
the sidebar shows a filtered list of notes with uncommitted changes.
The view updates in real-time as files are saved or committed.

- Add 'changes' filter to SidebarSelection type
- Make StatusBar "N pending" indicator clickable
- Add "Changes" NavItem in sidebar (visible when modifiedCount > 0)
- Filter NoteList by modifiedFiles paths for changes view
- Show "No pending changes" empty state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:32:23 +01:00
lucaronin
486c0faa6f feat: collapsible sidebar and note list with ⌥1/2/3 shortcuts
- Add useViewMode hook: manages panel visibility state (editor-only, editor-list, all)
- Persist view mode preference in localStorage
- Add Option+1 (editor only), Option+2 (editor + note list), Option+3 (all panels)
- Add collapse button (CaretLeft icon) in sidebar title bar
- Extract useDialogs hook from App to reduce component size
- Extract SidebarTitleBar component to reduce Sidebar complexity
- Listen for Tauri menu events to support macOS View menu (wired next)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 08:35:51 +01:00
lucaronin
8cb382e3a3 fix: resolve React hooks/compiler ESLint errors
- Wrap ref assignments in useEffect to fix refs-during-render in
  useTabManagement, useKeyboardNavigation, and Editor
- Rewrite useAppKeyboard to define keyMap inside useEffect, eliminating
  ref access during render
- Add eslint-disable for react-hooks/set-state-in-effect on legitimate
  dialog reset patterns (CommitDialog, CreateNoteDialog, CreateTypeDialog,
  QuickOpenPalette, AIChatPanel, useVaultLoader)
- Add eslint-disable for react-hooks/static-components on icon lookups
  (NoteItem, NoteList PinnedCard) — stateless icon components from a
  static map
- Add eslint-disable for react-hooks/purity on Date.now() in
  NoteItem TrashDateLine — intentionally memoized on trashedAt
- Remove unused `model` param from buildSystemPrompt (ai-chat.ts) and
  update callers
- Fix exhaustive-deps: suppress vault object dep in App.tsx git history
  effect (vault object is unstable, loadGitHistory is the real dep)
- Remove unused `modifiedFiles` from useNoteListData params and caller
- Add missing `ref` to Sidebar useOutsideClick deps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:06:51 +01:00
lucaronin
4d0840c6c6 feat: add border between macOS title bar and sidebar content
The macOS window frame (transparent title bar, 38px) and the sidebar
share the same background color (#F7F6F3), making them visually
indistinguishable. Replace the sidebar's paddingTop: 38 with a
dedicated spacer div that has a bottom border (1px solid var(--border)),
matching the border style used between all other panels. The spacer
also serves as a drag region for window movement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 12:11:39 +01:00
lucaronin
5bbd1469e2 fix: resolve TypeScript build errors in refactored code and test mocks
- Remove unused cn import from NoteList.tsx
- Fix SidebarSelection type narrowing in NoteList entity view
- Fix SortableSection onToggle type in Sidebar Omit type
- Fix TypeRow isA prop to accept null
- Align useEntryActions handleUpdateFrontmatter value type
- Add missing trashed/trashedAt/order to test mock VaultEntry objects

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 11:00:07 +01:00
lucaronin
178d0784d1 refactor: decompose TabBar and Sidebar for reduced complexity
TabBar (8.50 → 9.38):
- Extract useTabDrag hook for drag state management
- Extract computeDropTarget/computeInsertIndex helpers
- Extract TabItem, DropIndicator, TabBarActions sub-components
- TabBar main function reduced from cc=23/176 LoC to ~25 LoC

Sidebar (8.57 → 9.38, SidebarParts 10.0):
- Create SidebarParts.tsx with NavItem, SectionContent, VisibilityPopover
- Extract useSidebarSections hook for section computation
- Extract useEntryCounts hook consolidating 3 useMemos into 1
- Extract useOutsideClick hook (eliminates 3 duplicate useEffect patterns)
- Extract buildCustomizeArgs, computeReorder pure helpers
- Extract CommitButton, ContextMenuOverlay, CustomizeOverlay
- isSelectionActive extracted as pure function (was closure)
- Sidebar reduced from 604 LoC/cc=34 to ~120 LoC/cc=11

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 10:37:33 +01:00
lucaronin
081f1e5743 feat: replace 'Customize Sections' label with 'Sections' header
Changed the sidebar section header from a button-style "Customize sections"
label with inline icon to a clean "Sections" heading with the settings icon
pushed to the far right. The settings icon still toggles the customize
popover — no functionality change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 18:40:06 +01:00
lucaronin
cc1631c368 feat: draggable section groups in sidebar 2026-02-21 18:36:28 +01:00
lucaronin
09609eff55 feat: trash notes — sidebar filter, breadcrumb buttons, cmd+del shortcut, demo vault data 2026-02-21 18:34:40 +01:00
lucaronin
a10589fb6c fix: sidebar collapse toggle and update tests for DnD
- Fix toggleSection to account for default collapsed state
  (collapsed[type] ?? true, not just !prev[type])
- Update tests to expand sections before asserting item visibility
  (sections start collapsed by default)
- Add tests for section ordering by Type entry order property
- Add test for drag handle rendering on section headers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:33:36 +01:00
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
2a01f44374 feat: trash notes — sidebar filter, list view, relationship indicators
- Sidebar: replaced disabled Trash placeholder with active filter showing
  count badge and destructive color when selected
- Sidebar: trashed notes excluded from section groups and All Notes count
- NoteList: trash filter shows only trashed entries with TRASHED badge
- NoteList: 30-day warning banner when expired trash notes exist
- NoteList: per-note warning text for notes past 30-day retention
- Inspector: trash icon shown before name in relationship pills for
  trashed entries, with (trashed) label and dimmed styling
- Inspector: backlinks show trash icon for trashed entries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:54:59 +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
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
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
23daf47353 fix: remove unused getSectionColor function (TS build fix) 2026-02-21 16:26:32 +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
5f2a6495db feat: AI chat panel 2026-02-21 10:38:41 +01:00
lucaronin
170de2a7e0 feat: implement create new type feature
Core implementation:
- CreateTypeDialog: simple dialog with name field for creating new types
- handleCreateType in useNoteActions: creates Type documents in type/ folder
- Dynamic sidebar sections: custom types (Recipe, Book, etc.) appear as new
  sidebar sections after built-in ones, each with a + button for instances
- Updated CreateNoteDialog: accepts custom types, shows them with blue accent
- handleCreateNote now supports custom types (folder = lowercased type name)

Product decisions:
- The + on Types section opens CreateTypeDialog (not CreateNoteDialog)
- Custom type sections use FileText icon and blue accent color by default
- Section labels are pluralized (e.g., "Recipes", "Books")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 09:41:46 +01:00
lucaronin
388160998f Merge task/create-from-sidebar: Create new items from sidebar 2026-02-21 09:17:30 +01:00
lucaronin
89e5a2eb79 feat: add + button to sidebar section groups for quick note creation
Each sidebar section header (Projects, People, Topics, etc.) now shows
a + button on hover. Clicking it opens the CreateNoteDialog pre-filled
with that section's type, so users can quickly create new items without
manually selecting the type.

- Add defaultType prop to CreateNoteDialog for pre-selecting type
- Add onCreateType callback to Sidebar with hover-visible + button
- Wire up in App.tsx with unified openCreateDialog handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 23:49:30 +01:00
lucaronin
bca6b3c8e8 docs: AI chat architecture + fix pre-existing build errors
Update docs/ARCHITECTURE.md with:
- AI Chat system architecture (context picker, streaming, MCP)
- WebSocket bridge protocol
- New files listing and data flow diagrams
- Updated tech stack table

Update mock-tauri.ts with richer AI chat mock responses
(context-aware summarize, expand, grammar responses).

Fix pre-existing TypeScript build errors:
- Add missing snippet/relationships to test VaultEntry fixtures
- Fix string|null → string type mismatches in Sidebar, NoteList, Inspector
- Remove unused imports (cn in Editor, AIChatPanel in App)
- Fix tryParseMarkdownToBlocks Promise cast

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 23:07:10 +01:00
lucaronin
2286385244 fix: resolve TypeScript build errors across components
Fix null-safety issues (string | null → string), add missing VaultEntry
fields in test fixtures, remove unused imports, and fix type assertion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 22:02:04 +01:00
lucaronin
2a564578a8 feat(ui): add Type color, icon, and sidebar section group
- Add Type to color maps (accent-blue) in typeColors.ts
- Add StackSimple icon for Type in NoteList, Inspector, and Sidebar
- Add "Types" section group to sidebar navigation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 21:45:54 +01:00
lucaronin
0053eb3009 feat: UI polish — typography, layout, and sidebar fixes
- font-mono-label: font-weight 500, remove letter-spacing
- NoteList: move timestamp below snippet in note items
- Sidebar: add border-r with sidebar-border color
- ResizeHandle: overlap sidebar border with -ml-1 (no visible gap)
- Sidebar items: text-muted-foreground for inactive group items
- NoteList: uniform 14px vertical padding across all note items
- NoteList header: fixed height 45px to match tab bar
2026-02-18 10:52:01 +01:00
lucaronin
6c63abc9c5 feat: reduce font weight of sidebar entity items to 400
Section group headers and nav items stay at font-weight 500 (medium).
Individual entity items under sections now use font-weight 400 (normal)
to create better visual hierarchy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 19:57:31 +01:00
lucaronin
444dd03ca6 refactor: use shared getTypeColor utility in Sidebar
Replace inline color strings in SECTION_GROUPS and the string-replace
hack for light colors with the shared typeColors utility.

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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:14:50 +01:00
lucaronin
1f8740e4af feat: add native macOS title bar with transparent overlay
- Use titleBarStyle: Transparent for native window frame on top
- Add paddingTop: 38px to Sidebar to make room for title bar
- Keep solution simple: native traffic lights + dragging work out-of-the-box
- Removed custom traffic lights and drag handlers
2026-02-17 16:55:23 +01:00
lucaronin
517148f2a6 feat: replace sidebar header with native macOS title bar (38px) 2026-02-17 16:39:23 +01:00
lucaronin
348b028e2a fix: use dynamic color-coding for active note states based on type 2026-02-17 14:24:13 +01:00
lucaronin
a7b6726964 feat: update sidebar colors and spacing - accent colors, increased gaps 2026-02-17 14:12:56 +01:00
lucaronin
0b3d190644 feat: sidebar redesign - chevron right, remove section badges, align groups 2026-02-17 13:47:48 +01:00
lucaronin
5c7c06705f feat: update Sidebar to match design - traffic lights, wrench icon, proper indentation 2026-02-17 13:45:09 +01:00
lucaronin
d8b91522bb Remove dark mode — force light mode only
- Remove .dark CSS variables block from index.css
- Remove theme toggle state and Cmd+Shift+T shortcut from Sidebar
- Remove dark class initialization from main.tsx
- Hardcode BlockNote theme to 'light' in Editor
- shadcn dark: classes left in place (harmless, no-op without .dark class)
2026-02-17 11:03:23 +01:00
lucaronin
6989f44031 feat: migrate to shadcn/ui
Install Tailwind CSS v4 + shadcn/ui with Radix UI primitives. Migrate all
UI components (Sidebar, NoteList, Editor tabs, Inspector, dialogs, palette)
from BEM CSS to Tailwind utility classes and shadcn components (Button,
Input, Dialog, Badge, etc.). Map theme system to shadcn CSS variables while
preserving BlockNote editor styles untouched. Remove 8 old CSS files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:56:44 +01:00
lucaronin
a15982bc37 Add commit and push functionality with dialog
Sidebar shows "Commit & Push" button when uncommitted changes exist.
Clicking opens a commit message dialog. After committing, auto-pushes and
shows success/error toast. Modified files count refreshes after commit.

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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 12:56:28 +01:00
lucaronin
b5971c9618 Add light/dark mode toggle with CSS variables
Replace all hardcoded colors across 10 CSS files with CSS variables defined
in index.css. Dark mode (default) uses the existing navy/purple palette,
light mode uses Notion-inspired warm neutrals from the design tokens
(--bg-primary: #FFFFFF, --bg-sidebar: #F7F6F3, --text-primary: #37352F).

Toggle button (sun/moon) in the sidebar header persists preference to
localStorage. An inline script in index.html applies the saved theme
before React mounts to prevent flash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:34:59 +01:00
lucaronin
9d29959fba Add frameless window with custom drag regions (Obsidian-style)
Remove native macOS titlebar via decorations:false + titleBarStyle:overlay.
Add -webkit-app-region:drag to panel headers (Sidebar, NoteList, Editor tab
bar, Inspector) with no-drag on interactive elements. Sidebar header gets
78px left padding for macOS traffic light buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:00:29 +01:00
lucaronin
97499088b3 Add TOPICS section to sidebar
Flat list of Topic entities at the bottom of the sidebar,
separated from section groups by a border. Clicking a topic
fires onSelect with kind: 'topic'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:42:46 +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
57083ad12c Add four-panel layout shell with vault scanning on load
- Sidebar (250px, resizable): navigation placeholder
- Note list (300px, resizable): displays vault entries from scan
- Editor (flex grow): placeholder for CodeMirror 6
- Inspector (280px, collapsible): properties/relationships placeholder
- Resizable panels with drag handles
- Calls list_vault on app load and displays results in note list

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