Major PWA and mobile UI improvements

- Fixed PWA installation on Android by correcting manifest.json icon configuration
- Made UI mobile-friendly with compact layout and sticky record button
- Implemented auto-translation after transcription stops
- Updated branding from 'Voice Translator' to 'Talk2Me' throughout
- Added reverse proxy support with ProxyFix middleware
- Created diagnostic tools for PWA troubleshooting
- Added proper HTTP headers for service worker and manifest
- Improved mobile CSS with responsive design
- Fixed JavaScript bundling with webpack configuration
- Updated service worker cache versioning
- Added comprehensive PWA documentation

These changes ensure the app works properly as a PWA on Android devices
and provides a better mobile user experience.
This commit is contained in:
2025-06-03 12:28:09 -06:00
parent b5f2b53262
commit d818ec7d73
16 changed files with 2813 additions and 50 deletions

View File

@@ -2,21 +2,107 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Talk2Me</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="icon" href="/favicon.ico" sizes="any">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
<title>Talk2Me - Real-time Voice Translation</title>
<!-- Icons for various platforms -->
<link rel="icon" href="/static/icons/favicon.ico" sizes="any">
<link rel="apple-touch-icon" href="/static/icons/apple-icon-180x180.png">
<link rel="apple-touch-icon" sizes="120x120" href="/static/icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="152x152" href="/static/icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/static/icons/apple-icon-180x180.png">
<link rel="apple-touch-icon" sizes="167x167" href="/static/icons/apple-icon-167x167.png">
<link rel="apple-touch-icon" sizes="180x180" href="/static/icons/apple-icon-180x180.png">
<style>
body {
padding-top: 20px;
padding-bottom: 20px;
padding-top: 10px;
padding-bottom: 10px;
background-color: #f8f9fa;
}
/* Mobile-first approach */
@media (max-width: 768px) {
.container {
padding-left: 10px;
padding-right: 10px;
}
h1 {
font-size: 1.5rem;
margin-bottom: 0.5rem !important;
}
.card {
margin-bottom: 10px !important;
}
.card-body {
padding: 0.75rem !important;
}
.card-header {
padding: 0.5rem 0.75rem !important;
}
.card-header h5 {
font-size: 1rem;
margin-bottom: 0;
}
.text-display {
min-height: 60px !important;
max-height: 100px;
overflow-y: auto;
padding: 10px !important;
margin-bottom: 10px !important;
font-size: 0.9rem;
}
.language-select {
padding: 5px 10px !important;
font-size: 0.9rem;
margin-bottom: 10px !important;
}
.btn-action {
padding: 5px 10px !important;
font-size: 0.875rem;
margin: 2px !important;
}
.record-btn {
width: 60px !important;
height: 60px !important;
font-size: 24px !important;
margin: 10px auto !important;
}
.status-indicator {
font-size: 0.8rem !important;
margin-top: 5px !important;
}
/* Hide speaker toolbar on mobile by default */
#speakerToolbar {
position: fixed;
bottom: 70px;
left: 0;
right: 0;
z-index: 100;
border-radius: 0 !important;
}
#conversationView {
position: fixed;
bottom: 0;
left: 0;
right: 0;
top: 50%;
z-index: 99;
border-radius: 15px 15px 0 0 !important;
margin: 0 !important;
}
}
.record-btn {
width: 80px;
height: 80px;
@@ -91,19 +177,39 @@
font-style: italic;
color: #6c757d;
}
/* Ensure record button area is always visible on mobile */
@media (max-width: 768px) {
.record-section {
position: sticky;
bottom: 0;
background: white;
padding: 10px 0;
box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
z-index: 50;
margin-left: -10px;
margin-right: -10px;
padding-left: 10px;
padding-right: 10px;
}
}
</style>
<!-- PWA Meta Tags -->
<meta name="description" content="Translate spoken language between multiple languages with speech input and output">
<meta name="description" content="Real-time voice translation app - translate spoken language instantly">
<meta name="theme-color" content="#007bff">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Translator">
<meta name="apple-mobile-web-app-title" content="Talk2Me">
<meta name="application-name" content="Talk2Me">
<meta name="msapplication-TileColor" content="#007bff">
<meta name="msapplication-TileImage" content="/static/icons/icon-192x192.png">
<!-- PWA Icons and Manifest -->
<link rel="manifest" href="/static/manifest.json">
<link rel="icon" type="image/png" href="/static/icons/icon-192x192.png">
<link rel="apple-touch-icon" href="/static/icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/static/icons/icon-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/static/icons/icon-512x512.png">
<!-- Apple Splash Screens -->
<link rel="apple-touch-startup-image" href="/static/splash/apple-splash-2048-2732.png" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
@@ -199,7 +305,7 @@
</div>
</div>
<div class="text-center">
<div class="text-center record-section">
<button id="recordBtn" class="btn btn-primary record-btn">
<i class="fas fa-microphone"></i>
</button>
@@ -211,12 +317,13 @@
<i class="fas fa-sync"></i> Active: <span id="activeRequests">0</span>
</small>
</div>
</div>
<div class="text-center mt-3">
<button id="translateBtn" class="btn btn-success" disabled>
<i class="fas fa-language"></i> Translate
</button>
<div class="mt-2">
<button id="translateBtn" class="btn btn-outline-secondary btn-sm" disabled title="Translation happens automatically after transcription">
<i class="fas fa-redo"></i> Re-translate
</button>
<small class="text-muted d-block mt-1">Translation happens automatically after transcription</small>
</div>
</div>
<div class="mt-3">
@@ -399,6 +506,6 @@
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script src="/static/js/dist/app.js"></script>
<script src="/static/js/dist/app.bundle.js"></script>
</body>
</html>