Skip to content

Mobile app expansion (uniwind, dashboard/diary)#645

Merged
CodeWithCJ merged 3 commits intoCodeWithCJ:mainfrom
apedley:app-expansion-pr
Feb 10, 2026
Merged

Mobile app expansion (uniwind, dashboard/diary)#645
CodeWithCJ merged 3 commits intoCodeWithCJ:mainfrom
apedley:app-expansion-pr

Conversation

@apedley
Copy link
Copy Markdown
Contributor

@apedley apedley commented Feb 10, 2026

Expanded the mobile app by adding dashboard and diary screens. These screens are purely read only for now.
Migrated to uniwind (tailwindcss for react native)
Added tanstack query for API fetching, retrying, and caching
Updated theme and tweaked images
Restructured settings
Moved main screen to sync screen

I'm sorry about the giant PR!

@apedley apedley marked this pull request as ready for review February 10, 2026 00:25
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @apedley, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the SparkyFitness mobile application by introducing new Dashboard and Diary screens, providing users with detailed daily health insights. A major architectural shift involved migrating the styling to Uniwind (TailwindCSS for React Native) and integrating Tanstack Query for robust data management. These changes enhance the app's functionality, improve its visual consistency, and lay a strong foundation for future feature development by centralizing API interactions and state management.

Highlights

  • New Dashboard and Diary Screens: Introduced dedicated Dashboard and Diary screens to expand mobile app functionality, providing read-only views of daily health summaries, food entries, and exercise logs.
  • Uniwind (TailwindCSS for React Native) Migration: Migrated the mobile application's styling system to Uniwind, enabling the use of TailwindCSS for a more streamlined and consistent UI development experience across themes.
  • Tanstack Query Integration: Integrated Tanstack Query for efficient API data fetching, caching, retrying, and state management, significantly improving data handling and user experience.
  • Theme System Overhaul: Updated the application's theme system, including tweaks to existing images and the introduction of an AMOLED theme variant, leveraging Uniwind's theming capabilities.
  • Settings Restructuring and New Components: Restructured the Settings screen for better organization and introduced new UI components like CalorieRingCard, MacroCard, HydrationGauge, ExerciseProgressCard, FoodSummary, ExerciseSummary, DateNavigator, CalendarSheet, ServerConfigModal, and a cross-platform Icon component.
  • Main Screen Renamed to Sync Screen: The original MainScreen has been renamed to SyncScreen to more accurately reflect its primary function of health data synchronization.
  • Comprehensive API Service Refactor: Refactored API services into a modular structure (apiClient, exerciseApi, foodEntriesApi, goalsApi, healthDataApi, measurementsApi, preferencesApi, profileApi) and introduced dedicated Tanstack Query hooks (useDailySummary, useMeasurements, usePreferences, useProfile, useRefetchOnFocus, useServerConnection, useSyncHealthData, useWaterIntakeMutation) for each data domain.
