Skip to content

fix: move change-password to ShellRoute and improve code quality#68

Merged
cevheri merged 2 commits intocevheri:mainfrom
yusuf-gundogdu:fix/change-password-shell-route-and-quality
Mar 23, 2026
Merged

fix: move change-password to ShellRoute and improve code quality#68
cevheri merged 2 commits intocevheri:mainfrom
yusuf-gundogdu:fix/change-password-shell-route-and-quality

Conversation

@yusuf-gundogdu
Copy link
Copy Markdown
Contributor

Summary

  • Fix UI inconsistency: Change Password screen was rendering full-screen (outside AppShell) while Account screen rendered inside the shell with sidebar. Moved the route into ShellRoute so both screens behave consistently.
  • Fix critical bugs: Unsafe BuildContext cast in _handlePopScope (crash on system back button), missing Equatable props on ChangePasswordChanged event, and submit button not actually disabling during loading state.
  • Code quality cleanup: Removed dead code (unused event, state subclasses, orphaned constant), localized hardcoded English string, removed duplicate heading, moved test file to correct directory.
  • Test coverage: Expanded from 72% to 97% with 16 tests covering BLoC state changes, password visibility toggles, pop scope behavior, and GoRouter navigation.

Test plan

  • All 1395 tests pass (fvm flutter test)
  • fvm dart analyze reports no issues
  • Change Password screen renders inside AppShell (sidebar visible)
  • Back button works correctly (clean form → direct back, dirty form → confirmation dialog)
  • Password visibility toggles work for both fields
  • Submit button is disabled during loading state
  • Success/failure/loading snackbars display correctly
  • Localization works for EN and TR

🤖 Generated with Claude Code

yusuf-gundogdu and others added 2 commits March 23, 2026 16:12
Move change-password route from AuthFeatureRoutes into ShellRoute so it
renders inside AppShell (sidebar/navigation) like Account screen, fixing
the full-screen inconsistency when navigating from Settings.

Key changes:
- Split AuthFeatureRoutes into publicRoutes and authenticatedRoutes
- Remove Scaffold/AppBar from ChangePasswordScreen, use custom header
  pattern matching AccountScreen for visual consistency
- Fix _handlePopScope crash: unsafe cast of null to BuildContext when
  system back button triggers pop
- Fix ChangePasswordChanged event missing Equatable props override
- Fix submit button disable logic (was always callable during loading)
- Localize hardcoded English string to ARB files (EN + TR)
- Remove dead code: unused TogglePasswordVisibility event, unused state
  subclasses, orphaned authenticationFailKey constant
- Remove duplicate "Change Password" heading inside card
- Move test file to correct directory (test/features/auth/)
- Expand test coverage from 72% to 97% (16 tests covering state
  changes, password visibility, pop scope, and navigation)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cevheri cevheri merged commit 87e4d95 into cevheri:main Mar 23, 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