Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mobile app architecture and initial screens (#2144)
* feat: initialize mobile app with Expo setup and configuration * chore: update deps * feat: update layout and integrate WebView for follow * chore: update lock * chore: lint * chore: lock file * feat: login with deeplink * feat: auth * feat: add Expo development script and refactor mobile app configuration - Added a new development script for Expo in package.json. - Refactored the app.config.ts to configure expo-router with a specified root. - Removed unused files: _layout.tsx, auth.tsx, and index.tsx from the mobile app directory, streamlining the codebase. Signed-off-by: Innei <tukon479@gmail.com> * feat: update dependencies and enhance mobile app configuration - Added new dependencies: nativewind, swiftui-react-native, and tailwindcss to improve styling capabilities. - Updated react-native-reanimated version to 3.16.5 for better performance. - Refactored tailwind configuration to use baseTwConfig for consistency across applications. - Enhanced mobile layout with color scheme toggle functionality and improved button styling. - Included type definitions for nativewind in shim-env.d.ts. Signed-off-by: Innei <tukon479@gmail.com> * refactor: streamline color configuration and enhance authentication UI - Updated tailwind configuration to simplify color definitions, removing unnecessary color mappings and using CSS variables for palette colors. - Refactored authentication screen to utilize new color scheme and improved styling for better user experience. - Introduced a function to retrieve current colors based on the system theme, enhancing dynamic styling capabilities. Signed-off-by: Innei <tukon479@gmail.com> * feat: add tab - Refactored app.config.ts to use resolved paths for icon assets, improving path management. - Enhanced RootLayout component by adding additional Stack.Screen elements for better navigation structure. - Removed unused authentication and index screens to streamline the codebase and improve maintainability. Signed-off-by: Innei <tukon479@gmail.com> * feat: add new icons and update mobile app configuration - Introduced multiple new icon components for enhanced UI representation in the mobile app. - Updated package.json and pnpm-lock.yaml to include new dependencies and ensure proper package management. - Refactored mobile screens (_layout.tsx, home.tsx, auth.tsx) for improved structure and navigation. Signed-off-by: Innei <tukon479@gmail.com> * chore: init debug screen - Added a new Link component in RootLayout for debugging purposes, improving navigation capabilities. - Adjusted the position of the existing button in RootLayout to enhance UI layout. - Refactored HeadlessLayout to ensure proper closing of Stack component. - Updated home screen to include Link and removed unused components for cleaner code. Signed-off-by: Innei <tukon479@gmail.com> Signed-off-by: Innei <i@innei.in> * feat: app route layer Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance mobile app layout and navigation - Updated RootLayout to include a new Stack.Screen for "Add Subscription" with customized header styles. - Refactored TabLayout to improve tab bar styling and adjusted icon sizes for better visual consistency. - Replaced List component with ScrollView in FeedList, adding header actions for editing and navigation to the add screen. - Introduced accentColor in the theme for consistent color usage across components. Signed-off-by: Innei <tukon479@gmail.com> * fix: navigation theme Signed-off-by: Innei <tukon479@gmail.com> * refactor: update layout components and streamline navigation - Removed unused headerTintColor from AppRootLayout for cleaner code. - Simplified TabLayout by removing unnecessary screenOptions, enhancing readability. - Updated RootLayout to import navigation themes from local theme file, improving theme management. Signed-off-by: Innei <tukon479@gmail.com> * feat: update dependencies and refactor mobile app components - Added new dependencies: @follow/constants, jotai, and zustand to enhance state management and component functionality. - Updated package.json and pnpm-lock.yaml to reflect new dependencies and their versions. - Removed the Logo component to streamline the codebase. - Refactored FeedList and TabLayout components to improve layout and navigation, including the addition of themed blur views for better UI consistency. Signed-off-by: Innei <tukon479@gmail.com> * feat: integrate React Native Bottom Tabs * refactor: use native bottom tab * chore: jsx preserve for ts config * Revert "refactor: use native bottom tab" This reverts commit e937047. * feat: enhance tab bar icons in TabLayout - Updated TabLayout to use different icons based on tab focus state, improving user experience. - Introduced SafariCuteFi and Setting7CuteFi icons for the "Discover" and "Settings" tabs, respectively. - Adjusted icon sizes for better visual consistency across the tab bar. Signed-off-by: Innei <tukon479@gmail.com> * feat: add withFollowAssets plugin for managing asset resources * feat: add FollowWebView component * chore: set base path to current directory in vite config * refactor: rename withFollowAssets.js to with-follow-assets.js and add error handling for missing assets directory * feat: debug for webview Signed-off-by: Innei <tukon479@gmail.com> * chore(lint): correct tailwind config for mobile * fix: share cookie with webview * fix: redirect to home for webview * fix: bring cookie inject back * feat: init db Signed-off-by: Innei <tukon479@gmail.com> * fix: inject js * fix: add shared env * feat: useAuthCookie * fix: save token * chore: update icon * chore: add note * feat: init auth client * feat: simple auth flow * refactor: use cookie-es * chore: remove unstable_enablePackageExports * chore: remove auth page * chore: update dependencies and refactor storage management - Added '@follow/shared' package to pnpm-lock and package.json. - Updated 'hono' and 'ofetch' dependencies in package.json. - Removed 'react-native-mmkv' and its related storage implementation. - Refactored layout to use 'RootProviders' for better context management. - Updated API fetch headers to include application name. - Changed '@electron/node-gyp' resolution method to use git URL. Signed-off-by: Innei <tukon479@gmail.com> * chore: update dependencies and add subscriptions schema - Added 'immer' dependency to package.json and pnpm-lock.yaml. - Updated '@electron/node-gyp' resolution method to use tarball URL. - Introduced 'subscriptionsTable' schema in the database for managing user subscriptions. Signed-off-by: Innei <tukon479@gmail.com> * chore: remove unused config * chore: remove unused code * chore: signout for debug * refactor: use kv as auth storage * chore: remove expo-secure-store, see better-auth/better-auth#928 * fix: logout from native * feat: react-hook-form * feat: simple ui * chore: auto-fix linting and formatting issues * feat: sn pro font * chore: auto-fix linting and formatting issues * feat: enhance database schema and API error handling; improve feed list functionality * feat: update ThemedBlurView and enhance feed list with new subscription handling Signed-off-by: Innei <tukon479@gmail.com> * chore: remove login url env * feat: implement navigation handling in FollowWebView * feat: make social login work * chore: update * feat: update environment variables, add dayjs dependency, enhance database schema integration, and improve subscription handling with transaction support Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance tab layout and feed list with improved ThemedBlurView integration and dynamic tab height adjustment - Updated tab bar background and style in TabLayout for better visual consistency. - Integrated useBottomTabBarHeight in FeedList to dynamically adjust layout based on tab height. - Enhanced SubscriptionList header background with ThemedBlurView for improved aesthetics. - Added styles for tab container to maintain consistent appearance across screens. Signed-off-by: Innei <tukon479@gmail.com> * refactor: move video URL handling to utils * feat: integrate utility functions for URL handling in FollowWebView * chore: update lock * fix: workaround potential null value in remoteSettings.updated * feat: enhance FeedList layout with dynamic header and tab height adjustments - Integrated useHeaderHeight to dynamically adjust the ScrollView's content inset based on the header height. - Updated scrollIndicatorInsets to improve scrolling experience by accounting for safe area insets. - Ensured consistent layout adjustments for better visual alignment with the tab bar. Signed-off-by: Innei <tukon479@gmail.com> * chore: update dependencies and configure babel-plugin-module-resolver - Added babel-plugin-module-resolver version 5.0.2 to package.json for improved module resolution. - Configured babel.config.js to use module-resolver with custom alias for es-toolkit. - Updated pnpm-lock.yaml to reflect new dependencies and their resolutions. - Refactored import statement in utils.ts to use the updated es-toolkit import path. Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance database integration and add SQL support - Added support for SQL file imports in the mobile app by configuring babel-plugin-inline-import and updating metro.config.js to recognize .sql file extensions. - Introduced new database migrations for improved data management, including the addition of a new migration file. - Updated the drizzle migration logic to include the new migration. - Enhanced the database initialization process to support the new subscription service. - Refactored the hydrate function to streamline database hydration and improve performance. Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance database functionality - Added expo-clipboard and expo-file-system dependencies to the mobile app for improved file handling and clipboard functionality. - Implemented a new function to retrieve the SQLite database path using expo-file-system. - Enhanced the DebugPanel to include options for clearing SQLite data and copying the database file location to the clipboard. - Updated pnpm-lock.yaml and package.json to reflect the new dependencies and their versions. Signed-off-by: Innei <tukon479@gmail.com> * feat: implement session token management and enhance DebugPanel - Removed unused session token handling from apiFetch. - Updated cookie management functions to include synchronous storage with kv for session tokens. - Added functionality to get and set session tokens in the DebugPanel, allowing users to view and save session tokens. - Improved user interface in DebugPanel for better session token management. Signed-off-by: Innei <tukon479@gmail.com> * fix: handle keyboard * feat: enhance layout and subscription service functionality - Added BugCuteReIcon to the RootLayout for improved user interface. - Updated the upsertMany method in SubscriptionService to handle conflicts during database insertions, ensuring data integrity by using SQL's onConflictDoUpdate. Signed-off-by: Innei <tukon479@gmail.com> * refactor: update FeedList component with improved pressable interactions and remove unused code - Deleted unused .gitkeep file in mobile modules directory. - Enhanced SubscriptionItem to use Pressable for better user interaction feedback. - Removed redundant text displays for subscription IDs and current view in SubscriptionList. - Added state management for press interactions to visually indicate button presses. Signed-off-by: Innei <tukon479@gmail.com> * chore: reduce bundle size Signed-off-by: Innei <tukon479@gmail.com> * fix: cookie * fix: cookie name * fix: update iOS URI for FollowWebView * chore: eas link Signed-off-by: Innei <tukon479@gmail.com> * chore: update @better-auth/expo * chore: format * chore: fix can not click debug button * chore: add expo-drizzle-studio-plugin * chore: turn off typechecked rules in eslint * chore: pan debug button Signed-off-by: Innei <tukon479@gmail.com> * fix: dark mode in rn webview * chore: update * fix: detect safari in webview * fix: try fix db init Signed-off-by: Innei <tukon479@gmail.com> * refactor: adjust layout and improve tab view in FeedList component - Reduced bottom view tab height from 45 to 35. - Updated ScrollView content insets for better layout. - Replaced static tab view with a horizontally scrollable tab view. - Enhanced tab item styling for better visual feedback on selection. Signed-off-by: Innei <tukon479@gmail.com> * refactor: simplify FeedList component by removing unused code and optimizing imports - Removed unused imports and components to streamline the FeedList. - Consolidated the tab view logic and improved the overall structure. - Enhanced readability by eliminating redundant code and simplifying the component's layout. Signed-off-by: Innei <tukon479@gmail.com> * refactor: enhance subscription sorting in useSubscriptionByView hook - Updated useSubscriptionByView to accept a sorting parameter, defaulting to "alphabet". - Implemented sorting logic for subscription IDs based on alphabetical order. - Introduced a new helper function, sortByAlphabet, to compare subscriptions by title. - Improved the overall functionality of the subscription list in the FeedList component. Signed-off-by: Innei <tukon479@gmail.com> * refactor: data schemas and improve feed and subscription handling - Renamed FeedModel to FeedSchema and SubscriptionModel to SubscriptionSchema for consistency. - Introduced new InboxSchema and ListSchema to enhance data structure. - Updated FeedService and SubscriptionService to utilize the new schemas. - Refactored the FeedList component to support grouped and ungrouped subscriptions. - Removed unused Morph class and related types to clean up the codebase. - Enhanced sorting logic for subscriptions in the useSubscriptionByView hook. Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * fix: enhance FeedIcon styling for dark mode compatibility Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * feat: enhance FeedList component with animated accordion for grouped subscriptions - Introduced animated accordion functionality in the CategoryGrouped component to improve user experience when viewing grouped subscriptions. - Replaced static toggle with AnimatedTouchableOpacity for better visual feedback. - Updated the layout and styling of the CategoryGrouped component for improved aesthetics. - Adjusted ScrollView in FeedList to include right scroll indicator insets for better layout. Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * refactor: update database schema and migration files - Removed obsolete SQL migration files for `bitter_bloodstrike` and `ancient_dexter_bennett`. - Updated migration scripts to reflect new table structures and relationships. - Enhanced `migrations.js` to import new migration files. - Adjusted `_journal.json` and snapshot files to align with the new schema. - Added error handling and logging in migration processes. - Improved database initialization with logging capabilities. - Refactored subscription handling in the store to accommodate new schema changes. Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * feat: enhance FeedList component with ItemPressable for improved interaction - Replaced static Pressable components with ItemPressable in CategoryGrouped and SubscriptionItem for better touch handling. - Updated the layout of CategoryGrouped to include a pressable area for category navigation. - Added a new utility function, composeEventHandlers, to facilitate event handling in the utils package. Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * refactor: restructure FeedIcon and enhance list handling in FeedList component - Removed the FeedIcon component to streamline icon handling. - Updated FeedList component to include a new ListList section for displaying lists. - Introduced ListSubscriptionItem for rendering individual list items with fallback support for missing images. - Enhanced state management in the list store to utilize a record structure for lists and list IDs. - Improved subscription handling by adding list subscriptions to the subscription store. Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * feat: enhance FeedList and ViewTab components with new features and styling improvements - Added a new StarItem component to the FeedList for collections navigation. - Updated ListList and SubscriptionItem components for improved layout and spacing. - Enhanced ViewTab with increased horizontal padding and a bottom border for better visual separation. - Adjusted icon sizes in ViewTab for consistency. Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * feat: apple sign in, not work yet * chore: bring type check lint back * feat: enhance mobile app components and linting configuration - Added a new ESLint rule for preventing leaked conditional rendering in React. - Updated the initialization process in main.ts to ensure proper loading of the expo-router. - Enhanced the FeedList component by integrating the HeaderBlur for improved header styling and added routing functionality in SubscriptionItem for better navigation. - Modified the Add screen to include a Stack.Screen for improved navigation handling. Signed-off-by: Innei <tukon479@gmail.com> * chore: enable no-inline-styles * chore: update * chore: auto-fix linting and formatting issues * feat: enhance feed-list functionality with new components and dependencies - Added react-native-pager-view for improved navigation between feed views. - Introduced ViewPageCurrentViewContext for managing the current view state in the feed list. - Updated SubscriptionList to utilize PagerView for dynamic content rendering. - Enhanced ListList to use the new context for better state management. - Refactored imports for consistency and clarity. This update improves the user experience by allowing seamless transitions between different feed types. * feat: improve ViewTab component with animated tab indicator and dynamic scrolling - Added animated indicator for the currently selected tab, enhancing visual feedback. - Implemented dynamic scrolling to the selected tab using ScrollView reference. - Introduced state management for tab widths and positions to support the animation. - Updated tab rendering to capture layout dimensions for improved responsiveness. This update enhances the user experience by providing a smoother and more interactive tab navigation. Signed-off-by: Innei <tukon479@gmail.com> * fix: lockfile Signed-off-by: Innei <tukon479@gmail.com> * refactor: video URL transformation * fix: web dev * chore: add URL linking functionality to Add screen * chore: expo update config * feat: enhance feed-list and configuration with new features and optimizations - Updated app configuration to support dark mode for splash screen background. - Refactored feed-list components to utilize Jotai for state management, improving performance and readability. - Introduced new hooks for managing current view state, enhancing the user experience. - Implemented animated tab indicators and dynamic scrolling in ViewTab for better navigation feedback. - Cleaned up imports and improved overall code structure for maintainability. These changes collectively enhance the functionality and user experience of the feed-list feature in the mobile app. Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * feat: integrate gesture handling and state management for feed view - Added Jotai state management for current feed view, allowing dynamic updates. - Implemented double-tap gesture to switch to the Articles view, enhancing user interaction. - Wrapped the main provider in GestureHandlerRootView to support gesture handling. - Updated tab layout to utilize gesture detection for improved navigation experience. These changes collectively enhance the functionality and interactivity of the feed-list feature in the mobile app. Signed-off-by: Innei <tukon479@gmail.com> * chore: update prepare script * chore: prepare for rn web build * feat: add inbox management and improve list handling in feed view - Introduced InboxList and InboxItem components to display inboxes within the Articles view. - Enhanced state management by implementing useInboxSubscription for fetching inbox data. - Updated ListService and SubscriptionService to use upsertManyInSession for improved session handling. - Refactored inbox store to utilize createZustandStore for better state management. - Added inboxIdByView to SubscriptionState for managing inbox subscriptions by view type. These changes collectively enhance the feed-list feature by integrating inbox management, improving data handling, and optimizing state management in the mobile app. Signed-off-by: Innei <tukon479@gmail.com> * chore: auto-fix linting and formatting issues * feat: enhance mobile app with new context menu and unread management - Added `react-native-context-menu-view` version 1.16.0 to support context menus in the mobile app. - Implemented new `unread` table schema to track unread counts for subscriptions. - Updated `FeedList` and `ViewTab` components to display unread counts dynamically. - Refactored inbox management to improve session handling with `upsertManyInSession`. - Enhanced state management by integrating unread counts into subscription hooks. These changes collectively improve user experience by providing context menus and better unread message tracking in the mobile application. Signed-off-by: Innei <tukon479@gmail.com> * feat: integrate context menu and enhance unread management in feed list - Added ContextMenu component to ViewTab for marking all items as read. - Updated FeedList and ViewTab components to utilize context menus for improved user interaction. - Enhanced unread management by implementing markViewAsRead functionality in UnreadSyncService. - Refactored subscription getters and hooks to streamline data retrieval by view type. These changes collectively improve user experience by providing context menus for actions and better management of unread items in the mobile application. Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance feed list with swipeable actions and performance improvements - Integrated swipeable functionality in SubscriptionItem for better user interaction, allowing users to unsubscribe or read items directly. - Refactored styles for accordion icons to improve layout consistency. - Optimized animated styles in ViewTab for smoother transitions and reduced performance issues. - Consolidated spring configuration for animation to enhance maintainability. These changes collectively improve the user experience by providing intuitive swipe actions and enhancing the performance of the feed list in the mobile application. Signed-off-by: Innei <tukon479@gmail.com> * refactor: proxy creation to use evalCode for improved reusability * refactor: update Add screen to use router for navigation and handle deep linking * feat: implement deep linking support and refactor navigation handling in FollowWebView * fix: use hash router for rn web * chore: fill submit info * chore: autoIncrement version * fix: remove unnecessary width class to prevent unexpected scrolling * feat: improve login page ui * fix: disable state * refactor: enhance ViewTab layout and header background in FeedList Signed-off-by: Innei <tukon479@gmail.com> * feat: integrate react-native-reanimated and enhance feed list functionality - Added react-native-reanimated plugin to Babel configuration for improved animation support. - Updated metro configuration to wrap with reanimated settings. - Refactored AccordionItem to use withTiming for smoother animations. - Introduced JotaiPersistSyncStorage for persistent state management in feed list atoms. - Enhanced SubscriptionList to utilize FlashList for better performance and rendering. - Implemented sorting functionality in feed list with atom hooks for sort method and order. - Improved ViewTab component to handle tab scrolling more effectively. Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance feed list and debug panel functionality - Added color scheme support in InboxItem for dynamic icon coloring based on theme. - Updated FlashList padding to improve layout consistency. - Introduced a new "Reload App" button in the DebugPanel for easier app reloading. Signed-off-by: Innei <tukon479@gmail.com> * feat: sort Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance ItemPressable and refactor feed list interaction Signed-off-by: Innei <tukon479@gmail.com> * fix: padding safe for webview * chore: update FollowWebView background style * fix: enable hoverOnlyWhenSupported for rn web build * feat: subscription management ctx menu - Added '@follow/hooks' and 'usehooks-ts' as workspace dependencies in pnpm-lock.yaml and package.json. - Refactored AccordionItem to use withSpring for improved animation performance. - Introduced SubscriptionItemContextMenu for better context menu handling in feed list. - Updated subscription model to handle 'isPrivate' as a boolean. - Enhanced subscription store with new utility functions for managing subscription IDs and added patch functionality. - Improved reset functionality in subscription store to clear state by view. Signed-off-by: Innei <tukon479@gmail.com> * refactor: update API URL handling and enhance subscription management - Replaced direct usage of process.env.EXPO_PUBLIC_API_URL with a new getApiUrl() function across multiple files for improved maintainability. - Updated SubscriptionItemContextMenu to SubscriptionFeedItemContextMenu for better clarity in context menu handling. - Implemented a delete method in SubscriptionService to handle subscription removals and associated cleanup for feeds, lists, and inboxes. - Enhanced the unsubscribe functionality in SubscriptionSyncService to ensure proper state management during subscription deletions. Signed-off-by: Innei <tukon479@gmail.com> * feat: user management features and list and category ctx menu - Added a new migration script (m0004) for "majestic_thunderbolt_ross" to the SQLite migrations. - Updated the journal JSON to include the new migration entry. - Introduced a new users table schema to manage user data, including fields for id, email, handle, name, image, and isMe. - Refactored context menu actions in feeds to improve clarity and functionality. - Removed deprecated feed list components and consolidated related logic for better maintainability. - Updated RootProviders to ensure proper context management across the application. Signed-off-by: Innei <tukon479@gmail.com> * feat: enhance Add screen and layout for better user experience - Updated the AppRootLayout to include modal presentation for the "Add Subscription" screen. - Refactored the Add screen to improve navigation and user interaction, including a new header with close and search icons. - Introduced a state for managing the feed URL input, enhancing the user interface with appropriate styles and functionality. - Added new color handling in the theme to support disabled states and improve accessibility. Signed-off-by: Innei <tukon479@gmail.com> * style: update input field styling in Add screen for improved dark mode support - Modified the className of the URL input field in the Add screen to enhance its appearance in dark mode, ensuring better visibility and user experience. Signed-off-by: Innei <tukon479@gmail.com> * feat: update mobile app configuration and enhance subscription list interaction - Added application category type to the iOS infoPlist for better app classification. - Increased hitSlop on the AnimatedTouchableOpacity in the subscription list for improved touch responsiveness. - Un-commented the DebugButton in the layout to ensure it is always visible for debugging purposes. These changes aim to enhance the user experience and improve app visibility in app stores. Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com> Signed-off-by: Innei <i@innei.in> Co-authored-by: lawvs <18554747+lawvs@users.noreply.github.com> Co-authored-by: Innei <tukon479@gmail.com> Co-authored-by: Innei <i@innei.in> Co-authored-by: hyoban <hyoban@users.noreply.github.com> Co-authored-by: Innei <Innei@users.noreply.github.com>
- Loading branch information