Commit Graph

73 Commits

Author SHA1 Message Date
drelich
8bbd5f9262 Fix bidirectional favorite sync - use timestamp matching in syncFavoriteStatus
The syncFavoriteStatus method was using title matching which fails when
API and WebDAV titles differ. Now uses modified timestamp + category
matching (with title fallback) for reliable bidirectional sync.
2026-03-26 09:18:26 +01:00
drelich
244ba69eed Implement hybrid WebDAV + API favorite sync
- Keep WebDAV for reliable content sync
- Add REST API calls for favorite status only
- Match notes by modified timestamp + category (titles can differ)
- Sync favorites from API after WebDAV sync completes
- Update favorite via API when user toggles star
- Tested and working with mobile app sync
2026-03-26 09:14:42 +01:00
drelich
36733da434 Remove title field again after revert - keep auto-resize behavior
- Removed separate title input field (reverted back in previous commit)
- Title extracted from first line of content
- Favorite star moved to toolbar
- Fixed duplicate import in NotesList
- Auto-resize behavior preserved to avoid scroll jumping issue
2026-03-25 23:48:36 +01:00
drelich
f4ba8c9775 Merge branch 'main' into dev 2026-03-25 23:45:50 +01:00
drelich
dac08f1d2f Revert scroll position changes - restore original auto-resize behavior
The attempts to fix scroll jumping caused other issues. Reverting to original
working state with auto-resize, accepting the scroll-to-top behavior for now.
This can be revisited later with more time for proper testing.
2026-03-25 23:43:14 +01:00
drelich
0a6ecd25da Fix scroll position when typing in long notes
- Preserve textarea scroll position during auto-resize in onChange handler
- Prevents view from jumping to top when typing below the fold
2026-03-25 23:36:02 +01:00
drelich
cb7a8d8276 Major UX improvements: remove title field, auto-sync, fix image uploads
- Remove separate title input field - first line of content is now the title (standard Markdown behavior)
- Update note parsing to extract title from first line while keeping full content
- Move favorite star button to toolbar to save vertical space
- Fix image upload attachment directory path sanitization
- Add automatic background sync after save operations (create, update, move)
- Add rotating sync icon animation during sync operations
- Fix infinite sync loop by preventing sync complete callback from triggering another sync
- Bump IndexedDB version to 2 to clear old cached notes with stripped first lines
- Remove dialog permission errors in attachment upload (use console.log and alert instead)
- Add detailed debug logging for attachment upload troubleshooting
2026-03-25 23:31:27 +01:00
drelich
911662b214 Merge branch 'main' into dev 2026-03-25 20:20:04 +01:00
drelich
dfc0e644eb fix: remove duplicate import in NotesList.tsx 2026-03-25 20:16:27 +01:00
drelich
5a925dc50e feat: WebDAV file access and category color sync (v0.2.0)
Major Changes:
- Switch from Nextcloud Notes API to direct WebDAV file access
- Notes stored as .txt files with filename-based IDs for reliability
- Implement safer sync strategy without clearNotes() to prevent data loss
- Add ETag-based conflict detection for concurrent edits
- Add category color sync to .category-colors.json on server
- Show neutral gray badges for categories without assigned colors

Technical Improvements:
- Replace numeric IDs with filename-based string IDs
- Update Note type to support both number and string IDs
- Implement WebDAV methods: fetchNotesWebDAV, createNoteWebDAV, updateNoteWebDAV, deleteNoteWebDAV
- Add CategoryColorsSync service for server synchronization
- Remove hash-based color fallback (only show colors when explicitly set)

