136 Commits

Author SHA1 Message Date
37321f31c9 perf: Apply PreferenceKey optimization to BookmarkDetailView2 and fix spacing
- Implemented ScrollOffsetPreferenceKey for BookmarkDetailView2
- Replaced onScrollGeometryChange + onScrollPhaseChange with onPreferenceChange
- Removed currentScrollOffset and scrollViewHeight state variables
- Changed jumpButton from var to func with containerHeight parameter
- Fixed excessive spacing between header and content by using ZStack layout

Layout fix: Header image is now in ZStack background with content in foreground,
eliminating double spacing that occurred with separate VStacks.

Performance: Same PreferenceKey benefits as LegacyView - more efficient scroll tracking.
2025-10-10 17:24:17 +02:00
e9195351aa perf: Optimize scroll tracking with PreferenceKey instead of onScrollGeometryChange
- Implemented ScrollOffsetPreferenceKey for performance-optimized scroll tracking
- Added invisible GeometryReader at top of ScrollView to track offset
- Replaced onScrollGeometryChange + onScrollPhaseChange with onPreferenceChange
- Removed currentScrollOffset and scrollViewHeight state variables
- Continuous tracking with 3% threshold check in onPreferenceChange
- Updated JumpButton to receive containerHeight as parameter

PreferenceKey approach is more performant than onScrollGeometryChange:
- Single preference update instead of multiple geometry changes
- Direct access to scroll coordinate space
- Simpler state management with lastSentProgress threshold
2025-10-10 15:49:48 +02:00
a782a27eea revert: Remove JavaScript scroll tracking, back to SwiftUI-based solution
- Removed JavaScript scroll event listeners and console.log debugging
- Removed WebViewCoordinator.updateScrollProgress() method
- Removed onExternalScrollUpdate callback
- Removed webView reference and lastSentProgress from coordinator
- Restored scrollViewHeight state variable
- Restored JumpButton functionality with ScrollPosition
- Back to onScrollPhaseChange with 3% threshold for reading progress

The JavaScript approach didn't work because WebView scrolling is disabled
(embedded in SwiftUI ScrollView). The SwiftUI-based solution is cleaner
and performs well with onScrollPhaseChange.
2025-10-10 15:43:50 +02:00
5c9c00134a feat: Connect SwiftUI ScrollView tracking to WebView coordinator
- Added WebViewCoordinator reference storage in BookmarkDetailLegacyView
- Added updateScrollProgress() method to WebViewCoordinator with 3% threshold
- Connected onScrollPhaseChange to coordinator's updateScrollProgress
- Added onExternalScrollUpdate callback to pass coordinator reference
- Scroll progress now flows: SwiftUI ScrollView -> Coordinator -> onScroll callback

This bridges the gap between SwiftUI ScrollView (which wraps the WebView)
and the JavaScript-style scroll progress tracking with threshold.
2025-10-10 15:33:20 +02:00
0a53705df1 debug: Add comprehensive logging to JavaScript scroll tracking
- Added console.log statements in JavaScript for scroll events
- Added Swift print statements in message handler
- Added logging in BookmarkDetailLegacyView onScroll callback
- Logs cover: JS initialization, scroll events, message passing, Swift handling

This will help diagnose why scroll events aren't being captured.
2025-10-10 15:25:19 +02:00
32dbab400e feat: Implement JavaScript-based scroll tracking in BookmarkDetailLegacyView
- Added scroll progress tracking via JavaScript in WebView
- Implemented 3% threshold to reduce message frequency
- Removed SwiftUI onScrollGeometryChange and onScrollPhaseChange
- Cleaned up unused state variables (scrollViewHeight, currentScrollOffset)
- Removed Combine import (no longer needed)
- Disabled JumpButton scroll-to-position (requires JavaScript implementation)

