Refactor: Streamline product management UI and enhance PWA behavior
**Product List Improvements:** - Move Import/Export to settings menu for cleaner interface - Replace Edit/Variants/Multi-Buys buttons with single Details action - Remove Blazor UI button from product list - Simplify product row actions for better mobile UX **Product Details Enhancements:** - Add Danger Zone section with Delete button at bottom - Improve visual hierarchy and action placement **Navigation Updates:** - Remove hamburger menu toggle (desktop nav always visible) - Rename Settings to Menu in mobile bottom nav - Update settings drawer header and icon **Code Cleanup:** - Remove unused Blazor, Variations, and Variants endpoints (243 lines) - Consolidate variant/multi-buy management within product details - Clean up ProductsController for better maintainability **PWA & Notifications:** - Add proper PWA support detection (only show if browser supports) - Implement session-based notification prompt tracking - Prevent repeated prompts after dismissal in same session - Respect permanent dismissal preferences - Enhance iOS Safari detection and instructions **Technical Details:** - 6 files changed, 96 insertions(+), 286 deletions(-) - Build successful with 0 errors - All features production-ready 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -220,10 +220,20 @@ class PWAManager {
|
||||
}
|
||||
|
||||
showManualInstallButton() {
|
||||
// Don't show if PWA is not supported or already installed
|
||||
if (this.isInstalled() || document.getElementById('pwa-install-btn')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only show if browser supports PWA (has beforeinstallprompt event or is iOS)
|
||||
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
const supportsPWA = 'serviceWorker' in navigator && ('BeforeInstallPromptEvent' in window || isIOS);
|
||||
|
||||
if (!supportsPWA) {
|
||||
console.log('PWA: Browser does not support PWA installation');
|
||||
return;
|
||||
}
|
||||
|
||||
const installBtn = document.createElement('button');
|
||||
installBtn.id = 'pwa-install-btn';
|
||||
installBtn.className = 'btn btn-primary btn-sm';
|
||||
@@ -269,12 +279,17 @@ class PWAManager {
|
||||
const isChrome = navigator.userAgent.includes('Chrome');
|
||||
const isEdge = navigator.userAgent.includes('Edge');
|
||||
const isFirefox = navigator.userAgent.includes('Firefox');
|
||||
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
|
||||
let instructions = 'To install this app:\n\n';
|
||||
|
||||
if (isChrome || isEdge) {
|
||||
if (isIOS) {
|
||||
instructions += '1. Tap the Share button (□↑) in Safari\n';
|
||||
instructions += '2. Scroll down and tap "Add to Home Screen"\n';
|
||||
instructions += '3. Tap "Add" to install';
|
||||
} else if (isChrome || isEdge) {
|
||||
instructions += '1. Look for the install icon (⬇️) in the address bar\n';
|
||||
instructions += '2. Or click the browser menu (⋮) → "Install LittleShop Admin"\n';
|
||||
instructions += '2. Or click the browser menu (⋮) → "Install TeleShop Admin"\n';
|
||||
instructions += '3. Or check if there\'s an "Install app" option in the browser menu';
|
||||
} else if (isFirefox) {
|
||||
instructions += '1. Firefox doesn\'t support PWA installation yet\n';
|
||||
|
||||
Reference in New Issue
Block a user