Skip to content

Review fix 27 05 2026#13

Open
rezwana-karim wants to merge 4 commits into
mainfrom
review-fix-27-05-2026
Open

Review fix 27 05 2026#13
rezwana-karim wants to merge 4 commits into
mainfrom
review-fix-27-05-2026

Conversation

@rezwana-karim
Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and refactors across navigation, theming, and authentication flow. The most significant changes are the addition of a dedicated email verification route with corresponding redirect logic, a refactor to remove legacy color aliases in favor of a more consistent color system, and enhancements to navigation tab accessibility and maintainability. Below are the most important changes grouped by theme:

Authentication & Routing Improvements:

  • Added a /verify-email route and EmailVerificationScreen, updated router logic to gate access for users who haven't confirmed their email, and ensured that public auth screens are accessible when logged out. This improves the onboarding and security flow. [1] [2] [3] [4]
  • Removed the /profile/orders/:id route from the router, possibly simplifying the order detail navigation.

Navigation & Accessibility Enhancements:

  • Refactored navigation tab color assignment: each _NavDestination now includes its accent color directly, removing the need for a separate _tabColors list and reducing the risk of mismatches when reordering tabs. Also improved accessibility by using Semantics and InkWell for tab interactions. [1] [2] [3] [4] [5] [6]
  • Updated the "Back to Pets" button on the missing pet edit screen to navigate to /pets/manage instead of /home.

Color System Refactor:

  • Removed all legacy color aliases from AppColors, such as blue500, coral500, and others, consolidating the color system to use the new design system colors directly (e.g., tangerine, poppy).
  • Replaced all usages of old color aliases in admin screens, dashboard widgets, and badges with their new equivalents (tangerine, poppy, etc.), ensuring visual consistency across the app. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Theming and Spacing Adjustments:

  • Added an xxl (20px) spacing value to AppThemeSpacing for more granular layout control.
  • Updated the muted text color in the theme to use a slightly darker shade for better contrast.

Miscellaneous:

  • Updated local settings to add new commands/scripts and remove a deprecated file.

These changes collectively improve the app's maintainability, accessibility, and visual consistency.

Replace legacy blue/coral/apricot/mulberry accents with new design tokens (tangerine, poppy, mint, lilac, sunny) across multiple screens and widgets to align with updated brand palette. Add per-destination color to bottom/rail navigation and improve accessibility (Semantics, InkWell, ripple/highlight behavior) so colors remain tied to routes and interactions. Adjust spacing (add xxl) and muted text contrast, update theme/text styles to new values. Remove obsolete care repository export and update imports to pet_care_repository and new pet model paths. Remove a now-unused buyer order detail route. Add Supabase function and several DB migration files, update local .claude settings for edge function deployment and a file removal helper. Miscellaneous UI tweaks (badges, buttons, shop/vendor screens, forms, and social species palettes) to use the new tokens.
Add a complete email confirmation UX and improve auth error handling:

- New EmailVerificationScreen (/verify-email) with resend button, 60s cooldown, and spam hint.
- AuthRepository.signUp now returns AuthResponse; added resendVerificationEmail(). Registration navigates to /verify-email when response.session == null (confirmation required).
- Added isEmailVerifiedProvider and wired router: new route for /verify-email, router listens to email-verified state and enforces gating/redirects (unauthenticated users see only /login,/register,/verify-email; logged-in unverified users are sent to /verify-email; verified users are redirected away from auth screens).
- Login & Registration UIs: field-level error routing (email/password inline errors), error-clearing on input, and password fields use TextInputType.visiblePassword.
- AuthField: new errorText parameter to show server-side field errors overriding validator messages.
- Updated progress.md to document the changes.
Replace hardcoded bottom paddings with dynamic insets and add pull-to-refresh on pet profile. Files changed:
- lib/features/care/presentation/screens/care_screen.dart: ListView bottom padding changed from a hardcoded 120 to MediaQuery.paddingOf(context).bottom + 80 to avoid nav clipping.
- lib/features/marketplace/presentation/screens/marketplace_screen.dart: SliverPadding bottom changed from 100 to MediaQuery.paddingOf(context).bottom + 80.
- lib/features/social/presentation/screens/social_screen.dart: Footer Padding bottom changed from 120 to MediaQuery.paddingOf(context).bottom + 80.
- lib/features/pet_profile/presentation/screens/pet_profile_screen.dart: Added AlwaysScrollableScrollPhysics to the CustomScrollView, wrapped the scroll view with RefreshIndicator.adaptive to invalidate relevant providers (petListProvider, careDashboardProvider, petAwardsSummaryProvider) and await petListProvider.future; replaced fixed SizedBox(100) with dynamic bottom inset (MediaQuery.paddingOf(context).bottom + 80); renamed local variable `view` to `scrollView` for clarity.
- progress.md: Updated changelog entry describing these fixes.

These changes ensure content is not clipped by the bottom navigation area on devices with system insets and enable pull-to-refresh on the pet profile screen.
Introduce modular care widgets and move AI routine generation into the controller.

- Add new widgets: care_routine_generator_button, care_task_form_sheet, care_task_list (moved/extracted from care_screen).
- Update CareDashboard controller: add isGeneratingRoutine flag on DailyRoutineState and a generateRoutine(Pet) method that uses CareRecommendationService and returns generated CareTask list.
- Simplify care_screen: remove many internal widgets (AI banner, task cards, form sheet, date picker, etc.) and wire up the new widgets and controller method; clean up imports and minor layout/formatting tweaks.
- Update progress.md.

