Commit Graph

33 Commits

Author SHA1 Message Date
drelich
0a5dba2a98 Fix favorite star not showing in editor toolbar after sync
Added note.favorite to useEffect dependencies so localFavorite state
updates when favorite status changes via background sync from mobile.
2026-03-26 09:23:36 +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
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
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
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
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
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
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
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
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
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
drelich
19a42a1190 Simplify PDF export using jsPDF's html() method for automatic pagination
- Removed complex manual page-by-page rendering logic
- Using jsPDF's built-in html() method instead (like dompdf does)
- Handles pagination automatically with proper page breaks
- Set 20mm margins on all sides via margin parameter
- Content width set to 170mm (210mm - 40mm margins)
- Much simpler and more reliable approach
- Leverages jsPDF's native HTML rendering engine
2026-03-17 10:23:10 +01:00
drelich
e018b9e1e9 Fix PDF page breaks to properly respect margins on all pages
- Rewrote PDF export to render content page-by-page instead of as one image
- Calculate total content height and number of pages needed
- Create separate canvas for each page with proper dimensions
- Use overflow:hidden wrapper to show only one page's worth of content at a time
- Position content with negative top offset for each subsequent page
- Each page gets proper 20mm margins on all sides
- Fixes issue where content flowed continuously across pages
- Bottom margins now properly respected on every page
2026-03-17 10:20:36 +01:00
drelich
12579d6198 Fix PDF export with Tauri native dialogs and proper margins
- Installed @tauri-apps/plugin-dialog for native dialogs
- Added tauri-plugin-dialog to Rust dependencies
- Registered dialog plugin in Tauri app initialization
- Replaced web alert() with Tauri message() dialog
- Success dialog shows filename and download location
- Error dialog shows if export fails
- Added 20mm margins on all sides of PDF pages
- Content width adjusted to 170mm (210mm - 40mm margins)
- Multi-page support respects margins on all pages
- Native dialogs work properly in Tauri app
2026-03-17 10:15:20 +01:00
drelich
9d3c8b5e3c Improve PDF export with multi-page support and better UX
- Fixed multi-page PDF generation - now properly splits long documents across pages
- Added isExportingPDF state for loading feedback
- Replaced generic download icon with document/PDF icon
- Button shows spinning loader during PDF generation
- Button changes to blue background while exporting
- Added success alert with filename and download location
- Button disabled during export to prevent multiple clicks
- Improved visual feedback throughout export process
2026-03-17 09:42:27 +01:00
drelich
d53a454d7b Add PDF export feature to notes
- Installed jsPDF and html2canvas libraries
- Implemented handleExportPDF function to convert note to PDF
- Creates temporary styled container with title and content
- Uses html2canvas to render content as image
- Generates A4 format PDF with proper formatting
- Added export button (download icon) in note header
- Button positioned between discard and favorite buttons
- PDF filename uses note title
- Includes error handling with user feedback
2026-03-17 09:34:27 +01:00
drelich
2d1cc4baf0 Add Discard Changes button to revert unsaved edits
- Added handleDiscard function to reload original note content
- New discard button appears next to save button when there are unsaved changes
- Button uses X icon and gray styling to distinguish from save
- Clicking discard reloads the original note title and content
- Resets hasUnsavedChanges to false, allowing note switching again
- Provides way to abandon changes without saving
2026-03-17 09:27:46 +01:00
drelich
9a229dcc00 Prevent note switching when there are unsaved changes
- Added hasUnsavedChanges state tracking in App.tsx
- NoteEditor now notifies parent via onUnsavedChanges callback
- NotesList receives hasUnsavedChanges prop
- Clicking on other notes is prevented when current note has unsaved changes
- Visual feedback: other notes become semi-transparent with cursor-not-allowed
- Tooltip shows 'Save current note before switching' on disabled notes
- Much simpler and more reliable than trying to auto-save on switch
2026-03-17 09:24:30 +01:00
drelich
e6ecab13fa Fix note switching to save unsaved changes before loading new note
- Added loadNewNote helper function to encapsulate note loading logic
- Check for unsaved changes when switching notes
- Save previous note if it has unsaved changes
- Add 100ms delay before loading new note to ensure save completes
- Prevents data loss when switching from unsaved note to another note
- Fixes bug where new note content would overwrite unsaved changes
2026-03-17 09:19:03 +01:00
drelich
c7f314d632 Fix disabled save button styling in dark mode
- Changed disabled save button background from light grey to dark grey in dark mode
- Changed disabled save button text from grey-400 to grey-500 in dark mode
- Button now blends better with dark mode design
- No longer draws unwanted attention when disabled
2026-03-17 00:27:01 +01:00
drelich
d09920850d Remove category feature from UI
- Removed category input field from note editor
- Removed category display from notes list
- Removed category state management from NoteEditor component
- Category field now always saved as empty string
- Simplified UI to focus on core note-taking features
- Fixed favorite star icon dark mode styling
2026-03-17 00:18:18 +01:00
drelich
81cc72b444 Fix dark mode visibility for all toolbar buttons and icons
- Fixed all formatting toolbar buttons to be visible in dark mode
- Added proper text colors (gray-700/gray-300) to all toolbar icons
- Fixed sync and new note button icons in sidebar
- Fixed divider colors between button groups
- All UI elements now properly visible in both light and dark modes
2026-03-17 00:10:07 +01:00
drelich
f3096c16ca Add light/dark mode theme support with OS sync
- Added theme state management (light/dark/system)
- Implemented OS theme detection and automatic sync
- Added theme toggle UI in sidebar with 3 buttons
- Applied dark mode styles to all components:
  - Sidebar with dark backgrounds and borders
  - Note editor with dark text and inputs
  - Toolbar buttons with dark hover states
  - TipTap editor with dark mode text and code blocks
- Theme preference saved to localStorage
- Enabled Tailwind dark mode with class strategy
- Smooth transitions between themes
2026-03-17 00:07:23 +01:00
drelich
2ad076c052 Initial commit: Nextcloud Notes Tauri app with WYSIWYG editor
Features:
- WYSIWYG markdown editor with TipTap
- Manual save with unsaved changes indicator
- Auto-title derivation from first line (with manual override)
- Manual sync button with visual feedback
- Auto-sync every 5 minutes
- Full formatting toolbar (bold, italic, headings, lists, code)
- Note creation, editing, deletion
- Search and favorites filter
- Cross-platform desktop app built with Tauri + React + TypeScript
2026-03-16 23:49:51 +01:00