diff --git a/apps/mobile/native/ios/Media.xcassets/Accent.colorset/Contents.json b/apps/mobile/native/ios/Media.xcassets/Accent.colorset/Contents.json deleted file mode 100644 index 3f349aed5..000000000 --- a/apps/mobile/native/ios/Media.xcassets/Accent.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "colors": [ - { - "color": { - "color-space": "srgb", - "components": { - "alpha": "1.000", - "blue": "0x00", - "green": "0x5C", - "red": "0xFF" - } - }, - "idiom": "universal" - }, - { - "appearances": [ - { - "appearance": "luminosity", - "value": "dark" - } - ], - "color": { - "color-space": "srgb", - "components": { - "alpha": "1.000", - "blue": "0x00", - "green": "0x5C", - "red": "0xFF" - } - }, - "idiom": "universal" - } - ], - "info": { - "author": "xcode", - "version": 1 - } -} diff --git a/apps/mobile/native/ios/Media.xcassets/Contents.json b/apps/mobile/native/ios/Media.xcassets/Contents.json deleted file mode 100644 index 74d6a722c..000000000 --- a/apps/mobile/native/ios/Media.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info": { - "author": "xcode", - "version": 1 - } -} diff --git a/apps/mobile/native/ios/Utils/Utils.swift b/apps/mobile/native/ios/Utils/Utils.swift index 1bb9efda9..d6ff454ea 100644 --- a/apps/mobile/native/ios/Utils/Utils.swift +++ b/apps/mobile/native/ios/Utils/Utils.swift @@ -12,8 +12,7 @@ private class Noop {} enum Utils { static let bundle = Bundle(for: Noop.self) - static let accentColor = - UIColor(named: "Accent", in: bundle, compatibleWith: nil) ?? UIColor.systemBlue + static let accentColor = UIColor(cgColor: .init(red: 255 / 255, green: 92 / 255, blue: 0, alpha: 1)) static func getRootVC() -> UIViewController? { if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene, diff --git a/apps/mobile/src/modules/ai/summary.tsx b/apps/mobile/src/modules/ai/summary.tsx index 484271009..d476c786b 100644 --- a/apps/mobile/src/modules/ai/summary.tsx +++ b/apps/mobile/src/modules/ai/summary.tsx @@ -1,8 +1,9 @@ import { cn } from "@follow/utils" import type { FC } from "react" import * as React from "react" -import { Text, View } from "react-native" +import { Pressable, Text, View } from "react-native" import Animated, { + CurvedTransition, FadeIn, FadeOut, LinearTransition, @@ -20,8 +21,11 @@ export const AISummary: FC<{ className?: string summary: string pending?: boolean -}> = ({ className, summary, pending = false }) => { + error?: string + onRetry?: () => void +}> = ({ className, summary, pending = false, error, onRetry }) => { const labelColor = useColor("label") + const opacity = useSharedValue(0.3) React.useEffect(() => { @@ -38,20 +42,35 @@ export const AISummary: FC<{ })) return ( - + AI Summary - {pending ? ( - + {error ? ( + + + {/* */} + {error} + + {onRetry && ( + + Retry + + )} + + ) : pending ? ( + @@ -59,12 +78,12 @@ export const AISummary: FC<{ - {summary} + {summary.trim()} )} - + ) } diff --git a/apps/mobile/src/modules/entry-content/EntryAISummary.tsx b/apps/mobile/src/modules/entry-content/EntryAISummary.tsx index d52e9d1c0..f62813df0 100644 --- a/apps/mobile/src/modules/entry-content/EntryAISummary.tsx +++ b/apps/mobile/src/modules/entry-content/EntryAISummary.tsx @@ -23,6 +23,7 @@ export const EntryAISummary: FC<{ className="mb-3" summary={summary?.summary || ""} pending={status === SummaryGeneratingStatus.Pending} + error={status === SummaryGeneratingStatus.Error ? "Failed to generate summary" : undefined} /> ) } diff --git a/apps/mobile/web-app/html-renderer/hooks/useCalculateNaturalSize.tsx b/apps/mobile/web-app/html-renderer/hooks/useCalculateNaturalSize.tsx index e8a9c42d8..fb061b7b2 100644 --- a/apps/mobile/web-app/html-renderer/hooks/useCalculateNaturalSize.tsx +++ b/apps/mobile/web-app/html-renderer/hooks/useCalculateNaturalSize.tsx @@ -5,11 +5,11 @@ export const calculateDimensions = ({ height, max, }: { - width: number - height: number + width: number | undefined + height: number | undefined max: { width: number; height: number } }) => { - if (width === 0 || height === 0) return { width: 0, height: 0 } + if (!width || !height) return { width: undefined, height: undefined } const { width: maxW, height: maxH } = max diff --git a/apps/mobile/web-app/html-renderer/src/components/image.tsx b/apps/mobile/web-app/html-renderer/src/components/image.tsx index 821b5d516..d4222843f 100644 --- a/apps/mobile/web-app/html-renderer/src/components/image.tsx +++ b/apps/mobile/web-app/html-renderer/src/components/image.tsx @@ -28,8 +28,8 @@ export const MarkdownImage = (props: HTMLProps<"img">) => { const { height: scaleHeight, width: scaleWidth } = useMemo( () => calculateDimensions({ - width: image?.width ?? 0, - height: image?.height ?? 0, + width: image?.width, + height: image?.height, max: { width: ref?.clientWidth ?? 0, height: window.innerHeight,