Skip to content

Frontend: UI for Strava webhook configuration#102

Draft
Copilot wants to merge 3 commits intoiss-59from
copilot/add-strava-webhook-ui
Draft

Frontend: UI for Strava webhook configuration#102
Copilot wants to merge 3 commits intoiss-59from
copilot/add-strava-webhook-ui

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 20, 2025

Summary

Adds frontend UI components for Strava webhook configuration as specified in issue #59. This PR implements the user-facing elements needed to configure automatic Strava activity syncing, including:

  • Plan creation toggle to enable webhook syncing for new plans
  • Retroactive sync button in the plans index for existing plans
  • Status indicators showing which plans have sync enabled
  • Unmatched activity notifications to surface activities that couldn't be auto-matched

Screenshot

Strava Webhook UI Mockups

The mockup demonstrates all four UI components:

  1. Plan Creation Form - Checkbox to enable Strava Activity Sync with descriptive help text
  2. Plans Index - "Enable Sync" button for plans without webhook, green checkmark badge for enabled plans
  3. Plan Show - Status Banner - Confirmation banner when webhook sync is active
  4. Plan Show - Unmatched Activities - Notification section with Link/Dismiss actions

Implementation Details

Graceful Degradation

The UI uses respond_to?(:webhook_enabled?) checks throughout to handle cases where the database column doesn't exist yet. This allows the frontend to be deployed independently of the backend implementation, preventing errors and providing a smooth migration path.

User Experience

  • Clear, descriptive labels explain what webhook syncing does
  • Confirmation dialog before enabling sync retroactively
  • Visual distinction between enabled/disabled states (green checkmark vs. yellow "Enable Sync" button)
  • Actionable interface for handling unmatched activities

Controller Changes

Added enable_webhook_sync action to handle retroactive webhook enabling:

def enable_webhook_sync
  if @plan.respond_to?(:webhook_enabled=)
    @plan.update(webhook_enabled: true)
    redirect_to plans_path, notice: "Strava activity sync has been enabled for this plan."
  else
    redirect_to plans_path, alert: "Webhook sync is not available yet. Database migration pending."
  end
end

Styling

All components use existing Tailwind CSS utility classes and follow the app's design patterns:

  • Green for success states (webhook enabled)
  • Amber for warnings (unmatched activities)
  • Consistent spacing, typography, and mobile-responsive layout

Testing

Added comprehensive test coverage:

  • Controller tests verify form checkbox presence and enable_webhook_sync action
  • System tests verify all UI elements render correctly
  • Tests use conditional skipping when webhook_enabled column doesn't exist

Scope

This PR focuses exclusively on frontend UI as requested in the issue. The backend implementation (database migrations, webhook endpoint, background jobs, matching algorithm) will be handled in separate PRs per the parent issue #59.

Related

Addresses #59 (UI portion)

Original prompt

This section details on the original issue you should resolve

<issue_title>Frontend: UI for Strava webhook configuration</issue_title>
<issue_description>See parent issue #59 for overall context.

Add toggle to plan creation form, add sync button to plans view, handle unmatched activity notifications</issue_description>

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

Fixes #99


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits October 20, 2025 14:59
Co-authored-by: apdarr <3004606+apdarr@users.noreply.github.com>
Co-authored-by: apdarr <3004606+apdarr@users.noreply.github.com>
Copilot AI changed the title [WIP] Add UI components for Strava webhook configuration Frontend: UI for Strava webhook configuration Oct 20, 2025
Copilot AI requested a review from apdarr October 20, 2025 15:08
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