Skip to content

Add caaals extension - #26443

Merged
raycastbot merged 6 commits into
raycast:mainfrom
chuckcg:ext/caaals
Apr 2, 2026
Merged

raycastbot merged 6 commits into
raycast:mainfrom
chuckcg:ext/caaals

Conversation

@chuckcg

@chuckcg chuckcg commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

Screencast

Checklist

- Merge pull request raycast#93 from chuckcg/fix/fix-raycast-before-publish
- Fix raycast before publish
- Merge pull request raycast#92 from chuckcg/fix/barcode-item-crash
- Fix crash
- Merge pull request raycast#90 from chuckcg/fix/crash-on-add-entry
- Refactor replay session sample rate handling
- Fix photo camera token guard
- Fix barcode camera token guard
- Disable mobile replay in development
- Remove incorrect app.json and update package.json and pnpm-lock.yaml, it was there because of a expo run on root instead of apps/mobile
- Fix mobile AI token limit handling and validation
- Merge pull request raycast#86 from chuckcg/feature/apple-health-integration
- Fix UTC- timezone rejection and stale sync cursor on empty HealthKit imports
- Address review feedback: dead code, deprecation, validation, sync cursor
- Fix stale healthkit_last_synced_at and redundant setState call
- Hardcode manual source on store endpoint and add 403 doc to sync
- Fix requestAuthorization args and add lockForUpdate to sync() query
- Fix defensive HealthKit auth check and make store() atomic
- Document manual-entry protection in sync() docblock
- Fix DST-unsafe timezone offset, fail-safe permission check, and store() docblock
- Enhance Weight Logging and HealthKit Integration
- Fix manual-entry protection, HealthKit export values, and import deduplication
- Enhance Validation and HealthKit Sync Logic
- Update WeightController and SyncWeightEntriesRequest for Enhanced Validation and HealthKit Integration
- Enhance WeightController and LogWeightScreen for HealthKit Sync Validation
- Refactor WeightController and HealthKit Integration for Improved Data Handling
- Update WeightController Response Documentation and Enhance LogWeightScreen Sync Logic
- Refactor HealthKit Sync Logic and Update TypeScript Configuration
- Fix greptile comments
- Update WeightController to ensure user healthkit_last_synced_at is updated after weight sync
- Implement HealthKit Integration and Weight Sync Features
- Merge pull request raycast#85 from chuckcg/feature/weight-tracking
- Enhance WeightController and Mobile Components with Improved Response Documentation and Timezone Handling
- Enhance Settings and Trends Screens with Timezone and Appearance Updates
- Refactor weight logging and timezone handling
- Update TrendsService to support user timezone in streak calculation
- Enhance Settings and Layout with Profile Section
- Add goal weight functionality and related updates
- Merge pull request raycast#84 from chuckcg/fix/token-limit-exceeded-crash
- Enhance error handling in handleAIError function to improve date parsing for token limit resets and clarify error messages based on operation type. This update ensures more accurate user feedback when AI limits are reached.
- Refactor AI error handling in AddFoodScreen and SearchScreen components to utilize a centralized error handling function. Updated mutation error callbacks to improve consistency and user feedback regarding token limits.
- Refactor error handling in food analysis mutations to improve user feedback and token limit management. Introduced a centralized error handling function for AI operations and updated the analyzeText and analyzeImage methods to utilize this new function. Enhanced error messages for better clarity on token limits.
- Merge pull request raycast#80 from chuckcg/feature/add-web-features
- Improve NutritionInput component by adding early return in handleCommit function
- Add date display for logged entries in SearchPage
- Merge pull request raycast#83 from chuckcg/fix/sentry-on-prod
- Fix sentry on prod
- Update serving size picker logic in SearchPage to conditionally render based on nutrition overrides
- Enhance EditEntryDialog and NutritionInput for improved user interaction
- Add toast notifications in SearchPage for improved user feedback
- Enhance error handling and accessibility in SearchPage and EditEntryDialog
- Refactor diary entry deletion handling for improved clarity
- Refactor focus management in EditEntryDialog for improved accessibility
- Enhance accessibility and error handling in EditEntryDialog and SearchPage
- Update foodKey generation in SearchPage to use generateFoodKey function
- Refactor NutritionInput component and enhance nutrition handling in SearchPage
- Enhance EditEntryDialog and SearchPage with time adjustment features
- Add calorie calculator feature and integrate with diary and settings pages
- Merge pull request raycast#76 from chuckcg/fix/avoid-running-stale-dependencies
- Merge pull request raycast#75 from chuckcg/feature/improve-ai-accuracy
- Update entrypoint.sh to always sync composer dependencies instead of conditionally installing them based on the presence of autoload.php
- Fix greptile comments
- Fix issues
- Refactor food analysis service to implement a two-step pipeline for food identification and nutrition lookup. Introduced NutritionLookupService for fetching verified nutrition data. Updated analyzeText and analyzeImage methods to utilize the new service and adjusted response structure to include nutrition source. Enhanced tests to validate new functionality and ensure quantity enforcement.
- Merge pull request raycast#73 from chuckcg/hotfix/change-php-version
- Upgrade php (required for sentry pr)
- Merge pull request raycast#71 from chuckcg/feature/add-sentry-on-api-and-web
- Fix gc
- Fix gc
- Fix gc
- Fix gc
- Fix gc
- Add sentry on api and web
- Merge pull request raycast#68 from chuckcg/feature/raycast-extension
- Fix greptile comment
- Fix greptile comments
- Fix greptile comments
- Add api token system (for raycast, and more later maybe)
- Fix greptile comments
- Fix greptile comments
- Fix greptile comments
- Fix greptile comments
- Add api token system (for raycast, and more later maybe)
- Add api token system (for raycast, and more later maybe)
- Add raycast extension. Working but no api key management yet , so user can only login and use raycast extension if he has a no-social-login account (normal account) and has a password. We will implement api key quickly to fix that
- Merge pull request raycast#67 from chuckcg/feature/onboarding-macro-settings
- Onboarding macro settings
- Merge pull request raycast#66 from chuckcg/feature/better-avg-weekly-calories
- Fix greptile issue
- Fix greptile issues
- Better avg weekly calories
- Merge pull request raycast#64 from chuckcg/hotfix/forget-password-deploy-issue
- Fix issue
- Merge pull request raycast#62 from chuckcg/feature/password-reset
- Fix greptile comment
- Fix greptile issues
- Fix greptile comments
- Fix greptile comments
- Fix greptile comments
- Fix greptile comments
- Fix greptile comment
- Fix greptile comments
- Fix greptile comments
- Add password reset functionality with email notifications
- Merge pull request raycast#61 from chuckcg/feature/better-add-pane
- Fix greptile comments
- Fix greptile comments
- Better edit food, add food, and prompt for macro generation
- Merge pull request raycast#58 from chuckcg/cursor/greptile-pr-comment-resolution-33ae
- Fix greptile issue
- Fix greptile issue
- Fix greptile issue
- WIP
- WIP
- WIP
- Fix greptile comments
- Refactor UserResource token balance injection
- fix: enhance error handling and token balance checks in AIFoodController
- refactor: improve date range calculation in TokenBalanceService
- feat: implement token balance management for AI features
- Merge pull request raycast#56 from chuckcg/feature/recents-favorites-screens
- refactor: streamline food selection state management in AddFoodScreen
- fix: dismiss router before navigating to add food in favorites and recents screens
- feat: add recents and favorites screens with navigation
- Merge pull request raycast#51 from chuckcg/cursor/history-week-start-day-71bd
- Update packages/shared/src/types/index.ts
- feat: add week start day functionality to user profile
- fix: make history week start on Monday instead of Sunday
- Merge pull request raycast#52 from chuckcg/cursor/quick-log-macro-prefill-8234
- Merge pull request raycast#53 from chuckcg/cursor/ideal-macro-goals-71f5
- Update fat calculation logic in calculateMacrosFromPreset function to ensure a minimum fat value of 10, enhancing macro distribution accuracy.
- Add Greptile Fix Skill
- Enhance calorie calculation logic in CalorieCalculatorScreen
- Update apps/mobile/app/calorie-calculator.tsx
- WIP
- Update packages/shared/src/utils/index.ts
- WIP
- Fix greptile errors
- feat: add body metrics handling in user profile updates
- style: arrange goal preset chips in a clean 2x2 grid
- Merge pull request raycast#54 from chuckcg/feature/better-add-button
- WIP
- Wrap image analysis logic in try-finally block in AddFoodScreen to ensure camera is deactivated after processing, improving error handling and user experience.
- Refactor FloatingAddButton to use Pressable for improved accessibility and interaction, enabling long press functionality and maintaining visual styles.
- Fix camera activation logic in AddFoodScreen to use inputMode instead of params.mode
- Handle photo capture failure by deactivating the camera in AddFoodScreen
- Remove error alert for photo capture failure in AddFoodScreen and ensure camera is deactivated.
- Update useEffect dependencies in AddFoodScreen to include requestCameraPermission
- Add accessibility features to FloatingAddButton component
- Disable camera activation when resetting the form in AddFoodScreen
- Refactor AddFoodScreen to use a constant for valid input modes
- Update themeVariant in FloatingAddButton to default to \'light\' when not dark
- Update dependencies in AddFoodScreen to include cameraActive and cameraPermission in useEffect
- Disable camera activation on form submission in AddFoodScreen component
- WIP
- WIP
- feat: add ideal macro goal presets in settings screen
- feat: prefill manual quick log macro fields with 0
- WIP
- WIP
- WIP
- Merge pull request raycast#38 from chuckcg/fix/remove-weird-screen
- Add expo-system-ui dependency and configuration to enhance UI capabilities
- Add splash screen configuration to app.json with custom background and image settings
- Merge pull request raycast#36 from chuckcg/fix/google-login
- Enhance Google authentication error handling in SocialLoginButtons component by validating required fields before token exchange
- Implement manual token exchange for Google authentication in SocialLoginButtons component to improve error handling
- Merge pull request raycast#35 from chuckcg/fix/dark-mode-by-default
- Put darkmode by default
- Merge pull request raycast#34 from chuckcg/fix/opening-screen-issue
- Remove loading screen background color rendering to prevent display issues during app launch
- Merge branch \'fix/opening-screen-issue\' of github.com:chuckcg/caaals into fix/opening-screen-issue
- Fix purple/green flash on app launch before splash screen
- Fix purple/green flash on app launch before splash screen
- Merge pull request raycast#33 from chuckcg/fix/fix-login-issues
- Fix logout not redirecting to login from settings screen
- Fix API error dedup so captureHandledError skips all API-layer errors
- Merge pull request raycast#32 from chuckcg/feature/better-icon-feb
- Update app assets: replace adaptive, favicon, icon, and splash images
- Update app.json background colors to black and replace asset images
- Merge pull request raycast#31 from chuckcg/fix/fix-crashes-and-logout-issues
- Implement auth error suppression during logout to prevent premature navigation on 401 errors
- Merge pull request raycast#29 from chuckcg/feature/feb-ui-review-desktop
- WIP
- Merge pull request raycast#28 from chuckcg/feature/feb-ui-review
- WIP
- WIP
- WIP
- WIP
- WIP
- WIP UI Review
- Merge pull request raycast#27 from chuckcg/feature/barcode-scanner
- Refactor scanner handling in AddFoodScreen
- Refactor AddFoodScreen scanner handling
- Update apps/mobile/app/add-food.tsx
- Update apps/mobile/app/add-food.tsx
- Refactor AddFoodScreen layout for improved UI consistency
- Add expo-camera integration for barcode scanning in AddFoodScreen
- Merge pull request raycast#25 from chuckcg/feature/better-icon
- Refactor UIBackgroundModes in app.json for optimization
- Better icon
- Merge pull request raycast#23 from chuckcg/feature/broader-liquid-design-system
- Refactor button appearance from \'variant\' to \'appearance\' for consistency
- Enhance UI components with glass appearance
- Rename release sop
- Merge pull request raycast#22 from chuckcg/feature/show-apps-versions-in-mobile
- Add build metadata endpoint and update mobile settings for backend info display
- Merge pull request raycast#21 from chuckcg/fix/refresh-on-app-opening
- WIP
- Merge pull request raycast#20 from chuckcg/fix/better-portion-management
- Fix multiplier calculation in FoodAnalysisService to handle zero grams gracefully
- chore(api): ignore phpunit result cache
- Add PHPUnit result cache and update FoodAnalysisContractTest
- Enhance Food Analysis Service and UI for Quantity Handling
- Merge pull request raycast#18 from chuckcg/feature/better-sentry
- Enhance sensitive value detection in Sentry sanitization
- Refactor API error handling and enhance Sentry context sanitization
- Enhance Sentry integration and API error handling
- WIP Better Sentry
- Merge pull request raycast#17 from chuckcg/feature/liquid-glass-nav
- Enhance FloatingAddButton positioning with dynamic tab bar offset
- Update .gitignore to exclude .tanstack directory and remove temporary React component file
- Add liquid glass nav
- SOP expo
- Update dependencies in pnpm-lock.yaml and package.json
- Remove tests strings
- Merge pull request raycast#15 from chuckcg/fix/fix-ota-updates
- Integrate Sentry for error tracking and enhance API error handling
- Update mobile app configuration and enhance error handling
- Merge pull request raycast#13 from chuckcg/fix/crash-on-login
- Refactor UserResource to remove default values for user goals and timezone
- Enhance user data handling and timezone management
- WIP
- Update mobile app configuration and dependencies
- Update Dockerfile for production build optimization
- Add lessons learned and prevention checklist for EAS build plugin resolution
- Fix the build issue successfully.
- Remove expo-apple-authentication and expo-secure-store dependencies from package.json; add eas-build-post-install script to mobile package.json for improved dependency management.
- Add expo-apple-authentication and expo-secure-store dependencies
- Refactor mobile app configuration and dependency management
- Enhance mobile app configuration and dependency management
- Add post-install script for EAS build in mobile package.json
- Add Expo config plugin resolution in app.config.js and include expo-secure-store in app.json
- Remove expo-secure-store plugin from mobile app configuration in app.json
- Update EAS configuration for iOS production submit settings
- Update EAS configuration for production environment
- Add shamefully-hoist configuration to .npmrc
- Update mobile app configuration and add EAS build settings
- Merge pull request raycast#11 from chuckcg/feature/google-apple-login
- Refactor login and registration screens to use Input component
- Refactor error handling in SocialAuthService
- Merge branch \'main\' into feature/google-apple-login
- Merge pull request raycast#12 from chuckcg/feature/better-homescreen
- Refactor nutrition handling in AddFoodScreen and EditEntryScreen
- Enhance nutrition management and UI consistency across mobile app
- WIP
- Update apps/api/app/Services/Auth/SocialAuthService.php
- Update apps/api/app/Services/Auth/SocialAuthService.php
- Update apps/api/app/Http/Controllers/Api/V1/AuthController.php
- Enhance social authentication handling
- Enhance Apple authentication script loading
- Add Google and Apple authentication configuration guide
- Implement social authentication for Google and Apple
- Merge pull request raycast#10 from chuckcg/feature/favorites
- Add state management for saved favorites in AddFoodScreen
- Update food selection logic and improve input focus handling in AddFoodScreen and Search components
- Refactor state management in AddFoodScreen and Search components
- Add Favorites and new quick log system
- Merge pull request raycast#9 from chuckcg/feature/better-ring
- Refactor animation cancellation in useAnimatedProgress for improved safety
- Refine comments in DiaryScreen for improved clarity
- Enhance comments in DiaryScreen for clarity
- Add nutrition display options and integrate NutritionBars component
- Merge pull request raycast#8 from chuckcg/feature/edit-entry
- Fix issue
- Fix issue
- Edit entries and history feature done
- Merge pull request raycast#7 from chuckcg/feature/better-ux
- Fix greptile comments
- Fix greptiles comments
- Better UI - WIP
- Better UI - WIP
- Merge pull request raycast#6 from chuckcg/fix/fix-history
- Fix History issue
- Merge pull request raycast#5 from chuckcg/feature/pivot-to-ai-search
- fix(api): increase rate limit for AI Food Analysis routes from 10/min to 30/min
- fix(DiaryController): enhance nutrition calculation logic for diary entries
- refactor(migration): update unique constraint for favorite_foods table
- fix(AnalyzeImageRequest): update image_base64 validation to include maximum size limit
- fix(FoodAnalysisService): enforce API key configuration on initialization
- feat(migration): add constraint to ensure food_key or cached_food_id is set
- fix(FoodAnalysisService): update image detail setting for better accuracy
- fix(request): update food_key validation regex for StoreDiaryFromSnapshotRequest
- refactor(utils): remove async version of generateFoodKey function
- refactor(FoodController): optimize recent food retrieval using DISTINCT ON in database query
- Fix issue
- Finished the whole thing.
- Merge pull request raycast#4 from chuckcg/feature/better-mobile-mav
- feat(mobile): add floating glass tab bar with center FAB
- Merge pull request raycast#3 from chuckcg/feature/mobile-style-review
- Review mobile styles
- Merge pull request raycast#2 from chuckcg/chore/update-expo
- add env example for expo public api url
- Update expo and fix issue
- misc
- Merge pull request raycast#1 from chuckcg/feature/review-styles
- Enhance UI with new theming and styling updates. Implement dark mode support, update color variables, and refine component styles for better consistency. Improve accessibility and responsiveness across various components, including buttons, inputs, and error boundaries.
- Fix food service issue
- Bugs and security fixes
- WIP
@raycastbot raycastbot added new extension Label for PRs with new extensions platform: macOS labels Mar 18, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@chuckcg
chuckcg marked this pull request as ready for review March 19, 2026 04:28
@greptile-apps

