Commit Graph

74 Commits

Author SHA1 Message Date
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
ef7ec39fed Add TODO.md with future improvements and unsaved note switching proposal 2026-03-17 09:33:06 +01:00
drelich
93e2a87fa6 Fix delete button to respect unsaved changes lock
- Prevent delete button from working when there are unsaved changes on a different note
- Delete button now checks hasUnsavedChanges before allowing deletion
- Only the currently selected note can be deleted when it has unsaved changes
- Prevents accidental deletion of other notes when locked
2026-03-17 09:29:53 +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
489f2f847d Update app name to 'Nextcloud Notes'
- Changed productName from 'nextcloud-notes-tauri' to 'Nextcloud Notes'
- Updated identifier to 'com.davidrelich.nextcloud-notes'
- App will now show as 'Nextcloud Notes' in macOS Applications
- DMG and .app bundle will use proper name
2026-03-17 00:29:39 +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
a2c717c2e2 Add visual hint for delete confirmation
- Shows 'Click again to delete' text when delete button is clicked once
- Text appears next to the red delete button in confirmation state
- Makes the double-click deletion flow much more intuitive
- Button also stays visible (opacity-100) during confirmation state
- Text styled in red to match the delete action
2026-03-17 00:24:47 +01:00
drelich
9b0a289cc8 Improve note deletion UX with double-click confirmation
- Replaced confusing browser confirm() dialog with double-click to delete
- First click highlights delete button in red (confirmation state)
- Second click within 3 seconds actually deletes the note
- Visual feedback with red background on confirmation state
- Tooltip changes to 'Click again to confirm deletion'
- Removed debug logging from delete handlers
- Much clearer and more intuitive deletion flow
2026-03-17 00:22:29 +01:00
drelich
42cc1ffcd9 Add debug logging for note deletion 2026-03-17 00:19:45 +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
1c9efe6007 Fix TipTap editor content colors for dark mode
- Added proper text colors for all editor content in dark mode
- Fixed headings (H1, H2, H3) to use light text in dark mode
- Fixed bold, italic, strikethrough, underline text colors
- Fixed list items (ul, ol, li) text colors
- Fixed blockquote colors and borders for dark mode
- Fixed horizontal rule colors
- All formatted content now properly visible in dark mode
2026-03-17 00:12:06 +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
f4b324b702 Add TypeScript types for turndown library
- Added @types/turndown dev dependency for production build
- Fixes TypeScript compilation errors during build process
2026-03-17 00:03:31 +01:00
drelich
835643d690 Update app icon to official Nextcloud Notes icon
- Downloaded official Nextcloud Notes favicon
- Generated all required icon sizes for Tauri (macOS, Windows, Store)
- Replaced placeholder icons with branded Nextcloud Notes icon
- Icon sizes: 32x32, 128x128, 256x256, .icns, .ico, and Windows Store logos
2026-03-17 00:01:12 +01:00
drelich
074f695b3e Add logout functionality and username display
- Added logout button at bottom of sidebar
- Display username with avatar (first letter)
- Clear all credentials and state on logout
- Username persists from saved credentials
- Clean logout flow returns to login screen
2026-03-16 23:56:41 +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