Afsan final UI bugs fixes#11
Merged
Merged
Conversation
…nd backend persistence.
…s to pet-themed variants
Add .gitignore entries to exclude automation artifacts: screenshots and UI-dumps under docs/automation and the fresh_2026-05-25_automation folder to avoid committing large generated files.
There was a problem hiding this comment.
Pull request overview
This PR extends Petfolio’s social experience with Instagram-like Stories support and threaded/liked comments, while also introducing a persistent Riverpod-driven theme mode and expanding social navigation routes.
Changes:
- Added Supabase schema support for Stories plus comment likes and threaded replies (new tables/RPCs/triggers + RLS).
- Implemented Stories UI (stories row, story viewer, create story flow) and updated routing to dedicated create-post/create-story pages.
- Added persistent dark mode via a Riverpod
ThemeNotifierand integrated theme toggles into key screens.
Reviewed changes
Copilot reviewed 28 out of 80 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| supabase/migrations/20260525220000_comment_likes_replies.sql | Adds parent_id + like_count to comments, introduces comment_likes and like-count trigger/RLS. |
| supabase/migrations/20260525210000_add_pet_stories.sql | Introduces stories table, RLS, and SECURITY DEFINER RPCs for views/cleanup. |
| progress.md | Documents architectural patterns and the new social/theming features. |
| lib/main.dart | Wires themeProvider into MaterialApp.router and minor formatting/title change. |
| lib/features/social/presentation/screens/story_viewer_screen.dart | New full-screen story viewer with timed progress + profile navigation. |
| lib/features/social/presentation/screens/social_screen.dart | Adds stories row, long-press own-story menu, and updates create navigation + paw icons. |
| lib/features/social/presentation/screens/post_detail_screen.dart | Adds threaded replies UI, comment likes UI, reply banner/focus, and edit/delete bottom sheets. |
| lib/features/social/presentation/screens/create_story_screen.dart | New “media-first” story creation flow with camera/gallery + preview/share UX. |
| lib/features/social/presentation/screens/create_post_screen.dart | Ensures create-post defaults to non-story + adjusts image aspect ratio to 4:5. |
| lib/features/social/presentation/controllers/story_controller.dart | New Riverpod controller for fetching stories + optimistic view tracking + adding stories. |
| lib/features/social/presentation/controllers/create_post_controller.dart | Adds isStory mode and routes story submissions through storiesProvider. |
| lib/features/social/presentation/controllers/comment_controller.dart | Adds reply support, comment edit, and optimistic like toggling with snackbars. |
| lib/features/social/data/repositories/story_repository.dart | New repository for story fetch/create + RPC view tracking + image uploads. |
| lib/features/social/data/repositories/comment_repository.dart | Extends comment read/write to include parent + likes and adds like toggle API. |
| lib/features/social/data/models/story.dart | New Story model with joined pet fields and viewedByUsers. |
| lib/features/social/data/models/comment.dart | Adds parentId, likeCount, isLiked, and helper copy methods. |
| lib/features/pet_profile/presentation/screens/pet_profile_screen.dart | Replaces “View Social Profile” button with a richer social profile card + theme toggle action. |
| lib/features/marketplace/presentation/controllers/my_shop_controller.g.dart | Regenerated Riverpod code (hash update). |
| lib/features/care/presentation/screens/care_screen.dart | Replaces prior header action with theme toggle. |
| lib/features/care/presentation/controllers/care_dashboard_controller.g.dart | Regenerated Riverpod code (hash update). |
| lib/core/widgets/app_header.dart | Avatar tap now navigates to the active pet’s social profile. |
| lib/core/theme/theme.dart | Re-exports theme_notifier.dart. |
| lib/core/theme/theme_notifier.g.dart | Generated Riverpod provider for theme mode. |
| lib/core/theme/theme_notifier.dart | Implements persistent theme mode via SharedPreferences. |
| lib/core/theme/app_theme.dart | Minor whitespace change. |
| lib/core/theme/app_colors.dart | Refines dark-mode neutral/surface palette values. |
| lib/core/router.dart | Adds /social/create-story and /social/stories, renames create-post route to /social/create-post. |
| .remember/remember.md | Adds “high-signal context” documentation for routes, theming, stories, and social UI conventions. |
| .gitignore | Ignores additional automation artifacts under docs/automation/. |
Comments suppressed due to low confidence (1)
supabase/migrations/20260525220000_comment_likes_replies.sql:65
- The SECURITY DEFINER trigger function is still executable by
PUBLICunless you explicitly revoke fromPUBLIC(revoking fromanon, authenticateddoesn’t remove privileges granted toPUBLIC). ConsiderREVOKE ALL/EXECUTE ... FROM PUBLICand addingSET search_path = publicon the function to avoid search_path injection risks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
91
to
97
| .insert({ | ||
| 'post_id': postId, | ||
| 'author_id': _uid, | ||
| 'pet_id': petId, | ||
| 'content': content.trim(), | ||
| 'parent_id': ?parentId, | ||
| }) |
Comment on lines
+1
to
+5
| import 'dart:async'; | ||
| import 'dart:io'; | ||
| import 'package:cached_network_image/cached_network_image.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_riverpod/flutter_riverpod.dart'; |
Comment on lines
+236
to
+243
| data: (stories) { | ||
| if (stories.isEmpty) { | ||
| WidgetsBinding.instance.addPostFrameCallback((_) => context.pop()); | ||
| return const SizedBox.shrink(); | ||
| } | ||
|
|
||
| _setupStacks(stories); | ||
|
|
Comment on lines
+372
to
+380
| child: GestureDetector( | ||
| behavior: HitTestBehavior.opaque, | ||
| onTap: () { | ||
| _timer?.cancel(); | ||
| context.push('/social/profile/${activeStack.petId}').then((_) { | ||
| if (mounted) { | ||
| _startStory(); | ||
| } | ||
| }); |
Comment on lines
+728
to
+736
| onPressed: () { | ||
| final newText = editController.text.trim(); | ||
| if (newText.isEmpty) return; | ||
| Navigator.of(sheetCtx).pop(); | ||
| ref | ||
| .read(commentListProvider(postId).notifier) | ||
| .edit(comment.id, newText); | ||
| editController.dispose(); | ||
| }, |
Comment on lines
+237
to
241
| class _StoriesRow extends ConsumerWidget { | ||
| const _StoriesRow({required this.posts, required this.pet}); | ||
| final List<FeedPost> posts; | ||
| final Pet pet; | ||
|
|
Comment on lines
35
to
38
| class _CareScreenState extends ConsumerState<CareScreen> { | ||
| bool _outdoor = false; | ||
| final bool _outdoor = false; | ||
| bool _onboardingSuccessHandled = false; | ||
| bool _isGeneratingRoutine = false; |
Comment on lines
+280
to
+288
| // Build threaded comment display list | ||
| final rootComments = list.where((c) => c.parentId == null).toList(); | ||
| final displayList = <_CommentDisplayItem>[]; | ||
| for (final root in rootComments) { | ||
| displayList.add(_CommentDisplayItem(comment: root, isReply: false)); | ||
| final replies = list.where((c) => c.parentId == root.id).toList(); | ||
| for (final reply in replies) { | ||
| displayList.add(_CommentDisplayItem(comment: reply, isReply: true)); | ||
| } |
Add a comprehensive Design System HTML and a new PetFolio Redesign folder containing multiple JSX/HTML UI assets (app.jsx, android-frame.jsx, components.jsx, onboarding.jsx, home.jsx, market.jsx, match.jsx, social.jsx, care.jsx, health.jsx, tweaks-panel.jsx, index.html, and screenshots/ref paths). Update .gitignore to exclude PetFolio UI screenshots/ref directories. Also apply UI updates to Flutter screens to align with the redesign: lib/features/care/presentation/screens/care_screen.dart, lib/features/pet_profile/presentation/screens/pet_profile_screen.dart, and several social screens (create_story_screen.dart, post_detail_screen.dart, social_screen.dart, story_viewer_screen.dart). These changes add design documentation and initial frontend redesign components and integrate corresponding Flutter screen adjustments.
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.
This pull request introduces several key architectural improvements and user-facing features, focusing on theming, navigation, and social/profile interactions. The most significant updates include a persistent dark mode toggle using Riverpod, expanded routing for social features, a more discoverable social profile card, and refined color palette adjustments for dark mode. Additionally, a new
.remember/remember.mdfile documents high-signal architectural decisions for future development.Theming & State Management
ThemeNotifier(theme_notifier.dart,theme_notifier.g.dart) for persistent dark mode support, storing the user's theme preference inSharedPreferencesand exposing athemeProviderfor app-wide consumption. The theme toggle is now integrated into both the care and pet profile screens, replacing placeholder or unrelated actions. [1] [2] [3] [4] [5] [6]Navigation & Routing
/social/create-storyand/social/stories, and updated the post creation route to/social/create-post. Also, tapping a pet avatar now navigates to the pet's social profile instead of home. [1] [2] [3] [4]Social/Profile UI Enhancements
PetProfileScreenwith a new_SocialProfileCardwidget, providing a more visually engaging and accessible entry point to the pet's social profile. [1] [2]Theme & Visual Improvements
app_colors.dartfor improved legibility and consistency, updating several neutral and surface color constants.Project Documentation
.remember/remember.mdto capture high-signal architectural context, including routing conventions, theming, state management, and social feature guidelines for future contributors.