Add Ideas feature (controller, UI, repository, and routing) - #54
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b72aa396f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| state = state.copyWith(isSubmitting: false); | ||
| await refresh(); |
There was a problem hiding this comment.
Keep submit lock until post-create refresh completes
createIdea clears isSubmitting before awaiting refresh, which re-enables the Add button while the first submission is still in progress; on a slow network, users can tap again and send duplicate create requests because the re-entry guard only checks isSubmitting. This can create duplicate ideas for a single intended submission.
Useful? React with 👍 / 👎.
| await ref.read(ideasControllerProvider(widget.sessionId).notifier).deleteIdea(ideaId); | ||
| if (mounted) { | ||
| ScaffoldMessenger.of(context).showSnackBar( | ||
| const SnackBar(content: Text('Idea deleted')), |
There was a problem hiding this comment.
Only show delete success after a confirmed delete
The page always shows the "Idea deleted" snackbar after calling deleteIdea, but deleteIdea handles failures internally and does not report success/failure to the caller. If the API delete fails (or refresh fails after delete), users still see a success message, which gives incorrect feedback about data state.
Useful? React with 👍 / 👎.
Motivation
Description
IdeasStateandIdeasControllerwithinitLoad,refresh,loadMore,createIdea, anddeleteIdeabehaviors and pagination support.IdeasPage,AddIdeaSheet,IdeaListTile,FriendIdeaBadge, and lightweight deck widgetsDeckCardandCardDetailsSheetfor displaying plans and friend-idea badges.ideasControllerProvider, updatingideasRepository.listIdeasto acceptcursorandlimit, and registering a new route'/sessions/:id/ideas'inrouter.dart.SessionPageto navigate to the ideas page and implements form validation and phone normalization in the add-idea sheet.Testing
Codex Task