greptile-apps Bot commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a new Caaals Food Tracker extension that lets users log meals via AI text analysis and browse their recent food diary — all from Raycast. The extension is well-structured with a clean API layer (timeout, 401 handling, 204 guard), a two-step log-food flow, and a diary browser with grouped list sections.

Previous review concerns around the changelog date placeholder, printWidth, and the README/package.json URL mismatch have all been addressed. One functional correctness issue remains:

  • Wrong serving resolved in the diary browser — both the list view (browse-diary.tsx:113) and the EntryDetail component (browse-diary.tsx:178) call getDefaultServing(food) instead of looking up the serving by entry.servingId. This means the serving description shown in list subtitles and the fiber/sugar/sodium values computed in the detail view can be wrong for any diary entry that was logged with a non-first serving (e.g. entries created via the Caaals mobile or web app).

Confidence Score: 4/5

Safe to merge after fixing the serving-lookup bug in the diary browser.

One P1 logic issue remains: browse-diary.tsx resolves servings by position (getDefaultServing) rather than by entry.servingId, which produces incorrect serving descriptions and wrong fiber/sugar/sodium values for entries logged with a non-default serving. All other previously flagged issues have been addressed.

extensions/caaals/src/browse-diary.tsx (serving lookup at lines 113 and 178)

