144 Commits

Author SHA1 Message Date
6de413376f Clean up documentation and remove debug settings
- Move documentation files from root to docs/ folder
- Remove DEBUG-only settings from ReadingSettingsView (Safari Reader Mode, Auto-mark as read)
2025-11-21 22:07:41 +01:00
a3b3863fa3 Refactor tag management system with improved search and real-time sync
- Add CreateLabelUseCase for consistent label creation across app and extension
- Implement TagRepository for Share Extension to persist new labels to Core Data
- Enhance CoreDataTagManagementView with real-time search functionality
- Add automatic tag synchronization on app startup and resume
- Improve Core Data context configuration for better extension support
- Unify label terminology across UI components (tags -> labels)
- Fix label persistence issues in Share Extension
- Add immediate Core Data persistence for newly created labels
- Bump version to 36
2025-11-10 21:29:38 +01:00
4134b41be2 Fix tag scrolling and improve debug logging
- Fix duplicate ID warning in CoreDataTagManagementView by using objectID
- Enhance debug logging system with category filtering
2025-11-08 19:18:56 +01:00
e5d4e6d8a0 Fix tag scrolling and improve debug logging
- Fix duplicate ID warning in CoreDataTagManagementView by using objectID
- Enhance debug logging system with category filtering
2025-11-08 19:18:41 +01:00
4b788650b8 Redesign settings screen with native iOS style
- Move font settings to dedicated detail screen with larger preview
- Add inline explanations directly under each setting
- Reorganize sections: split General into Reading Settings and Sync Settings
- Combine Legal, Privacy and Support into single section
- Move "What's New" to combined Legal/Privacy/Support section
- Redesign app info footer with muted styling and center alignment
- Remove white backgrounds from font preview for better light/dark mode support
2025-11-08 19:12:08 +01:00
f3719fa9d4 Refactor tag management to use Core Data with configurable sorting
This commit introduces a comprehensive refactoring of the tag management
system, replacing the previous API-based approach with a Core Data-first
strategy for improved performance and offline support.

Major Changes:

Tag Management Architecture:
- Add CoreDataTagManagementView using @FetchRequest for reactive updates
- Implement cache-first sync strategy in LabelsRepository
- Create SyncTagsUseCase following Clean Architecture principles
- Add TagSortOrder enum for configurable tag sorting (by count/alphabetically)
- Mark LegacyTagManagementView as deprecated

Share Extension Improvements:
- Replace API-based tag loading with Core Data queries
- Display top 150 tags sorted by usage count
- Remove unnecessary label fetching logic
- Add "Most used tags" localized title
- Improve offline bookmark tag management

Main App Enhancements:
- Add tag sync triggers in AddBookmarkView and BookmarkLabelsView
- Implement user-configurable tag sorting in settings
- Add sort order indicator labels with localization
- Automatic UI updates via SwiftUI @FetchRequest reactivity

Settings & Configuration:
- Add TagSortOrder setting with persistence
- Refactor Settings model structure
- Add FontFamily and FontSize domain models
- Improve settings repository with tag sort order support

Use Case Layer:
- Add SyncTagsUseCase for background tag synchronization
- Update UseCaseFactory with tag sync support
- Add mock implementations for testing

Localization:
- Add German and English translations for:
  - "Most used tags"
  - "Sorted by usage count"
  - "Sorted alphabetically"

Technical Improvements:
- Batch tag updates with conflict detection
- Background sync with silent failure handling
- Reduced server load through local caching
- Better separation of concerns following Clean Architecture
2025-11-08 13:46:40 +01:00
460b05ef34 Add delete annotation feature with swipe gesture
Implemented ability to delete annotations via swipe-to-delete gesture in the annotations list view. Added close button with X icon to dismiss the annotations sheet.

