Enhance authentication UI and implement Focus feature set#35
Conversation
…o feature/auth-api
- Added Pomodoro timer with Start/Reset/Skip logic. - Integrated local Quick Notes with Pin/Delete functionality. - Supported image attachments in notes using image_picker. - Added Focus settings: time duration, vibration, and ringtones.
Fixed 3 file(s) based on 4 unresolved review comments. Co-authored-by: CodeRabbit <[email protected]>
…tize negative settings input
…/TaskManagement into feature/countdown_timer
…tize negative settings input
📝 WalkthroughWalkthroughThe pull request introduces a compact layout mode to the authentication template that dynamically adjusts spacing, padding, and typography based on a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/lib/features/auth/presentation/view/login_view.dart (1)
106-139: Footer UI is now duplicated across auth views.Consider extracting this footer into a shared widget/helper to keep compact-style tweaks in one place.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/lib/features/auth/presentation/view/login_view.dart` around lines 106 - 139, The _buildFooter method duplicates footer UI across auth views; extract it into a reusable widget (e.g., AuthFooter or FooterButton) so style tweaks live in one place: create a stateless widget that accepts text, action, and VoidCallback onTap and internally uses the same Padding/Row/Text/TextButton and Theme-based TextStyles, replace calls to _buildFooter in LoginView (and other auth views) with the new widget to centralize styling and behavior.src/lib/core/theme/auth_layout_template.dart (1)
68-93: Consider centralizing compact spacing/sizing tokens.There are many repeated compact/non-compact literals. Extracting them into named constants (or a small token object) would make future layout tuning safer and faster.
Also applies to: 112-114, 133-143, 161-162, 188-197, 220-221, 235-293
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/lib/core/theme/auth_layout_template.dart` around lines 68 - 93, The code repeats compact vs non-compact numeric literals (e.g., padding EdgeInsets.fromLTRB(..., isCompact ? 8.0 : 16.0, ..., isCompact ? 16.0 : 36.0), SizedBox heights, and other spacing across methods like _buildHeader, _buildCardContainer, and _buildTransparentContainer), so create a small centralized spacing token set (e.g., a private class or const map such as _AuthLayoutSpacing with properties like horizontalPadding, headerTopCompact, headerTopRegular, cardVerticalCompact, cardVerticalRegular, gapSmall, gapLarge) and replace all inline ternary literals with those tokens keyed by isCompact; update uses in the SingleChildScrollView padding, SizedBox heights, and any other occurrences (including footer spacing) to reference the tokens so future tuning only changes the token definitions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/lib/features/auth/presentation/view/login_view.dart`:
- Line 83: The TextButton touch target is set to a 40dp minimum height which is
below accessibility guidelines; update the TextButton.styleFrom(minimumSize:
const Size(50, 40), ...) instances in login_view.dart (e.g., the style usage in
the widget building code around the login view) to use a minimum height of 48
(e.g., Size(50, 48)) and adjust the other occurrence mentioned (line ~126)
similarly so all interactive buttons meet the 48dp touch target recommendation.
---
Nitpick comments:
In `@src/lib/core/theme/auth_layout_template.dart`:
- Around line 68-93: The code repeats compact vs non-compact numeric literals
(e.g., padding EdgeInsets.fromLTRB(..., isCompact ? 8.0 : 16.0, ..., isCompact ?
16.0 : 36.0), SizedBox heights, and other spacing across methods like
_buildHeader, _buildCardContainer, and _buildTransparentContainer), so create a
small centralized spacing token set (e.g., a private class or const map such as
_AuthLayoutSpacing with properties like horizontalPadding, headerTopCompact,
headerTopRegular, cardVerticalCompact, cardVerticalRegular, gapSmall, gapLarge)
and replace all inline ternary literals with those tokens keyed by isCompact;
update uses in the SingleChildScrollView padding, SizedBox heights, and any
other occurrences (including footer spacing) to reference the tokens so future
tuning only changes the token definitions.
In `@src/lib/features/auth/presentation/view/login_view.dart`:
- Around line 106-139: The _buildFooter method duplicates footer UI across auth
views; extract it into a reusable widget (e.g., AuthFooter or FooterButton) so
style tweaks live in one place: create a stateless widget that accepts text,
action, and VoidCallback onTap and internally uses the same
Padding/Row/Text/TextButton and Theme-based TextStyles, replace calls to
_buildFooter in LoginView (and other auth views) with the new widget to
centralize styling and behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: aaf5f13b-19bf-48d0-b08b-6286bdc9dcc4
📒 Files selected for processing (3)
src/lib/core/theme/auth_layout_template.dartsrc/lib/features/auth/presentation/view/login_view.dartsrc/lib/features/auth/presentation/view/register_view.dart
| ), | ||
| TextButton( | ||
| onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const ForgotPasswordView())), | ||
| style: TextButton.styleFrom(minimumSize: const Size(50, 40), padding: const EdgeInsets.symmetric(horizontal: 4)), |
There was a problem hiding this comment.
Keep interactive touch targets at least 48dp height.
Reducing button minimum height to 40 may make tap targets too small on mobile. Prefer 48 for better accessibility and usability consistency.
Suggested adjustment
- style: TextButton.styleFrom(minimumSize: const Size(50, 40), padding: const EdgeInsets.symmetric(horizontal: 4)),
+ style: TextButton.styleFrom(minimumSize: const Size(50, 48), padding: const EdgeInsets.symmetric(horizontal: 4)),
...
- style: TextButton.styleFrom(minimumSize: const Size(50, 40)),
+ style: TextButton.styleFrom(minimumSize: const Size(50, 48)),Also applies to: 126-126
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/lib/features/auth/presentation/view/login_view.dart` at line 83, The
TextButton touch target is set to a 40dp minimum height which is below
accessibility guidelines; update the TextButton.styleFrom(minimumSize: const
Size(50, 40), ...) instances in login_view.dart (e.g., the style usage in the
widget building code around the login view) to use a minimum height of 48 (e.g.,
Size(50, 48)) and adjust the other occurrence mentioned (line ~126) similarly so
all interactive buttons meet the 48dp touch target recommendation.
There was a problem hiding this comment.
Pull request overview
This PR updates the shared authentication layout and the login/register screens to support a more compact UI presentation on smaller viewports.
Changes:
- Add
compactModesupport toAuthLayoutTemplateand make the layout responsive viaLayoutBuilder. - Reduce spacing and font sizes across auth screens (header, form spacing, footer).
- Adjust button sizing/padding for “compact” auth flows (login/register).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
src/lib/features/auth/presentation/view/register_view.dart |
Enables compact auth layout and tightens footer spacing/button sizing. |
src/lib/features/auth/presentation/view/login_view.dart |
Enables compact auth layout; tightens footer and “forgot password” button sizing. |
src/lib/core/theme/auth_layout_template.dart |
Introduces compactMode + responsive compact sizing across the shared auth UI template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| body: LayoutBuilder( | ||
| builder: (context, constraints) { | ||
| final isCompact = compactMode || constraints.maxHeight <= 780; | ||
|
|
| body: LayoutBuilder( | ||
| builder: (context, constraints) { | ||
| final isCompact = compactMode || constraints.maxHeight <= 780; |
| disabledBackgroundColor: | ||
| Theme.of(context).colorScheme.primary.withValues(alpha: 0.6), | ||
| padding: const EdgeInsets.symmetric(vertical: 20), | ||
| padding: EdgeInsets.symmetric(vertical: isCompact ? 14 : 20), |
| shape: RoundedRectangleBorder( | ||
| borderRadius: BorderRadius.circular(16), | ||
| ), | ||
| padding: const EdgeInsets.symmetric(vertical: 14), | ||
| padding: EdgeInsets.symmetric(vertical: isCompact ? 10 : 14), | ||
| ), |
| child: Icon( | ||
| Icons.task_alt, | ||
| size: 48, | ||
| size: isCompact ? 36 : 48, |
| TextButton( | ||
| onPressed: () => Navigator.pop(context), | ||
| style: TextButton.styleFrom(minimumSize: const Size(50, 48)), | ||
| style: TextButton.styleFrom(minimumSize: const Size(50, 40)), |
| ), | ||
| TextButton( | ||
| onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const ForgotPasswordView())), | ||
| style: TextButton.styleFrom(minimumSize: const Size(50, 40), padding: const EdgeInsets.symmetric(horizontal: 4)), |
| TextButton( | ||
| onPressed: onTap, | ||
| style: TextButton.styleFrom(minimumSize: const Size(50, 48)), | ||
| style: TextButton.styleFrom(minimumSize: const Size(50, 40)), |
| builder: (context, _) => AuthLayoutTemplate( | ||
| title: 'Task Management', | ||
| subtitle: 'Chào mừng trở lại!', | ||
| submitText: 'Đăng nhập', | ||
| compactMode: true, | ||
| isLoading: _vm.isLoading, |
* Feature/user profile (#30) * feat(UserProfile): build screen UserProfile # Conflicts: # src/lib/features/main/view/screens/main_screen.dart * feat: switch dark/light theme * fix: black color theme * fix: black theme in statistics screen * feat: add dark theme to auth screen * feat: apply dark theme for bottom navigation bar * feat(priority task):Implement priority and tag selection in task creation version 1 (#31) * feat(task): implement priority and tag selection features in task creation * Update README.md * Update README.md * Update README.md --------- Co-authored-by: Tran Quang Ha <[email protected]> * Update README.md (#32) * feat: Priority selector and tag system verson2 (#33) * feat(task): implement priority and tag selection features in task creation * feat(tags): enhance tag management with custom tag creation and selection * Update README.md * Update README.md * fix: error screen in main.dart (#34) * Enhance authentication UI and implement Focus feature set (#35) * feat(core): add auth layout template, custom textfield and colors * feat(auth): implement viewmodels for auth flow (MVVM) * feat(auth): build complete auth UI screens (Login, Register, OTP, Passwords) * chore(main): set LoginView as initial route * refactor(auth) : delete .gitkeep * chore: update dependencies and pubspec.lock * refactor(auth): optimize registration logic, timezone handling, and form validation * feat(auth): update UI for login, registration, and forgot password screens * feat(tasks): update task management UI and statistics screen * chore: update main entry point and fix widget tests * chore: ignore devtools_options.yaml * chore: ignore devtools_options.yaml * style(login) : rewrite title for login view * feat(auth): configure android deep link for supabase oauth * refactor(ui): add social login callbacks to auth layout template * feat(auth): update oauth methods with redirect url and signout * feat(auth): implement AuthGate using StreamBuilder for session tracking * feat(viewmodel): add oauth logic and improve provider lifecycle * refactor(ui): migrate LoginView to Provider pattern * chore(main): set AuthGate as initial route and setup provider * feat: implement full Focus feature set - Added Pomodoro timer with Start/Reset/Skip logic. - Integrated local Quick Notes with Pin/Delete functionality. - Supported image attachments in notes using image_picker. - Added Focus settings: time duration, vibration, and ringtones. * fix (auth) : dispose TextEditingControllers to prevent memory leaks * refactor (alarm ) : create off alarm button when time out * fix: apply CodeRabbit auto-fixes Fixed 3 file(s) based on 4 unresolved review comments. Co-authored-by: CodeRabbit <[email protected]> * fix(timer): prevent division by zero in progress calculation and sanitize negative settings input * fix(timer): prevent division by zero in progress calculation and sanitize negative settings input * fix(auth): unblock new-user login and add settings logout * refactor(LoginScreen) : compact all items to fit in screen to help users interface easily --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <[email protected]> * build(deps)(deps): bump shared_preferences from 2.5.4 to 2.5.5 in /src (#36) Bumps [shared_preferences](https://github.com/flutter/packages/tree/main/packages/shared_preferences) from 2.5.4 to 2.5.5. - [Commits](https://github.com/flutter/packages/commits/shared_preferences-v2.5.5/packages/shared_preferences) --- updated-dependencies: - dependency-name: shared_preferences dependency-version: 2.5.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feature/user profile (#37) * feat(UserProfile): build screen UserProfile # Conflicts: # src/lib/features/main/view/screens/main_screen.dart * feat: switch dark/light theme * fix: black color theme * fix: black theme in statistics screen * feat: add dark theme to auth screen * feat: apply dark theme for bottom navigation bar * feat(RPC): update RPC to get data for heatmap * feat(RPC): update new RPC to get data for heatmap * feat: integrate chatbot assistant * feat(chatbot): integrate create task, answer question for chatbot * feat: remove mock data and get data tags and categories from supabase * feat: integrate chatbot's ability to create task --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Nguyễn Anh Kiệt <[email protected]> Co-authored-by: Nguyễn Lê Hoàng Hảo <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: add create task screen and fix home screen provider errors * Feature/user profile (#30) * feat(UserProfile): build screen UserProfile # Conflicts: # src/lib/features/main/view/screens/main_screen.dart * feat: switch dark/light theme * fix: black color theme * fix: black theme in statistics screen * feat: add dark theme to auth screen * feat: apply dark theme for bottom navigation bar * feat(priority task):Implement priority and tag selection in task creation version 1 (#31) * feat(task): implement priority and tag selection features in task creation * Update README.md * Update README.md * Update README.md --------- Co-authored-by: Tran Quang Ha <[email protected]> * Remove comment about main UI in home_screen.dart Removed commented section about main UI. * Update README.md (#32) * feat: Priority selector and tag system verson2 (#33) * feat(task): implement priority and tag selection features in task creation * feat(tags): enhance tag management with custom tag creation and selection * Update README.md * Update README.md * fix: error screen in main.dart (#34) * Enhance authentication UI and implement Focus feature set (#35) * feat(core): add auth layout template, custom textfield and colors * feat(auth): implement viewmodels for auth flow (MVVM) * feat(auth): build complete auth UI screens (Login, Register, OTP, Passwords) * chore(main): set LoginView as initial route * refactor(auth) : delete .gitkeep * chore: update dependencies and pubspec.lock * refactor(auth): optimize registration logic, timezone handling, and form validation * feat(auth): update UI for login, registration, and forgot password screens * feat(tasks): update task management UI and statistics screen * chore: update main entry point and fix widget tests * chore: ignore devtools_options.yaml * chore: ignore devtools_options.yaml * style(login) : rewrite title for login view * feat(auth): configure android deep link for supabase oauth * refactor(ui): add social login callbacks to auth layout template * feat(auth): update oauth methods with redirect url and signout * feat(auth): implement AuthGate using StreamBuilder for session tracking * feat(viewmodel): add oauth logic and improve provider lifecycle * refactor(ui): migrate LoginView to Provider pattern * chore(main): set AuthGate as initial route and setup provider * feat: implement full Focus feature set - Added Pomodoro timer with Start/Reset/Skip logic. - Integrated local Quick Notes with Pin/Delete functionality. - Supported image attachments in notes using image_picker. - Added Focus settings: time duration, vibration, and ringtones. * fix (auth) : dispose TextEditingControllers to prevent memory leaks * refactor (alarm ) : create off alarm button when time out * fix: apply CodeRabbit auto-fixes Fixed 3 file(s) based on 4 unresolved review comments. Co-authored-by: CodeRabbit <[email protected]> * fix(timer): prevent division by zero in progress calculation and sanitize negative settings input * fix(timer): prevent division by zero in progress calculation and sanitize negative settings input * fix(auth): unblock new-user login and add settings logout * refactor(LoginScreen) : compact all items to fit in screen to help users interface easily --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <[email protected]> * build(deps)(deps): bump shared_preferences from 2.5.4 to 2.5.5 in /src (#36) Bumps [shared_preferences](https://github.com/flutter/packages/tree/main/packages/shared_preferences) from 2.5.4 to 2.5.5. - [Commits](https://github.com/flutter/packages/commits/shared_preferences-v2.5.5/packages/shared_preferences) --- updated-dependencies: - dependency-name: shared_preferences dependency-version: 2.5.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feature/user profile (#37) * feat(UserProfile): build screen UserProfile # Conflicts: # src/lib/features/main/view/screens/main_screen.dart * feat: switch dark/light theme * fix: black color theme * fix: black theme in statistics screen * feat: add dark theme to auth screen * feat: apply dark theme for bottom navigation bar * feat(RPC): update RPC to get data for heatmap * feat(RPC): update new RPC to get data for heatmap * feat: integrate chatbot assistant * feat(chatbot): integrate create task, answer question for chatbot * feat: remove mock data and get data tags and categories from supabase * fixed codes, added save delete and create tasks and notes * Delete .vs/TaskManagement.slnx/v18/.wsuo * Delete .vs directory * Delete .vscode directory * Delete src/.gitignore * Delete src/lib/features/auth/viewmodels/task_provider.dart * Delete src/web_entrypoint.dart --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Tran Quang Ha <[email protected]> Co-authored-by: Nguyễn Anh Kiệt <[email protected]> Co-authored-by: Nguyễn Lê Hoàng Hảo <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Style