A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
feat(mobile): revamp search and navigation chrome (#2685)
Evan Simkowitz649efb87c473
diff --git a/apps/mobile/app/dashboard/(tabs)/(highlights)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/(highlights)/_layout.tsxindex 07359aea..29e45714 100644--- a/apps/mobile/app/dashboard/(tabs)/(highlights)/_layout.tsx+++ b/apps/mobile/app/dashboard/(tabs)/(highlights)/_layout.tsx@@ -1,32 +1,9 @@-import { Platform } from "react-native";import { Stack } from "expo-router/stack";-import { isIOS26 } from "@/lib/ios";+import { tabScreenOptions } from "@/lib/tabScreenOptions";export default function Layout() {return (- <Stack- screenOptions={{- ...Platform.select({- ios: {- headerLargeTitle: true,- headerTransparent: true,- headerBlurEffect: isIOS26 ? undefined : "systemMaterial",- headerLargeTitleShadowVisible: false,- headerLargeStyle: { backgroundColor: "transparent" },- },- android: {- headerStyle: {- backgroundColor: "transparent",- },- contentStyle: {- // Manual padding to avoid the native tabbar until expo fixes this in sdk 55.- paddingBottom: 100,- },- },- }),- headerShadowVisible: false,- }}- >+ <Stack screenOptions={tabScreenOptions}><Stack.Screen name="index" options={{ title: "Highlights" }} /></Stack>);diff --git a/apps/mobile/app/dashboard/(tabs)/(home)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/(home)/_layout.tsxindex 6ef07b9f..44a2d8f3 100644--- a/apps/mobile/app/dashboard/(tabs)/(home)/_layout.tsx+++ b/apps/mobile/app/dashboard/(tabs)/(home)/_layout.tsx@@ -1,30 +1,21 @@-import { Platform } from "react-native";import { Stack } from "expo-router/stack";-import { isIOS26 } from "@/lib/ios";+import { tabScreenOptions } from "@/lib/tabScreenOptions";+import { Platform } from "react-native";+import { ProfileAvatarButton } from "@/components/settings/ProfileAvatarButton";export default function Layout() {return (<StackscreenOptions={{+ ...tabScreenOptions,...Platform.select({ios: {- headerLargeTitle: true,- headerTransparent: true,- headerBlurEffect: isIOS26 ? undefined : "systemMaterial",- headerLargeTitleShadowVisible: false,- headerLargeStyle: { backgroundColor: "transparent" },+ headerRight: () => <ProfileAvatarButton />,},android: {- headerStyle: {- backgroundColor: "transparent",- },- contentStyle: {- // Manual padding to avoid the native tabbar until expo fixes this in sdk 55.- paddingBottom: 100,- },+ headerShown: false,},}),- headerShadowVisible: false,}}><Stack.Screen name="index" options={{ title: "Home" }} />diff --git a/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx b/apps/mobile/app/dashboard/(tabs)/(home)/index.tsxindex eeee0877..8fece487 100644--- a/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx+++ b/apps/mobile/app/dashboard/(tabs)/(home)/index.tsx@@ -1,26 +1,22 @@-import { useRef } from "react";-import { Platform, Pressable, View } from "react-native";+import { useRef, useState } from "react";+import { Platform, PlatformColor, View } from "react-native";import * as Haptics from "expo-haptics";import * as ImagePicker from "expo-image-picker";-import { router, Stack } from "expo-router";+import { router } from "expo-router";import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";-import { TailwindResolver } from "@/components/TailwindResolver";-import { Text } from "@/components/ui/Text";+import InlineSearch from "@/components/search/InlineSearch";+import { ProfileAvatarButton } from "@/components/settings/ProfileAvatarButton";+import AndroidSearchBar from "@/components/ui/AndroidSearchBar";+import { FAB } from "@/components/ui/FAB";import useAppSettings from "@/lib/settings";import { useUploadAsset } from "@/lib/upload";-import { useColorScheme } from "@/lib/useColorScheme";import { useMenuIconColors } from "@/lib/useMenuIconColors";import { MenuView } from "@react-native-menu/menu";-import { Plus, Search } from "lucide-react-native";+import { Plus } from "lucide-react-native";import { toast as sonnerToast } from "sonner-native";-function HeaderRight({- openNewBookmarkModal,-}: {- openNewBookmarkModal: () => void;-}) {+function useNewBookmarkActions(openNewBookmarkModal: () => void) {const { settings } = useAppSettings();- const { colors } = useColorScheme();const { menuIconColor } = useMenuIconColors();const uploadToastIdRef = useRef<string | number | null>(null);const { uploadAsset } = useUploadAsset(settings, {@@ -39,111 +35,109 @@ function HeaderRight({}},});- return (- <MenuView- onPressAction={async ({ nativeEvent }) => {- Haptics.selectionAsync();- if (nativeEvent.event === "new") {- openNewBookmarkModal();- } else if (nativeEvent.event === "library") {- try {- const result = await ImagePicker.launchImageLibraryAsync({- mediaTypes: ["images"],- quality: settings.imageQuality,- allowsMultipleSelection: false,- });- if (!result.canceled) {- const asset = result.assets[0];- if (!asset) {- uploadToastIdRef.current = null;- return;- }- uploadToastIdRef.current =- sonnerToast.loading("Uploading image...");- uploadAsset({- type: asset.mimeType ?? "",- name: asset.fileName ?? "",- uri: asset.uri,- });- }- } catch {- sonnerToast.error("Failed to open photo library", {- id:- uploadToastIdRef.current !== null- ? uploadToastIdRef.current- : undefined,- });++ const onPressAction = async ({+ nativeEvent,+ }: {+ nativeEvent: { event: string };+ }) => {+ Haptics.selectionAsync();+ if (nativeEvent.event === "new") {+ openNewBookmarkModal();+ } else if (nativeEvent.event === "library") {+ try {+ uploadToastIdRef.current = sonnerToast.loading(+ "Opening photo library...",+ );+ const result = await ImagePicker.launchImageLibraryAsync({+ mediaTypes: ["images"],+ quality: settings.imageQuality,+ allowsMultipleSelection: false,+ });+ if (!result.canceled) {+ const asset = result.assets[0];+ if (!asset) {+ sonnerToast.dismiss(uploadToastIdRef.current);uploadToastIdRef.current = null;+ return;}+ sonnerToast.loading("Uploading image...", {+ id: uploadToastIdRef.current,+ });+ uploadAsset({+ type: asset.mimeType ?? "",+ name: asset.fileName ?? "",+ uri: asset.uri,+ });+ } else {+ sonnerToast.dismiss(uploadToastIdRef.current);+ uploadToastIdRef.current = null;}- }}- actions={[- {- id: "new",- title: "New Bookmark",- image: Platform.select({- ios: "square.and.pencil",- }),- imageColor: Platform.select({- ios: menuIconColor,- }),- },- {- id: "library",- title: "Photo Library",- image: Platform.select({- ios: "photo",- }),- imageColor: Platform.select({- ios: menuIconColor,- }),- },- ]}- shouldOpenOnLongPress={false}- >- <View className="my-auto">- <Plus- color={colors.foreground}- onPress={() => Haptics.selectionAsync()}- />- </View>- </MenuView>- );+ } catch {+ if (uploadToastIdRef.current !== null) {+ sonnerToast.error("Failed to open photo library", {+ id: uploadToastIdRef.current,+ });+ uploadToastIdRef.current = null;+ } else {+ sonnerToast.error("Failed to open photo library");+ }+ }+ }+ };++ const actions = [+ {+ id: "new",+ title: "New Bookmark",+ image: Platform.select({ ios: "square.and.pencil" }),+ imageColor: Platform.select({ ios: menuIconColor }),+ },+ {+ id: "library",+ title: "Photo Library",+ image: Platform.select({ ios: "photo" }),+ imageColor: Platform.select({ ios: menuIconColor }),+ },+ ];++ return { onPressAction, actions };}export default function Home() {+ const [searchActive, setSearchActive] = useState(false);+ const { onPressAction, actions } = useNewBookmarkActions(() =>+ router.push("/dashboard/bookmarks/new"),+ );++ if (Platform.OS === "android" && searchActive) {+ return <InlineSearch onClose={() => setSearchActive(false)} />;+ }+return (<>- <Stack.Screen- options={{- headerRight: () => (- <HeaderRight- openNewBookmarkModal={() =>- router.push("/dashboard/bookmarks/new")- }- />- ),- }}- />- <UpdatingBookmarkList- query={{ archived: false }}- header={- <Pressable- className="flex flex-row items-center gap-1 rounded-lg border border-input bg-card px-4 py-1"- onPress={() => router.push("/dashboard/search")}- >- <TailwindResolver- className="text-muted"- comp={(styles) => (- <Search size={16} color={styles?.color?.toString()} />- )}+ {Platform.OS === "android" && (+ <AndroidSearchBar+ label="Search bookmarks..."+ onPress={() => setSearchActive(true)}+ rightElement={<ProfileAvatarButton />}+ />+ )}+ <UpdatingBookmarkList query={{ archived: false }} />+ <FAB>+ <MenuView+ onPressAction={onPressAction}+ actions={actions}+ shouldOpenOnLongPress={false}+ >+ <View className="h-full w-full items-center justify-center">+ <Plus+ size={24}+ color={Platform.OS === "ios" ? PlatformColor("label") : "white"}/>- <Text className="flex-1 text-muted" numberOfLines={1}>- Search- </Text>- </Pressable>- }- />+ </View>+ </MenuView>+ </FAB></>);}diff --git a/apps/mobile/app/dashboard/(tabs)/(lists)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/(lists)/_layout.tsxindex 659c0735..849ca489 100644--- a/apps/mobile/app/dashboard/(tabs)/(lists)/_layout.tsx+++ b/apps/mobile/app/dashboard/(tabs)/(lists)/_layout.tsx@@ -1,32 +1,9 @@-import { Platform } from "react-native";import { Stack } from "expo-router/stack";-import { isIOS26 } from "@/lib/ios";+import { tabScreenOptions } from "@/lib/tabScreenOptions";export default function Layout() {return (- <Stack- screenOptions={{- ...Platform.select({- ios: {- headerLargeTitle: true,- headerTransparent: true,- headerBlurEffect: isIOS26 ? undefined : "systemMaterial",- headerLargeTitleShadowVisible: false,- headerLargeStyle: { backgroundColor: "transparent" },- },- android: {- headerStyle: {- backgroundColor: "transparent",- },- contentStyle: {- // Manual padding to avoid the native tabbar until expo fixes this in sdk 55.- paddingBottom: 100,- },- },- }),- headerShadowVisible: false,- }}- >+ <Stack screenOptions={tabScreenOptions}><Stack.Screen name="index" options={{ title: "Lists" }} /></Stack>);diff --git a/apps/mobile/app/dashboard/(tabs)/(lists)/index.tsx b/apps/mobile/app/dashboard/(tabs)/(lists)/index.tsxindex fde79afd..4e28b146 100644--- a/apps/mobile/app/dashboard/(tabs)/(lists)/index.tsx+++ b/apps/mobile/app/dashboard/(tabs)/(lists)/index.tsx@@ -1,9 +1,16 @@import { useEffect, useMemo, useState } from "react";-import { FlatList, Pressable, View } from "react-native";+import {+ FlatList,+ Platform,+ PlatformColor,+ Pressable,+ View,+} from "react-native";import * as Haptics from "expo-haptics";-import { Link, router, Stack } from "expo-router";+import { Link, router } from "expo-router";import FullPageError from "@/components/FullPageError";import ChevronRight from "@/components/ui/ChevronRight";+import { FAB } from "@/components/ui/FAB";import FullPageSpinner from "@/components/ui/FullPageSpinner";import { Text } from "@/components/ui/Text";import { useColorScheme } from "@/lib/useColorScheme";@@ -15,21 +22,6 @@ import { useBookmarkLists } from "@karakeep/shared-react/hooks/lists";import { useTRPC } from "@karakeep/shared-react/trpc";import { ZBookmarkListTreeNode } from "@karakeep/shared/utils/listUtils";-function HeaderRight({ openNewListModal }: { openNewListModal: () => void }) {- const { colors } = useColorScheme();- return (- <Pressable- className="my-auto"- onPress={() => {- Haptics.selectionAsync();- openNewListModal();- }}- >- <Plus color={colors.foreground} />- </Pressable>- );-}-interface ListLink {id: string;logo: string;@@ -186,25 +178,18 @@ export default function Lists() {return (<>- <Stack.Screen- options={{- headerRight: () => (- <HeaderRight- openNewListModal={() => router.push("/dashboard/lists/new")}- />- ),- }}- /><FlatListclassName="h-full"contentInsetAdjustmentBehavior="automatic"contentContainerStyle={{gap: 6,paddingBottom: 20,+ marginHorizontal: 15,+ marginBottom: 15,}}renderItem={(l) => (<View- className="mx-2 flex flex-row items-center rounded-xl bg-card px-4 py-2"+ className="flex flex-row items-center rounded-xl bg-card px-4 py-2"style={{borderCurve: "continuous",...condProps({@@ -280,6 +265,20 @@ export default function Lists() {refreshing={refreshing}onRefresh={onRefresh}/>+ <FAB>+ <Pressable+ className="h-full w-full items-center justify-center"+ onPress={() => {+ Haptics.selectionAsync();+ router.push("/dashboard/lists/new");+ }}+ >+ <Plus+ size={24}+ color={Platform.OS === "ios" ? PlatformColor("label") : "white"}+ />+ </Pressable>+ </FAB></>);}diff --git a/apps/mobile/app/dashboard/(tabs)/(search)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/(search)/_layout.tsxnew file mode 100644index 00000000..5aeff033--- /dev/null+++ b/apps/mobile/app/dashboard/(tabs)/(search)/_layout.tsx@@ -0,0 +1,10 @@+import { Stack } from "expo-router/stack";+import { tabScreenOptions } from "@/lib/tabScreenOptions";++export default function Layout() {+ return (+ <Stack screenOptions={tabScreenOptions}>+ <Stack.Screen name="index" options={{ title: "Search" }} />+ </Stack>+ );+}diff --git a/apps/mobile/app/dashboard/(tabs)/(search)/index.ios.tsx b/apps/mobile/app/dashboard/(tabs)/(search)/index.ios.tsxnew file mode 100644index 00000000..07683d9c--- /dev/null+++ b/apps/mobile/app/dashboard/(tabs)/(search)/index.ios.tsx@@ -0,0 +1,60 @@+import { useCallback, useRef, useState } from "react";+import { Stack, useFocusEffect } from "expo-router";+import type { SearchBarCommands } from "react-native-screens";+import BookmarkSearchResults from "@/components/search/BookmarkSearchResults";+import { useBookmarkSearchState } from "@/lib/useBookmarkSearchState";++export default function SearchTab() {+ const [search, setSearch] = useState("");+ const [isSearchFocused, setIsSearchFocused] = useState(false);+ const searchBarRef = useRef<SearchBarCommands>(+ null,+ ) as React.RefObject<SearchBarCommands>;+ const state = useBookmarkSearchState(search);++ useFocusEffect(+ useCallback(() => {+ const id = setTimeout(() => searchBarRef.current?.focus(), 0);+ return () => clearTimeout(id);+ }, []),+ );++ const handleSearchSubmit = (searchTerm: string) => {+ const term = searchTerm.trim();+ if (term.length > 0) {+ setSearch(term);+ searchBarRef.current?.setText(term);+ state.addTerm(term);+ }+ searchBarRef.current?.blur();+ };++ return (+ <>+ <Stack.Screen+ options={{+ headerSearchBarOptions: {+ ref: searchBarRef,+ placeholder: "Search bookmarks...",+ onChangeText: (event) => setSearch(event.nativeEvent.text),+ onFocus: () => setIsSearchFocused(true),+ onBlur: () => {+ setIsSearchFocused(false);+ state.commitTerm(search);+ },+ onSearchButtonPress: () => handleSearchSubmit(search),+ autoCapitalize: "none",+ hideWhenScrolling: false,+ },+ }}+ />++ <BookmarkSearchResults+ rawSearch={search}+ isInputFocused={isSearchFocused}+ state={state}+ onSelectHistory={handleSearchSubmit}+ />+ </>+ );+}diff --git a/apps/mobile/app/dashboard/(tabs)/(search)/index.tsx b/apps/mobile/app/dashboard/(tabs)/(search)/index.tsxnew file mode 100644index 00000000..2953c1e1--- /dev/null+++ b/apps/mobile/app/dashboard/(tabs)/(search)/index.tsx@@ -0,0 +1,5 @@+// Android stub — the search tab is hidden on Android.+// AndroidSearchBar in the home tab toggles InlineSearch inline (see (home)/index.tsx).+export default function SearchTab() {+ return null;+}diff --git a/apps/mobile/app/dashboard/(tabs)/(settings)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/(settings)/_layout.tsxdeleted file mode 100644index f51c168e..00000000--- a/apps/mobile/app/dashboard/(tabs)/(settings)/_layout.tsx+++ /dev/null@@ -1,33 +0,0 @@-import { Platform } from "react-native";-import { Stack } from "expo-router/stack";-import { isIOS26 } from "@/lib/ios";--export default function Layout() {- return (- <Stack- screenOptions={{- ...Platform.select({- ios: {- headerLargeTitle: true,- headerTransparent: true,- headerBlurEffect: isIOS26 ? undefined : "systemMaterial",- headerLargeTitleShadowVisible: false,- headerLargeStyle: { backgroundColor: "transparent" },- },- android: {- headerStyle: {- backgroundColor: "transparent",- },- contentStyle: {- // Manual padding to avoid the native tabbar until expo fixes this in sdk 55.- paddingBottom: 100,- },- },- }),- headerShadowVisible: false,- }}- >- <Stack.Screen name="index" options={{ title: "Settings" }} />- </Stack>- );-}diff --git a/apps/mobile/app/dashboard/(tabs)/(tags)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/(tags)/_layout.tsxindex e9509ed5..f739425f 100644--- a/apps/mobile/app/dashboard/(tabs)/(tags)/_layout.tsx+++ b/apps/mobile/app/dashboard/(tabs)/(tags)/_layout.tsx@@ -1,32 +1,9 @@-import { Platform } from "react-native";import { Stack } from "expo-router/stack";-import { isIOS26 } from "@/lib/ios";+import { tabScreenOptions } from "@/lib/tabScreenOptions";export default function Layout() {return (- <Stack- screenOptions={{- ...Platform.select({- ios: {- headerLargeTitle: true,- headerTransparent: true,- headerBlurEffect: isIOS26 ? undefined : "systemMaterial",- headerLargeTitleShadowVisible: false,- headerLargeStyle: { backgroundColor: "transparent" },- },- android: {- headerStyle: {- backgroundColor: "transparent",- },- contentStyle: {- // Manual padding to avoid the native tabbar until expo fixes this in sdk 55.- paddingBottom: 100,- },- },- }),- headerShadowVisible: false,- }}- >+ <Stack screenOptions={tabScreenOptions}><Stack.Screen name="index" options={{ title: "Tags" }} /></Stack>);diff --git a/apps/mobile/app/dashboard/(tabs)/_layout.tsx b/apps/mobile/app/dashboard/(tabs)/_layout.tsxindex fd5798b9..d25710bd 100644--- a/apps/mobile/app/dashboard/(tabs)/_layout.tsx+++ b/apps/mobile/app/dashboard/(tabs)/_layout.tsx@@ -1,17 +1,26 @@import React from "react";+import { Platform } from "react-native";import {Icon,Label,NativeTabs,VectorIcon,} from "expo-router/unstable-native-tabs";+import { isIOS26 } from "@/lib/ios";import { useColorScheme } from "@/lib/useColorScheme";import MaterialCommunityIcons from "@expo/vector-icons/MaterialCommunityIcons";export default function TabLayout() {const { colors } = useColorScheme();return (- <NativeTabs backgroundColor={colors.grey6} minimizeBehavior="onScrollDown">+ <NativeTabs+ backgroundColor={colors.grey6}+ minimizeBehavior={Platform.select({+ ios: "never",+ default: "onScrollDown",+ })}+ labelVisibilityMode={Platform.select({ android: "labeled" })}+ ><NativeTabs.Trigger name="(home)"><Iconsf="house.fill"@@ -50,12 +59,18 @@ export default function TabLayout() {<Label>Highlights</Label></NativeTabs.Trigger>- <NativeTabs.Trigger name="(settings)">+ <NativeTabs.Trigger+ name="(search)"+ hidden={Platform.OS === "android"}+ role={isIOS26 ? "search" : undefined}+ ><Icon- sf="gearshape.fill"- androidSrc={<VectorIcon family={MaterialCommunityIcons} name="cog" />}+ sf="magnifyingglass"+ androidSrc={+ <VectorIcon family={MaterialCommunityIcons} name="magnify" />+ }/>- <Label>Settings</Label>+ <Label>Search</Label></NativeTabs.Trigger></NativeTabs>);diff --git a/apps/mobile/app/dashboard/_layout.tsx b/apps/mobile/app/dashboard/_layout.tsxindex 1f9fc292..971e12dc 100644--- a/apps/mobile/app/dashboard/_layout.tsx+++ b/apps/mobile/app/dashboard/_layout.tsx@@ -158,15 +158,16 @@ export default function Dashboard() {}}/><Stack.Screen- name="search"+ name="settings/index"options={{- headerTitle: "",- headerBackTitle: "",- headerShown: true,+ headerTitle: "Settings",headerTransparent: false,headerLargeTitle: false,- animation: "fade_from_bottom",- animationDuration: 100,+ presentation: Platform.select({+ ios: "formSheet" as const,+ default: "modal" as const,+ }),+ sheetGrabberVisible: true,}}/><Stack.Screendiff --git a/apps/mobile/app/dashboard/search.tsx b/apps/mobile/app/dashboard/search.tsxdeleted file mode 100644index 207dd119..00000000--- a/apps/mobile/app/dashboard/search.tsx+++ /dev/null@@ -1,157 +0,0 @@-import { useMemo, useRef, useState } from "react";-import { FlatList, Keyboard, Pressable, TextInput, View } from "react-native";-import { router } from "expo-router";-import BookmarkList from "@/components/bookmarks/BookmarkList";-import FullPageError from "@/components/FullPageError";-import FullPageSpinner from "@/components/ui/FullPageSpinner";-import { SearchInput } from "@/components/ui/SearchInput";-import { Text } from "@/components/ui/Text";-import AsyncStorage from "@react-native-async-storage/async-storage";-import {- keepPreviousData,- useInfiniteQuery,- useQueryClient,-} from "@tanstack/react-query";--import { useSearchHistory } from "@karakeep/shared-react/hooks/search-history";-import { useDebounce } from "@karakeep/shared-react/hooks/use-debounce";-import { useTRPC } from "@karakeep/shared-react/trpc";--const MAX_DISPLAY_SUGGESTIONS = 5;--export default function Search() {- const [search, setSearch] = useState("");-- const query = useDebounce(search, 10);- const inputRef = useRef<TextInput>(null);-- const [isInputFocused, setIsInputFocused] = useState(true);- const { history, addTerm, clearHistory } = useSearchHistory({- getItem: (k: string) => AsyncStorage.getItem(k),- setItem: (k: string, v: string) => AsyncStorage.setItem(k, v),- removeItem: (k: string) => AsyncStorage.removeItem(k),- });-- const api = useTRPC();- const queryClient = useQueryClient();-- const onRefresh = () => {- queryClient.invalidateQueries(api.bookmarks.searchBookmarks.pathFilter());- };-- const { data, error, refetch, isPending, fetchNextPage, isFetchingNextPage } =- useInfiniteQuery(- api.bookmarks.searchBookmarks.infiniteQueryOptions(- { text: query },- {- placeholderData: keepPreviousData,- gcTime: 0,- initialCursor: null,- getNextPageParam: (lastPage) => lastPage.nextCursor,- },- ),- );-- const filteredHistory = useMemo(() => {- if (search.trim().length === 0) {- // Show recent items when not typing- return history.slice(0, MAX_DISPLAY_SUGGESTIONS);- }- // Show filtered items when typing- return history- .filter((item) => item.toLowerCase().includes(search.toLowerCase()))- .slice(0, MAX_DISPLAY_SUGGESTIONS);- }, [search, history]);-- if (error) {- return <FullPageError error={error.message} onRetry={() => refetch()} />;- }-- const handleSearchSubmit = (searchTerm: string) => {- const term = searchTerm.trim();- if (term.length > 0) {- addTerm(term);- setSearch(term);- }- inputRef.current?.blur();- Keyboard.dismiss();- };-- const renderHistoryItem = ({ item }: { item: string }) => (- <Pressable- onPress={() => handleSearchSubmit(item)}- className="border-b border-gray-200 p-3"- >- <Text className="text-foreground">{item}</Text>- </Pressable>- );-- const handleOnFocus = () => {- setIsInputFocused(true);- };-- const handleOnBlur = () => {- setIsInputFocused(false);- if (search.trim().length > 0) {- addTerm(search);- }- };-- return (- <>- <SearchInput- containerClassName="m-3"- ref={inputRef}- placeholder="Search"- className="flex-1"- value={search}- onChangeText={setSearch}- onFocus={handleOnFocus}- onBlur={handleOnBlur}- onSubmitEditing={() => handleSearchSubmit(search)}- returnKeyType="search"- autoFocus- autoCapitalize="none"- onCancel={router.back}- />-- {isInputFocused && search.trim().length === 0 ? (- <FlatList- data={filteredHistory}- renderItem={renderHistoryItem}- keyExtractor={(item, index) => `${item}-${index}`}- ListHeaderComponent={- <View className="flex-row items-center justify-between p-3">- <Text className="text-sm font-bold text-gray-500">- Recent Searches- </Text>- {history.length > 0 && (- <Pressable onPress={clearHistory}>- <Text className="text-sm text-blue-500">Clear</Text>- </Pressable>- )}- </View>- }- ListEmptyComponent={- <Text className="p-3 text-center text-gray-500">- No matching searches.- </Text>- }- keyboardShouldPersistTaps="handled"- />- ) : isPending && query.length > 0 ? (- <FullPageSpinner />- ) : data && query.length > 0 ? (- <BookmarkList- bookmarks={data.pages.flatMap((p) => p.bookmarks)}- fetchNextPage={fetchNextPage}- isFetchingNextPage={isFetchingNextPage}- onRefresh={onRefresh}- isRefreshing={isPending}- />- ) : (- <View />- )}- </>- );-}diff --git a/apps/mobile/app/dashboard/(tabs)/(settings)/index.tsx b/apps/mobile/app/dashboard/settings/index.tsxsimilarity index 100%rename from apps/mobile/app/dashboard/(tabs)/(settings)/index.tsxrename to apps/mobile/app/dashboard/settings/index.tsxdiff --git a/apps/mobile/components/search/BookmarkSearchResults.tsx b/apps/mobile/components/search/BookmarkSearchResults.tsxnew file mode 100644index 00000000..eccaefc3--- /dev/null+++ b/apps/mobile/components/search/BookmarkSearchResults.tsx@@ -0,0 +1,93 @@+import { FlatList, Pressable, View } from "react-native";+import BookmarkList from "@/components/bookmarks/BookmarkList";+import FullPageError from "@/components/FullPageError";+import FullPageSpinner from "@/components/ui/FullPageSpinner";+import { Text } from "@/components/ui/Text";++import type { BookmarkSearchState } from "@/lib/useBookmarkSearchState";++interface BookmarkSearchResultsProps {+ rawSearch: string;+ isInputFocused: boolean;+ state: BookmarkSearchState;+ onSelectHistory: (term: string) => void;+}++export default function BookmarkSearchResults({+ rawSearch,+ state,+ onSelectHistory,+}: BookmarkSearchResultsProps) {+ const {+ history,+ filteredHistory,+ clearHistory,+ data,+ error,+ refetch,+ isPending,+ fetchNextPage,+ isFetchingNextPage,+ onRefresh,+ } = state;++ if (error) {+ return <FullPageError error={error.message} onRetry={() => refetch()} />;+ }++ const renderHistoryItem = ({ item }: { item: string }) => (+ <Pressable+ onPress={() => onSelectHistory(item)}+ className="border-b border-gray-200 p-3"+ >+ <Text className="text-foreground">{item}</Text>+ </Pressable>+ );++ if (rawSearch.trim().length === 0) {+ return (+ <FlatList+ contentInsetAdjustmentBehavior="automatic"+ data={filteredHistory}+ renderItem={renderHistoryItem}+ keyExtractor={(item, index) => `${item}-${index}`}+ ListHeaderComponent={+ <View className="flex-row items-center justify-between p-3">+ <Text className="text-sm font-bold text-gray-500">+ Recent Searches+ </Text>+ {history.length > 0 && (+ <Pressable onPress={clearHistory}>+ <Text className="text-sm text-blue-500">Clear</Text>+ </Pressable>+ )}+ </View>+ }+ ListEmptyComponent={+ <Text className="p-3 text-center text-gray-500">+ No recent searches+ </Text>+ }+ keyboardShouldPersistTaps="handled"+ />+ );+ }++ if (isPending) {+ return <FullPageSpinner />;+ }++ if (data) {+ return (+ <BookmarkList+ bookmarks={data.pages.flatMap((p) => p.bookmarks)}+ fetchNextPage={fetchNextPage}+ isFetchingNextPage={isFetchingNextPage}+ onRefresh={onRefresh}+ isRefreshing={isPending}+ />+ );+ }++ return null;+}diff --git a/apps/mobile/components/search/InlineSearch.tsx b/apps/mobile/components/search/InlineSearch.tsxnew file mode 100644index 00000000..5778156a--- /dev/null+++ b/apps/mobile/components/search/InlineSearch.tsx@@ -0,0 +1,82 @@+import { useRef, useState } from "react";+import { Pressable, TextInput, View } from "react-native";+import { useSafeAreaInsets } from "react-native-safe-area-context";+import BookmarkSearchResults from "@/components/search/BookmarkSearchResults";+import { useBookmarkSearchState } from "@/lib/useBookmarkSearchState";+import { TailwindResolver } from "@/components/TailwindResolver";+import { SearchInput } from "@/components/ui/SearchInput";+import { XIcon } from "lucide-react-native";++interface InlineSearchProps {+ onClose: () => void;+ rightElement?: React.ReactNode;+}++export default function InlineSearch({+ onClose,+ rightElement,+}: InlineSearchProps) {+ const [search, setSearch] = useState("");+ const [isInputFocused, setIsInputFocused] = useState(true);+ const inputRef = useRef<TextInput>(null);+ const insets = useSafeAreaInsets();+ const state = useBookmarkSearchState(search);++ const handleSearchSubmit = () => {+ state.commitTerm(search);+ inputRef.current?.blur();+ };++ const handleSelectHistory = (term: string) => {+ setSearch(term);+ state.commitTerm(term);+ inputRef.current?.blur();+ };++ return (+ <View className="flex-1 bg-background">+ <View+ className="flex-row items-center gap-2 px-4 pb-2 pt-2"+ style={{ paddingTop: insets.top + 8 }}+ >+ <View className="flex-1">+ <SearchInput+ ref={inputRef}+ placeholder="Search bookmarks..."+ value={search}+ onChangeText={setSearch}+ onFocus={() => setIsInputFocused(true)}+ onBlur={() => {+ setIsInputFocused(false);+ state.commitTerm(search);+ }}+ onSubmitEditing={handleSearchSubmit}+ returnKeyType="search"+ autoFocus+ autoCapitalize="none"+ />+ </View>+ {rightElement}+ <Pressable+ onPress={onClose}+ accessibilityLabel="Close"+ accessibilityRole="button"+ className="p-1"+ >+ <TailwindResolver+ className="text-muted-foreground"+ comp={(styles) => (+ <XIcon size={22} color={styles?.color?.toString()} />+ )}+ />+ </Pressable>+ </View>+ <BookmarkSearchResults+ rawSearch={search}+ isInputFocused={isInputFocused}+ state={state}+ onSelectHistory={handleSelectHistory}+ />+ </View>+ );+}diff --git a/apps/mobile/components/settings/ProfileAvatarButton.tsx b/apps/mobile/components/settings/ProfileAvatarButton.tsxnew file mode 100644index 00000000..b7ddb8a7--- /dev/null+++ b/apps/mobile/components/settings/ProfileAvatarButton.tsx@@ -0,0 +1,29 @@+import { Pressable } from "react-native";+import { useRouter } from "expo-router";+import { Avatar } from "@/components/ui/Avatar";+import { useQuery } from "@tanstack/react-query";++import { useTRPC } from "@karakeep/shared-react/trpc";++const AVATAR_SIZE = 28;+const HIT_TARGET = 44;++export function ProfileAvatarButton() {+ const router = useRouter();+ const api = useTRPC();+ const { data } = useQuery(api.users.whoami.queryOptions());++ return (+ <Pressable+ onPress={(e) => {+ e.stopPropagation();+ router.push("/dashboard/settings");+ }}+ hitSlop={(HIT_TARGET - AVATAR_SIZE) / 2}+ accessibilityLabel="Open profile settings"+ accessibilityRole="button"+ >+ <Avatar image={data?.image} name={data?.name} size={AVATAR_SIZE} />+ </Pressable>+ );+}diff --git a/apps/mobile/components/ui/AndroidSearchBar.tsx b/apps/mobile/components/ui/AndroidSearchBar.tsxnew file mode 100644index 00000000..1848cbf1--- /dev/null+++ b/apps/mobile/components/ui/AndroidSearchBar.tsx@@ -0,0 +1,45 @@+import { Pressable, View } from "react-native";+import { useSafeAreaInsets } from "react-native-safe-area-context";+import { TailwindResolver } from "@/components/TailwindResolver";+import { Text } from "@/components/ui/Text";+import { useIsFocused } from "@react-navigation/core";+import { Search } from "lucide-react-native";++export default function AndroidSearchBar({+ label,+ onPress,+ rightElement,+}: {+ label: string;+ onPress: () => void;+ rightElement?: React.ReactNode;+}) {+ const insets = useSafeAreaInsets();+ const isFocused = useIsFocused();++ return (+ <View+ style={{+ paddingTop: insets.top + 8,+ marginBottom: 15,+ opacity: isFocused ? 1 : 0,+ }}+ className="bg-background px-4 pb-2 pt-2"+ >+ <Pressable+ className="flex flex-row items-center gap-4 rounded-full border-input bg-card px-4 py-2"+ style={{ minHeight: 56 }}+ onPress={onPress}+ >+ <TailwindResolver+ className="text-muted"+ comp={(styles) => (+ <Search size={24} color={styles?.color?.toString()} />+ )}+ />+ <Text className="flex-1 text-[17px] text-muted">{label}</Text>+ {rightElement}+ </Pressable>+ </View>+ );+}diff --git a/apps/mobile/components/ui/FAB/FAB.ios.tsx b/apps/mobile/components/ui/FAB/FAB.ios.tsxnew file mode 100644index 00000000..a087422d--- /dev/null+++ b/apps/mobile/components/ui/FAB/FAB.ios.tsx@@ -0,0 +1,51 @@+import type { ReactNode } from "react";+import { StyleSheet, View } from "react-native";+import { useSafeAreaInsets } from "react-native-safe-area-context";+import { BlurView } from "expo-blur";+import { GlassView, isGlassEffectAPIAvailable } from "expo-glass-effect";+import { isIOS26 } from "@/lib/ios";++const shouldUseGlass = isIOS26 && isGlassEffectAPIAvailable();+const SIZE = 62;++export function FAB({ children }: { children: ReactNode }) {+ const insets = useSafeAreaInsets();++ return (+ <View+ style={[+ styles.container,+ {+ bottom: insets.bottom + (isIOS26 ? 57 : 60),+ right: isIOS26 ? 21 : 16,+ },+ ]}+ >+ {shouldUseGlass ? (+ <GlassView glassEffectStyle="regular" style={styles.button}>+ {children}+ </GlassView>+ ) : (+ <BlurView tint="systemMaterial" intensity={80} style={styles.button}>+ {children}+ </BlurView>+ )}+ </View>+ );+}++const styles = StyleSheet.create({+ container: {+ position: "absolute",+ zIndex: 10,+ },+ button: {+ width: SIZE,+ height: SIZE,+ borderRadius: SIZE / 2,+ borderCurve: "continuous",+ alignItems: "center",+ justifyContent: "center",+ overflow: "hidden",+ },+});diff --git a/apps/mobile/components/ui/FAB/FAB.tsx b/apps/mobile/components/ui/FAB/FAB.tsxnew file mode 100644index 00000000..bafcad86--- /dev/null+++ b/apps/mobile/components/ui/FAB/FAB.tsx@@ -0,0 +1,44 @@+import type { ReactNode } from "react";+import { StyleSheet, View } from "react-native";+import { useSafeAreaInsets } from "react-native-safe-area-context";+import { useColorScheme } from "@/lib/useColorScheme";+import { COLORS } from "@/theme/colors";++const SIZE = 56;+// Android M3 bottom navigation is ~80dp + 16dp gap+const TAB_BAR_CLEARANCE = 96;++export function FAB({ children }: { children: ReactNode }) {+ const insets = useSafeAreaInsets();+ const { colorScheme } = useColorScheme();+ const primaryColor = COLORS[colorScheme].primary;++ return (+ <View+ style={[+ styles.container,+ { bottom: insets.bottom + TAB_BAR_CLEARANCE, right: 16 },+ ]}+ >+ <View style={[styles.button, { backgroundColor: primaryColor }]}>+ {children}+ </View>+ </View>+ );+}++const styles = StyleSheet.create({+ container: {+ position: "absolute",+ zIndex: 10,+ },+ button: {+ width: SIZE,+ height: SIZE,+ borderRadius: 16,+ alignItems: "center",+ justifyContent: "center",+ elevation: 6,+ overflow: "hidden",+ },+});diff --git a/apps/mobile/components/ui/FAB/index.ts b/apps/mobile/components/ui/FAB/index.tsnew file mode 100644index 00000000..40b373a5--- /dev/null+++ b/apps/mobile/components/ui/FAB/index.ts@@ -0,0 +1 @@+export { FAB } from "./FAB";diff --git a/apps/mobile/lib/tabScreenOptions.ts b/apps/mobile/lib/tabScreenOptions.tsnew file mode 100644index 00000000..0632eb07--- /dev/null+++ b/apps/mobile/lib/tabScreenOptions.ts@@ -0,0 +1,37 @@+import type { NativeStackNavigationOptions } from "@react-navigation/native-stack";+import { Platform } from "react-native";++import { isIOS26 } from "./ios";++/**+ * Shared screen options for tab stack navigators.+ *+ * iOS: Large title with transparent/blur header (Liquid Glass on iOS 26).+ *+ * Android:+ * - `headerShown: false` — headers are rendered as inline React content+ * (AndroidSearchBar / InlineSearch) to avoid native header z-index issues.+ * - `contentStyle.paddingBottom: 100` compensates for the native tab bar overlapping+ * content. Should be removed when expo fixes this in SDK 55.+ */+export const tabScreenOptions: NativeStackNavigationOptions = {+ ...Platform.select({+ ios: {+ headerLargeTitle: true,+ headerTransparent: true,+ headerBlurEffect: isIOS26 ? undefined : ("systemMaterial" as const),+ headerLargeTitleShadowVisible: false,+ headerLargeStyle: { backgroundColor: "transparent" },+ },+ android: {+ headerStyle: {+ backgroundColor: "transparent",+ },+ contentStyle: {+ // Manual padding to avoid the native tab bar until expo fixes this in SDK 55.+ paddingBottom: 100,+ },+ },+ }),+ headerShadowVisible: false,+};diff --git a/apps/mobile/lib/useBookmarkSearchState.ts b/apps/mobile/lib/useBookmarkSearchState.tsnew file mode 100644index 00000000..bc24f360--- /dev/null+++ b/apps/mobile/lib/useBookmarkSearchState.ts@@ -0,0 +1,79 @@+import { useMemo } from "react";+import AsyncStorage from "@react-native-async-storage/async-storage";+import {+ keepPreviousData,+ useInfiniteQuery,+ useQueryClient,+} from "@tanstack/react-query";++import { useSearchHistory } from "@karakeep/shared-react/hooks/search-history";+import { useDebounce } from "@karakeep/shared-react/hooks/use-debounce";+import { useTRPC } from "@karakeep/shared-react/trpc";++const MAX_DISPLAY_SUGGESTIONS = 5;+const DEBOUNCE_MS = 10;++export function useBookmarkSearchState(rawSearch: string) {+ const query = useDebounce(rawSearch, DEBOUNCE_MS);++ const { history, addTerm, clearHistory } = useSearchHistory({+ getItem: (k: string) => AsyncStorage.getItem(k),+ setItem: (k: string, v: string) => AsyncStorage.setItem(k, v),+ removeItem: (k: string) => AsyncStorage.removeItem(k),+ });++ const api = useTRPC();+ const queryClient = useQueryClient();++ const onRefresh = () => {+ queryClient.invalidateQueries(api.bookmarks.searchBookmarks.pathFilter());+ };++ const { data, error, refetch, isPending, fetchNextPage, isFetchingNextPage } =+ useInfiniteQuery(+ api.bookmarks.searchBookmarks.infiniteQueryOptions(+ { text: query },+ {+ enabled: query.trim().length > 0,+ placeholderData: keepPreviousData,+ gcTime: 0,+ initialCursor: null,+ getNextPageParam: (lastPage) => lastPage.nextCursor,+ },+ ),+ );++ const filteredHistory = useMemo(() => {+ if (rawSearch.trim().length === 0) {+ return history.slice(0, MAX_DISPLAY_SUGGESTIONS);+ }+ return history+ .filter((item) => item.toLowerCase().includes(rawSearch.toLowerCase()))+ .slice(0, MAX_DISPLAY_SUGGESTIONS);+ }, [rawSearch, history]);++ const commitTerm = (term: string) => {+ const normalized = term.trim();+ if (normalized.length > 0) {+ addTerm(normalized);+ }+ };++ return {+ query,+ history,+ filteredHistory,+ addTerm,+ commitTerm,+ clearHistory,+ data,+ error,+ refetch,+ isPending,+ fetchNextPage,+ isFetchingNextPage,+ onRefresh,+ };+}++export type BookmarkSearchState = ReturnType<typeof useBookmarkSearchState>;