Bug Fixes:
- Fix category badge rendering to show all categories
- Prevent note loss during sync operations
- Improve offline-first functionality with better merge strategy
2026-03-25 20:12:00 +01:00
drelich
70c38cb925 Merge feature/webdav-file-access: WebDAV implementation and improvements 2026-03-25 20:11:28 +01:00
drelich
4f13b0d57f fix: show neutral badge for categories without assigned colors
- Categories without colors now show gray badge instead of no badge
- Categories with colors show colored badge as before
- Bump version to 0.2.0
2026-03-25 20:08:47 +01:00
drelich
4dbf0233b7 fix: add category color sync and remove hash-based fallback
- Add categoryColorsSync service from dev branch
- Add missing fetchCategoryColors() method to NextcloudAPI
- Remove hash-based color fallback in NotesList (only show badges when color explicitly set)
- Initialize categoryColorsSync in App.tsx for server sync
- Category colors now sync to .category-colors.json on server
2026-03-25 19:58:48 +01:00
drelich
5de3cd3789 feat: switch from Notes API to WebDAV file access
- Replace API-based note operations with direct WebDAV file access
- Use filename-based IDs instead of numeric IDs for better reliability
- Implement safer merge strategy that doesn't clear local notes
- Add ETag-based conflict detection to prevent data loss
- Support string | number IDs throughout the codebase
- Notes are now stored as .txt files in /Notes/{category}/
- Eliminates race conditions and temporary ID conflicts
- More reliable sync with direct file system access
2026-03-25 19:47:00 +01:00
drelich
486579809f feat: add category colors sync to Nextcloud server
- Add categoryColorsSync service to sync colors to server
- Store category colors in .category-colors.json file in Notes directory
- Add fetchCategoryColors() and saveCategoryColors() methods to NextcloudAPI
- Initialize categoryColorsSync with API instance on login/logout
- Remove automatic hash-based color assignment for categories
- Only show category badges when colors are explicitly set by user
- Simplify color change event handling using category
2026-03-25 15:45:53 +01:00
drelich
f8b3cc8a9d Merge branch 'main' into dev 2026-03-23 16:11:50 +01:00
drelich
0b13a2df5b feat: add custom category color picker with visual improvements
- Add custom color picker for categories (10 pastel colors)
- Store category colors in localStorage
- Add real-time color updates across components using custom events
- Change folder icons to filled/solid style for better visibility
- Use vibrant darker shades for folder icon colors
- Add 'Remove Color' option to reset category to default
- Add color indicator dots (replaced with filled icons)
- Improve hash distribution using FNV-1a algorithm for auto-assigned colors
- Expand auto-assigned color palette from 10 to 20 colors
2026-03-23 16:08:36 +01:00
drelich
861eb1e103 feat: add custom category color picker with visual improvements
- Add custom color picker for categories (10 pastel colors)
- Store category colors in localStorage
- Add real-time color updates across components using custom events
- Change folder icons to filled/solid style for better visibility
- Use vibrant darker shades for folder icon colors
- Add 'Remove Color' option to reset category to default
- Add color indicator dots (replaced with filled icons)
- Improve hash distribution using FNV-1a algorithm for auto-assigned colors
- Expand auto-assigned color palette from 10 to 20 colors
2026-03-23 16:08:26 +01:00
drelich
edc65f2edd Merge dev: category renaming feature (v0.1.5) 2026-03-21 22:34:22 +01:00
drelich
4ef0814ccd feat: add category renaming functionality (v0.1.5)
- Add double-click to rename categories (deprecated in favor of pencil icon)
- Add pencil icon on hover for intuitive category renaming
- Click pencil icon to enter inline rename mode
- Show helpful hint (Enter to save, Esc to cancel)
- Update all notes with old category name to new name
- Sync category changes to server
- Update selected category if currently viewing renamed category
- Bump version to 0.1.5
2026-03-21 22:34:05 +01:00
drelich
c775661caa Merge dev: PDF export improvements and offline fonts (v0.1.4) 2026-03-21 22:14:32 +01:00
drelich
3e93cf2408 feat: improve PDF export styling and functionality
- Fix inline code padding to prevent overlap with line above
- Add proper heading styles (h1, h2, h3) with correct font sizes
- Add list styling (ul/ol) with proper bullets and numbering
- Embed images as data URLs in PDF export
- Fix list layout issues when images are present
- Add image styling to prevent layout interference
- Remove grey background from inline code for cleaner appearance
2026-03-21 22:14:16 +01:00
drelich
3e3d9ca7f1 feat: embed custom fonts in PDF exports using jsPDF addFont/setFont
- Load TTF font files as base64 from local fonts directory
- Use pdf.addFileToVFS() and pdf.addFont() to register custom fonts
- Use pdf.setFont() to explicitly set preview font before rendering
- Support all preview fonts: Merriweather, Crimson Pro, Roboto Serif, Average
- Include italic variants for proper markdown italic rendering
- Embed Source Code Pro for code blocks
- Maintains efficient file size (~120KB increase vs 18MB with html2canvas)
- Keeps proper margins, pagination, and page breaks
2026-03-21 21:49:50 +01:00
drelich
ed6dd69b32 Merge dev: fix TypeScript build error 2026-03-21 21:34:47 +01:00
drelich
bd6d2cd404 fix: restore hidden file input for InsertToolbar attachment upload
- Add back hidden file input element removed with Attach button
- InsertToolbar still uses file upload functionality
- Fixes TypeScript build error TS6133 (unused handleAttachmentUpload)
- Attachment upload still available via floating insert toolbar
2026-03-21 21:34:30 +01:00
drelich
e86e851b31 Merge dev: UI improvements and offline fonts (v0.1.4) 2026-03-21 21:30:54 +01:00
drelich
e9ba48d7d4 feat: implement offline fonts support (v0.1.4)
- Add local font files to public/fonts directory
- Replace Google Fonts CDN with local @font-face declarations
- Include both regular and italic variants for preview fonts
- Remove unused editor italic fonts to reduce bundle size
- App now fully functional offline without external dependencies
- Total font bundle: ~22.8 MB (10 font files)
2026-03-21 21:30:37 +01:00
drelich
c5c963200a refactor: remove Attach button from note editor header
- Remove confusing attachment upload button from header
- Simplify UI by keeping only category selector and preview toggle
- Attachment functionality removed from this section
2026-03-21 21:18:05 +01:00
drelich
013e7670f5 feat: add UI improvements to notes list
- Add color-coded category badges with consistent pastel colors
- Fix scroll jump issue when editing at bottom of note
- Add localStorage persistence for notes list width
- Prevent notes list from shrinking with flex-shrink-0
- Preserve cursor and scroll position during textarea resize
2026-03-21 21:12:58 +01:00
drelich
23ef338e47 Merge dev: offline-first functionality (v0.1.3) 2026-03-21 21:01:18 +01:00
drelich
1667c6cf13 chore: bump version to 0.1.3 2026-03-21 21:00:48 +01:00
drelich
6172abbe53 feat: implement offline-first functionality with local storage
- Add IndexedDB storage layer for notes (src/db/localDB.ts)
- Implement sync manager with queue and conflict resolution (src/services/syncManager.ts)
- Add online/offline detection hook (src/hooks/useOnlineStatus.ts)
- Load notes from local storage immediately on app startup
- Add sync status UI indicators (offline badge, pending count)
- Auto-sync every 5 minutes when online
- Queue operations when offline, sync when connection restored
- Fix note content update when synced from server while viewing
- Retry failed sync operations up to 5 times
- Temporary IDs for offline-created notes
2026-03-21 21:00:14 +01:00
drelich
4ddf2d15a9 chore: update Tauri config version to 0.1.2 2026-03-21 08:46:54 +01:00
drelich
472e6e3b2e Merge dev: collapsible settings and resizable notes list (v0.1.2) 2026-03-21 08:45:45 +01:00
drelich
e3a1d74413 feat: add collapsible settings panel and resizable notes list (v0.1.2)
- Settings panel in categories sidebar now collapses/expands with toggle button
- Settings collapsed by default to save space
- Notes list column now resizable with drag handle (240px-600px range)
- Improved UI flexibility and space management
2026-03-21 08:43:58 +01:00
drelich
c147890138 Fix preview mode stale content bug when switching notes (v0.1.1)
- Fixed race condition where image processing ran before localContent updated
- Added synchronization guard to prevent processing stale content
- Added comprehensive logging for debugging note switches
- Bumped version to 0.1.1
2026-03-18 17:42:39 +01:00
drelich
7d992d103c Add app screenshot to README header
- Display nextcloud-notes-tauri.png at top of README
- Provides visual branding before project title
2026-03-18 16:45:48 +01:00
drelich
2a3b733178 Add app screenshot to README header 2026-03-18 16:43:42 +01:00
drelich
c11e792062 Initial release: Nextcloud Notes Desktop App
A cross-platform desktop application for Nextcloud Notes built with Tauri, React, and TypeScript.