Changes:
- Added DeleteAnnotationUseCase with repository integration
- Extended API with DELETE endpoint for annotations
- Implemented swipe-to-delete in AnnotationsListView
- Added error handling and optimistic UI updates
- Updated toolbar with close button (X icon)
2025-11-01 14:03:39 +01:00
7338db5fab Improve debug logging system
- Redesign logging configuration UI with cleaner list-based navigation
- Replace segmented controls with detailed selection screens for better UX
- Add in-app debug log viewer with filtering and search capabilities
- Implement opt-in logging toggle to reduce device performance impact
- Add log storage system with 1000 entry limit
- Enable log export via share sheet
- Show warning banner when logging is disabled
2025-11-01 13:54:40 +01:00
4b93c605f1 Redesign settings screen with native iOS style
- Refactor all settings views to use List with .insetGrouped style
- Create reusable SettingsRow components for consistent UI
- Separate onboarding flow into dedicated OnboardingServerView
- Consolidate font, theme, and card layout into unified Appearance section
- Add visual card layout previews in dedicated selection screen
- Move "Open links in" option to Appearance with descriptive footer
- Improve settings organization and native iOS feel
2025-10-31 23:39:59 +01:00
4e973751f4 Simplify release notes for regular users 2025-10-30 22:27:14 +01:00
571d61c8e5 Update release notes for markdown rendering improvement 2025-10-30 21:54:02 +01:00
05ae421a40 Add MarkdownUI package and cleanup project structure
- Add swift-markdown-ui package dependency (v2.4.1)
- Remove old Logger.swift (moved to Utils/Logger.swift)
- Remove RELEASE_NOTES.md from Resources (moved to UI/Resources)
- Update German localization strings for settings sections
- Bump build version to 32
2025-10-30 21:50:33 +01:00
85bad35788 Refactor release notes to use MarkdownUI library
- Create MarkdownContentView to encapsulate MarkdownUI rendering
- Replace custom AttributedString markdown parsing with MarkdownUI
- Simplify ReleaseNotesView by removing manual markdown styling
- Improve markdown rendering with proper support for lists, links, and formatting
- Make markdown rendering easily replaceable by keeping it in a dedicated view
2025-10-30 21:48:28 +01:00
db3cbf41d4 Fix URL label translation and formatting
- Add localization keys for "open_url" and "open_original_page" in EN/DE
- Create URLUtil.openUrlLabel() helper function for consistent formatting
- Replace incorrect string concatenation with proper localized labels
- Fix: "example.comopen" now displays as "Open example.com" (EN) or "example.com öffnen" (DE)
- Update BookmarkDetailLegacyView, BookmarkDetailView2, and BookmarkCardView
2025-10-30 21:14:40 +01:00
cdfa6dc4c5 Fix annotation navigation by scrolling outer ScrollView instead of WebView
The JavaScript was executing scrollIntoView() but the WebView itself cannot
scroll (isScrollEnabled = false). Fixed by calculating the annotation's Y
position in the WebView and scrolling the outer ScrollView to the correct
position instead.

Changes:
- WebView.swift: Added onScrollToPosition callback and scrollToPosition
  message handler. JavaScript now calculates and sends annotation position
  to Swift instead of using scrollIntoView().
- NativeWebView.swift: Same changes for iOS 26+ with polling mechanism for
  window.__pendingScrollPosition.
- BookmarkDetailLegacyView.swift: Implemented onScrollToPosition callback
  that calculates final scroll position (header height + annotation position)
  and scrolls the outer ScrollView.
- BookmarkDetailView2.swift: Same implementation as BookmarkDetailLegacyView.
2025-10-30 21:07:13 +01:00
87464943ac bumped build version and version 2025-10-29 22:12:02 +01:00
907cc9220f perf: Optimize label loading for 1000+ labels
Major performance improvements to prevent crashes and lag when working with large label collections:

Main App:
- Switch to Core Data as primary source for labels (instant loading)
- Implement background API sync to keep labels up-to-date
- Add LazyVStack for efficient rendering of large label lists
- Use batch operations instead of individual queries (1 query vs 1000)
- Generate unique IDs for local labels to prevent duplicate warnings

Share Extension:
- Convert getTags() to async with background context
- Add saveTags() method with batch insert support
- Load labels from Core Data first, then sync with API
- Remove duplicate server reachability checks
- Reduce memory usage and prevent UI freezes

Technical Details:
- Labels now load instantly from local cache
- API sync happens in background without blocking UI
- Batch fetch operations for optimal database performance
- Proper error handling for offline scenarios
- Fixed duplicate ID warnings in ForEach loops

Fixes crashes and lag reported by users with 1000+ labels.
2025-10-26 21:24:12 +01:00
c629894611 feat: Show annotations button only when article contains annotations
Add conditional visibility for the annotations button in the toolbar based on whether the loaded article contains any rd-annotation tags.