Changelog
  • SparkyFitnessMobile/App.tsx
    • Integrated Uniwind for global styling and theme management.
    • Replaced MainScreen with SyncScreen in the tab navigator.
    • Added DashboardScreen and DiaryScreen to the tab navigator.
    • Introduced QueryClientProvider for Tanstack Query integration.
    • Implemented a custom navigation theme using Uniwind's CSS variables.
  • SparkyFitnessMobile/tests/MainScreen-test.tsx
    • Removed the test file for the deprecated MainScreen.
  • SparkyFitnessMobile/tests/SyncScreen-test.tsx
    • Added a new test file for the SyncScreen component, including QueryClientProvider setup.
  • SparkyFitnessMobile/tests/hooks/useDailySummary.test.ts
    • Added comprehensive unit tests for the useDailySummary hook, covering data fetching, calculations, and error handling.
  • SparkyFitnessMobile/tests/hooks/useMeasurements.test.ts
    • Added unit tests for the useMeasurements hook, verifying data retrieval and refetching behavior.
  • SparkyFitnessMobile/tests/hooks/usePreferences.test.ts
    • Added unit tests for the usePreferences hook, ensuring correct fetching and caching of user preferences.
  • SparkyFitnessMobile/tests/hooks/useProfile.test.ts
    • Added unit tests for the useProfile hook, validating profile data fetching and updates.
  • SparkyFitnessMobile/tests/hooks/useRefetchOnFocus.test.ts
    • Added unit tests for the useRefetchOnFocus utility hook, confirming refetch triggers on screen focus.
  • SparkyFitnessMobile/tests/hooks/useServerConnection.test.ts
    • Added unit tests for the useServerConnection hook, checking connection status and polling functionality.
  • SparkyFitnessMobile/tests/hooks/useSyncHealthData.test.ts
    • Added unit tests for the useSyncHealthData mutation hook, covering success, error, and alert behaviors.
  • SparkyFitnessMobile/tests/hooks/useWaterIntakeMutation.test.ts
    • Added unit tests for the useWaterIntakeMutation hook, including optimistic updates and error handling for water intake.
  • SparkyFitnessMobile/tests/services/apiClient.test.ts
    • Added unit tests for the new apiClient utility, covering URL normalization, request headers, and error handling.
  • SparkyFitnessMobile/tests/services/backgroundSyncService.test.ts
    • Updated mock imports to reflect the new API service structure.
  • SparkyFitnessMobile/tests/services/calculations.test.ts
    • Added unit tests for various calculation utility functions, including age, BMR, body fat, and calorie balance.
  • SparkyFitnessMobile/tests/services/exerciseApi.test.ts
    • Added unit tests for the exerciseApi functions, verifying data fetching and calorie calculations.
  • SparkyFitnessMobile/tests/services/foodEntriesApi.test.ts
    • Added unit tests for the foodEntriesApi functions, ensuring correct data fetching and macro calculations.
  • SparkyFitnessMobile/tests/services/goalsApi.test.ts
    • Added unit tests for the goalsApi functions, specifically fetchDailyGoals.
  • SparkyFitnessMobile/tests/services/healthConnectService.ios.test.ts
    • Updated mock imports to align with the new API service and HealthMetrics structure.
  • SparkyFitnessMobile/tests/services/healthConnectService.test.ts
    • Updated mock imports to align with the new API service and HealthMetrics structure.
  • SparkyFitnessMobile/tests/services/healthDataApi.test.ts
    • Renamed api.test.ts to healthDataApi.test.ts and updated internal references.
  • SparkyFitnessMobile/tests/services/healthconnect/index.test.ts
    • Updated mock imports to use the new HealthMetrics path.
  • SparkyFitnessMobile/tests/services/measurementsApi.test.ts
    • Added unit tests for the measurementsApi functions, covering fetching measurements, water intake, and water containers.
  • SparkyFitnessMobile/tests/services/preferencesApi.test.ts
    • Added unit tests for the preferencesApi functions, verifying preference data fetching.
  • SparkyFitnessMobile/tests/services/profileApi.test.ts
    • Added unit tests for the profileApi functions, ensuring profile data retrieval.
  • SparkyFitnessMobile/app.config.ts
    • Removed VERSION_CODE constant.
  • SparkyFitnessMobile/docs/api.md
    • Removed a trailing newline character.
  • SparkyFitnessMobile/global.css
    • Added a new global CSS file for TailwindCSS and Uniwind styling.
    • Defined custom CSS variables for light, dark, and AMOLED themes, covering various UI elements and semantic colors.
  • SparkyFitnessMobile/jest.setup.js
    • Added mocks for @shopify/react-native-skia and react-native-ui-datepicker to support testing new UI components.
  • SparkyFitnessMobile/metro.config.js
    • Integrated uniwind/metro configuration for TailwindCSS processing.
    • Configured cssEntryFile, dtsFile, and extraThemes for Uniwind.
    • Added minifierConfig to drop console logs in production builds.
  • SparkyFitnessMobile/package.json
    • Added new dependencies: @shopify/react-native-skia, @tanstack/react-query, expo-build-properties, expo-linear-gradient, expo-symbols, react-native-nitro-modules, react-native-svg, react-native-ui-datepicker, tailwindcss, uniwind, victory-native.
    • Removed axios dependency.
    • Removed @react-native-community/cli related dev dependencies.
    • Added expo-atlas dev dependency.
    • Updated transformIgnorePatterns in Jest configuration to include new modules.
  • SparkyFitnessMobile/src/HealthMetrics.ts
    • Added a new file defining HealthMetric interface and HEALTH_METRICS array, including platform-specific filtering and new icon paths.
  • SparkyFitnessMobile/src/components/AppearanceSettings.tsx
    • Refactored to use Uniwind's theming hooks (useThemePreference, setThemePreference) and TailwindCSS classes for styling.
  • SparkyFitnessMobile/src/components/BottomSheetPicker.tsx
    • Updated to use Uniwind theming (useUniwind, useCSSVariable) and the new Icon component.
    • Converted inline styles to TailwindCSS classes.
  • SparkyFitnessMobile/src/components/CalendarSheet.tsx
    • Added a new component for date selection using react-native-ui-datepicker within a BottomSheetModal, styled with Uniwind.
  • SparkyFitnessMobile/src/components/CalorieRingCard.tsx
    • Added a new component to display calorie consumption and goals using an animated progress ring from @shopify/react-native-skia and Uniwind styling.
  • SparkyFitnessMobile/src/components/CollapsibleSection.tsx
    • Refactored to use useCSSVariable and the new Icon component for styling and icon display.
    • Converted inline styles to TailwindCSS classes.
  • SparkyFitnessMobile/src/components/ConnectionStatus.tsx
    • Updated to use useCSSVariable for dynamic styling based on theme.
    • Converted inline styles to TailwindCSS classes and introduced a pill-style for the 'connected' state.
  • SparkyFitnessMobile/src/components/DateNavigator.tsx
    • Added a new component for navigating between dates (previous, next, today) and displaying formatted date labels, styled with Uniwind and custom Icon.
  • SparkyFitnessMobile/src/components/DevTools.tsx
    • Integrated a preview for the OnboardingModal component.
    • Converted inline styles to TailwindCSS classes.
  • SparkyFitnessMobile/src/components/ExerciseProgressCard.tsx
    • Added a new component to visualize exercise progress with animated bars using @shopify/react-native-skia and react-native-reanimated.
  • SparkyFitnessMobile/src/components/ExerciseSummary.tsx
    • Added a new component to display a summary of exercise entries, including intelligent icon selection and Uniwind styling.
  • SparkyFitnessMobile/src/components/FoodSummary.tsx
    • Added a new component to display food entries grouped by meal type, featuring macro bars and Uniwind styling.
  • SparkyFitnessMobile/src/components/HydrationGauge.tsx
    • Added a new component to visualize water intake with an animated bottle gauge using @shopify/react-native-skia and Uniwind styling, including increment/decrement functionality.
  • SparkyFitnessMobile/src/components/Icon.tsx
    • Added a new cross-platform Icon component that uses SF Symbols on iOS and Ionicons on Android.
  • SparkyFitnessMobile/src/components/MacroCard.tsx
    • Added a new component to display macro nutrient progress with animated bars using @shopify/react-native-skia and Uniwind styling.
  • SparkyFitnessMobile/src/components/OnboardingModal.tsx
    • Updated to use useCSSVariable and the new Icon component for styling.
    • Converted inline styles to TailwindCSS classes.
  • SparkyFitnessMobile/src/components/PrivacyPolicyModal.tsx
    • Updated to use useCSSVariable and the new Icon component for styling.
    • Converted inline styles to TailwindCSS classes.
  • SparkyFitnessMobile/src/components/ProgressRing.tsx
    • Added a new reusable ProgressRing component for displaying circular progress, built with @shopify/react-native-skia.
  • SparkyFitnessMobile/src/components/ServerConfig.tsx
    • Refactored server configuration display to use TailwindCSS classes and the new Icon component.
    • Integrated ServerConfigModal for adding/editing configurations.
    • Added a button to open the web dashboard.
  • SparkyFitnessMobile/src/components/ServerConfigModal.tsx
    • Added a new modal component for managing server configurations, utilizing Clipboard and Uniwind styling.
  • SparkyFitnessMobile/src/components/SyncFrequency.tsx
    • Updated to use useCSSVariable for dynamic styling.
    • Converted inline styles to TailwindCSS classes.
  • SparkyFitnessMobile/src/constants/HealthMetrics.ts
    • Removed, its content was moved to src/HealthMetrics.ts.
  • SparkyFitnessMobile/src/contexts/ThemeContext.tsx
    • Removed, as theming is now handled by Uniwind and themeService.ts.
  • SparkyFitnessMobile/src/hooks/index.ts
    • Added an index file to export all new Tanstack Query hooks.
  • SparkyFitnessMobile/src/hooks/queryClient.ts
    • Added a new file to configure the Tanstack Query client with default options.
  • SparkyFitnessMobile/src/hooks/queryKeys.ts
    • Added a new file to define centralized query keys for Tanstack Query.
  • SparkyFitnessMobile/src/hooks/useDailySummary.ts
    • Added a new Tanstack Query hook to fetch and process daily health summaries.
  • SparkyFitnessMobile/src/hooks/useMeasurements.ts
    • Added a new Tanstack Query hook to fetch daily measurements.
  • SparkyFitnessMobile/src/hooks/usePreferences.ts
    • Added a new Tanstack Query hook to fetch user preferences.
  • SparkyFitnessMobile/src/hooks/useProfile.ts
    • Added a new Tanstack Query hook to fetch user profile data.
  • SparkyFitnessMobile/src/hooks/useRefetchOnFocus.ts
    • Added a new utility hook to automatically refetch Tanstack Query data when a screen gains focus.
  • SparkyFitnessMobile/src/hooks/useServerConnection.ts
    • Added a new Tanstack Query hook to manage and monitor server connection status.
  • SparkyFitnessMobile/src/hooks/useSyncHealthData.ts
    • Added a new Tanstack Query mutation hook to handle health data synchronization, including success/error alerts.
  • SparkyFitnessMobile/src/hooks/useWaterIntakeMutation.ts
    • Added a new Tanstack Query mutation hook for managing water intake, featuring optimistic updates.
  • SparkyFitnessMobile/src/screens/DashboardScreen.tsx
    • Added a new Dashboard screen, displaying a daily health overview using new components and Tanstack Query hooks.
  • SparkyFitnessMobile/src/screens/DiaryScreen.tsx
    • Added a new Diary screen, presenting detailed food and exercise entries using new components and Tanstack Query hooks.
  • SparkyFitnessMobile/src/screens/LogScreen.tsx
    • Refactored to use TailwindCSS classes for styling.
    • Updated log status color and icon logic.
  • SparkyFitnessMobile/src/screens/SettingsScreen.tsx
    • Refactored to use useServerConnection hook and the new ServerConfigModal.
    • Converted styling to TailwindCSS classes.
    • Added navigation to the Logs screen and integrated AppearanceSettings.
  • SparkyFitnessMobile/src/screens/SettingsScreenStyles.ts
    • Removed, as styling is now handled by TailwindCSS classes.
  • SparkyFitnessMobile/src/screens/SyncScreen.tsx
    • Renamed from MainScreen.tsx to better reflect its purpose.
    • Refactored to use useServerConnection and useSyncHealthData hooks.
    • Converted styling to TailwindCSS classes.
  • SparkyFitnessMobile/src/services/api.ts
    • Renamed to src/services/api/healthDataApi.ts and refactored into a specific API service.
  • SparkyFitnessMobile/src/services/api/apiClient.ts
    • Added a new centralized API client for consistent request handling, authentication, and error logging.
  • SparkyFitnessMobile/src/services/api/exerciseApi.ts
    • Added a new API service for fetching and calculating exercise-related data.
  • SparkyFitnessMobile/src/services/api/foodEntriesApi.ts
    • Added a new API service for fetching and calculating food entry data.
  • SparkyFitnessMobile/src/services/api/goalsApi.ts
    • Added a new API service for fetching daily goals.
  • SparkyFitnessMobile/src/services/api/healthDataApi.ts
    • Renamed from src/services/api.ts and updated to use the new apiClient.
  • SparkyFitnessMobile/src/services/api/measurementsApi.ts
    • Added a new API service for fetching measurements, water intake, and water containers, including water intake modification.
  • SparkyFitnessMobile/src/services/api/preferencesApi.ts
    • Added a new API service for fetching user preferences.
  • SparkyFitnessMobile/src/services/api/profileApi.ts
    • Added a new API service for fetching user profile information.
  • SparkyFitnessMobile/src/services/backgroundSyncService.ts
    • Updated imports to reflect the new API service and HealthMetrics paths.
  • SparkyFitnessMobile/src/services/calculations.ts
    • Added a new file containing pure calculation functions for health metrics like age, BMR, body fat, and calorie balance.
  • SparkyFitnessMobile/src/services/healthConnectService.ios.ts
    • Updated imports to use the new API service and HealthMetrics paths.
  • SparkyFitnessMobile/src/services/healthConnectService.ts
    • Updated imports to use the new API service and HealthMetrics paths.
  • SparkyFitnessMobile/src/services/healthconnect/index.ts
    • Updated imports to use the new HealthMetrics path.
  • SparkyFitnessMobile/src/services/storage.ts
    • Updated imports to use the new HealthMetrics path.
  • SparkyFitnessMobile/src/services/themeService.ts
    • Added a new service for managing theme preferences, integrating with Uniwind and AsyncStorage.
  • SparkyFitnessMobile/src/types/dailySummary.ts
    • Added new type definitions for the daily health summary data structure.
  • SparkyFitnessMobile/src/types/exercise.ts
    • Added new type definitions for exercise entries and snapshots.
  • SparkyFitnessMobile/src/types/foodEntries.ts
    • Added new type definitions for food entries, including detailed nutritional information.
  • SparkyFitnessMobile/src/types/goals.ts
    • Added new type definitions for daily goals, including calorie, macro, and exercise targets.
  • SparkyFitnessMobile/src/types/healthRecords.ts
    • Updated imports to use the new HealthMetrics path.
  • SparkyFitnessMobile/src/types/measurements.ts
    • Added new type definitions for check-in measurements, water intake, and water containers.
  • SparkyFitnessMobile/src/types/preferences.ts
    • Added new type definitions for user preferences, including various unit and algorithm settings.
  • SparkyFitnessMobile/src/types/profile.ts
    • Added new type definitions for user profile information.
  • SparkyFitnessMobile/src/uniwind-types.d.ts
    • Added a new Uniwind type declaration file for theme configuration.
  • SparkyFitnessMobile/src/utils/dateUtils.ts
    • Added new utility functions for getting today's date, adding/subtracting days, and formatting dates for display.