Important Files Changed

Filename Overview
extensions/caaals/src/browse-diary.tsx Uses getDefaultServing in both the list and EntryDetail instead of resolving the serving by entry.servingId, producing incorrect serving descriptions and wrong fiber/sugar/sodium values for any entry logged with a non-first serving.
extensions/caaals/src/api.ts Well-structured API layer with timeout, auth error handling, and 204 guard; still carries the manually-defined Preferences interface flagged in a prior thread.
extensions/caaals/src/log-food.tsx Clear two-step log-food flow (form → confirmation detail); error handling and popToRoot usage are correct.
extensions/caaals/src/utils.ts Utility functions for meal defaults, date formatting, and serving display are straightforward and correct.
extensions/caaals/src/types.ts Domain types are well-defined and comprehensive.
extensions/caaals/package.json Extension manifest is well-formed; preferences use correct types and the API token correctly uses password type.
extensions/caaals/CHANGELOG.md Uses {PR_MERGE_DATE} placeholder and [Initial Release] label correctly.
extensions/caaals/.prettierrc printWidth is now 120 as required; configuration matches Raycast standards.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/caaals/src/browse-diary.tsx
Line: 113-114

Comment:
**Serving resolved by position instead of `servingId`**

`getDefaultServing` always returns `food.servings[0]` (or a synthetic base), but `DiaryEntry` carries a `servingId` that identifies which serving was actually used when the entry was logged. If any entry was created with a non-first serving (e.g. via the mobile or web app), two things go wrong:

1. The subtitle in the list (`formatServingWithQuantity(serving, entry.quantity)`) shows the wrong serving description.
2. Inside `EntryDetail`, the `multiplier` derived from `serving.multiplier` is incorrect, so the computed fiber / sugar / sodium values are wrong.

The fix is to resolve the serving from the food's servings list before falling back to `getDefaultServing`:

```typescript
const serving = entry.food.servings.find((s) => s.id === entry.servingId) ?? getDefaultServing(entry.food);
```

Apply the same fix to `EntryDetail` at line 178.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/caaals/src/browse-diary.tsx
Line: 178-180

Comment:
**Same wrong-serving issue in `EntryDetail`**

`getDefaultServing(food)` is used here too instead of looking up the serving by `entry.servingId`. The `multiplier` is therefore potentially incorrect, causing the fiber, sugar, and sodium rows in the markdown table to display wrong values for entries logged with a non-default serving.

```typescript
const serving = food.servings.find((s) => s.id === entry.servingId) ?? getDefaultServing(food);
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (3): Last reviewed commit: "Update caaals extension" | Re-trigger Greptile

Comment thread extensions/caaals/CHANGELOG.md Resolved
Comment thread extensions/caaals/.prettierrc Resolved
Comment thread extensions/caaals/src/api.ts Outdated
Comment on lines +11 to +18
interface Preferences {
apiUrl: string;
apiToken: string;
}

function getPrefs(): Preferences {
return getPreferenceValues<Preferences>();
}

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.

P2 Manually defined Preferences interface

The Preferences interface on lines 11–14 is manually defined and passed to getPreferenceValues<Preferences>(). These types are auto-generated in raycast-env.d.ts when the extension runs, so manual definitions can drift out of sync with the actual package.json preference schema and cause type mismatches.

Remove the manual interface and use the auto-generated type:

const prefs = getPreferenceValues<Preferences>();

Rule Used: What: Don't manually define Preferences for `get... (source)

