Skip to content

[server][web][mobile] Show climbing attempt outcomes - #1871

Merged
Asherlc merged 3 commits into
mainfrom
Asherlc/fix-incomplete-activity-sync
Jul 22, 2026
Merged

Asherlc merged 3 commits into
mainfrom
Asherlc/fix-incomplete-activity-sync

Conversation

@Asherlc

@Asherlc Asherlc commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • expose climbing attempt counts and provider-recorded ascent classifications from the activity detail API
  • render route/problem names, ascent types, and explicit sent/attempted wording consistently on web and mobile
  • accept Kaya flash ascents, share result formatting across clients, and document the production diagnosis

Validation

pnpm lint, workspace/server/web TypeScript checks, pnpm test (12,978 passed), and the real-Postgres climbing integration suite (4 passed).


Summary by cubic

Show per-climb attempt outcomes and ascent types in activity details on web and mobile, using clear “Sent in N attempts”/“Attempted N times.” Extracts the climbing UI into small components and adds a docs entry with the production diagnosis and validation.

  • Bug Fixes

    • Server detail API returns attemptCount and ascentType for each climb.
    • Web and mobile display ascent type (when present) and outcome using attempt counts.
  • New Features

    • @dofek/format adds formatClimbingAttemptResult(sent, attemptCount).
    • src/providers/kaya importer accepts Flash as a successful ascent.

Written for commit af0b7f4. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Activity details now show ascent types, route names, and precise attempt counts.
    • Climbing results use clearer wording, such as “Sent in 7 attempts” or “Attempted 1 time.”
    • Kaya imports now recognize Flash and Repeat ascents as successful.
  • Bug Fixes

    • Fixed activity details collapsing climbing results into a generic “Sent” status.
    • Improved display of multiple climbs within a single activity.

Copilot AI review requested due to automatic review settings July 22, 2026 21:30

@sourcery-ai sourcery-ai Bot left a comment

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.

Sorry @Asherlc, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Per-climb attempt counts and ascent types now flow from Kaya imports and repository queries through the activity detail API to web and mobile displays. A shared formatter produces count-aware result text, with tests covering API mapping, rendering, and Flash imports.

Changes

Climbing activity detail enrichment

Layer / File(s) Summary
Kaya ascent classification
src/providers/kaya/import.ts, src/providers/kaya/import.test.ts
Kaya parsing recognizes Flash and Repeat as successful ascent types, with coverage for Flash imports.
Activity entry API fields
packages/server/src/repositories/climbing-repository.ts, packages/server/src/repositories/climbing-repository.test.ts, packages/server/src/routers/climbing.integration.test.ts
Activity entries select, validate, map, serialize, and test attemptCount and nullable ascentType.
Attempt result formatting and client rendering
packages/format/src/format.ts, packages/format/src/format.test.ts, packages/web/src/pages/ActivityDetailPage.tsx, packages/web/src/pages/ActivityDetailPage.test.tsx, packages/mobile/app/activity/[id].tsx, packages/mobile/app/activity/[id].test.tsx
Web and mobile screens show ascent classifications and formatted “Sent in N attempts” or “Attempted N times” text.
Production incident record
docs/production-incident-baseline.md
Documents the API, client, display, and Kaya import changes, validation outcomes, and remaining limitations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Asherlc/dofek#1572: Overlaps with Kaya export parsing and climbing entry ascent/attempt handling.
  • Asherlc/dofek#1860: Overlaps with attempt_count usage in climbing repository queries and tests.

Suggested labels: area/server, area/web, area/mobile, area/providers, type/feature

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is imperative, under 70 characters, properly area-prefixed, and matches the climbing attempt outcome changes.

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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews.

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Mobile Preview

Scan to open on device:

QR code for dofek://preview/pr-1871

Channel pr-1871
Deep Link dofek://preview/pr-1871
Commit 5afe92d

To test on device:

  1. Build and install the preview client: PREVIEW_CHANNEL=pr-1871 pnpm expo prebuild --clean -p ios
  2. Or tap deep link on an existing preview build: dofek://preview/pr-1871