This approach offloads scroll tracking to the WebView's JavaScript,
reducing SwiftUI state updates and improving performance.
2025-10-10 14:47:56 +02:00
171bf881fb feat: Add native SwiftUI WebView support with iOS 26+ BookmarkDetailView2
- Created BookmarkDetailView2 with native SwiftUI WebView (iOS 26+)
- Refactored BookmarkDetailView as version router
- Renamed original implementation to BookmarkDetailLegacyView
- Moved Archive/Favorite buttons to bottom toolbar using ToolbarItemGroup
- Added toggle button to switch between native and legacy views
- Implemented onScrollPhaseChange for optimized reading progress tracking
- Added NativeWebView component with improved JavaScript height detection
- All changes preserve existing functionality while adding modern alternatives
2025-10-10 00:27:59 +02:00
6addacb1d9 perf: Optimize ScrollView performance with onScrollGeometryChange
- Replace PreferenceKey-based scroll tracking with onScrollGeometryChange API
- Remove ScrollOffsetPreferenceKey struct (no longer needed)
- Add 50px threshold for scroll offset updates to reduce processing frequency
- Add 5% threshold for readingProgress state updates to minimize view refreshes
- Simplify header view by removing parallax effect and nested GeometryReader
- Keep single GeometryReader only for container dimensions (width/height)
- Fix WebView width constraints with explicit frame settings

This significantly improves scroll performance by reducing unnecessary
calculations and state updates during scrolling.
2025-10-09 19:22:49 +02:00
2834102d45 feat: Add iOS 26 search toolbar and tab bar minimize behaviors
- Add searchToolbarBehavior(.minimize) for iOS 26+ to improve search UX
- Add tabBarMinimizeBehavior(.onScrollDown) to auto-hide tab bar on scroll
- Remove redundant toolbar visibility modifiers from tab views
- Extract iOS 26+ compatibility helpers into reusable View extensions
- Bump version to 1.1 (build 26)
2025-10-07 22:08:29 +02:00
7b12bb4cf5 fix: Improve WebView performance by sanitizing problematic HTML attributes
- Remove jsaction, jscontroller, jsname attributes that trigger navigation events
- Strip unnecessary id attributes to reduce DOM size
- Remove tabindex from non-interactive elements
- Fix invalid nested p tags inside pre/span blocks
- Prevents WebKit crashes on complex HTML content
2025-10-07 20:41:43 +02:00
a2c805b700 missing file 2025-10-04 00:42:41 +02:00
ad7ac19d79 refactor: Clean up PhoneTabView and improve code organization
- Remove unused state: selectedMoreTab, searchPath
- Remove obsolete navigation callbacks (.onAppear, .onDisappear)
- Hide disclosure indicators in search results using ZStack pattern
- Add computed properties for cardLayoutStyle and badge count
- Mark .search case as EmptyView (now directly implemented)
- Hide tab bar in more menu detail views
2025-10-04 00:36:39 +02:00
080c5aa4d2 feat: Modernize PhoneTabView with iOS 18/26 adaptive search
Implement version-specific search UI:
- iOS 26+: Dedicated search Tab with .searchable() and role .search
- iOS 18-25: Classic search bar integrated in More tab
- Each main tab now has independent NavigationStack with separate path
- Conditional view switches between menu and search results
- Remove .search from moreTabs array (now integrated)
- Direct binding to SearchBookmarksViewModel.searchQuery
2025-10-04 00:13:19 +02:00
f3d52b3c3a feat: Implement correct iOS 18 Tab API syntax
- Use Tab(title, systemImage:) without value parameter as per iOS 18 standards
- Remove manual selection handling as TabView handles it automatically
- Simplify ForEach to iterate directly over tabs instead of enumeration
- Remove .tag() and .tabItem modifiers which are no longer needed
- Clean up selection state management for modern Tab API
2025-10-01 21:58:19 +02:00
a651398dca fix: Revert to working tabItem syntax due to compiler error
- Revert Tab() syntax that caused compiler diagnostic error
- Use proven .tabItem approach that works reliably
- Keep modern Label() components for better accessibility
- Maintain all functionality while ensuring compilation success
2025-10-01 21:56:50 +02:00
58b89d4c86 refactor: Remove legacy tabItem code and use only modern Tab API
- Remove iOS version checks and legacy .tabItem implementations
- Use modern Tab() syntax throughout as app targets iOS 18+ minimum
- Simplify code by removing duplicate implementations
- Remove @available annotations as they're no longer needed
- Clean up code structure while maintaining all functionality
2025-10-01 21:56:11 +02:00
62f2f07f38 feat: Modernize PhoneTabView with iOS 18+ Tab API
- Add support for new SwiftUI Tab API (iOS 18+) alongside legacy tabItem
- Implement mainTabsContentNew and moreTabContentNew with modern Tab() syntax
- Maintain backward compatibility with iOS versions < 18
- Use @available annotations for version-specific implementations
- Replace deprecated .tabItem with cleaner Tab(..., value:) approach
- Keep all existing functionality including badges and navigation
2025-10-01 21:55:15 +02:00
f42d138f58 refactor: Clean up WebView code and remove debug prints
- Remove all debug print statements for cleaner output
- Group related properties in WebViewCoordinator for better organization
- Remove redundant comments throughout the code
- Simplify JavaScript code by removing unnecessary comments
- Maintain all functionality while improving code readability
2025-09-30 23:21:46 +02:00
f50ad505ae fix: Add memory leak prevention and proper WebView cleanup
- Add dismantleUIView method to properly cleanup WebView resources
- Remove script message handlers to prevent memory leaks
- Add cleanup() method to WebViewCoordinator with timer invalidation
- Clear all callbacks and references when view is destroyed
- Add isCleanedUp guard to prevent double cleanup
- Improve memory management for better stability
2025-09-30 23:20:00 +02:00
c8c93b76da update README with new iPhone and iPad screenshots 2025-09-27 22:44:12 +02:00
f3147a6cc6 Merge branch 'develop' of https://codeberg.org/readeck/readeck-ios into develop 2025-09-26 21:58:54 +02:00
ac7f4e66eb fix: Improve Core Data thread safety and resolve scrolling flicker
- Add background context support to CoreDataManager
- Fix TagEntity threading crashes in LabelsRepository
- Prevent WebView height updates during scrolling to reduce flicker
- Add App Store download link to README
2025-09-26 21:56:49 +02:00
Christian Putzke
b929611430 Code review fixes 2025-09-26 20:45:38 +02:00
Christian Putzke
d369791f27 Merge branch 'develop' into feature/url_opener 2025-09-22 06:03:18 +02:00
52bf16a8eb fix: Update Privacy Policy date from placeholder to current date 2025-09-20 22:18:15 +02:00
051b5b169d fix: Update contact details in legal views 2025-09-20 22:15:32 +02:00
d6ea56cfa9 feat: Add comprehensive i18n support and Legal & Privacy section
- Create String+Localization extension with .localized property
- Add LabelUtils for consistent label splitting and deduplication logic
- Implement Legal & Privacy settings section with Privacy Policy and Legal Notice views
- Add German/English localization for all navigation states and settings sections
- Fix navigationDestination placement warning in PadSidebarView
- Unify label input handling across main app and share extension
- Support for space-separated label input in share extension