Features:
- Full Nextcloud Notes integration with real-time sync
- Rich markdown editor with live preview
- Category management and organization
- Image and attachment support
- Customizable fonts and UI themes
- Focus mode for distraction-free writing
- Floating toolbar for quick formatting
- PDF export functionality
- Offline mode support

Tech Stack:
- Tauri (Rust backend)
- React + TypeScript
- TailwindCSS for styling
- Vite for build tooling
- Markdown-it for rendering
2026-03-18 16:03:53 +01:00
drelich
ba4600773a Add attachment upload and InsertToolbar for quick link/file insertion
- Add uploadAttachment method to NextcloudAPI (WebDAV PUT to .attachments directory)
- Add InsertToolbar component that appears on cursor placement in editor
- InsertToolbar provides quick access to insert links (with modal) and files
- Add Attach button to main toolbar as alternative upload method
- Insert markdown references at cursor position after upload
2026-03-18 14:42:36 +01:00
drelich
5ff3427848 Update TODO: mark image viewing support as completed 2026-03-18 14:26:32 +01:00
drelich
7fd765ceb6 Add image/attachment support in preview mode
- Fetch attachments via WebDAV using Tauri HTTP plugin (bypasses CORS)
- Parse markdown for image references and convert to base64 data URLs
- In-memory cache to avoid re-fetching images
- Loading indicator while images load
- Register tauri-plugin-http in Rust builder
- Add HTTP permissions in capabilities
2026-03-18 14:25:03 +01:00
drelich
7611f8e82e fix: Remove unused fontSize prop (replaced by editorFontSize/previewFontSize) 2026-03-17 20:58:52 +01:00
drelich
75c3cd4796 docs: Update TODO with high priority items - PDF export fix and offline mode 2026-03-17 20:46:08 +01:00
drelich
f06fc640b6 feat: Add customizable fonts for editor and preview
- Added Google Fonts: Source Code Pro, Roboto Mono, Inconsolata (editor)
  and Merriweather, Crimson Pro, Roboto Serif, Average (preview)
