Skip to content

feat: watch app + intents + race tools + history/favorites + shared fixes#1

Merged
saadjs merged 54 commits into
mainfrom
feat/v2
Mar 2, 2026
Merged

feat: watch app + intents + race tools + history/favorites + shared fixes#1
saadjs merged 54 commits into
mainfrom
feat/v2

Conversation

@saadjs

@saadjs saadjs commented Mar 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • add Siri intents for pace<->speed conversion
  • add race tools: finish time, even splits, negative splits; include rounding/rebalance fixes
  • add conversion history + favorites store/view + star actions
  • add haptics; replace toolbar clutter with popup menu nav
  • add watch app tabs, picker/runtime fixes, watch icon assets
  • move conversion/race models to Shared; remove duplicate app/watch logic
  • fix parse/units: reject pace seconds >= 60, convert values on unit switch, lock iPhone portrait
  • update project wiring + regression/unit/UI tests + AGENTS.md docs

Testing

  • update and run unit/regression/UI coverage in pace-to-mphTests and pace-to-mphUITests

saadjs and others added 25 commits February 28, 2026 20:40
Add inline App Intents (iOS 16+) for Siri integration:
- PaceToSpeedIntent: converts mm:ss pace to MPH/KPH
- SpeedToPaceIntent: converts speed value to mm:ss pace
- SpeedUnitEntity: AppEnum for MPH/KPH selection
- RunPaceShortcuts: AppShortcutsProvider with Siri phrases

Uses existing ConversionEngine for all conversion logic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add dedup check in ConversionHistory.add() to skip identical consecutive saves
- Trigger recordCurrentConversion() in switchDirection() and switchUnit()
- Add onChange listener for keyboard dismiss to capture intent to navigate away
- Relax input validation from count>1 to non-empty to allow single-digit speeds
Add onChange listener to detect keyboard focus loss and trigger save,
capturing intent to navigate away or interact with controls.

Copilot AI 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.

Pull request overview

Adds new race-calculation tools (finish-time, even splits, negative splits), favorites + history persistence, haptic feedback triggers, and App Intents/Shortcuts support, while introducing a watchOS target and consolidating navigation into a single menu.

Changes:

  • Add Race Calculator (finish time / required pace), Even Splits, and Negative Splits views backed by a new RaceCalculator model.
  • Add Favorites + History persistence (FavoritesStore, ConversionHistory) and wire them into the main converter UI.
  • Add App Intents + Shortcuts for pace/speed conversion and expand test coverage with new regression/unit tests.

Reviewed changes

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

Show a summary per file
File Description
pace-to-mphTests/RaceCalculatorTests.swift Adds unit tests for RaceCalculator and negative split behavior.
pace-to-mphTests/IntentConversionRegressionTests.swift Adds regression tests for AppIntents conversion outputs + dialog text.
pace-to-mphTests/FavoritesStoreTests.swift Adds persistence/store behavior tests for favorites.
pace-to-mph/ViewModels/ConverterViewModel.swift Adds conversion history tracking and records conversions on direction/unit changes.
pace-to-mph/SplitCalculatorView.swift New Even Splits calculator UI.
pace-to-mph/RaceTimeView.swift New finish time calculator UI.
pace-to-mph/NegativeSplitView.swift New negative splits calculator UI + splits list rendering.
pace-to-mph/Models/RaceCalculator.swift New model for duration parsing/formatting, pace/time calculations, negative splits.
pace-to-mph/Models/FavoritesStore.swift New favorites persistence store using UserDefaults.
pace-to-mph/Models/ConversionHistory.swift New conversion history persistence store using UserDefaults.
pace-to-mph/Models/ConversionEngine.swift Marks conversion engine nonisolated (actor-isolation opt-out) while keeping conversion logic.
pace-to-mph/Intents/SpeedUnitEntity.swift Adds AppEnum wrapper for speed units for intents.
pace-to-mph/Intents/SpeedToPaceIntent.swift Adds Speed→Pace AppIntent.
pace-to-mph/Intents/RunPaceShortcuts.swift Registers two app shortcuts (pace→speed, speed→pace).
pace-to-mph/Intents/PaceToSpeedIntent.swift Adds Pace→Speed AppIntent.
pace-to-mph/HistoryView.swift New history UI with “clear” + favorite toggle per record.
pace-to-mph/FavoritesView.swift New favorites UI with “clear” + remove actions.
pace-to-mph/ContentView.swift Consolidates navigation into menu; wires favorites/history; adds haptic feedback on result changes.
pace-to-mph.xcodeproj/xcuserdata/saad.xcuserdatad/xcschemes/xcschememanagement.plist Updates scheme ordering in user-specific Xcode data.
pace-to-mph.xcodeproj/project.pbxproj Adds watchOS app target + build settings.
AGENTS.md Adds contributor guidelines for committing and post-review workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Shared/RaceCalculator.swift
Comment thread pace-to-mph/Models/FavoritesStore.swift
Comment thread pace-to-mphTests/IntentConversionRegressionTests.swift Outdated

Copilot AI 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.

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pace-to-mphTests/FavoritesStoreTests.swift Outdated
Comment thread pace-to-mph/NegativeSplitView.swift Outdated
Comment thread pace-to-mph/ContentView.swift Outdated
- precompute cumulative seconds in NegativeSplitView to avoid O(n²) reduce
- compute isFav once in ContentView star button to avoid duplicate work
- migrate FavoritesStoreTests to isolated UserDefaults suites via makeStore helper

Copilot AI 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.

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pace-to-mphTests/FavoritesStoreTests.swift
Comment thread pace-to-mph/Models/RaceCalculator.swift Outdated
Comment thread pace-to-mph/NegativeSplitView.swift
Repository owner deleted a comment from Copilot AI Mar 1, 2026
saadjs added 12 commits March 1, 2026 11:02
…ing remainder

When difference > 0, add remainder to splitTimes[0] (slowest split) instead
of splitTimes[last] (fastest). Adding to the last split can make it equal to
or slower than the prior split when dropSeconds is small.

Regression: negativeSplitsRoundingPreservesStrictlyDecreasingOrder
(202s/6mi/1s-drop produced splits[4]==splits[5]==32)
Move ConversionEngine and RaceCalculator to Shared/ so both
iOS and watch targets use them directly. Remove SharedConversionMath
wrapper and watch-local WatchSpeedUnit/WatchRaceDistance duplicates.
Restore inline implementations, add Distance helpers (shortLabel,
distance(unit:), standardCases) for watch usage.
…ime warnings

- Custom PaceInputRow with crown input eliminates ScrollView contentOffset warning
- Single digitalCrownRotation binding avoids Crown Sequencer warning
- UnitToggle/DistanceSelector custom button bars replace incompatible Picker styles
- Glass card styling on result displays
Add bounds check for seconds component to match parseDuration validation.
Add regression tests for invalid seconds inputs.
@saadjs saadjs changed the title feat: add negative splits, favorites, haptics, watch enhancements & menu feat: watch app + intents + race tools + history/favorites + shared fixes Mar 1, 2026
@saadjs
saadjs merged commit 4f8640b into main Mar 2, 2026
@saadjs
saadjs deleted the feat/v2 branch April 17, 2026 14:37
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