Skip to content

Main -> Development#2358

Merged
mikib0 merged 36 commits into
developmentfrom
main
Apr 28, 2026
Merged

Main -> Development#2358
mikib0 merged 36 commits into
developmentfrom
main

Conversation

@mikib0

@mikib0 mikib0 commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

andrew-bierman and others added 30 commits April 26, 2026 17:27
Bun's default isolated linker doesn't hoist transitive deps to locations
Metro and native build scripts can resolve. Switching to hoisted mode
creates a flat node_modules layout compatible with React Native tooling.

Also adds react-native-css-interop as an explicit dep (previously only in
the bun content-addressed store with no symlink).
@aws-sdk/xml-builder v3.894.0 switched S3 XML parsing to window.DOMParser
in its browser bundle. Wrangler uses the browser esbuild condition, but
Cloudflare Workers has no DOMParser or DOM Node constants.

Polyfilling via @xmldom/xmldom causes TypeScript dom-lib type conflicts
throughout the worker. Pinning below the breakpoint is the clean fix until
AWS adds a workerd export condition.

Refs: aws/aws-sdk-js-v3#7375
      cloudflare/workers-sdk#10755
Template catalog items send notes: null but both CreatePackItemRequestSchema
and UpdatePackItemRequestSchema only accepted string | undefined via .optional().
Changed both to .nullish() to accept null as well.
Plain View root caused LargeTitleHeader button/content to render behind
the header on iOS. Matches the SafeAreaView pattern used by other screens
such as gear-inventory.tsx.
Catalog items carry full https:// image URLs. Concatenating cacheDirectory
with a URL produced an invalid local path that FileSystem.uploadAsync then
tried to open, crashing with ERR_FILE_NOT_EXISTS. Guard both createPackItem
and updatePackItem to only upload when the image is a local filename.
…View

LargeTitleHeader.ios.tsx renders only Stack.Screen options (nothing in
the RN tree); the native large title is transparent and overlays content.
SafeAreaView only covers the device safe area, not the nav bar height.
Fragment wrapper + contentInsetAdjustmentBehavior="automatic" lets iOS
calculate the correct scroll inset, matching weather-alert-preferences.tsx.
…leHeader screens

All 19 screens using LargeTitleHeader were missing this prop on their main
scroll component, causing content to render behind the transparent native
header on iOS. Fixes the overlap bug found on SeasonSuggestions.
- Remove .optional() from tags in generateObject schema; OpenAI structured
  output requires all properties in the required array
- Fix Icon usage: pass namingScheme="sfSymbol" + name= so iconNames.sfSymbol
  is truthy on iOS, preventing fallthrough to MaterialCommunityIcons with
  MaterialIcons-only names (auto-awesome, eco, location-on)
Catalog template items store a full https:// URL in image. CachedImage
uses the image field as a local filename (cacheDirectory + fileName),
producing an invalid path like /Documents/images/https://... that
downloadAsync then fails to create. Guard: if image is a remote URL,
render <Image> directly — same check applied to uploadImage in packItems.ts.
…tem FK race

- Add isRemoteUrl() to packages/guards/src/narrow.ts and remove the two
  inline copies in packItems.ts and PackItemImage.tsx

- Delay item store writes by 1500ms in useCreatePackWithItems so the pack
  API call has time to commit before items are synced. Without this, Legend
  State's parallel sync triggers FK violations (23503) on pack_items.
  UI is unaffected — items appear immediately via optimistic store update.
parseISO('') crashes internally when date-fns tries to split an empty
string on 'T' and accesses the undefined second part. Accept
string | null | undefined, bail out early on falsy input, and skip
NaN dates. The pack/item timestamps can be absent before server sync.
…viver

Legend State's `safeParse` silently converts ISO8601 strings to `Date`
objects when loading from SQLite, causing `parseISO(Date)` to throw
`dateString.split is not a function`.

- Rewrote `getRelativeTime` to accept `Date | string | null | undefined`
  via a `toDate()` helper; `parseISO` removed in favour of `new Date()`
- Added optional `t: TFunction` param so relative times are translated
- Added `common.timeAgo.*` i18n keys (justNow + pluralised units) to en.json
- Hardened `PackItem`, `Pack`, `PackWeightHistoryEntry` timestamp fields
  to `Date | string` to reflect runtime reality
- Updated call sites in recent-packs and current-pack to pass `t`
- Remove the ENVIRONMENT=production 503 guard on /token — Basic-only
  remains valid when CF vars are absent (no CF account or misconfigured)
- Add scoped CORS on adminRoutes (origin: admin.packratai.com,
  credentials: true) so the browser can send the CF Access session
  cookie cross-origin; CF edge then injects Cf-Access-Jwt-Assertion
- Add credentials: 'include' to adminFetch and the login page fetch
  so the CF Access session cookie travels with every API request
- Update /token CF check comment to reflect the browser flow
- Update tests: replace 503 assertion with Basic-only-in-prod test
fix(admin): wire CF Access two-factor auth for browser SPA login
…ameterization

fix(admin/analytics): use sql.raw for date_trunc period to avoid parameter mismatch
…tInsetAdjustmentBehavior

- PackItemDetailScreen: edges={['bottom']} — regular stack header already offsets content
- current-pack, weight-analysis, trail-conditions: strip manual paddingTop/insets since
  contentInsetAdjustmentBehavior=automatic handles nav bar offset
…h contentInsetAdjustmentBehavior"

This reverts commit 715a013.
…k-schema

fix: iOS runtime crashes, date hardening, and icon fixes
andrew-bierman and others added 6 commits April 26, 2026 21:58
chore: regenerate bun.lock after merge (fix frozen-lockfile CI)
…leHeader screens

All 19 screens using LargeTitleHeader were missing this prop on their main
scroll component, causing content to render behind the transparent native
header on iOS. Fixes the overlap bug found on SeasonSuggestions.
…tInsetAdjustmentBehavior

- PackItemDetailScreen: edges={['bottom']} — regular stack header already offsets content
- current-pack, weight-analysis, trail-conditions: strip manual paddingTop/insets since
  contentInsetAdjustmentBehavior=automatic handles nav bar offset
fix: iOS contentInsetAdjustmentBehavior for all LargeTitleHeader screens
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2740d3d2-eefb-4e9c-b49e-5af06c51d86f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: String must contain at most 250 character(s) at "tone_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch main

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file api mobile labels Apr 28, 2026
@mikib0 mikib0 changed the title Main - Main -> Development Apr 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Expo Unit Tests Coverage (./apps/expo)

Status Category Percentage Covered / Total
🔵 Lines 81.65% 534 / 654
🔵 Statements 81.65% (🎯 75%) 534 / 654
🔵 Functions 92.98% 53 / 57
🔵 Branches 90.13% 201 / 223
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/expo/lib/utils/getRelativeTime.ts 96.77% 57.14% 100% 96.77% 33
Generated in workflow #906 for commit 9cbd0c6 by the Vitest Coverage Report Action

@mikib0 mikib0 merged commit cae0026 into development Apr 28, 2026
12 of 18 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for API Unit Tests Coverage (./packages/api)

Status Category Percentage Covered / Total
🔵 Lines 75.74% 609 / 804
🔵 Statements 75.74% (🎯 65%) 609 / 804
🔵 Functions 95.91% 47 / 49
🔵 Branches 88.23% 270 / 306
File CoverageNo changed files found.
Generated in workflow #906 for commit 9cbd0c6 by the Vitest Coverage Report Action

andrew-bierman pushed a commit that referenced this pull request May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api dependencies Pull requests that update a dependency file mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants