Review: UI fixes, search, pet care, chat, settings, and audits - #18
Merged
Conversation
Add QA artifacts and integration tooling, refactor bootstrap and theming, and apply various runtime and CI fixes. This commit introduces two audit reports (FRESH_CODEBASE_AND_UI_REVIEW.md, QA_UX_Audit_Report.md), integration tests and driver entries (integration_test/*, test_driver/*), and a dart_define example. Core app changes: refactor bootstrap into a Notifier-based bootstrapProvider with serialized data hydration and explicit syncAllData, add ThemeNotifier/persistent themeProvider and wire theme selection into main, add lifecycle resume sync, and make main compatible with integration/driver bindings and safer Supabase initialization via assertValidReleaseSupabaseConfig and dart-define URLs. Controller tweaks: auth timeouts and session fallbacks, health error clearing on load, remove duplicate client-side notification sends in chat/match controllers (moved to DB triggers), and notification controller listener pre-seed fix. Project and CI updates: added many Supabase migration and policy files, updated supabase table/storage policies, updated ios-build workflow to inject SUPABASE_* dart-defines and include secrets, updated .gitignore and android/gradle.properties optimizations, and small emulator script PATH fixes. Misc: new pet model fields and multiple view/controller UI/accessibility changes referenced by the audits.
Multiple UI and feature tweaks across app screens: - chat_screen.dart: Add attachment bottom sheet and _AttachOption widget, implement animated send/mic button toggle, update message hint, wire text change state handling and show snackbars for unimplemented features. - pet_care_screen.dart: Add per-pet selector in AppBar for users with multiple pets, integrate active pet provider, remove old _PetSelector, and adjust layout/TabBar sizing. - pet_profile_screen.dart: Restyle action buttons (use FilledButton for Message, circular share InkWell) and adjust spacing. - search_repository.dart: Fix search filter to query animal_type instead of species. - search_screen.dart: Hook SearchBar.onChanged to _onSearch and update clear button to refresh UI state. - settings_screen.dart: Add Achievements & Badges section (new UI, badge dialog and sharing via share_plus), import controllers/models needed. - APP_SCREENS_AUDIT.md: Add new audit file. These changes improve messaging attachments UX, multi-pet navigation, badges visibility and search correctness.
Multiple robustness and UX improvements: - New utils: escapeIlikePattern to safely escape ILIKE patterns and pendingBootstrapThemeMode for bootstrapping ThemeMode from SharedPreferences. - Main now reads saved theme into pendingBootstrapThemeMode to avoid light->dark flash; ThemeNotifier boots from that value and reconciles with prefs. - SearchRepository now escapes queries, clamps length, and uses safe ilike filters; updated select projection for posts. - Chat: added logging, safer realtime payload parsing, fetchThreadById for deep links, ThreadMessagesNotifier clears previous state on thread switch and guards against races, and ChatController.ensureThreadLoaded to merge single thread when list is stale. - Chat UI: improved init flow to refresh/ensure thread, added error/retry UI and back navigation handling, and adjusted header details. - Misc: added developer logging on various repository/controller failures, bounded list limits for marketplace/pets/orders, null-safe dental log getters, minor lifecycle checks (ref.mounted), and other small fixes.
There was a problem hiding this comment.
Pull request overview
This draft PR bundles a broad review/remediation pass across Flutter UI, Riverpod controllers, Supabase policies/migrations, test harnesses, and build/config files. It mainly aims to improve UX polish, search behavior, pet-care/settings flows, chat recovery, theme support, and backend RLS coverage across the PetSphere app.
Changes:
- Adds app/runtime infrastructure updates: theme bootstrap/toggle support, bootstrap sync coordination, Supabase config changes, integration/driver test entry points, and workflow/config updates.
- Expands user-facing flows in Settings, Pet Care, Discovery, Chat, Search, Login, and theming, plus several smaller UI polish updates.
- Adds/updates multiple Supabase policies and migrations for posts, pets, chat threads, storage, orders, and products.
Reviewed changes
Copilot reviewed 57 out of 65 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test_driver/integration_test.dart | Adds Integration Test driver entrypoint. |
| test/supabase_config_test.dart | Adds tests around Supabase config resolution. |
| test/integration/expense_journey_test.dart | Updates expense integration test expectations/input handling. |
| supabase/table_policies.sql | Adds posts UPDATE RLS policy. |
| supabase/storage_policies.sql | Documents storage RLS migration source-of-truth. |
| supabase/migrations/20260507103100_fix_chat_threads_insert_rls_user_owns_pet.sql | Adds chat thread INSERT RLS migration. |
| supabase/migrations/20260507103000_fix_rls_remove_pets_subquery_policy_cycles.sql | Adds broader RLS recursion cleanup migration. |
| supabase/migrations/20260506120000_fix_pets_rls_cross_table_recursion.sql | Adds placeholder/consolidation migration for pets recursion fix. |
| supabase/migrations/20260504150000_fix_pets_select_rls_recursion.sql | Adds helper-function-based pets SELECT RLS fix. |
| supabase/migrations/20260504140000_review_remediation_rls_storage_posts_products.sql | Adds review remediation migration for storage/posts/products/orders. |
| supabase/migrations/20260503140000_fix_pets_rls_security_definer_bypass_row_security.sql | Adds SECURITY DEFINER row_security fix migration. |
| supabase/migrations/20260503130000_orders_server_side_pricing_trigger.sql | Adds server-side order pricing/stock trigger migration. |
| supabase/migrations/20260427120000_pet_care_scoring_and_pets_select_rls.sql | Updates earlier pets RLS migration to helper-based checks. |
| skills-lock.json | Adds android-adb skill lock entry. |
| lib/views/settings_screen.dart | Adds theme toggle and achievements/badges UI. |
| lib/views/search_screen.dart | Enables live search and clear-state repaint. |
| lib/views/registration_screen.dart | Updates registration chip/avatar colors for theme support. |
| lib/views/pet_care_screen.dart | Moves pet selector to app bar area across care tabs. |
| lib/views/main_layout.dart | Constrains main content width and adds nav semantics/keys. |
| lib/views/login_screen.dart | Uses auth repository for reset and adds semantics/keys. |
| lib/views/home_screen.dart | Renames app title text to PetSphere. |
| lib/views/discovery_screen.dart | Adds per-tab pet selector and discovery-state tracking. |
| lib/views/components/message_bubble.dart | Replaces hardcoded date-separator color with theme token. |
| lib/views/chat_screen.dart | Improves thread recovery, empty state, and attachment/send UX. |
| lib/views/add_pet_screen.dart | Replaces hardcoded text colors with theme colors. |
| lib/utils/theme_bootstrap.dart | Adds pending theme bootstrap holder. |
| lib/utils/supabase_config.dart | Switches Supabase config to dart-defines with debug fallback. |
| lib/utils/search_query_escape.dart | Adds LIKE/ILIKE escape helper. |
| lib/theme/app_theme_v2_material3.dart | Implements full light theme instead of dark fallback. |
| lib/repositories/search_repository.dart | Escapes search queries and updates pet/post selects. |
| lib/repositories/pet_repository.dart | Adds fetchAllPets limit parameter. |
| lib/repositories/notification_repository.dart | Adds logging around notification failures. |
| lib/repositories/marketplace_repository.dart | Adds result limits to products/orders queries. |
| lib/repositories/feed_repository.dart | Scopes post-media uploads under user-id path. |
| lib/repositories/chat_repository.dart | Adds single-thread fetch and realtime parse logging. |
| lib/repositories/auth_repository.dart | Adds password reset helper. |
| lib/models/pet_model.dart | Adds vaccination/care listing flags. |
| lib/main.dart | Adds theme bootstrap, define-based Supabase init, and lifecycle sync. |
| lib/controllers/theme_controller.dart | Adds persisted theme-mode notifier. |
| lib/controllers/search_controller.dart | Preserves/clears errors more safely during searches. |
| lib/controllers/pet_care_controller.dart | Guards async state update with ref.mounted. |
| lib/controllers/notification_controller.dart | Avoids duplicate initial notification rebind. |
| lib/controllers/match_controller.dart | Avoids redundant reload resets and removes duplicate notifications. |
| lib/controllers/health_controller.dart | Fixes dental-log getters and error clearing behavior. |
| lib/controllers/feed_controller.dart | Adds logging around realtime comment fetch failures. |
| lib/controllers/chat_controller.dart | Clears thread state on switch, adds logging, and deep-link thread merge. |
| lib/controllers/bootstrap_controller.dart | Replaces side-effect provider with serialized bootstrap notifier. |
| lib/controllers/auth_controller.dart | Adds auth-stream subscription management and profile-fetch timeout fallback. |
| integration_test/phase1_audit_driver_test.dart | Adds flutter_driver audit journey test. |
| integration_test/phase1_audit_driver_target.dart | Adds flutter_driver target entrypoint. |
| integration_test/petsphere_journey_test.dart | Adds real-app integration journey test. |
| config/dart_define.example.json | Adds example dart-define JSON template. |
| android/gradle.properties.md | Updates documented Gradle JDK path example. |
| android/gradle.properties | Adjusts Gradle settings and JDK path. |
| android/.kotlin/sessions/kotlin-compiler-4306309977914915476.salive | Adds Kotlin session artifact. |
| QA_UX_Audit_Report.md | Adds QA/UX accessibility audit report. |
| FRESH_CODEBASE_AND_UI_REVIEW.md | Adds broad architecture/UI review document. |
| APP_SCREENS_AUDIT.md | Adds per-screen audit report. |
| .gitignore | Ignores local dart-define JSON file. |
| .github/workflows/ios-build.yml | Injects Supabase dart-defines into iOS release build. |
| .claude/skills/android-emulator-skill/scripts/emu_health_check.ps1 | Fixes temporary PATH concatenation syntax. |
| .agents/skills/android-adb/SKILL.md | Adds raw ADB skill documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
3
to
4
| # Android Gradle Plugin / Gradle do not run on JDK 26; without a JDK 17–21 toolchain the build fails with "26.0.2" as the only message. | ||
| org.gradle.java.home=C:\\Program Files\\Android\\Android Studio\\jbr |
Comment on lines
+201
to
+203
| flutter build ios --release --no-codesign \ | ||
| --dart-define=SUPABASE_URL="$SUPABASE_URL" \ | ||
| --dart-define=SUPABASE_ANON_KEY="$SUPABASE_ANON_KEY" |
| **Test cases executed** | ||
|
|
||
| - Launch: `am start -n com.example.pet_dating_app/.MainActivity` | ||
| - **Data:** Stakeholder email `afsanchowdhury25@gmail.com`; password supplied out-of-band (not logged here). Entry used `adb shell input text` plus `keyevent 77` for `@`. |
Comment on lines
+63
to
+66
| await driver.tap(find.byValueKey('login_email_field')); | ||
| await driver.enterText('afsanchowdhury25@gmail.com'); | ||
| await driver.tap(find.byValueKey('login_password_field')); | ||
| await driver.enterText('callofduty100'); |
Comment on lines
+12
to
+15
| await driver.waitFor( | ||
| find.text('Atelier'), | ||
| timeout: const Duration(seconds: 45), | ||
| ); |
| child: SearchBar( | ||
| controller: _searchController, | ||
| hintText: 'Search pets, posts, products...', | ||
| onChanged: _onSearch, |
Comment on lines
+433
to
+436
| if (loadFinishedEmpty) { | ||
| final selId = ref.read(_discoveryActivePetIdProvider) ?? | ||
| ref.read(petProvider).activePet?.id; | ||
| if (selId != null) _allCaughtUpPetIds.add(selId); |
Delete stray .codex file. Update android/gradle.properties to select the Windows Android Studio JBR by uncommenting org.gradle.java.home for the Windows path and commenting out the Linux JDK path. This ensures the build uses the Android Studio JBR (avoiding JDK 26 incompatibility) while keeping other Gradle settings unchanged.
Add a new migration to correct object name qualification used by storage RLS policies (supabase/migrations/20260508120000_fix_storage_rls_objects_name_qualification.sql). Also update the earlier review/remediation migration for storage RLS on posts/products (supabase/migrations/20260504140000_review_remediation_rls_storage_posts_products.sql) to align with the naming/qualification fixes.
Allow discovery-selected pet to be used as the sender for like requests and add a silent loading mode. MatchController._load now accepts a silent flag to avoid showing a full-screen spinner for background refreshes and tracks the most-recent discovery pet via currentDiscoveryPetId. sendLikeRequest accepts an optional fromPetId (or falls back to the discovery-selected pet, then the global active pet), resolves the sender safely, updates notification actor/entity IDs, and performs an optimistic removal of the liked pet followed by a silent refresh. discovery_screen now passes the discoveryActivePetId when sending likes and restores dismissed pets on failure. The discovery listener logic was adjusted to only purge dismissed IDs during an actual load cycle to avoid re-showing pets removed by optimistic updates.
Introduce a Pet Followers feature and several UX improvements: - Add PetFollowersScreen UI to display a pet's followers with shimmer/loading, empty and error states, and formatted follow dates. - Add petFollowersListProvider (FollowController) and FollowRepository.fetchPetFollowersList to fetch combined direct pet followers and owner followers, deduplicate IDs, and join basic user profiles. - Add route /pet/:id/followers and import the new view in app routing. - Make followers count on Pet Profile tappable to open the followers screen and add a tappable chevron indicator to StatColumn. - Add allMatchRequestsProvider (MatchController) and MatchRepository.fetchAllMyRequests to aggregate incoming match requests across all of the user's pets. - Update Notifications screen to use the aggregated requests provider, show total request count in tab label, and invalidate the provider after accept/decline actions. - Revamp MessagesListScreen: add search bar with filtering and clear button, loading shimmer, empty states, refined app bar styling, thread row refactor into _ThreadTile with avatar tap to open pet profile, and nicer time formatting. - Improve SearchScreen UX: autofocus the search field, add debounce on input, replace custom SearchBar with a TextField styled consistently with app theme, and clean up focus/dispose handling. These changes improve follower discovery, provide a unified view of match requests, and polish messaging/search UX across the app.
…generic icons with custom logo components
…m-Hub/petsphere into cursor-review-implement
Add multiple accessibility fixes and align Android launch visuals: register semantic actions for bottom nav and center FAB so TalkBack/UiAutomator can activate tabs; add descriptive Semantics/ExcludeSemantics wrappers for Add Pet wizard (progress bar + animal options), pet profile (stats, header buttons, Add Pet avatar), home/marketplace badges and promo banner to prevent duplicated or missing screen-reader output; enhance Pet Care progress semantics and ProgressRing labels. Also replace the white launch background with a dark splash color (#0F0E0C) via a new colors.xml and update styles.xml to use the dark launch theme to eliminate the white flash. These changes improve accessibility, automated testing reliability, and brand-consistent launch visuals.
…m-Hub/petsphere into cursor-review-implement
Add .gemini/settings.json to register an mcpServer 'appium-mcp' that runs 'npx -y appium-mcp@latest'. Update android/gradle.properties to enable the Windows Android Studio JBR as org.gradle.java.home (uncommented) and comment out the Linux java-21-openjdk entry so the build uses the intended JDK/toolchain.
syed-reza98
marked this pull request as ready for review
May 3, 2026 23:08
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.
Summary
Draft PR for branch \cursor-review-implement\ into \main.
Included work (existing commits only)
Notes
How to verify
Made with Cursor