fix: use browser history for all back button navigation #352
+33
−9
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.
Summary
Updates all pages with back buttons to use
router.back()with appropriate fallbacks. This ensures the back button returns users to where they came from (e.g., home page, group detail page) instead of always going to the same hardcoded destination.Problem
Previously, back buttons on create/edit pages would always navigate to a hardcoded destination (e.g., "Create Event" always went back to dashboard, even if user came from a group page).
Solution
Use browser history (
router.back()) when available, with a sensible fallback for edge cases where there's no history.Pages Updated
DashboardEventCreatePageDashboardEventsPagerouter.back()→ fallback toDashboardEventsPageDashboardGroupPageDashboardGroupsPagerouter.back()→ fallback toDashboardGroupsPageDashboardGroupCreatePageDashboardGroupsPagerouter.back()→ fallback toDashboardGroupsPageCreateEventPageHomePagerouter.back()→ fallback toHomePageRelated Issue
Part of #348 - UX Improvements
Test Plan