Skip to content

Conversation

@tompscanlan
Copy link
Contributor

@tompscanlan tompscanlan commented Jan 7, 2026

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

Page Before After
DashboardEventCreatePage Always → DashboardEventsPage router.back() → fallback to DashboardEventsPage
DashboardGroupPage Always → DashboardGroupsPage router.back() → fallback to DashboardGroupsPage
DashboardGroupCreatePage Always → DashboardGroupsPage router.back() → fallback to DashboardGroupsPage
CreateEventPage Always → HomePage router.back() → fallback to HomePage

Related Issue

Part of #348 - UX Improvements

Test Plan

  • Navigate to Create Event from home page → back returns to home
  • Navigate to Create Event from group page → back returns to group
  • Navigate to Edit Group from group page → back returns to group
  • Navigate to Create Group from dashboard → back returns to dashboard
  • Direct URL access (no history) → back goes to sensible fallback

Update 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.

Pages updated:
- DashboardEventCreatePage: defaultBack + router.back() fallback
- DashboardGroupPage: defaultBack + router.back() fallback
- DashboardGroupCreatePage: router.back() fallback
- CreateEventPage: router.back() fallback

Part of #348 UX Improvements
- Added goBack(fallbackRoute) to useNavigation composable
- Refactored 4 pages to use centralized back navigation
- Reduces code duplication and centralizes logic for future improvements

Addresses code review feedback for PR #352
@tompscanlan tompscanlan merged commit 88e9603 into main Jan 8, 2026
3 checks passed
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