Changes:
- Add hasAnnotations property to BookmarkDetailViewModel
- Check for <rd-annotation tags when processing article content
- Conditionally show/hide annotations button in BookmarkDetailView2
2025-10-26 21:20:08 +01:00
b77e4e3e9f refactor: Centralize annotation colors and improve color consistency
- Move AnnotationColor enum to Constants.swift for centralized color management
- Add hexColor property to provide hex values for JavaScript overlays
- Add cssColorWithOpacity method for flexible opacity control
- Update NativeWebView and WebView to use centralized color values
- Replace modal color picker with inline overlay for better UX
- Implement annotation creation directly from text selection
- Add API endpoint for creating annotations with selectors
2025-10-25 09:19:49 +02:00
1b9f79bccc fix: Use callJavaScript instead of evaluateJavaScript for WebPage
WebPage in iOS 26 uses callJavaScript method, not evaluateJavaScript.
2025-10-22 15:58:07 +02:00
d1157defbe fix: Resolve WebPage binding error in NativeWebView text selection
Capture webPage locally in Task to avoid @State binding issues when
calling evaluateJavaScript in async context.
2025-10-22 15:54:55 +02:00
a041300b4f feat: Add text selection support for iOS 26+ NativeWebView
Implement text selection detection in NativeWebView:
- Add onTextSelected callback parameter to NativeWebView
- Use JavaScript polling to detect text selections
- Calculate text offsets for precise annotation positioning
- Integrate color picker in BookmarkDetailView2 for iOS 26+
- Match feature parity with legacy WebView implementation

Text selection now works on both WebView implementations.
2025-10-22 15:35:56 +02:00
ec12815a51 feat: Add text selection and annotation creation UI
Implement interactive text annotation feature:
- Add text selection detection via JavaScript in WebView
- Create AnnotationColorPicker with 4 color options (yellow, green, blue, red)
- Integrate color picker sheet in bookmark detail views
- Calculate text offsets for precise annotation positioning
- Add onTextSelected callback for WebView component
- Prepare UI for future API integration

Users can now select text in articles and choose a highlight color.
API integration for persisting annotations will follow.
2025-10-22 15:30:34 +02:00
cf06a3147d feat: Add annotations support with color-coded highlighting
Add comprehensive annotations feature to bookmark detail views:
- Implement annotations list view with date formatting and state machine
- Add CSS-based highlighting for rd-annotation tags in WebView components
- Support Readeck color scheme (yellow, green, blue, red) for annotations
- Enable tap-to-scroll functionality to navigate to selected annotations
- Integrate annotations button in bookmark detail toolbar
- Add API endpoint and repository layer for fetching annotations
2025-10-22 15:25:55 +02:00
47f8f73664 fix: Improve markdown formatting in release notes view
Add custom AttributedString extension to properly format markdown with correct spacing and header styles. This fixes the compressed appearance of release notes by adding proper line breaks between sections and applying appropriate font sizes to headers.
2025-10-19 20:41:04 +02:00
d97e404cc7 fix: Prevent UICollectionView crash from concurrent bookmark list updates
Add isUpdating flag to prevent race conditions when updating the bookmark list.
This fixes crashes that occurred when returning to the app after adding a bookmark
via the share extension while the list was being updated.
2025-10-19 20:40:02 +02:00
6906509aea fix: Remove trailing slash from endpoint instead of adding it
Trailing slash is added elsewhere in the codebase, so here we remove it if present to avoid duplication
2025-10-19 19:40:25 +02:00
afe3d1e261 feat: Add endpoint normalization with validation rules
- Default to https if no scheme provided
- Only accept http and https schemes
- Add trailing slash to path automatically
- Remove query parameters and fragments
- Update endpoint field with normalized value after save
2025-10-19 19:37:35 +02:00
554e223bbc feat: Redesign server settings form with prompt parameters and quick input chips
- Remove redundant field labels, use prompt parameter instead
- Add QuickInputChip component for quick URL entry
- Add chips: http://, https://, 192.168., :8000
- Improve spacing and layout consistency
- Cleaner, more modern UI appearance
2025-10-19 19:26:40 +02:00
819eb4fc56 feat: Add helpful hint text for server endpoint field
- Clarify HTTP/HTTPS support
- Note HTTP restriction to local networks
- Mention optional port configuration
- Indicate trailing slash not required
2025-10-19 19:17:30 +02:00
6385d10317 fix: Set gray tint color for server endpoint TextField placeholder 2025-10-19 19:16:12 +02:00
31ed3fc0e1 fix: Use @State instead of @StateObject for @Observable AppViewModel
- Replace @StateObject with @State for @Observable conformance
- Remove unnecessary Task wrapper in init
- Call loadSetupStatus() synchronously since it's already @MainActor
2025-10-19 19:06:35 +02:00
04de2c20d4 refactor: Use @Observable and inject factory in AppViewModel
- Replace ObservableObject with @Observable macro
- Inject UseCaseFactory instead of individual use cases
- Use factory.makeCheckServerReachabilityUseCase() on demand
- Use factory.makeLogoutUseCase() for 401 handling
2025-10-19 19:01:54 +02:00
fde1140f24 refactor: Check server reachability on app resume instead of app start
- Move server check from init to onAppResume() in AppViewModel
- Add scenePhase observer in readeckApp
- Check only when app becomes active (.active phase)
- Respects 30s cache - won't call API if recently checked
2025-10-19 11:08:13 +02:00
e5334d456d refactor: Remove NWPathMonitor auto-sync, keep only on-demand server checks
- Delete NetworkConnectivity.swift with problematic NWPathMonitor
- Remove serverDidBecomeAvailable notification
- Remove unused startAutoSync from OfflineSyncManager
- Server check now only on app start via AppViewModel
2025-10-19 10:47:19 +02:00
1957995a9e refactor: Update NetworkConnectivity to use CheckServerReachabilityUseCase 2025-10-19 10:45:21 +02:00
bf3ee7a1d7 fix: Add MockCheckServerReachabilityUseCase implementation 2025-10-19 10:32:44 +02:00
ef8ebd6f00 refactor: Optimize server connectivity with Clean Architecture
- Replace ServerConnectivity with CheckServerReachabilityUseCase
- Add InfoApiClient for /api/info endpoint
- Implement ServerInfoRepository with 30s cache TTL and 5s rate limiting
- Update ShareBookmarkViewModel to use ShareExtensionServerCheck manager
- Add server reachability check in AppViewModel on app start
- Update OfflineSyncManager to use new UseCase
- Extend SimpleAPI with checkServerReachability for Share Extension
2025-10-19 09:43:47 +02:00
eddc8a35ff bumped build version 2025-10-14 14:22:41 +02:00
446be3424e docs: Improve release notes with user-friendly language and better formatting
Release notes improvements:
- Rewrote technical descriptions for better user understanding
- Replaced technical jargon with clear benefits
- Added blank lines after section headers for better readability
- Focused on what users gain instead of implementation details