Comment on lines +1 to +4
{
"root": true,
"extends": ["@raycast"]
}

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.

P2 Outdated ESLint config format

This uses the legacy .eslintrc.json format. ESLint v9+ recommends a flat config file (eslint.config.js) with defineConfig imported from "eslint/config":

import { defineConfig } from "eslint/config";
import raycast from "@raycast/eslint-config";

export default defineConfig([...raycast]);

Rule Used: What: In ESLint v9+, defineConfig is exported fr... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread extensions/caaals/README.md Outdated
1. Install the extension from the Raycast Store.
2. Generate an API token from **Settings > Integrations** in the Caaals mobile or web app.
3. Open any command — Raycast will prompt you to fill in your preferences:
- **API URL** — The base URL of your Caaals instance (defaults to `https://api.caaals.com`).

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.

P2 Default API URL mismatch between README and package.json

The README instructs users that the API URL "defaults to https://api.caaals.com", but package.json sets the actual default to https://caaals.onrender.com. This will confuse users who expect the documented default but see a different value pre-filled in Raycast preferences. One of the two should be updated to match the other.

chuckcg and others added 2 commits March 19, 2026 06:22
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@chuckcg chuckcg closed this Mar 19, 2026
@chuckcg chuckcg reopened this Mar 19, 2026
- Merge branch \'contributions/merge-1773898380604\' into fix/raycast-ext-comments
- Pull contributions
- Fix lint
- Fix greptile comments (from raycast pr)
- Merge pull request raycast#95 from chuckcg/fix/apple-health-sync-crash
- Fix sync weight healthkit crash
- Fix sync weight healthkit crash
@0xdhrv 0xdhrv self-assigned this Apr 2, 2026
Comment thread extensions/caaals/src/browse-diary.tsx Outdated
Comment on lines +113 to +114
const serving = getDefaultServing(entry.food);
return (

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.

P1 Serving resolved by position instead of servingId

getDefaultServing always returns food.servings[0] (or a synthetic base), but DiaryEntry carries a servingId that identifies which serving was actually used when the entry was logged. If any entry was created with a non-first serving (e.g. via the mobile or web app), two things go wrong:

  1. The subtitle in the list (formatServingWithQuantity(serving, entry.quantity)) shows the wrong serving description.
  2. Inside EntryDetail, the multiplier derived from serving.multiplier is incorrect, so the computed fiber / sugar / sodium values are wrong.

The fix is to resolve the serving from the food's servings list before falling back to getDefaultServing:

const serving = entry.food.servings.find((s) => s.id === entry.servingId) ?? getDefaultServing(entry.food);

Apply the same fix to EntryDetail at line 178.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/caaals/src/browse-diary.tsx
Line: 113-114

Comment:
**Serving resolved by position instead of `servingId`**

`getDefaultServing` always returns `food.servings[0]` (or a synthetic base), but `DiaryEntry` carries a `servingId` that identifies which serving was actually used when the entry was logged. If any entry was created with a non-first serving (e.g. via the mobile or web app), two things go wrong:

1. The subtitle in the list (`formatServingWithQuantity(serving, entry.quantity)`) shows the wrong serving description.
2. Inside `EntryDetail`, the `multiplier` derived from `serving.multiplier` is incorrect, so the computed fiber / sugar / sodium values are wrong.

The fix is to resolve the serving from the food's servings list before falling back to `getDefaultServing`:

```typescript
const serving = entry.food.servings.find((s) => s.id === entry.servingId) ?? getDefaultServing(entry.food);
```

Apply the same fix to `EntryDetail` at line 178.

How can I resolve this? If you propose a fix, please make it concise.

Comment thread extensions/caaals/src/browse-diary.tsx Outdated
Comment on lines +178 to +180
const serving = getDefaultServing(food);
const fn = food.nutrition;
const multiplier = serving.multiplier * quantity;

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.

P1 Same wrong-serving issue in EntryDetail

getDefaultServing(food) is used here too instead of looking up the serving by entry.servingId. The multiplier is therefore potentially incorrect, causing the fiber, sugar, and sodium rows in the markdown table to display wrong values for entries logged with a non-default serving.

const serving = food.servings.find((s) => s.id === entry.servingId) ?? getDefaultServing(food);
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/caaals/src/browse-diary.tsx
Line: 178-180

Comment:
**Same wrong-serving issue in `EntryDetail`**

`getDefaultServing(food)` is used here too instead of looking up the serving by `entry.servingId`. The `multiplier` is therefore potentially incorrect, causing the fiber, sugar, and sodium rows in the markdown table to display wrong values for entries logged with a non-default serving.

```typescript
const serving = food.servings.find((s) => s.id === entry.servingId) ?? getDefaultServing(food);
```

How can I resolve this? If you propose a fix, please make it concise.

- Added subtitles to diary commands for clarity
- Improved serving selection logic in diary entries
- Updated date formatting for logged entries
- Included raycast-env.d.ts in TypeScript configuration

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit 7c0e492 into raycast:main Apr 2, 2026
2 checks passed
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@chuckcg).

Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag.

