WATranslate v4.2 — Mobile App Mode / PWA

BUILDS ON
WATranslate v4.1 adaptive mobile UI.

WHAT v4.2 ADDS

1. INSTALLABLE HOME SCREEN APP
- Web App Manifest
- iPhone Apple Touch icon
- Standalone display mode
- Theme/status-bar metadata
- Lightweight service worker for static UI assets

When added to the iPhone Home Screen and launched from its icon,
WATranslate opens without Safari's normal address/navigation bars.

2. MORE WHATSAPP-LIKE MOBILE HEADER
Mobile only:
- Small WATranslate label
- Large "Chats" title
- Three-dot application menu
- Log out moved into that menu
- "Add to Home Screen" help inside the menu

Desktop remains unchanged.

3. SEARCH CHATS
A mobile search field filters:
- contact display name
- WhatsApp ID
- latest message preview

This is client-side UI filtering and does not change the database.

4. ALL EXISTING FEATURES REMAIN
- Google Cloud Translation
- incoming translation
- Russian reply translation
- reply to a specific previous language/message
- translation review before sending
- WhatsApp/Meta sending
- archive
- restore
- delete
- avatars
- desktop UI

FILES TO OVERWRITE
public/index.php
assets/app.js
public/assets/app.js

FILES TO ADD
assets/mobile-v4.2.css
public/assets/mobile-v4.2.css
manifest.webmanifest
service-worker.js
icons/icon-192.png
icons/icon-512.png
icons/apple-touch-icon.png

NO BACKEND CHANGES
Do NOT change:
- root api.php wrapper
- public/api.php
- public/webhook.php
- config.php
- database
- src/
- Google credentials
- Meta credentials

INSTALL

1. Back up the current WATranslate folder.

2. Upload:
   watranslate-mobile-app-mode-v4.2.zip

   to:
   public_html/whatsapp-server-translator/

3. Extract and overwrite.

4. Reload the page on the iPhone.

5. For the cleanest iPhone experience, install it from SAFARI:

   Open:
   https://alldevlabs.com/whatsapp-server-translator/

   Tap Share
   → Add to Home Screen
   → Add

6. Launch WATranslate from the new Home Screen icon.

IMPORTANT FOR THE WHATSAPP IN-APP BROWSER
If you opened the link from inside WhatsApp and do not see "Add to Home Screen",
open the page in Safari first, then use Safari's Share menu.

SERVICE WORKER
The service worker caches only versioned static UI files/icons.
It intentionally does NOT cache:
- API responses
- PHP navigation
- login/logout responses
- WhatsApp messages

This avoids making live conversation/API data stale.

NO SQL MIGRATION REQUIRED.

TEST ON YOUR DIFFERENT IPHONES

A. Normal Safari
- Chats list works
- Search works
- Three-dot app menu works
- Conversation/back navigation works

B. Home Screen version
- Opens without normal Safari browser bars
- Safe areas/notches look correct
- Search/chat/archive/delete/translate/send all work

C. Desktop
- Existing v4 desktop layout remains unchanged.