This refactor modularizes the care UI and centralizes routine generation logic in the provider for better testability and reuse.
Copilot AI review requested due to automatic review settings May 27, 2026 02:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a broad cleanup pass covering authentication flow, navigation, theming, and backend data integrity. It introduces an email-verification gate, refactors the bottom navigation to co-locate accent colors with destinations, removes legacy color aliases in favor of the canonical design tokens, decomposes a large care screen into smaller widget files, and adds four Supabase migrations plus a new cleanup-stories Edge Function.

Changes:

  • Auth: new /verify-email route + screen, signUp now returns AuthResponse, router gates unverified users, login/registration route classified errors to inline field errors.
  • Theming & navigation: legacy blueXXX/coral500/sunset500/meadow500/apricot500/mulberry500 aliases deleted; consumers migrated to tangerine/poppy/mint/sunny/lilac; nav tab color is now a field on _NavDestination; xxl=20 spacing token added; muted text contrast bumped.
  • Backend: migrations add NOT NULL to follows FKs, swap bank_account_details JSONB for stripe_bank_account_token, add UNIQUE(order_id) and ledger insertion to process_checkout, drop inventory_count default, schedule cleanup cron; webhook switched from insert+23505-guard to upsert; new cleanup-stories Edge Function.

Reviewed changes

Copilot reviewed 54 out of 61 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
supabase/migrations/20260527000000_follows_not_null_constraints.sql NOT NULL on follows FK columns.
supabase/migrations/20260527010000_shops_bank_account_token.sql Replace raw bank JSONB with Stripe token text.
supabase/migrations/20260527020000_vendor_ledger_checkout.sql UNIQUE(order_id), RLS, updated process_checkout to insert ledger.
supabase/migrations/20260527030000_products_inventory_and_stories_cron.sql Drop inventory default; pg_cron hourly story cleanup.
supabase/functions/stripe-webhook/index.ts Switch ledger insert→upsert; simplified error path.
supabase/functions/cleanup-stories/index.ts New Edge Function invoking cleanup_expired_stories RPC.
lib/core/router.dart /verify-email route, email-verified redirect, nav color co-located on _NavDestination, removed /profile/orders/:id.
lib/core/theme/app_colors.dart Removed legacy color aliases.
lib/core/theme/app_theme.dart Added xxl spacing token; darker muted text.
lib/features/auth/data/repositories/auth_repository.dart signUp returns AuthResponse; added resendVerificationEmail.
lib/features/auth/presentation/controllers/auth_controller.dart New isEmailVerifiedProvider.
lib/features/auth/presentation/screens/email_verification_screen.dart New verification screen with resend cooldown.
lib/features/auth/presentation/screens/login_screen.dart Field-level error routing; visiblePassword keyboard.
lib/features/auth/presentation/screens/registration_screen.dart Email-already-registered routes to email field; navigation to /verify-email.
lib/features/auth/presentation/widgets/auth_widgets.dart AuthField.errorText; tangerine brand colors.
lib/features/care/data/repositories/care_repository.dart Stub file deleted.
lib/features/care/domain/services/care_recommendation_service.dart Updated Pet import path.
lib/features/care/presentation/controllers/care_dashboard_controller.dart Added isGeneratingRoutine + generateRoutine controller method.
lib/features/care/presentation/screens/care_screen.dart Decomposed (~1.6k LOC removed); uses new widget files; SnackBar race fix.
lib/features/care/presentation/screens/medical_vault_screen.dart Color token swap.
lib/features/care/presentation/screens/nutrition_screen.dart Empty-state widget for weight history.
lib/features/care/presentation/widgets/care_routine_generator_button.dart Extracted widget.
lib/features/care/presentation/widgets/care_task_form_sheet.dart Extracted task form sheet with static .show.
lib/features/care/presentation/widgets/care_task_list.dart Extracted list/card/context-menu/skeleton/empty widgets.
lib/features/care/presentation/widgets/routine_recommendation_sheet.dart Pet import path update.
lib/features/admin/** Tangerine color migration in admin layout, dashboard, KYC, orders, ledger, doc button.
lib/features/marketplace/** Tangerine/poppy/mint/sunny color migration; cart bottom-padding fix.
lib/features/matching/** Coral/sunset → poppy/tangerine swaps.
lib/features/pet_profile/presentation/screens/pet_profile_screen.dart RefreshIndicator + dynamic bottom padding.
lib/features/pet_profile/presentation/screens/manage_pets_screen.dart Color token swap.
lib/features/pet_profile/presentation/screens/edit_profile_screen.dart Color token swap.
lib/features/pet_profile/presentation/widgets/pet_switcher_sheet.dart Color token swap.
lib/features/social/** Color token swaps; story ring colors; notification icon colors.
lib/core/widgets/app_header.dart Notification badge color swap.
progress.md Session log entries.
.claude/settings.local.json Local tool permissions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 217 to 221
return const _SpeciesPalette(
accent: AppColors.blue500,
accent: AppColors.tangerine,
subject: Color(0xFF1D4ED8),
gradient: [Color(0xFFBFD7FF), Color(0xFF6EA8FE), AppColors.blue500],
gradient: [Color(0xFFBFD7FF), Color(0xFF6EA8FE), AppColors.tangerine],
);
Comment on lines +20 to +29
SELECT cron.unschedule('cleanup-expired-stories')
WHERE EXISTS (
SELECT 1 FROM cron.job WHERE jobname = 'cleanup-expired-stories'
);

SELECT cron.schedule(
'cleanup-expired-stories',
'0 * * * *',
'SELECT public.cleanup_expired_stories()'
);
Comment on lines +7 to +8
ALTER TABLE public.vendor_ledgers
ADD CONSTRAINT vendor_ledgers_order_id_key UNIQUE (order_id);
Comment thread lib/core/router.dart
Comment on lines +106 to +111
GoRoute(
path: '/verify-email',
builder: (context, state) => EmailVerificationScreen(
email: state.uri.queryParameters['email'] ?? '',
),
),
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.

3 participants