Activity
  • apedley opened this pull request on June 27, 2024.
  • apedley committed multiple changes, indicating a large, comprehensive update to the mobile application.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an impressive and substantial pull request that significantly modernizes the mobile app. The migration to Uniwind for styling and TanStack Query for data fetching are excellent architectural improvements that will make the codebase more maintainable and performant. The addition of the Dashboard and Diary screens, along with the restructuring of navigation and settings, greatly expands the app's functionality. The extensive test coverage for the new hooks and services is also highly commendable. I've identified a couple of important issues related to a potential race condition and an unhandled promise rejection that should be addressed, but overall, this is a fantastic contribution.

Comment on lines 75 to 84
Promise.all([
Ionicons.getImageSource('home', 24, '#999999'),
Ionicons.getImageSource('sync', 24, '#999999'),
Ionicons.getImageSource('grid', 24, '#999999'),
Ionicons.getImageSource('book', 24, '#999999'),
Ionicons.getImageSource('settings', 24, '#999999'),
Ionicons.getImageSource('document-text', 24, '#999999'),
]).then(([home, settings, document]) => {
if (home && settings && document) {
setIcons({ home, settings, document });
]).then(([sync, dashboard, book, settings]) => {
if (sync && dashboard && book && settings) {
setIcons({ sync, dashboard, book, settings });
}
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This Promise.all call is missing a .catch() block. If any of the Ionicons.getImageSource promises reject (e.g., due to a network issue or an invalid icon name), it will result in an unhandled promise rejection. In production builds, this can crash the app. It's crucial to handle potential errors from asynchronous operations to ensure app stability.

      ]).then(([sync, dashboard, book, settings]) => {
        if (sync && dashboard && book && settings) {
          setIcons({ sync, dashboard, book, settings });
        }
      }).catch(error => {
        console.error('Failed to load tab icons:', error);
      });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are bundled files so this shouldn't be an issue but I added a catch anyway.

onOpenWebDashboard={openWebDashboard}
isConnected={isConnected}
checkServerConnection={checkServerConnection}
checkServerConnection={() => refetchConnection().then(() => isConnected)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There's a potential race condition here due to a stale closure over the isConnected state. The then callback will use the value of isConnected from the render cycle in which checkServerConnection was defined, not the value from after the refetch completes. This could lead to the ConnectionStatus component receiving an outdated status.

To fix this, you should use the result of the refetchConnection promise, which contains the updated data.

Suggested change
checkServerConnection={() => refetchConnection().then(() => isConnected)}
checkServerConnection={() => refetchConnection().then(queryResult => queryResult.data ?? false)}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a bug now but it could be in the future. Fixed

@apedley
Copy link
Copy Markdown
Contributor Author

apedley commented Feb 10, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an impressive and extensive update to the mobile app. The migration to uniwind for styling and tanstack-query for data fetching is a significant architectural improvement that will greatly benefit maintainability and performance. The new Dashboard and Diary screens look fantastic, and the UI/UX enhancements, especially in the Settings screen, are well-thought-out. The addition of comprehensive tests for all the new hooks and services is particularly commendable.

I've found a couple of minor areas for improvement related to ensuring full consistency with the new theming system by replacing a few remaining hardcoded colors with theme variables. My detailed comments are on the respective lines.

Overall, this is an excellent pull request. Great job!

Comment on lines +137 to +145
const getStatusColor = (status: string) => {
switch (status) {
case 'SUCCESS': return '#28a745';
case 'WARNING': return '#ffc107';
case 'INFO': return '#007bff';
case 'DEBUG': return '#6c757d';
default: return '#dc3545';
}
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These status colors are hardcoded. To ensure consistency with the new theming system, you should use the theme variables from global.css.

You can achieve this by:

  1. Importing useCSSVariable from uniwind.
  2. Calling it at the top of the LogScreen component to get the theme colors.
  3. Using these variables inside this getStatusColor function.

Example:

const [successColor, warningColor, dangerColor] = useCSSVariable([
  '--color-text-success',
  '--color-text-warning',
  '--color-text-danger',
]);

// ... inside getStatusColor
case 'SUCCESS': return successColor;

activeOpacity={0.7}
>
<Text className="text-base font-semibold text-text-primary">View Logs</Text>
<Icon name="chevron-forward" size={20} color="#999" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This icon color is hardcoded. To make it theme-aware, you should use a CSS variable.

  1. At the top of the SettingsScreen component, get the muted text color:
const textMuted = useCSSVariable('--color-text-muted') as string;
  1. Then, use this variable for the icon's color:
<Icon name="chevron-forward" size={20} color={textMuted} />

@Sim-sat
Copy link
Copy Markdown
Contributor

Sim-sat commented Feb 10, 2026

@apedley It's impossible to review a PR with 10k additions in a single commit. At least have different commit per feature or tests.

I haven't looked deeply into the mobile app but can't we share the whole logic with the forntend? My next goal with the frontend is to migrate everything into Tanstack Query.
The only thing that should are the components for the view. Or am i missing something?

@apedley
Copy link
Copy Markdown
Contributor Author

apedley commented Feb 10, 2026

@apedley It's impossible to review a PR with 10k additions in a single commit. At least have different commit per feature or tests.

I haven't looked deeply into the mobile app but can't we share the whole logic with the forntend? My next goal with the frontend is to migrate everything into Tanstack Query. The only thing that should are the components for the view. Or am i missing something?

Yes I know it's a giant PR. I had a git mishap that was going to take me hours to fix but I'm the only one working on the mobile app currently so I okay'ed it with CodewithCJ.

Sharing logic isn't really possible but sharing types definitely is and I was going to ask you how you felt about it. I don't really have any experience with doing that but I do know some people use openapi to zod generators. Is the front end using zod at all? I'm probably going to use it along with react-hook-form once I get into add/edit territory.

@Sim-sat
Copy link
Copy Markdown
Contributor

Sim-sat commented Feb 10, 2026

I haven't done it but it's possible to share them using a monorepo with a @shared/api folder or something. Turborepo seems like the best tool for it. I can look into the details because it's going to save us alot of work. You define a new package using pnpm where you can install stuff or use it in every other tool.
It's not using zod but that would be great addition aswell. The types are all over the place at the moment and not everything even has a type. Are you on discord? We could talk about it there

@apedley
Copy link
Copy Markdown
Contributor Author

apedley commented Feb 10, 2026

I haven't done it but it's possible to share them using a monorepo with a @shared/api folder or something. Turborepo seems like the best tool for it. I can look into the details because it's going to save us alot of work. You define a new package using pnpm where you can install stuff or use it in every other tool. It's not using zod but that would be great addition aswell. The types are all over the place at the moment and not everything even has a type. Are you on discord? We could talk about it there

Turborepo shared types package does seem like the way to go. I'm on discord in the dev channel if you want to talk more

@CodeWithCJ CodeWithCJ merged commit 4ffe505 into CodeWithCJ:main Feb 10, 2026
6 checks passed
@apedley apedley deleted the app-expansion-pr branch February 10, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants