Skip to content

feat(iOS): Add comprehensive Trail Conditions feature with filtering, reporting, and condition history#1885

Merged
andrew-bierman merged 4 commits into
developmentfrom
copilot/add-trail-conditions-ios
Apr 11, 2026
Merged

feat(iOS): Add comprehensive Trail Conditions feature with filtering, reporting, and condition history#1885
andrew-bierman merged 4 commits into
developmentfrom
copilot/add-trail-conditions-ios

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

Trail Conditions was only accessible via a home dashboard tile with read-only mock data using vague condition labels. This PR expands the feature to the full spec — proper condition taxonomy, field reporting, filtering, and a dedicated entry point in the Trips tab.

Trail Conditions Screen (trail-conditions.tsx)

  • Replaced Good/Fair/Poor/Excellent with typed surface conditions: Dry | Muddy | Snow | Ice | Closed
  • Added all 8 condition categories per trail card: obstacles, water crossings, fire danger, bug activity, vegetation overgrowth, parking, and facility status — each with color-coded severity
  • Sticky filter bar to filter the trail list by surface condition
  • Expandable cards — tap to reveal timestamped hiker report history
  • "Report Condition" modal (presentationStyle="pageSheet") with chip selectors for surface/obstacles/water crossings, a notes field, and a photo upload placeholder
// Typed condition data replaces flat string fields
interface TrailConditionData {
  surface: 'Dry' | 'Muddy' | 'Snow' | 'Ice' | 'Closed';
  obstacles: 'None' | 'Minor' | 'Major';
  waterCrossings: 'Easy' | 'Moderate' | 'Difficult' | 'Flooded' | 'N/A';
  fireDanger: 'Low' | 'Moderate' | 'High' | 'Extreme';
  bugActivity: 'Low' | 'Moderate' | 'High';
  vegetationOvergrowth: boolean;
  parkingAvailable: boolean;
  facilitiesOpen: boolean;
  reports: TrailReport[]; // includes timestamps
}

Trips Tab (TripListScreen.tsx)

  • Added TrailConditionsBanner as ListHeaderComponent — gives iOS users a direct entry point from the Trips tab, not just the home dashboard

i18n (en.json)

  • Added trailConditions namespace (34 keys) and common.submit
Original prompt

This section details on the original issue you should resolve

<issue_title>Feature request: [iOS] Add "Trail Conditions" to iOS (currently only available on Android)</issue_title>
<issue_description>The Trail Conditions feature is currently available on Android but is missing on iOS. iOS users cannot view or access real-time trail conditions, creating platform inequality and a poor user experience for hikers and outdoor enthusiasts on iOS.

Current state:

  • Android: Trail Conditions available
  • iOS: No Trail Conditions feature available

Required Implementation for iOS:

Trail Conditions Feature Set:

  • View current trail conditions (e.g., "Dry", "Muddy", "Snow-covered", "icy", "Closed")
  • Report trail conditions from the field
  • Upload photos with condition reports (if possible)
  • View condition history for specific trails
  • Filter trails by current conditions (if possible)
  • Push notifications for condition reports with timestamps
  • Official trail status updates from park services

Condition Types Needed:

  • Trail surface condition (Dry/Muddy/Snow/Ice)
  • Obstacles (fallen trees, rock slides, washouts)
  • Water crossings (depth, flow rate)
  • Fire danger/restrictions
  • Bug activity
  • Vegetation overgrowth
  • Parking availability at the trailhead
  • Facility status (bathrooms/ water sources)</issue_description>

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add Trail Conditions feature to iOS feat(iOS): Add comprehensive Trail Conditions feature with filtering, reporting, and condition history 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 42 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: 34fd59ed-c786-4555-9d82-97994abd85bb

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-trail-conditions-ios

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 andrew-bierman marked this pull request as ready for review March 10, 2026 02:26
Copilot AI review requested due to automatic review settings March 10, 2026 02:26
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

Expands the Expo app’s Trail Conditions experience by introducing a richer condition taxonomy, filtering + history UI, and a new entry point from the Trips tab, with supporting i18n strings.

Changes:

  • Added trailConditions i18n namespace and common.submit.
  • Added a Trips tab banner linking to /trail-conditions.
  • Reworked the Trail Conditions screen with typed condition categories, a sticky surface filter, expandable history cards, and a “Report Condition” modal (UI-only submission).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
apps/expo/lib/i18n/locales/en.json Adds Trail Conditions translation namespace + common.submit.
apps/expo/features/trips/screens/TripListScreen.tsx Adds TrailConditionsBanner as a Trips list header linking to the Trail Conditions screen.
apps/expo/app/(app)/trail-conditions.tsx Implements new Trail Conditions UI: typed conditions, filter bar, expandable report history, and reporting modal.

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

Comment on lines +226 to +233
const SURFACE_FILTERS: Array<{ label: string; value: SurfaceCondition | 'All' }> = [
{ label: 'All', value: 'All' },
{ label: 'Dry', value: 'Dry' },
{ label: 'Muddy', value: 'Muddy' },
{ label: 'Snow', value: 'Snow' },
{ label: 'Ice', value: 'Ice' },
{ label: 'Closed', value: 'Closed' },
];
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.

SURFACE_FILTERS hard-codes English labels ("All", "Dry", etc.) even though the rest of the screen is localized via t(...). Consider adding i18n keys for these filter labels (and optionally deriving this array from a single SurfaceCondition[] source) so the filter bar can be translated consistently.

Copilot uses AI. Check for mistakes.
Comment on lines +668 to +672
activeFilter === filter.value
? filter.value === 'All'
? 'bg-primary'
: getSurfaceBadgeColor(filter.value as SurfaceCondition)
: 'bg-muted dark:bg-gray-50/10',
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 filter chip color logic uses a as SurfaceCondition cast when calling getSurfaceBadgeColor(...), which bypasses type-safety and can hide future bugs if new filter values are added. You can avoid the cast by narrowing on filter.value !== 'All' (or by splitting the "All" option out) so TypeScript enforces the valid surface values.

Copilot uses AI. Check for mistakes.
Comment on lines +657 to +661
<ScrollView className="flex-1" stickyHeaderIndices={[0]}>
{/* Filter bar — sticky */}
<View className="border-b border-border bg-background px-4 pb-3 pt-2">
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
<View className="flex-row gap-2">
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 screen renders the trail list inside a vertical ScrollView and maps items directly, which will render all cards at once (no virtualization). If this is intended to scale beyond a handful of mock rows, consider switching to FlatList (with a header component for the filter bar + subtitle) to avoid performance/memory issues as the number of trails/reports grows.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +30
interface TrailReport {
user: string;
date: string;
text: string;
timestamp: string;
}
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.

TrailReport stores both a display date string and a timestamp ISO string, but the UI displays report.date while timestamp is only used as the React key. To avoid duplicated/possibly-inconsistent date sources, consider storing a single timestamp and formatting it for display (or remove timestamp if you only need a display date).

Copilot uses AI. Check for mistakes.
@andrew-bierman andrew-bierman changed the base branch from main to development March 12, 2026 05:23
@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

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

Deploying packrat-landing with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4264490
Status:🚫  Build failed.

View logs

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

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

Deploying packrat-guides with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4264490
Status:🚫  Build failed.

View logs

@andrew-bierman andrew-bierman force-pushed the copilot/add-trail-conditions-ios branch from d672a8b to 4bcf824 Compare April 11, 2026 05:41
Copilot AI and others added 4 commits April 10, 2026 23:54
…ng, reporting, and condition history

Co-authored-by: andrew-bierman <94939237+andrew-bierman@users.noreply.github.com>
…arnings and add safe area padding for header overlap
…tion

- Add trailConditions.filters.{all,paved,gravel,dirt,rocky,snow,mud} keys
  to en.json so surface filter labels are localizable
- Introduce SURFACE_FILTERS (FilterItem[]) inside the component, using t()
  for each label — no more hardcoded English strings
- Add SurfaceFilter type (TrailSurface | 'all') and selectedSurface state;
  filter reports with useMemo before rendering
- getSurfaceBadgeColor takes a narrowed TrailSurface (never 'all') via a
  filter.value !== 'all' check, eliminating the unsafe type cast
- Replace ScrollView + map with FlatList; filter bar and subtitle moved
  into ListHeaderComponent, disclaimer into ListFooterComponent — list
  items are now virtualized
@andrew-bierman andrew-bierman force-pushed the copilot/add-trail-conditions-ios branch from f843b96 to 3a222cc Compare April 11, 2026 06:04
@andrew-bierman andrew-bierman merged commit f37e083 into development Apr 11, 2026
2 of 6 checks passed
@andrew-bierman andrew-bierman deleted the copilot/add-trail-conditions-ios branch April 11, 2026 06:06
andrew-bierman added a commit that referenced this pull request Apr 11, 2026
#1885 shipped with Icon name="terrain" which isn't in the @roninoss/icons
SF Symbol allowlist, breaking check-types on development. Replace with
"map" — valid and semantically equivalent for a trail-conditions banner.
andrew-bierman added a commit that referenced this pull request Apr 11, 2026
#1885 shipped with Icon name="terrain" which isn't in the @roninoss/icons
SF Symbol allowlist, breaking check-types on development. Replace with
"map" — valid and semantically equivalent for a trail-conditions banner.
andrew-bierman added a commit that referenced this pull request Apr 11, 2026
#1885 shipped with Icon name="terrain" which isn't in the @roninoss/icons
SF Symbol allowlist, breaking check-types on development. Replace with
"map" — valid and semantically equivalent for a trail-conditions banner.
andrew-bierman added a commit that referenced this pull request Apr 11, 2026
…nents

Replace invalid icon names (like 'delete') that weren't in the nwui Icon
type allowlist. These were causing check-types failures on development
after #1882, #1885, #1906 merged.
andrew-bierman added a commit that referenced this pull request May 14, 2026
#1885 shipped with Icon name="terrain" which isn't in the @roninoss/icons
SF Symbol allowlist, breaking check-types on development. Replace with
"map" — valid and semantically equivalent for a trail-conditions banner.
andrew-bierman added a commit that referenced this pull request May 14, 2026
…nents

Replace invalid icon names (like 'delete') that weren't in the nwui Icon
type allowlist. These were causing check-types failures on development
after #1882, #1885, #1906 merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: [iOS] Add "Trail Conditions" to iOS (currently only available on Android)

4 participants