View improvements:
- Use AttributedString with proper markdown parsing
- Enable text selection for copying content
- Better markdown rendering with .interpretedSyntax option

Content updates:
- AppStore link and introduction added
- User-focused feature descriptions
- Clear benefit-oriented language
- Acknowledgment for community contributions
2025-10-14 14:20:39 +02:00
b8e5766cb1 feat: Add release notes system with auto-popup on version updates
Implement comprehensive release notes feature:
- RELEASE_NOTES.md with version 1.0 and 1.1 content in English
- VersionManager to track app versions and detect updates
- ReleaseNotesView with native markdown rendering
- Auto-popup sheet on first launch after version update
- Manual access via "What's New" button in General Settings

Features:
- Markdown-based release notes stored in app bundle
- Automatic version detection using CFBundleShortVersionString
- UserDefaults tracking of last seen version
- Dismissable sheet with "Done" button
- Settings button shows current version number

Technical implementation:
- VersionManager singleton for version tracking
- Sheet presentation in MainTabView on new version
- Settings integration with sparkles icon
- Native SwiftUI Text markdown rendering
- Bundle resource loading for RELEASE_NOTES.md

Release notes content:
- Version 1.1: iOS 26 features, floating buttons, progress tracking
- Version 1.0: Initial release features and capabilities
2025-10-14 14:04:28 +02:00
e61dbc7d72 feat: Add iOS 26 native WebView with floating action buttons and improved header
BookmarkDetailView2 enhancements:
- Implement floating action buttons with iOS 26 GlassEffect
- Buttons appear at 90% reading progress with slide-up animation
- Use GlassEffectContainer with liquid glass interaction effect
- Position buttons in bottom-right corner with spring animation
- Auto-hide when scrolling back above 90%

Header image improvements:
- Use aspect fit with blurred background for better image display
- Prevents random cropping of header images
- Maintains full image visibility while filling header space

Debug-only features:
- Add #if DEBUG wrapper for view toggle buttons
- Toggle between legacy and native WebView only in debug builds

Technical details:
- GlassEffectContainer with 52pt buttons and 31pt icons
- Spring animation (response: 0.6, damping: 0.8)
- Combined move and opacity transitions
- Full screen ScrollView with bottom safe area extension
- Blurred background layer for non-filling images
2025-10-14 13:53:31 +02:00
3d4c695ffa added some if debug checks 2025-10-12 22:17:03 +02:00
a5d94d1aee feat: Implement performant scroll progress tracking with PreferenceKey
Replace onScrollGeometryChange/onScrollPhaseChange with ContentHeightPreferenceKey
approach for improved scroll performance and accurate read progress tracking.

Changes:
- Add ScrollOffsetPreferenceKey and ContentHeightPreferenceKey for scroll tracking
- Track content end position dynamically as WebView loads
- Calculate progress from scroll offset relative to total scrollable content
- Implement 3% threshold for progress updates to reduce API calls
- Add progress locking at 100% to prevent pixel-variation regressions
- Guarantee 100% update when reaching end of content
- Apply to both BookmarkDetailLegacyView and BookmarkDetailView2

Technical approach:
- Place invisible marker at end of content to measure position in scrollView
- Update initialContentEndPosition as content grows during WebView loading
- Progress = (initialPosition - currentPosition) / (initialPosition - containerHeight)
- Lock progress once 100% reached to avoid 100% -> 99% fluctuations
2025-10-12 20:56:59 +02:00
bef6a9dc2f fix: Use total content height for read progress calculation
Added ContentHeightPreferenceKey to track the total ScrollView content height.

The bug: Progress was calculated using only webViewHeight - containerHeight,
which ignores the header, title, and other content above the webview.

The fix: Use total content height (header + title + webview + archive section)
instead of just webViewHeight for accurate progress calculation.

Changes:
- Added ContentHeightPreferenceKey preference key
- Added contentHeight state variable
- Added background GeometryReader to VStack to measure total content height
- Changed progress calculation: contentHeight - containerHeight (not webViewHeight)

Applied to both BookmarkDetailLegacyView and BookmarkDetailView2.
2025-10-10 20:27:17 +02:00
4595a9b69f fix: Add explicit width constraint to headerView in BookmarkDetailView2
Changed headerView from var to func with width parameter, matching LegacyView.
Added .frame(width: width, height: headerHeight) to constrain header image width.

This was the root cause of content overflow - without explicit width on the
header image, the entire ZStack and its children (including title and webview)
could grow beyond viewport width. Now matches LegacyView implementation exactly.
2025-10-10 20:23:38 +02:00
4c744e6d10 fix: Add comprehensive width constraints to NativeWebView CSS
Added multiple CSS rules to prevent content overflow:

Universal rules:
- * { max-width: 100%; box-sizing: border-box; }

HTML/Body:
- overflow-x: hidden on both html and body
- width: 100% to enforce viewport width
- word-wrap and overflow-wrap: break-word on body

Pre blocks:
- max-width: 100%
- white-space: pre-wrap (allows wrapping)
- word-wrap: break-word

Viewport meta:
- Added maximum-scale=1.0, user-scalable=no to prevent zooming issues

The native iOS 26+ WebView handles width differently than WKWebView,
requiring explicit overflow and width constraints in CSS.
2025-10-10 20:18:38 +02:00
615abf1d74 fix: Set explicit width constraint on VStack in BookmarkDetailView2
Added width: geometry.size.width to the spacer Color.clear.frame()
to constrain the VStack width, matching the LegacyView implementation.
This prevents NativeWebView content from overflowing the screen width.

The explicit width on the spacer propagates to the parent VStack,
which then constrains all child views including NativeWebView.
2025-10-10 20:08:32 +02:00
969f80c0a5 fix: Remove maxWidth infinity from NativeWebView in BookmarkDetailView2
Removed .frame(maxWidth: .infinity) from NativeWebView which was causing
the content to be wider than the viewport. The NativeWebView now respects
the parent container's width constraints set by .padding(.horizontal, 4).
2025-10-10 20:01:03 +02:00
842c404f04 fix: Add return statement to JavaScript height detection in NativeWebView
Added 'return' keyword before document.body.scrollHeight to ensure
the JavaScript expression returns a value that can be captured by
webPage.callJavaScript().
2025-10-10 19:56:35 +02:00