Skip to content

Comments

Add web UI for creating data and editing exercise types#249

Open
fiddur wants to merge 3 commits intodevelopfrom
feat/web-add-edit-data
Open

Add web UI for creating data and editing exercise types#249
fiddur wants to merge 3 commits intodevelopfrom
feat/web-add-edit-data

Conversation

@fiddur
Copy link
Owner

@fiddur fiddur commented Feb 24, 2026

Summary

  • Add Data page (/add): New page with tabbed forms for creating activities, tags, and metrics directly from the web UI
  • Custom Metrics management: CRUD interface in Settings page for managing custom metric definitions (name, unit, description, min/max)
  • Exercise type editing: Exercise type is now visible in exercise detail view and editable via a dropdown selector
  • Backend support: Added exercise_type to the update activity API (REST + MCP) with proper validation and data merging

Test plan

  • Navigate to /add and verify all three tabs (Activity, Tag, Metric) work
  • Create an activity with exercise type, verify it appears in timeline
  • Create a tag with autocomplete suggestions, verify it appears
  • Create a metric entry, verify it saves
  • Go to Settings, add/edit/delete a custom metric definition
  • Open an exercise activity detail, verify exercise type is shown
  • Edit an exercise activity, change exercise type via dropdown, save
  • Verify dark mode styling on all new components

🤖 Generated with Claude Code

fiddur and others added 3 commits February 24, 2026 22:18
- Add new "Add Data" page with forms for activities, tags, and metrics
- Add custom metrics management (CRUD) to Settings page
- Show exercise type in exercise detail view (read + edit mode)
- Add exercise_type support to updateActivity API (api-spec, backend, MCP)
- Add API functions: addActivity, addTag, addMetric, addCustomMetric,
  updateCustomMetric, deleteCustomMetric
- Add "+ Add" navigation link in header

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Replace inline type definitions with proper imports from @aurboda/api-spec:
- updateActivity: use UpdateActivityBody
- addTag: use AddTagBody
- addCustomMetric: use AddCustomMetricBody
- updateCustomMetric: use UpdateCustomMetricBody

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Mutations unit tests (5 tests):
- Data merging with existing activity data
- Preserving existing fields when adding new data
- Setting data on activity with no existing data
- Not passing data when input has no data field
- Updating data and other fields together

MCP tool tests (5 tests):
- update_activity with exercise_type conversion
- update_activity without exercise_type
- Invalid exercise_type error handling
- Time updates passed as Date objects
- Service failure error propagation

DB integration tests (4 tests):
- updateActivity persists data field
- Data field replacement at DB level
- Preserving data when updating other fields
- Updating data and other fields together

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 3.67107% with 656 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.70%. Comparing base (c9997f0) to head (e4e7472).

Files with missing lines Patch % Lines
apps/web/src/pages/AddData/index.tsx 0.00% 342 Missing and 1 partial ⚠️
apps/web/src/components/CustomMetricsSettings.tsx 0.00% 208 Missing and 1 partial ⚠️
apps/web/src/state/api.ts 0.00% 47 Missing ⚠️
apps/web/src/pages/EntityDetail/ExerciseDetail.tsx 0.00% 30 Missing ⚠️
apps/backend/src/routes/activities-router.ts 0.00% 15 Missing ⚠️
apps/web/src/pages/EntityDetail/index.tsx 0.00% 6 Missing ⚠️
apps/web/src/components/Header.tsx 0.00% 2 Missing ⚠️
apps/web/src/index.tsx 0.00% 2 Missing ⚠️
apps/web/src/pages/Settings/index.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #249      +/-   ##
===========================================
- Coverage    27.31%   26.70%   -0.62%     
===========================================
  Files          176      178       +2     
  Lines        23863    24536     +673     
  Branches      2134     2149      +15     
===========================================
+ Hits          6519     6553      +34     
- Misses       17305    17942     +637     
- Partials        39       41       +2     
Flag Coverage Δ
android 8.57% <ø> (ø)
backend 57.49% <62.50%> (+0.12%) ⬆️
web 2.83% <0.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant