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
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
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.
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.
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.
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).
Added 'return' keyword before document.body.scrollHeight to ensure
the JavaScript expression returns a value that can be captured by
webPage.callJavaScript().
CSS Changes:
- Removed all overflow/max-width/word-break rules from body/html
- Simplified to match WebView.swift CSS structure exactly
- Only img keeps max-width: 100%
- Removed box-sizing and universal max-width rules
JavaScript Height Detection:
- Simplified from Math.max() with multiple properties to simple document.body.scrollHeight
- This matches how the standard WebView gets height
- Should resolve 'No valid JavaScript height found' errors
The width overflow was caused by aggressive CSS rules that interfered
with native layout. The height detection issue was likely due to complex
JavaScript expressions not working with webPage.callJavaScript().
- Added universal max-width: 100% to all elements
- Added overflow-wrap, word-wrap, and word-break to body
- Added overflow-x: hidden to html
- Fixed pre blocks with white-space: pre-wrap and max-width
- Fixed tables with display: block and overflow-x: auto
- Added word-wrap to table cells
This prevents wide content (long URLs, code blocks, tables) from
overflowing the viewport width in iOS 26+ NativeWebView.
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
- 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
- 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.
- 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)
- 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
- 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
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
- 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
- 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
- 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
- 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
- Cache token and endpoint in memory to avoid repeated keychain access
- First call reads from keychain, subsequent calls use cached values
- Significantly improves performance for frequent API calls
- Simple implementation without unnecessary locking or complexity
fix: Properly URL-encode labels parameter for API requests
- Add quotes around label values to match API requirements
- Fix label filtering for labels with spaces (e.g. 'aa aa')
- Ensure proper URL encoding as required by server
- Maintains existing pagination and filtering functionality
- Add quotes around label values to match API requirements
- Fix label filtering for labels with spaces (e.g. 'aa aa')
- Ensure proper URL encoding as required by server
- Maintains existing pagination and filtering functionality
- 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
- 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
- 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
- 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