⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.
TypeScript bookmarkbookmark-managercollaborationnextjsreact-nativeread-it-laterself-hostedtypescript
feat: add dynamic header tint color based on color scheme and adjust scroll view properties for better usability
daniel31x132d5eb87296c0
diff --git a/apps/mobile/app/(tabs)/collections/_layout.tsx b/apps/mobile/app/(tabs)/collections/_layout.tsxindex efbfb08b..063b869e 100644--- a/apps/mobile/app/(tabs)/collections/_layout.tsx+++ b/apps/mobile/app/(tabs)/collections/_layout.tsx@@ -12,6 +12,7 @@ export default function Layout() {screenOptions={{headerTitle: "Collections",headerLargeTitle: true,+ headerTintColor: colorScheme === "dark" ? "white" : "black",headerTransparent: Platform.OS === "ios",headerShadowVisible: false,headerSearchBarOptions: {diff --git a/apps/mobile/app/(tabs)/dashboard/_layout.tsx b/apps/mobile/app/(tabs)/dashboard/_layout.tsxindex 3a8aac08..82a7bfd6 100644--- a/apps/mobile/app/(tabs)/dashboard/_layout.tsx+++ b/apps/mobile/app/(tabs)/dashboard/_layout.tsx@@ -15,6 +15,7 @@ export default function Layout() {screenOptions={{headerLargeTitle: true,headerTransparent: Platform.OS === "ios",+ headerTintColor: colorScheme === "dark" ? "white" : "black",headerShadowVisible: false,headerLargeTitleStyle: {color: rawTheme[colorScheme as ThemeName]["base-content"], // or whatever token you wantdiff --git a/apps/mobile/app/(tabs)/links/_layout.tsx b/apps/mobile/app/(tabs)/links/_layout.tsxindex 5e310f41..6cfabd86 100644--- a/apps/mobile/app/(tabs)/links/_layout.tsx+++ b/apps/mobile/app/(tabs)/links/_layout.tsx@@ -12,6 +12,7 @@ export default function Layout() {screenOptions={{headerTitle: "Links",headerLargeTitle: true,+ headerTintColor: colorScheme === "dark" ? "white" : "black",headerTransparent: Platform.OS === "ios",headerShadowVisible: false,headerSearchBarOptions: {diff --git a/apps/mobile/app/(tabs)/settings/_layout.tsx b/apps/mobile/app/(tabs)/settings/_layout.tsxindex 3f1a547a..18bc836d 100644--- a/apps/mobile/app/(tabs)/settings/_layout.tsx+++ b/apps/mobile/app/(tabs)/settings/_layout.tsx@@ -11,6 +11,7 @@ export default function Layout() {screenOptions={{headerTitle: "Settings",headerLargeTitle: true,+ headerTintColor: colorScheme === "dark" ? "white" : "black",headerTransparent: Platform.OS === "ios",headerShadowVisible: false,headerLargeTitleStyle: {diff --git a/apps/mobile/app/(tabs)/tags/_layout.tsx b/apps/mobile/app/(tabs)/tags/_layout.tsxindex 9cddf593..fed56cb8 100644--- a/apps/mobile/app/(tabs)/tags/_layout.tsx+++ b/apps/mobile/app/(tabs)/tags/_layout.tsx@@ -12,6 +12,7 @@ export default function Layout() {screenOptions={{headerTitle: "Tags",headerLargeTitle: true,+ headerTintColor: colorScheme === "dark" ? "white" : "black",headerTransparent: Platform.OS === "ios",headerShadowVisible: false,headerSearchBarOptions: {diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsxindex 86bde9d9..a3780737 100644--- a/apps/mobile/app/_layout.tsx+++ b/apps/mobile/app/_layout.tsx@@ -125,6 +125,8 @@ const RootComponent = ({const { tmp } = useTmpStore();+ const isIOS26Plus = Platform.OS === "ios" && Number(Platform.Version) >= 26;+return (<Viewstyle={[{ flex: 1 }, colorScheme === "dark" ? darkTheme : lightTheme]}@@ -146,6 +148,7 @@ const RootComponent = ({}}>{/* <Stack.Screen name="(tabs)" /> */}+<Stack.Screenname="links/[id]"options={{@@ -153,160 +156,309 @@ const RootComponent = ({headerBackTitle: "Back",headerTitle: "",headerTintColor: colorScheme === "dark" ? "white" : "black",- headerStyle: {- backgroundColor:- colorScheme === "dark"- ? rawTheme["dark"]["base-100"]- : "white",- },- headerRight: () => (- <View className="flex-row gap-5 px-2">- <TouchableOpacity- onPress={() => {- if (tmp.link) {- if (tmp.link.url) {- return Linking.openURL(tmp.link.url);- } else {- const format = getOriginalFormat(tmp.link);+ ...(isIOS26Plus+ ? {+ headerTransparent: true,+ headerLargeStyle: { backgroundColor: "transparent" },+ headerStyle: { backgroundColor: "transparent" },+ headerRightBackgroundVisible: true,+ unstable_headerRightItems: () => [+ {+ type: "button",+ label: "Open",+ icon: { type: "sfSymbol", name: "safari" },+ onPress: () => {+ if (tmp.link) {+ if (tmp.link.url) {+ Linking.openURL(tmp.link.url);+ } else {+ const format = getOriginalFormat(tmp.link);- return Linking.openURL(- format !== null- ? auth.instance +- `/preserved/${tmp.link.id}?format=${format}`- : tmp.link.url || ""- );- }- }- }}- >- {Platform.OS === "ios" ? (- <Compass- size={21}- color={- rawTheme[colorScheme as ThemeName]["base-content"]- }- />- ) : (- <Chromium- stroke={- rawTheme[colorScheme as ThemeName]["base-content"]- }- />- )}- </TouchableOpacity>- <DropdownMenu.Root>- <DropdownMenu.Trigger>- <TouchableOpacity>- <Ellipsis- size={21}- color={- rawTheme[colorScheme as ThemeName][- "base-content"- ]+ Linking.openURL(+ format !== null+ ? `${auth.instance}/preserved/${tmp.link.id}?format=${format}`+ : tmp.link.url || ""+ );+ }}- />- </TouchableOpacity>- </DropdownMenu.Trigger>+ },+ sharesBackground: true,+ },+ {+ type: "menu",+ label: "More",+ icon: { type: "sfSymbol", name: "ellipsis.circle" },+ sharesBackground: true,+ menu: {+ items: [+ ...(tmp.link?.url+ ? [+ {+ type: "action",+ label: "Share",+ onPress: async () => {+ await Share.share({+ url: tmp.link!.url as string,+ });+ },+ },+ ]+ : []),- <DropdownMenu.Content>- {tmp.link?.url && (- <DropdownMenu.Item- key="share"- onSelect={async () => {- await Share.share({- ...(Platform.OS === "android"- ? { message: tmp.link?.url as string }- : { url: tmp.link?.url as string }),- });- }}- >- <DropdownMenu.ItemTitle>- Share- </DropdownMenu.ItemTitle>- </DropdownMenu.Item>- )}+ ...(tmp.link && tmp.user+ ? [+ {+ type: "action",+ label:+ tmp.link.pinnedBy &&+ tmp.link.pinnedBy[0]+ ? "Unpin Link"+ : "Pin Link",+ onPress: () => {+ const isAlreadyPinned =+ !!tmp.link?.pinnedBy?.[0];- {tmp.link && tmp.user && (- <DropdownMenu.Item- key="pin-link"- onSelect={() => {- const isAlreadyPinned =- tmp.link?.pinnedBy && tmp.link.pinnedBy[0]- ? true- : false;- updateLink.mutateAsync({- ...(tmp.link as LinkIncludingShortenedCollectionAndTags),- pinnedBy: (isAlreadyPinned- ? [{ id: undefined }]- : [{ id: tmp.user?.id }]) as any,- });- }}- >- <DropdownMenu.ItemTitle>- {tmp.link.pinnedBy && tmp.link.pinnedBy[0]- ? "Unpin Link"- : "Pin Link"}- </DropdownMenu.ItemTitle>- </DropdownMenu.Item>- )}+ updateLink.mutateAsync({+ ...(tmp.link as LinkIncludingShortenedCollectionAndTags),+ pinnedBy: (isAlreadyPinned+ ? [{ id: undefined }]+ : [{ id: tmp.user?.id }]) as any,+ });+ },+ },+ ]+ : []),- {tmp.link && (- <DropdownMenu.Item- key="edit-link"- onSelect={() => {- SheetManager.show("edit-link-sheet", {- payload: {- link: tmp.link as LinkIncludingShortenedCollectionAndTags,- },- });+ ...(tmp.link+ ? [+ {+ type: "action" as any,+ label: "Edit Link",+ onPress: () => {+ SheetManager.show("edit-link-sheet", {+ payload: {+ link: tmp.link as LinkIncludingShortenedCollectionAndTags,+ },+ });+ },+ },+ {+ type: "action" as any,+ label: "Delete",+ attributes: {+ destructive: true,+ },+ onPress: () => {+ Alert.alert(+ "Delete Link",+ "Are you sure you want to delete this link? This action cannot be undone.",+ [+ {+ text: "Cancel",+ style: "cancel",+ },+ {+ text: "Delete",+ style: "destructive",+ onPress: async () => {+ deleteLink.mutate(+ tmp.link?.id as number+ );+ await deleteLinkCache(+ tmp.link?.id as number+ );+ router.back();+ },+ },+ ]+ );+ },+ },+ ]+ : []),+ ],+ },+ },+ ],+ }+ : {+ headerTransparent: Platform.OS === "ios",+ headerLargeTitleStyle: {+ color:+ rawTheme[colorScheme as ThemeName]["base-content"],+ },+ headerTitleStyle: {+ color:+ rawTheme[colorScheme as ThemeName]["base-content"],+ },+ headerLargeStyle: {+ backgroundColor:+ Platform.OS === "ios"+ ? "transparent"+ : rawTheme[colorScheme as ThemeName]["base-100"],+ },+ headerStyle: {+ backgroundColor:+ Platform.OS === "ios"+ ? "transparent"+ : colorScheme === "dark"+ ? rawTheme["dark"]["base-100"]+ : "white",+ },+ headerRight: () => (+ <View className="flex-row gap-5 px-2">+ <TouchableOpacity+ onPress={() => {+ if (tmp.link) {+ if (tmp.link.url) {+ return Linking.openURL(tmp.link.url);+ } else {+ const format = getOriginalFormat(tmp.link);++ return Linking.openURL(+ format !== null+ ? auth.instance ++ `/preserved/${tmp.link.id}?format=${format}`+ : tmp.link.url || ""+ );+ }+ }}}>- <DropdownMenu.ItemTitle>- Edit Link- </DropdownMenu.ItemTitle>- </DropdownMenu.Item>- )}+ {Platform.OS === "ios" ? (+ <Compass+ size={21}+ color={+ rawTheme[colorScheme as ThemeName][+ "base-content"+ ]+ }+ />+ ) : (+ <Chromium+ stroke={+ rawTheme[colorScheme as ThemeName][+ "base-content"+ ]+ }+ />+ )}+ </TouchableOpacity>+ <DropdownMenu.Root>+ <DropdownMenu.Trigger>+ <TouchableOpacity>+ <Ellipsis+ size={21}+ color={+ rawTheme[colorScheme as ThemeName][+ "base-content"+ ]+ }+ />+ </TouchableOpacity>+ </DropdownMenu.Trigger>- {tmp.link && (- <DropdownMenu.Item- key="delete-link"- onSelect={() => {- return Alert.alert(- "Delete Link",- "Are you sure you want to delete this link? This action cannot be undone.",- [- {- text: "Cancel",- style: "cancel",- },- {- text: "Delete",- style: "destructive",- onPress: async () => {- deleteLink.mutate(- tmp.link?.id as number- );+ <DropdownMenu.Content>+ {tmp.link?.url && (+ <DropdownMenu.Item+ key="share"+ onSelect={async () => {+ await Share.share({+ ...(Platform.OS === "android"+ ? { message: tmp.link?.url as string }+ : { url: tmp.link?.url as string }),+ });+ }}+ >+ <DropdownMenu.ItemTitle>+ Share+ </DropdownMenu.ItemTitle>+ </DropdownMenu.Item>+ )}- await deleteLinkCache(- tmp.link?.id as number- );+ {tmp.link && tmp.user && (+ <DropdownMenu.Item+ key="pin-link"+ onSelect={() => {+ const isAlreadyPinned =+ tmp.link?.pinnedBy &&+ tmp.link.pinnedBy[0]+ ? true+ : false;+ updateLink.mutateAsync({+ ...(tmp.link as LinkIncludingShortenedCollectionAndTags),+ pinnedBy: (isAlreadyPinned+ ? [{ id: undefined }]+ : [{ id: tmp.user?.id }]) as any,+ });+ }}+ >+ <DropdownMenu.ItemTitle>+ {tmp.link.pinnedBy && tmp.link.pinnedBy[0]+ ? "Unpin Link"+ : "Pin Link"}+ </DropdownMenu.ItemTitle>+ </DropdownMenu.Item>+ )}- router.back();- },- },- ]- );- }}- >- <DropdownMenu.ItemTitle>- Delete- </DropdownMenu.ItemTitle>- </DropdownMenu.Item>- )}- </DropdownMenu.Content>- </DropdownMenu.Root>- </View>- ),+ {tmp.link && (+ <DropdownMenu.Item+ key="edit-link"+ onSelect={() => {+ SheetManager.show("edit-link-sheet", {+ payload: {+ link: tmp.link as LinkIncludingShortenedCollectionAndTags,+ },+ });+ }}+ >+ <DropdownMenu.ItemTitle>+ Edit Link+ </DropdownMenu.ItemTitle>+ </DropdownMenu.Item>+ )}++ {tmp.link && (+ <DropdownMenu.Item+ key="delete-link"+ onSelect={() => {+ return Alert.alert(+ "Delete Link",+ "Are you sure you want to delete this link? This action cannot be undone.",+ [+ {+ text: "Cancel",+ style: "cancel",+ },+ {+ text: "Delete",+ style: "destructive",+ onPress: async () => {+ deleteLink.mutate(+ tmp.link?.id as number+ );++ await deleteLinkCache(+ tmp.link?.id as number+ );++ router.back();+ },+ },+ ]+ );+ }}+ >+ <DropdownMenu.ItemTitle>+ Delete+ </DropdownMenu.ItemTitle>+ </DropdownMenu.Item>+ )}+ </DropdownMenu.Content>+ </DropdownMenu.Root>+ </View>+ ),+ }),}}/><Stack.Screen name="login" />diff --git a/apps/mobile/app/links/[id].tsx b/apps/mobile/app/links/[id].tsxindex bd552fc5..a9c2d750 100644--- a/apps/mobile/app/links/[id].tsx+++ b/apps/mobile/app/links/[id].tsx@@ -89,6 +89,9 @@ export default function LinkScreen() {? { Authorization: `Bearer ${auth.session}` }: {},}}+ contentInsetAdjustmentBehavior="automatic"+ automaticallyAdjustContentInsets+ automaticallyAdjustsScrollIndicatorInsetsonLoadEnd={() => setIsLoading(false)}/>) : (diff --git a/apps/mobile/components/Formats/ImageFormat.tsx b/apps/mobile/components/Formats/ImageFormat.tsxindex 9adf08dc..d72b49a5 100644--- a/apps/mobile/components/Formats/ImageFormat.tsx+++ b/apps/mobile/components/Formats/ImageFormat.tsx@@ -75,7 +75,12 @@ export default function ImageFormat({ link, setIsLoading, format }: Props) {return (content &&dimension && (- <ScrollView maximumZoomScale={10}>+ <ScrollView+ maximumZoomScale={10}+ contentInsetAdjustmentBehavior="automatic"+ automaticallyAdjustContentInsets+ automaticallyAdjustsScrollIndicatorInsets+ ><Imagesource={{ uri: content }}onLoadEnd={() => setIsLoading(false)}diff --git a/apps/mobile/components/Formats/ReadableFormat.tsx b/apps/mobile/components/Formats/ReadableFormat.tsxindex feeea01a..8bec9544 100644--- a/apps/mobile/components/Formats/ReadableFormat.tsx+++ b/apps/mobile/components/Formats/ReadableFormat.tsx@@ -78,6 +78,9 @@ export default function ReadableFormat({ link, setIsLoading }: Props) {className="flex-1 bg-base-100"contentContainerClassName="p-4"nestedScrollEnabled+ contentInsetAdjustmentBehavior="automatic"+ automaticallyAdjustContentInsets+ automaticallyAdjustsScrollIndicatorInsets><Text className="text-2xl font-bold mb-2.5 text-base-content">{decode(link.name || link.description || link.url || "")}diff --git a/apps/mobile/components/Formats/WebpageFormat.tsx b/apps/mobile/components/Formats/WebpageFormat.tsxindex a8622dae..ce758136 100644--- a/apps/mobile/components/Formats/WebpageFormat.tsx+++ b/apps/mobile/components/Formats/WebpageFormat.tsx@@ -71,6 +71,9 @@ export default function WebpageFormat({ link, setIsLoading }: Props) {javaScriptEnabled={false}allowFileAccess={true}onLoadEnd={() => setIsLoading(false)}+ contentInsetAdjustmentBehavior="automatic"+ automaticallyAdjustContentInsets+ automaticallyAdjustsScrollIndicatorInsets/>));