[Fix] PWA polish: remove type lies, dead config, and edge-swipe dead zone#187
Merged
[Fix] PWA polish: remove type lies, dead config, and edge-swipe dead zone#187
Conversation
- Replace selector! non-null assertions with conditional overload dispatch - Remove unused @/* path alias from tsconfig - Add sw.js no-cache header for spec-compliant SW update - Wrap IndexedDB upgrade in oldVersion guard for migration path - Replace _gwResult! with runtime invariant check - Reduce edge-swipe detector width from 20px to 12px
Contributor
|
Hi @samzong, DetailsInstructions for interacting with me using comments are available here. |
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.
Summary
Bundle six independent P3 polish items for the PWA package: eliminate non-null assertion type lies, remove dead tsconfig configuration, add missing service worker cache header, establish IndexedDB migration path, and reduce edge-swipe dead zone width.
Type of change
[Fix]bug fixWhy is this needed?
Each item individually is small but collectively they address: (1) two
!non-null assertions that lie to the type checker and mask potential runtime errors, (2) a dead@/*path alias that misleads contributors, (3) a missingsw.jscache header that relies on implicit browser behavior instead of explicit spec-compliant policy, (4) an IndexedDB upgrade callback with no version guard that will break on the first schema change, and (5) a 20px edge-swipe detector that creates an unnecessarily large tap dead zone.What changed?
stores/hooks.ts: Replaceselector!with conditional overload dispatch (selector ? useStore(api, selector) : useStore(api)) in all three store hookstsconfig.json: Remove unusedbaseUrlandpathsentriespublic/_headers: Add/sw.jswithCache-Control: public, max-age=0, must-revalidatepersistence/db.ts: AddoldVersionparameter to upgrade callback and wrap store creation inif (oldVersion < 1)platform/index.ts: Replace_gwResult!with local variable extraction and runtime invariant checkviews/DrawerLayout.tsx: Reduce edge-swipe detector width from 20px to 12pxArchitecture impact
docs/architecture-invariants.md: noneLinked issues
N/A
Validation
pnpm lintpnpm testpnpm buildpnpm check:ui-contractCommands, screenshots, or notes:
Screenshots or recordings
No UI changes beyond the edge-swipe detector width reduction (20px → 12px), which is invisible — it only affects the touch target area.
Release note
NONE.Checklist
[Feat],[Fix],[UI],[Docs],[Refactor],[Build], or[Chore]