ariesly15 pushed a commit to ariesly15/raycast-extensions that referenced this pull request Apr 2, 2026
- refactor: 简化 Action.CopyToClipboard 组件调用 (url-parse.tsx)
- chore: 移除 delink 扩展中的图标配置项
- chore: 删除图标文件并更新配置引用新图标
- Merge branch \'raycast:main\' into main
- Update CODEOWNERs (768930b)
- Add nocal extension (raycast#26482)
- Update CODEOWNERs (7c0e492)
- Add caaals extension (raycast#26443)
ariesly15 pushed a commit to ariesly15/raycast-extensions that referenced this pull request Apr 10, 2026
- feat[extensions/qq-mail]: 添加QQ邮箱扩展及配置文件
- Merge branch \'raycast:main\' into main
- Update CODEOWNERs (9944a1b)
- [XKCD Comics] Add viewing history (raycast#26704)
- refactor: 增加useCallback并更新tsconfig配置
- Update CODEOWNERs (9b7c8a4)
- Add Kafka UI extension (raycast#26259)
- Merge branch \'raycast:main\' into main
- refactor: 简化 Action.CopyToClipboard 组件调用 (url-parse.tsx)
- chore: 移除 delink 扩展中的图标配置项
- chore: 删除图标文件并更新配置引用新图标
- Update CODEOWNERs (756e9da)
- Update ascii-art-wallpaper extension (raycast#26707)
- Update CODEOWNERs (23ee8a8)
- Add paper-agent extension (raycast#26367)
- Merge branch \'raycast:main\' into main
- chore: 更新 delink 扩展变更日志并移除旧版本记录
- Update CODEOWNERs (768930b)
- Add nocal extension (raycast#26482)
- Update CODEOWNERs (7c0e492)
- Add caaals extension (raycast#26443)
- Merge branch \'raycast:main\' into main
- docs: 更新 delink 扩展文档及快捷键说明
- Update CODEOWNERs (41a12f0)
- Update mirror-displays extension (raycast#26445)
- chore: 更新 delink 扩展的版本信息为初始发布版
- docs: 调整 delink 扩展快捷键说明顺序
- Merge branch \'raycast:main\' into main
- feat:up
- Update CODEOWNERs (2134dff)
- Update hetzner extension (raycast#26705)
- Update CODEOWNERs (840e5a9)
- Add ram-prices extension (raycast#26564)
- Update CODEOWNERs (45fad15)
- Add habitica-todos extension (raycast#26446)
- Update CODEOWNERs (3e686e1)
- Add Bundles extension (raycast#25680)
- Update CODEOWNERs (f6261fd)
- Update tmux-cheatsheet extension (raycast#26379)
- Changelog Alignment (raycast#26824)
- Update prism-launcher extension (raycast#26816)
- Merge branch \'raycast:main\' into main
- feat: add metadata folder and language setting
- Update picgo extension (raycast#26818)
- Update CODEOWNERs (bd7023d)
- Add clockodo extension (raycast#26432)
- feat: add raycast extension delink
- Update CODEOWNERs (868aef4)
@chuckcg
chuckcg deleted the ext/caaals branch July 6, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants