Skip to content

feat: Featured Packs — curated pack templates with seed data and UI section#1886

Merged
andrew-bierman merged 3 commits into
developmentfrom
copilot/add-featured-packs-section
Apr 11, 2026
Merged

feat: Featured Packs — curated pack templates with seed data and UI section#1886
andrew-bierman merged 3 commits into
developmentfrom
copilot/add-featured-packs-section

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

  • Explore existing pack templates code and understand the architecture
  • Create seed data script (packages/api/src/db/seed.ts) with 6 featured pack types
  • Add db:seed script to packages/api/package.json
  • Create FeaturedPacksSection component
  • Update PackTemplateListScreen to show featured packs section
  • Update translations
  • Run lint/format checks
  • Rebase onto main — merged packages/api/package.json conflict (kept db:seed + incorporated main's test:unit, test:unit:coverage, and @vitest/coverage-v8); brought in all other files added/modified in main (test files, vitest configs, landing page updates)
Original prompt

This section details on the original issue you should resolve

<issue_title>Feature request: Create Pack Templates Based on the links provided for Gear Lists - "Featured Packs"</issue_title>
<issue_description>This feature request is based on @andrew-bierman 's idea. We want to introduce a new section in the app called "Featured Packs". These will be predefined hiking and camping packs. We aim to create predefined pack templates within the app based on content creators who share detailed "What I pack" videos for hiking and camping trips. The goal is to allow users to quickly select a realistic, field-tested pack setup and customize it for their own trip.

generate packs something like this:
https://www.tiktok.com/@xplor.outdoors/photo/7593292144874458390?_r=1&_t=ZT-947ZTMhgBMj

Other links will be provided below.

Pack Types to Include:

  • Day Pack
  • Overnight Pack
  • Weekend Pack
  • Multi-Day Pack
  • Winter Hiking Pack
  • Winter Camping Pack

Each pack should clearly indicate:

  • Trip duration
  • Environment type
  • Intended use ( hiking, camping, etc)

Objective:
Enable users to:

  • View curated "Featured" packs templates
  • See categorized pack list
  • View estimated total pack weight
  • Add the full pack or selected items directly to their trip checklist.
  • Modify/remove items as needed.

Initial Scope:

  1. Integration
  1. Requirements
  • New section "Featured Packs"
  • Ability to:
  • View full pack breakdown
  • See total weight
  • Add entire pack to trip
  • Add individual items only

Example Use Case:
User planning a 2-day mountain hike, user can choose from "Day Pack" "Overnight/Weekend Pack" "Multi-Day Pack". They import the pack to their trip, remove non-essential items, and adjust based on weather.

</issue_description>

Comments on the Issue (you are @copilot in this section)

@andrew-bierman @copilot Assigned for POC development. Please investigate and create a proof of concept implementation.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add new section for Featured Packs in app feat: Featured Packs — curated pack templates with seed data and UI section Mar 9, 2026
@andrew-bierman
Copy link
Copy Markdown
Collaborator

@coderabbitai Please review this PR for code quality, best practices, and potential issues.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 9, 2026

Rate Limit Exceeded

@andrew-bierman have exceeded the limit for the number of chat messages per hour. Please wait 0 minutes and 45 seconds before sending another message.

@andrew-bierman
Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 9, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 9, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 567ddfdf-d353-43a6-ad6e-10f02098e037

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/add-featured-packs-section

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

@andrew-bierman
Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 9, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@andrew-bierman
Copy link
Copy Markdown
Collaborator

@copilot This PR has merge conflicts with main. Please rebase onto main and resolve the conflicts.

@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

cloudflare-workers-and-pages Bot commented Mar 10, 2026

Deploying packrat-landing with  Cloudflare Pages  Cloudflare Pages

Latest commit: cd883aa
Status: ✅  Deploy successful!
Preview URL: https://de55878e.packrat-landing.pages.dev
Branch Preview URL: https://copilot-add-featured-packs-s.packrat-landing.pages.dev

View logs

@andrew-bierman andrew-bierman marked this pull request as ready for review March 10, 2026 02:28
Copilot AI review requested due to automatic review settings March 10, 2026 02:28
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 10, 2026

@copilot This PR has merge conflicts with main. Please rebase onto main and resolve the conflicts.

Done (commit cd883aa). The branch is now up to date with main. The only conflict was in packages/api/package.json — main added test:unit, test:unit:coverage scripts and @vitest/coverage-v8; those have been merged alongside the db:seed script from this PR. The diff against main now contains only the 5 feature files.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “Featured Packs” concept to Pack Templates by seeding curated isAppTemplate templates in the API DB and surfacing them in the Expo app with a dedicated horizontal section and updated translations.

Changes:

  • Add an idempotent-ish seed script that inserts 6 curated isAppTemplate pack templates with items.
  • Add FeaturedPacksSection UI and inject it into the Pack Templates list header.
  • Update English translations to rename “App”/“App Template” to “Featured” and add new Featured Packs strings.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/api/src/db/seed.ts New seed script that inserts 6 featured pack templates + items.
packages/api/package.json Adds db:seed script to run the new seed file.
apps/expo/lib/i18n/locales/en.json Updates “App” wording to “Featured” and adds new i18n keys for the section.
apps/expo/features/pack-templates/screens/PackTemplateListScreen.tsx Renders FeaturedPacksSection in the All tab header.
apps/expo/features/pack-templates/components/FeaturedPacksSection.tsx New horizontal featured templates strip with cards and “View All”.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +1889 to +1895
// Check if this featured template already exists (idempotent seed)
const existing = await seedDb.query.packTemplates.findFirst({
where: and(
eq(schema.packTemplates.id, templateDef.id),
eq(schema.packTemplates.deleted, false),
),
});
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The seed is not fully idempotent when a featured template already exists but is soft-deleted. The lookup only considers rows with deleted=false; if a row exists with the same id and deleted=true, this will attempt to insert a duplicate primary key and the script will fail. Consider checking by id regardless of deleted state, and either skip, undelete/update the existing row, or use an upsert strategy.

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +98
<Pressable onPress={() => router.push('/pack-templates')}>
<Text className="text-sm text-primary">{t('packTemplates.viewAll')}</Text>
</Pressable>
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

"View All" currently does router.push('/pack-templates'), which navigates to the same screen the section is rendered on (and may push a duplicate route onto the stack). If the intent is to show all featured templates, this should instead switch the segmented control to the Featured tab (index 1) and reset filters/search, or accept an onViewAll callback from the parent to perform that state change.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +70
<Text className="text-xs text-muted-foreground">
{template.items && isArray(template.items)
? `${template.items.length} ${t('packTemplates.items')}`
: `0 ${t('packTemplates.items')}`}
</Text>
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The item count label always uses the plural translation (t('packTemplates.items')), which can render grammatically incorrect strings like "1 items". Match the pluralization logic used in PackTemplateCard by choosing item vs items based on template.items.length.

Copilot uses AI. Check for mistakes.
Comment thread apps/expo/lib/i18n/locales/en.json Outdated
@@ -817,7 +817,7 @@
"type": "Type",
"markAsAppTemplate": "Mark as App Template",
"appTemplateFootnote": "App templates are shown to all users. Option is only available to admins.",
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The UI labels were changed to show "Featured", but appTemplateFootnote still says "App templates are shown to all users..." which is inconsistent/confusing in the updated UI. Update the footnote copy to use the same term users now see (e.g., "Featured templates").

Suggested change
"appTemplateFootnote": "App templates are shown to all users. Option is only available to admins.",
"appTemplateFootnote": "Featured templates are shown to all users. Option is only available to admins.",

Copilot uses AI. Check for mistakes.
const argUserIdRaw = process.argv[2] ? Number.parseInt(process.argv[2], 10) : undefined;
if (argUserIdRaw !== undefined && Number.isNaN(argUserIdRaw)) {
throw new Error(
'Invalid user ID provided. Please provide a valid numeric user ID, e.g.: bun run seed.ts 1',
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The CLI usage hint in this error message (bun run seed.ts 1) doesn't match the actual invocation paths documented at the top of the file or the new db:seed script. Update the message to reflect a command users can actually run (e.g., bun run db:seed 1 or bun run ./src/db/seed.ts 1).

Suggested change
'Invalid user ID provided. Please provide a valid numeric user ID, e.g.: bun run seed.ts 1',
'Invalid user ID provided. Please provide a valid numeric user ID, e.g.: NEON_DATABASE_URL=<url> bun run packages/api/src/db/seed.ts 1',

Copilot uses AI. Check for mistakes.
});
if (!adminUser) {
throw new Error(
'No ADMIN user found in the database. Please provide a user ID as argument: bun run seed.ts <userId>',
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This error message references bun run seed.ts <userId>, but the script is located at src/db/seed.ts and is also exposed via the db:seed package script. Adjust the message so the suggested command is valid for typical usage.

Suggested change
'No ADMIN user found in the database. Please provide a user ID as argument: bun run seed.ts <userId>',
'No ADMIN user found in the database. Please provide a user ID as argument: bun run db:seed <userId>',

Copilot uses AI. Check for mistakes.
@andrew-bierman andrew-bierman changed the base branch from main to development March 12, 2026 05:23
Copilot AI and others added 2 commits April 10, 2026 22:37
… data

Co-authored-by: andrew-bierman <94939237+andrew-bierman@users.noreply.github.com>
@andrew-bierman andrew-bierman force-pushed the copilot/add-featured-packs-section branch from 4308d87 to 389a488 Compare April 11, 2026 04:40
@github-actions
Copy link
Copy Markdown
Contributor

ghost commented Apr 11, 2026

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

Status Category Percentage Covered / Total
🔵 Lines 75.92% 495 / 652
🔵 Statements 75.92% (🎯 75%) 495 / 652
🔵 Functions 92.72% 51 / 55
🔵 Branches 91.82% 191 / 208
File CoverageNo changed files found.
Generated in workflow #45 for commit 0007888 by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

ghost commented Apr 11, 2026

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

Status Category Percentage Covered / Total
🔵 Lines 96.57% 902 / 934
🔵 Statements 96.57% (🎯 80%) 902 / 934
🔵 Functions 100% 48 / 48
🔵 Branches 90.03% 280 / 311
File CoverageNo changed files found.
Generated in workflow #45 for commit 0007888 by the Vitest Coverage Report Action

The previous discriminated union erased the schema generic, so every
seedDb.query.* access resolved to {}. The workaround was a lossy
'as ReturnType<typeof drizzlePg>' cast.

Import NodePgDatabase and NeonHttpDatabase generics, parameterize both
with typeof schema, and drop the cast. Both query callers
(users.findFirst, packTemplates.findFirst) type correctly.
@andrew-bierman andrew-bierman merged commit f10e9d9 into development Apr 11, 2026
7 of 9 checks passed
@andrew-bierman andrew-bierman deleted the copilot/add-featured-packs-section branch April 11, 2026 04:49
andrew-bierman added a commit that referenced this pull request Apr 11, 2026
Removes nine keys added in #1886 under `packTemplates` that were never
referenced anywhere in the monorepo: dayHike, overnight, weekendCamping,
multiDay, winterHiking, winterCamping, tripDuration, environment,
intendedUse.
andrew-bierman added a commit that referenced this pull request Apr 11, 2026
andrew-bierman added a commit that referenced this pull request May 14, 2026
…ection

feat: Featured Packs — curated pack templates with seed data and UI section
andrew-bierman added a commit that referenced this pull request May 14, 2026
Removes nine keys added in #1886 under `packTemplates` that were never
referenced anywhere in the monorepo: dayHike, overnight, weekendCamping,
multiDay, winterHiking, winterCamping, tripDuration, environment,
intendedUse.
andrew-bierman added 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 database dependencies Pull requests that update a dependency file mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Create Pack Templates Based on the links provided for Gear Lists - "Featured Packs"

3 participants