Skip to content

Tap an activity entry to edit it - #291

Merged
mike12806 merged 1 commit into
mainfrom
claude/activity-tap-edit-nav-u225z1
Aug 5, 2026
Merged

Tap an activity entry to edit it#291
mike12806 merged 1 commit into
mainfrom
claude/activity-tap-edit-nav-u225z1

Conversation

@mike12806

Copy link
Copy Markdown
Owner

What

Entries in the dashboard's Recent activity list and in the Activity feed are now tappable. Tapping one navigates to the section page that owns that entry (Feedings, Diapers, Sleep, …) with the entry's edit form already open.

Both views previously listed entries with no way to act on one — you had to remember what it was, go find the right section page, and hunt for it again.

Why this shape

You asked for either "into the nested section" or "straight into edit mode"; this does both. Landing on the section page keeps the type-specific form (and its delete action) in the one place that already owns it, and closing the dialog leaves you on that category's full list instead of bouncing you back. No form logic is duplicated — each page's existing edit handler is what opens.

How

  • GET /api/activity now returns each row's source id, so a tap can be resolved back to the record it came from.
  • client/src/utils/activityLinks.ts maps a category to its section route and API resource, and builds the ?edit=<id> link.
  • useEditEntryParam(resource, onEdit) reads ?edit=<id> on a section page, fetches that entry, and calls the page's existing edit handler. It fetches by id rather than looking in the page's loaded list — the activity feed pages back through the entire history, well past what a section page loads up front.
  • The param is dropped as soon as it's handled, so a refresh or a return visit doesn't reopen the form, and Back still goes to the view you tapped from.
  • Wired into all eight section pages: feedings, diapers, sleep, tummy time, pumping, temperature, notes, medications.
  • Rows are real <button>s with an aria-label and a chevron affordance, so they work with keyboard and screen readers.

Testing

  • server/test/activity.test.ts (new): the feed returns the correct source id for every activity type, and ids stay attached to the right entry when several share a type. Also mounts the activity + medications routes in the test app.
  • client/test/ActivityEditNavigation.test.tsx (new): tapping from the activity feed and from the dashboard opens the right entry's form; an entry outside the section page's loaded list still opens; a failed load surfaces an error instead of an empty form.
  • Full suites pass — server 77, client 88.
  • Verified in a browser against a seeded local D1: tapped a 7:30 PM feeding in the feed → Feedings page with that exact bottle prefilled; tapped a pump row on the dashboard → Pumping page with that session open; Cancel leaves you on the list.

Generated by Claude Code

Both cross-cutting views listed entries but had no way to act on one — you
had to remember what it was, find the right section page, and hunt for it
again.

Tapping an entry now navigates to the section page that owns it with that
entry's edit form already open. That keeps the type-specific form (and its
delete action) in one place, and closing the dialog leaves you on the full
list for that category rather than back where you started.

- The activity feed now returns each row's source id, so a tap can be
  resolved back to the record it came from.
- `useEditEntryParam` reads `?edit=<id>` on a section page, fetches that
  entry, and opens the page's existing edit handler. It fetches by id rather
  than looking in the loaded list: the feed pages back through the whole
  history, well past what a section page loads up front.
- The param is dropped once handled, so a refresh or a return visit doesn't
  reopen the form, and Back still goes to the view you tapped from.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014BAKuQvA43r4rXFdanhsXQ
@mike12806
mike12806 marked this pull request as ready for review August 5, 2026 11:45
@mike12806
mike12806 merged commit bb69da3 into main Aug 5, 2026
6 checks passed
@mike12806
mike12806 deleted the claude/activity-tap-edit-nav-u225z1 branch August 5, 2026 11:45
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