Navigation & Settings now fully localized:
- All/Unread/Favorites/Archive → Alle/Ungelesen/Favoriten/Archiv
- Font/Appearance/Cache/General/Server Settings → German equivalents
- Legal section with GitHub issue reporting and email support contact
2025-09-20 22:14:17 +02:00
Christian Putzke
f78de1f740 Added setting to select in app or default browser to open external links 2025-09-18 22:35:43 +02:00
dcbe0515fc fix: Share extension title extraction and theme persistence
- Enable text support in share extension to extract page titles
- Extract titles from attributedTitle and attributedContentText
- Prevent titles from being used as URLs with proper validation
- Fix theme settings persistence using SettingsRepository instead of UserDefaults
- Theme changes now properly notify the app for immediate updates
2025-09-17 22:27:52 +02:00
ba74430d10 feat: Improve label input functionality
- Split label input on space to create multiple labels at once
- Disable autocapitalization in tag search field
- Prevent duplicate labels when adding multiple at once
2025-09-17 13:36:36 +02:00
c13fc107b1 fix: Card width consistency and layout loading in search
- Fixed natural layout width using screen bounds instead of infinity
- Added card layout settings loading in SearchBookmarksView
- Consistent card width across all views prevents overflow
2025-09-05 21:58:24 +02:00
5947312339 fix: Core Data threading and network error handling
- Add thread-safe NSManagedObjectContext extension
- Fix EXC_BAD_ACCESS with performAndWait wrappers
- Add network error detection with retry functionality
- Change hero image to aspectFill for better layout
- Mark classes as @unchecked Sendable for Swift Concurrency
2025-09-04 21:15:54 +02:00
5b520995ac typo 2025-09-04 12:14:44 +02:00
8fb2a2a14e fix: Add circular progress for delete countdown 2025-09-04 12:14:20 +02:00
df8a7b64b2 feat: Add Kingfisher caching, card layouts, dynamic tag layout, and undo delete
- Integrate Kingfisher for image caching with CachedAsyncImage component
- Add CacheSettingsView for managing image cache size and clearing cache
- Implement three card layout styles: compact, magazine (default), natural
- Add AppearanceSettingsView with visual layout previews and theme settings
- Create Clean Architecture for card layout with domain models and use cases
- Implement FlowLayout for dynamic label width calculation
- Add skeleton loading animation for initial bookmark loads
- Replace delete confirmation dialogs with immediate delete + 3-second undo
- Support multiple simultaneous undo operations with individual progress bars
- Add grayed-out visual feedback for pending deletions
- Centralize notification names in dedicated NotificationNames file
- Remove pagination logic from label management (replaced with FlowLayout)
- Update AsyncImage usage across BookmarkCardView, BookmarkDetailView, ImageViewerView
- Improve UI consistency and spacing throughout the app
2025-09-04 10:43:27 +02:00
953ff5da8d feat: Implement persistent logout on 401 errors and hide TabBar in detail views
- Add AppViewModel to manage app-level state and handle 401 responses
- Implement automatic logout when API returns 401 Unauthorized
- Add persistent logout state using existing hasFinishedSetup flag
- Move NavigationStack outside TabView to enable automatic TabBar hiding
- Update API classes to send UnauthorizedAPIResponse notifications
- TabBar now hides automatically when navigating to detail views
2025-08-27 22:04:37 +02:00
fd50f28628 feat: Enable text selection and improve bookmark error handling
- Enable text selection and copy functionality in article WebView
- Add CSS properties for proper text selection on iOS devices
- Preserve bookmark data during reload errors for better UX
- Update documentation with new offline sync features
- Restructure changelog with planned version roadmap

Users can now select and copy text from articles, and bookmark lists
remain visible even when refresh operations fail.
2025-08-20 21:00:50 +02:00
76bc28ae02 feat: Improve UI components and performance optimizations
- Refactor BookmarksView with better error handling and loading states
- Optimize BookmarkLabelsViewModel with cached properties and reduced recomputation
- Fix Core Data thread safety in LabelsRepository with performAndWait
- Enhance TagManagementView with sorted selected labels display
- Clean up ShareBookmarkViewModel comments
- Update localization strings for error states
- Bump build version to 19

These changes improve overall app performance and user experience across
bookmark management workflows.
2025-08-20 20:38:42 +02:00
692f34d2ce fix: Prevent redundant timer creation in offline sync state machine
- Guard against multiple concurrent completion timers in sync state handling
- Only trigger completion timer when transitioning from actual syncing state
- Remove debug logging that impacted performance during scroll operations

This resolves scroll performance issues introduced by excessive timer creation
in the offline bookmark synchronization workflow.
2025-08-20 20:35:53 +02:00
ffb41347af refactor: Implement state machine architecture for offline sync
- Replace multiple boolean properties with single OfflineBookmarkSyncState enum
- Add Use Case pattern for OfflineSyncManager with dependency injection
- Simplify LocalBookmarksSyncView using state-driven UI with external bindings
- Convert OfflineBookmarksViewModel to use @Observable instead of ObservableObject
- Move credentials from Core Data to Keychain for better persistence
- Implement comprehensive database migration for App Group containers
- Add structured logging throughout sync operations and API calls

Architecture improvements follow MVVM principles with clean separation of concerns.
2025-08-18 22:58:42 +02:00
ef13faeff7 feat: Add offline bookmark sync functionality
Add comprehensive offline bookmark support with sync capabilities:
- Implement offline bookmark storage using Core Data with App Group sharing
- Add Share Extension support for saving bookmarks when server unavailable
- Create LocalBookmarksSyncView for managing offline bookmark queue
- Add OfflineSyncManager for automatic and manual sync operations
- Implement ServerConnectivity monitoring and status handling
- Add badge notifications on More tab for pending offline bookmarks
- Fix tag pagination in Share Extension with unique IDs for proper rendering
- Update PhoneTabView with event-based badge count updates
- Add App Group entitlements for data sharing between main app and extension

The offline system provides seamless bookmark saving when disconnected,
with automatic sync when connection is restored and manual sync options.
2025-08-16 22:32:20 +02:00
b71fc0a4e0 feat: Enhance search UX and improve localization
- Replace German strings with English translations in Localizable.xcstrings
- Add smooth zoom transitions between bookmark list and detail views using matchedGeometryEffect
- Improve search interface with better styling, focus management, and loading states
- Enhance bookmark card interactions and visual consistency
- Refactor search functionality for cleaner code structure
2025-08-11 21:12:16 +02:00
1ffafc3b35 fix: Improve tag chip alignment in TagManagementView
- Update grid container to align chips to top when fewer than 3 rows
- Adjust top padding to prevent label overlap with chips
2025-08-07 20:41:45 +02:00
bbcb7bd81f feat: Add tappable hero image with zoom functionality
- Add ImageViewerView for full-screen image viewing with zoom and pan
- Make hero image in BookmarkDetailView tappable with zoom icon
- Implement drag-to-dismiss functionality for image viewer
- Extract ImageViewerView to separate file for better code organization
- Add zoom icon (arrow symbol) to indicate tappable hero image
- Support pinch-to-zoom (1x-4x), double-tap zoom, and pan gestures
2025-08-06 22:19:00 +02:00
f3f94f1cfe refactor: Clean up tag management UI and update project version
- Remove duplicate search functionality from BookmarkLabelsView
- Update TagManagementView font sizes for better readability
- Bump URLShare extension version to 13
2025-08-06 21:49:12 +02:00
a09cad5d7e feat: Add intelligent scroll behavior to AddBookmarkView
- Add enum-based FocusState (AddBookmarkFieldFocus) for cleaner code
- Implement auto-scroll to URL field when focused
- Implement auto-scroll to labels field with 40px offset when focused
- Implement auto-scroll to title field when focused
- Add ScrollViewReader with smooth animations
- Update TagManagementView to support enum-based focus binding
- Add FocusModifier for optional focus state handling
- Improve keyboard handling with proper padding adjustments
2025-08-03 22:40:51 +02:00
61b30112ee feat: Add advanced tag functionality to AddBookmarkView
- Add tag search, pagination and selection with UnifiedLabelChip
- Implement Set-based tag management with validation
- Add keyboard toolbar with Done button
- Remove field labels for compact UI
- Fix duplicate toolbar buttons in ShareBookmarkView
- Update localization strings for tag functionality
2025-07-31 23:06:35 +02:00
5b2d177f94 feat: Enhanced tag management with unified search and keyboard handling
- Added search functionality to BookmarkLabelsView with real-time filtering
- Implemented custom tag creation with smart suggestions
- Unified search and tag selection in ShareBookmarkView
- Added keyboard toolbar with 'Done' button for extensions
- Implemented notification-based keyboard dismissal for extensions
- Added pagination logic to ShareBookmarkViewModel
- Created selected tags section with remove functionality
- Improved UX with consistent tag management across views
- Added proper keyboard handling for iOS extensions
2025-07-30 23:53:30 +02:00
d036c2e658 feat: Improve AddBookmarkView and loading animations
- Simplify AddBookmarkView header by removing large icon and title
- Add clipboard monitoring with button directly under URL field
- Improve clipboard detection logic with smart URL comparison
- Add dismiss functionality for clipboard suggestions
- Enhance loading animations in BookmarksView:
  - Better initial loading screen with centered animation
  - Use pull-to-refresh instead of overlay for reloading
  - Add 1-second delay after creating bookmark for server sync
- Remove custom Close button styling for default appearance
- Improve overall UX with more natural iOS patterns
2025-07-30 21:18:34 +02:00
03713230b0 feat: optimize label pagination and read progress handling
- Optimize calculatePages() to show single page when ≤12 labels
- Add loading animation for initial label loading only
- Unify label filtering logic in ViewModel instead of UI
- Fix read progress regression by always taking higher value
- Prevent server updates with lower progress values
- Improve UX with better loading states and pagination
2025-07-30 16:09:40 +02:00