Tap an activity entry to edit it - #291
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/activitynow returns each row's sourceid, so a tap can be resolved back to the record it came from.client/src/utils/activityLinks.tsmaps 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.<button>s with anaria-labeland 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.Generated by Claude Code