Each PR gets its own channel. Build a preview client with PREVIEW_CHANNEL=pr-{N} to test.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Storybook previews for 5afe92d9 are ready:

This comment updates automatically on each PR push.

@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/server/src/repositories/climbing-repository.ts`:
- Line 107: Derive the ascentType type from the canonical Zod schema
activityEntryRowSchema instead of maintaining the duplicated string union.
Define or reuse an inferred schema type and reference its ascentType property in
both the row type declaration and the schema-related definition, preserving
nullability and keeping activityEntryRowSchema as the single source of truth.

In `@packages/server/src/routers/climbing.integration.test.ts`:
- Around line 241-258: Extend the real-Postgres fixture used by the climbing
integration test to include one entry with a non-null ascent type such as
“Redpoint” or “Flash”. Update the corresponding activityEntries assertion to
verify that extracted ascentType value, while preserving the existing
null-ascent assertions.

In `@packages/web/src/pages/ActivityDetailPage.tsx`:
- Around line 305-309: Extract the climbing breakdown rendering, including the
ascent type and formatted attempt result logic surrounding
formatClimbingAttemptResult, from ActivityDetailPage into a focused
ClimbingEntryBreakdown component/module. Replace the inline markup with that
component while preserving the existing props, conditional rendering, styling,
and behavior, and ensure ActivityDetailPage remains under the 1000-line limit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bf087ead-355c-4210-b042-62f63fbee03c

📥 Commits

Reviewing files that changed from the base of the PR and between 28cc738 and 667f6ed.

📒 Files selected for processing (12)
  • docs/production-incident-baseline.md
  • packages/format/src/format.test.ts
  • packages/format/src/format.ts
  • packages/mobile/app/activity/[id].test.tsx
  • packages/mobile/app/activity/[id].tsx
  • packages/server/src/repositories/climbing-repository.test.ts
  • packages/server/src/repositories/climbing-repository.ts
  • packages/server/src/routers/climbing.integration.test.ts
  • packages/web/src/pages/ActivityDetailPage.test.tsx
  • packages/web/src/pages/ActivityDetailPage.tsx
  • src/providers/kaya/import.test.ts
  • src/providers/kaya/import.ts

Comment thread packages/server/src/repositories/climbing-repository.ts Outdated
Comment thread packages/server/src/routers/climbing.integration.test.ts
Comment thread packages/web/src/pages/ActivityDetailPage.tsx Outdated
@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds detailed climbing outcomes to activity details. The main changes are:

  • Returns attempt counts and ascent classifications from the server.
  • Uses shared outcome wording on web and mobile.
  • Treats Kaya Flash records as successful ascents.
  • Documents the production diagnosis and validation.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • Database constraints support the new positive attempt-count validation.
  • Missing ascent classifications remain nullable, while Kaya values match the server enum.
  • Web and mobile use the same formatter and preserve matching behavior.

Important Files Changed

Filename Overview
packages/server/src/repositories/climbing-repository.ts Adds validated attempt counts and nullable ascent classifications to climbing activity entries.
packages/format/src/format.ts Adds shared singular and plural wording for climbing outcomes.
packages/web/src/pages/activity-detail/components/ClimbingEntryBreakdown.tsx Renders route names, ascent classifications, and attempt results on web.
packages/mobile/app/activity/[id].tsx Renders the same climbing details and shared outcome wording on mobile.
src/providers/kaya/import.ts Adds Flash to Kaya's successful ascent classifications.
packages/web/src/pages/activity-detail/components/DeleteActivityButton.tsx Moves the existing activity deletion control into a focused component without changing behavior.
docs/production-incident-baseline.md Records the production symptom, cause, fix, validation, and remaining limits.

Reviews (1): Last reviewed commit: "refactor(climbing): address PR review" | Re-trigger Greptile

@Asherlc Asherlc changed the title Show climbing attempt outcomes in activity details [server][web][mobile] Show climbing attempt outcomes Jul 22, 2026
@Asherlc
Asherlc merged commit 5338e75 into main Jul 22, 2026
108 checks passed
@Asherlc
Asherlc deleted the Asherlc/fix-incomplete-activity-sync branch July 22, 2026 22:49
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.

2 participants