diff --git a/build-and-publish-app-release.sh b/build-and-publish-app-release.sh index 3e19ea2..e82cb29 100644 --- a/build-and-publish-app-release.sh +++ b/build-and-publish-app-release.sh @@ -1,9 +1,13 @@ #!/bin/bash -# Check if the correct number of arguments are provided -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - echo "Example: $0 https://grim-reyna-tapframe-69970143.koyeb.app" +# Usage: build-and-publish-app-release.sh [--yes] [--release-notes "text here"] +# --yes Skip interactive confirmation +# --release-notes Provide release notes to attach to this upload + +# Parse arguments +if [ "$#" -lt 1 ]; then + echo "Usage: $0 [--yes] [--release-notes \"text here\"]" + echo "Example: $0 https://grim-reyna-tapframe-69970143.koyeb.app --yes --release-notes \"Bug fixes and improvements\"" exit 1 fi @@ -27,6 +31,29 @@ fi # Assign arguments to variables serverHost=$1 +shift + +SKIP_CONFIRM=false +RELEASE_NOTES="" + +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + --yes) + SKIP_CONFIRM=true + shift + ;; + --release-notes) + RELEASE_NOTES="$2" + shift + shift + ;; + *) + echo "Unknown option: $1" + shift + ;; + esac +done # Validate server URL format if [[ ! "$serverHost" =~ ^https?:// ]]; then @@ -47,13 +74,15 @@ echo "📱 Runtime Version: $runtimeVersion" echo "🔗 Commit Hash: $commitHash" echo "📝 Commit Message: $commitMessage" echo "🌐 Server URL: $serverHost" +echo "📝 Release Notes: ${RELEASE_NOTES:-}" echo "" -read -p "Do you want to proceed with these values? (y/n): " confirm - -if [ "$confirm" != "y" ]; then - echo "❌ Operation cancelled by the user." - exit 1 +if [ "$SKIP_CONFIRM" = false ]; then + read -p "Do you want to proceed with these values? (y/n): " confirm + if [ "$confirm" != "y" ]; then + echo "❌ Operation cancelled by the user." + exit 1 + fi fi echo "🔨 Starting build process..." @@ -107,6 +136,7 @@ while [ $retry_count -lt $max_retries ]; do -F "runtimeVersion=$runtimeVersion" \ -F "commitHash=$commitHash" \ -F "commitMessage=$commitMessage" \ + ${RELEASE_NOTES:+-F "releaseNotes=$RELEASE_NOTES"} \ --write-out "HTTP_CODE:%{http_code}" \ --silent \ --show-error) diff --git a/src/components/UpdatePopup.tsx b/src/components/UpdatePopup.tsx index 0e0e9ed..421903e 100644 --- a/src/components/UpdatePopup.tsx +++ b/src/components/UpdatePopup.tsx @@ -42,6 +42,17 @@ const UpdatePopup: React.FC = ({ const { currentTheme } = useTheme(); const insets = useSafeAreaInsets(); + const getReleaseNotes = () => { + const manifest: any = updateInfo?.manifest || {}; + return ( + manifest.description || + manifest.releaseNotes || + manifest.extra?.releaseNotes || + manifest.metadata?.releaseNotes || + '' + ); + }; + const handleUpdateNow = () => { Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium); onUpdateNow(); @@ -129,13 +140,13 @@ const UpdatePopup: React.FC = ({ - {updateInfo.manifest?.description && ( + {!!getReleaseNotes() && ( - {updateInfo.manifest.description} + {getReleaseNotes()} )} diff --git a/src/components/metadata/FloatingHeader.tsx b/src/components/metadata/FloatingHeader.tsx index 08b1831..f5c4286 100644 --- a/src/components/metadata/FloatingHeader.tsx +++ b/src/components/metadata/FloatingHeader.tsx @@ -14,6 +14,8 @@ import Animated, { useAnimatedStyle, interpolate, Extrapolate, + useAnimatedReaction, + runOnJS, } from 'react-native-reanimated'; import { useTheme } from '../../contexts/ThemeContext'; import { logger } from '../../utils/logger'; @@ -46,6 +48,7 @@ const FloatingHeader: React.FC = ({ setLogoLoadError, }) => { const { currentTheme } = useTheme(); + const [isHeaderInteractive, setIsHeaderInteractive] = React.useState(false); // Animated styles for the header const headerAnimatedStyle = useAnimatedStyle(() => ({ @@ -55,6 +58,15 @@ const FloatingHeader: React.FC = ({ ] })); + // Disable touches when header is transparent (Android can still register touches at opacity 0) + useAnimatedReaction( + () => headerOpacity.value, + (opacity) => { + const interactive = opacity > 0.05; + runOnJS(setIsHeaderInteractive)(interactive); + } + ); + // Animated style for header elements const headerElementsStyle = useAnimatedStyle(() => ({ opacity: headerElementsOpacity.value, @@ -62,7 +74,7 @@ const FloatingHeader: React.FC = ({ })); return ( - + {Platform.OS === 'ios' ? ( (({ onLoad={handleLoad} onError={(error: any) => handleError(error)} onProgress={handleProgress} - controls={false} + controls={Platform.OS === 'android' ? isFullscreen : false} onEnd={() => { // Only loop if still considered playing and component is mounted if (isPlaying && isComponentMounted) { diff --git a/src/screens/UpdateScreen.tsx b/src/screens/UpdateScreen.tsx index 9ff651c..a31f50f 100644 --- a/src/screens/UpdateScreen.tsx +++ b/src/screens/UpdateScreen.tsx @@ -66,6 +66,7 @@ const UpdateScreen: React.FC = () => { const insets = useSafeAreaInsets(); const [updateInfo, setUpdateInfo] = useState(null); + const [currentInfo, setCurrentInfo] = useState(null); const [isChecking, setIsChecking] = useState(false); const [isInstalling, setIsInstalling] = useState(false); const [lastChecked, setLastChecked] = useState(null); @@ -154,11 +155,35 @@ const UpdateScreen: React.FC = () => { const getCurrentUpdateInfo = async () => { const info = await UpdateService.getCurrentUpdateInfo(); - setUpdateInfo(info); + setCurrentInfo(info); const logs = UpdateService.getLogs(); setLogs(logs); }; + // Extract release notes from various possible manifest fields + const getReleaseNotes = () => { + const manifest: any = updateInfo?.manifest || {}; + return ( + manifest.description || + manifest.releaseNotes || + manifest.extra?.releaseNotes || + manifest.metadata?.releaseNotes || + '' + ); + }; + + // Extract release notes for the currently running version + const getCurrentReleaseNotes = () => { + const manifest: any = currentInfo?.manifest || {}; + return ( + manifest.description || + manifest.releaseNotes || + manifest.extra?.releaseNotes || + manifest.metadata?.releaseNotes || + '' + ); + }; + const refreshLogs = () => { const logs = UpdateService.getLogs(); setLogs(logs); @@ -414,6 +439,19 @@ const UpdateScreen: React.FC = () => { + {/* Release Notes */} + {updateInfo?.isAvailable && !!getReleaseNotes() && ( + + + + + + Release notes: + + {getReleaseNotes()} + + )} + {/* Info Section */} @@ -439,6 +477,33 @@ const UpdateScreen: React.FC = () => { )} + {/* Current Version Section */} + + + + + + Current version: + + {currentInfo?.manifest?.id ? `${currentInfo.manifest.id.substring(0, 8)}...` : (currentInfo?.isEmbeddedLaunch === false ? 'Unknown' : 'Embedded')} + + + + {!!getCurrentReleaseNotes() && ( + + + + + + Current release notes: + + + {getCurrentReleaseNotes()} + + + )} + + {/* Advanced Toggle */}