Phase2#37
Merged
AccessiT3ch merged 17 commits intomainfrom Feb 2, 2026
Merged
Conversation
- Mark Phase 2.1 as completed (PR #32 merged) - Mark Phase 2.3 as completed (UpdatePrompt done in 2.1) - Update Phase 2.2 with scope clarifications: - Cache external resources (PDFs, assets) - Save button triggers offline caching - Add offline indicator to Header
- Create network utility for online/offline detection - Create storage utility with localStorage wrapper - Create cache utility for managing external resource caching - Add offline indicator (🟢/🔴) to Header - Enhance Save button to trigger offline caching when app installed - Add runtime caching for external PDFs in vite.config.js - Update Header tests for new caching behavior - All tests passing (187 tests)
- All core tasks completed - Offline caching utilities implemented - Network indicator added to Header - Save button enhanced with caching functionality - Deferred utility tests to Phase 5 - Manual offline testing needed
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: AccessiT3ch <95449364+AccessiT3ch@users.noreply.github.com>
fix(cache): use removeItem() and correct fetch modes
- Add 11 tests for network.js (100% coverage) - Add 18 tests for storage.js (100% coverage) - Add 18 tests for cache.js (100% coverage) - Test online/offline detection and network changes - Test localStorage error handling and edge cases - Test cache operations with mocked Cache API - All 234 tests passing (47 new tests added) - Overall coverage: 97.65% statements, 96.12% branches
- Mark utility tests as completed (47 new tests) - All utility modules now have 100% coverage - Overall coverage: 97.65% statements, 96.12% branches - 234 tests passing
Phase 2.2: Implement Offline Resource Caching
Set display: 'none' on the absolutely-positioned div in Header.jsx (top-right, 1.5rem) to remove the element from the UI without deleting the markup. This temporarily hides the control/indicator while preserving its code for potential future use.
Phase 2.3 bug fixes: Bug 1: Share API Detection - Remove mobile/desktop distinction for Share API - Prioritize navigator.share when available (any platform) - Fall back to clipboard API when share not available - Fixes Android apps incorrectly reporting no Share API Bug 2: Resource Modal Links - Add as="a" prop to Button components to ensure proper anchor rendering - All resource links now correctly open in new tabs - Fixes California Rapid Response Networks links opening in same tab Also: - Update all shareHandler tests to reflect new prioritization logic - Renumber Update Strategy section from 2.3 to 2.4 in workplan - Update workplan with Phase 2.3 bug fix details Tests: All 234 tests passing
Import cache utilities and expand Header tests to cover caching and install flows. Added tests to verify: already-cached message when resources are complete; loading spinner while caching; partial success alert when some resources fail; error alert when caching throws; and handling a beforeinstallprompt event without a userChoice property. Mocks for cacheUtils (isCached, cacheResources), navigator.onLine, and matchMedia are used to exercise different states.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Phase 2.3: Bug Fixes - Share API and Resource Links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the offline caching and sharing features in the app, particularly within the
Headercomponent. The changes enhance the user experience by providing better feedback during offline caching, more robust network state handling, and improved fallbacks and testing for the share functionality.Offline caching and install experience:
Headercomponent, including network state detection, caching progress indication (spinner), and user alerts for success, partial failure, or errors during resource caching. The "Save" button now triggers caching if the app is installed, and provides appropriate feedback based on cache and network state. (src/Components/Header/Header.jsx, [1] [2] [3]src/Components/Header/header.test.jsx, [1] [2] [3]Share functionality and testing:
src/utils.error-handling.test.js, [1] [2] [3] [4] [5] [6] [7] [8] [9]Minor UI/UX improvements:
as="a"prop for consistent styling and accessibility. (src/Components/Resources/ResourceModal.jsx, src/Components/Resources/ResourceModal.jsxR39)