- Font face and size selectors in Categories sidebar with polished UI
- Editor font applied to markdown textarea
- Preview font applied to preview mode and PDF export
- Code blocks always render in monospace
- Settings persist in localStorage
- Fixed textarea height recalculation when switching from preview to edit
2026-03-17 20:39:33 +01:00
drelich
28914207f6 feat: Major UI improvements - categories sidebar, floating toolbar, focus mode
Categories sidebar:
- Collapsible first column with category management
- Create new categories directly from sidebar
- Thin tab when collapsed
- Moved user info, logout, and theme selector here

Note editor redesign:
- Clean toolbar with pill-style buttons
- Category dropdown with folder icon
- Preview toggle in toolbar
- Streamlined action buttons

Floating formatting toolbar:
- Appears on text selection
- Bold, italic, strikethrough, code, code block, quote, lists, link, headings
- Active state highlighting for applied formats
- Toggle behavior removes formatting if already applied

Focus mode:
- Hides sidebars for distraction-free writing
- Content centered with max-width
- Escape key to exit
- Scrolling works from anywhere in viewport
2026-03-17 20:13:44 +01:00
drelich
e94e201ec8 Improve note preview and editor padding
- Increased editor padding from 6 to 8 for better spacing
- Simplified preview generation to show first 100 characters
- Remove markdown syntax (#, *, `) from note previews for cleaner display
- Replaced multi-line filtering logic with direct substring approach
2026-03-17 18:41:19 +01:00
drelich
db7daa81a3 Center PDF title and improve code/list formatting
- Centered note title in PDF exports for better visual balance
- Increased inline code font size from 0.9em to 1.1em for better readability
- Removed paragraph margins inside list items to fix spacing issues
2026-03-17 15:54:55 +01:00
drelich
89c161f2f3 Remove unused html2canvas import to fix production build
- Removed html2canvas import that was causing TypeScript error
- html2canvas is no longer needed since we switched to jsPDF's html() method
- Fixes build error: TS6133 'html2canvas' is declared but never read
2026-03-17 11:34:41 +01:00
drelich
55f50f3a77 Adjust PDF margins and content width for balanced layout
- Reordered jsPDF html() options for clarity
- Added autoPaging: 'text' for better page break handling
- Adjusted windowWidth to 650px for better content scaling
- Maintains 20mm margins on all sides
- Content width set to 170mm (210mm A4 - 40mm margins)
- Should produce more balanced left/right margins
2026-03-17 10:27:08 +01:00