Add v1.30.0, v1.30.1, and v1.30.2 entries to changelog-page.md covering: - Right sidebar feature implementation - TypeScript error fixes - Right sidebar default behavior fix
5.6 KiB
name, overview, todos
| name | overview | todos | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Mobile PWA Optimization | Add full mobile iOS/Android optimization and PWA support with automatic manifest.json generation from fork-config.json, iOS/Android meta tags, safe area CSS, and touch optimizations. |
|
Mobile and PWA Optimization Plan
Overview
Add full mobile iOS/Android optimization and Progressive Web App (PWA) support. The manifest.json will be automatically generated from fork-config.json during the configure step, so users don't need to manually set it up.
Implementation Steps
1. Update ForkConfig Interface
Add optional PWA configuration to scripts/configure-fork.ts:
interface ForkConfig {
// ... existing fields ...
pwa?: {
shortName?: string; // Short name for home screen (max 12 chars)
themeColor?: string; // Theme color (default: "#faf8f5")
backgroundColor?: string; // Background color (default: "#faf8f5")
};
}
2. Add manifest.json Generation Function
Create updateManifestJson() function in scripts/configure-fork.ts:
- Generate
public/manifest.jsonwith values fromfork-config.json - Use
siteNamefor full name,pwa.shortNameor truncatedsiteNamefor short name - Use
siteDescriptionfor description - Use
pwa.themeColorandpwa.backgroundColorwith defaults - Include icon references (favicon.svg, icon-192.png, icon-512.png)
- Set
display: "standalone"for home screen app behavior - Set
orientation: "portrait-primary"
3. Update index.html Generation
Enhance updateIndexHtml() function in scripts/configure-fork.ts:
- Update viewport meta tag to include
viewport-fit=coverfor iOS notches - Add manifest link:
<link rel="manifest" href="/manifest.json" /> - Add iOS meta tags:
apple-mobile-web-app-capableapple-mobile-web-app-status-bar-styleapple-mobile-web-app-titleapple-touch-iconlink- Add Android meta tags:
mobile-web-app-capable- Enhanced
theme-colorwith media queries for light/dark - Update existing
theme-colormeta tag to support both light and dark modes
4. Add Mobile CSS Optimizations
Update src/styles/global.css:Safe Area Insets (iOS notches):
- Add
@supports (padding: max(0px))blocks for safe area insets - Apply to
.main-content,.top-nav,.mobile-menu-drawer - Use
env(safe-area-inset-*)CSS variables
Touch Optimizations:
- Add
-webkit-tap-highlight-color: transparentglobally - Add
touch-action: manipulationto interactive elements - Add
user-select: noneto buttons - Add
-webkit-touch-callout: noneto buttons
Prevent Input Zoom (iOS):
- Ensure all
input,textarea,selecthavefont-size: 16pxminimum - Add mobile-specific rule to prevent zoom on focus
5. Update fork-config.json.example
Add optional PWA section:
{
// ... existing fields ...
"pwa": {
"shortName": "Your Site",
"themeColor": "#faf8f5",
"backgroundColor": "#faf8f5"
}
}
6. Update netlify.toml
Add headers for manifest.json:
[[headers]]
for = "/manifest.json"
[headers.values]
Content-Type = "application/manifest+json"
Cache-Control = "public, max-age=3600"
7. Update configure-fork.ts Main Function
Add updateManifestJson(config) call in main() function after updateAiPluginJson(config).
8. Update Documentation
Update content/blog/fork-configuration-guide.md:
- Add PWA section explaining optional
pwafields - Note that manifest.json is auto-generated
- Mention icon file requirements (icon-180.png, icon-192.png, icon-512.png)
Files to Modify
scripts/configure-fork.ts- Add manifest generation, update index.html generation, add PWA interfacefork-config.json.example- Add optional PWA fieldssrc/styles/global.css- Add safe area insets and touch optimizationsnetlify.toml- Add manifest.json headerscontent/blog/fork-configuration-guide.md- Document PWA configuration
User Requirements
After running npm run configure, users need to:
- Add icon files to
public/images/:
icon-180.png(180x180) - iOS home screenicon-192.png(192x192) - Androidicon-512.png(512x512) - Android splash
The manifest.json will be automatically generated with correct values from their fork-config.json.
Benefits
- Zero manual setup for manifest.json (auto-generated)
- Full iOS/Android home screen support
- Safe area support for notched devices