Skip to content

Fix CategoryScreen UI and scrolling issues#795

Open
mahmoudr80 wants to merge 1 commit intoAOSSIE-Org:masterfrom
mahmoudr80:fix_category_screen_ui_issues
Open

Fix CategoryScreen UI and scrolling issues#795
mahmoudr80 wants to merge 1 commit intoAOSSIE-Org:masterfrom
mahmoudr80:fix_category_screen_ui_issues

Conversation

@mahmoudr80
Copy link
Copy Markdown

@mahmoudr80 mahmoudr80 commented Mar 25, 2026

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • [o] Bug fix (non-breaking CHANGE which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [o] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [o] Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

  1. Scrolling Behavior
  • Open CategoryScreen
  • Verify that the story list scrolls smoothly
  • Confirm no scroll conflicts or freezes
  1. Navigation
  • Navigate to CategoryScreen
  • Verify that the back button is visible in AppBar
  • Tap back and confirm navigation works correctly

Result

All test cases passed successfully. UI behaves as expected across different screen sizes.

Please include screenshots below if applicable.

Checklist:

  • [o] My code follows the style guidelines of this project
  • [o] I have performed a self-review of my own code
  • [o] I have commented my code, particularly in hard-to-understand areas
  • [o] I have made corresponding changes to the documentation
  • [o] My changes generate no new warnings
  • [o] I have added tests that prove my fix is effective or that my feature works
  • [o] New and existing unit tests pass locally with my changes
  • [o] Any dependent changes have been merged and published in downstream modules
  • [o] I have checked my code and corrected any misspellings

Maintainer Checklist

Summary by CodeRabbit

UI/Style

  • Back button now appears in the category screen's app bar header
  • App bar title is centered for improved visual alignment and consistency
  • Layout refinements throughout category screen views

Bug Fixes

  • Enhanced empty-state display layout when no category content is available
  • Improved overall layout structure and spacing consistency

@mahmoudr80 mahmoudr80 requested a review from M4dhav as a code owner March 25, 2026 23:19
@github-actions
Copy link
Copy Markdown
Contributor

🎉 Welcome @mahmoudr80!
Thank you for your pull request! Our team will review it soon. 🔍

  • Please ensure your PR follows the contribution guidelines. ✅
  • All automated tests should pass before merging. 🔄
  • If this PR fixes an issue, link it in the description. 🔗

We appreciate your contribution! 🚀

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

Updated CategoryScreen's AppBar to display the back button and center the title, restructured the Obx builder's conditional logic formatting, and adjusted the empty-state Column layout by adding mainAxisSize sizing constraints for improved UX.

Changes

Cohort / File(s) Summary
CategoryScreen UI & Layout Updates
lib/views/screens/category_screen.dart
Modified AppBar configuration to show back button and center title; reformatted Obx builder indentation and state conditional branches (loading, non-empty ListView, empty state); added mainAxisSize: MainAxisSize.min to empty-state Column layout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 The CategoryScreen hops with grace,
Back button now shows its face,
Titles centered, clean and bright,
Empty states sized just right,
Scrolling smooth, UX takes flight! 📱✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Fix CategoryScreen UI and scrolling issues' directly summarizes the main changes made to the CategoryScreen component, addressing both UI fixes and scrolling problems.
Linked Issues check ✅ Passed The PR addresses the primary objectives from issue #794: fixing broken scrolling behavior (resolved through layout restructuring), improving UI responsiveness (AppBar configuration updates), and ensuring proper navigation elements visibility (back button now showing).
Out of Scope Changes check ✅ Passed All changes in the PR are directly related to fixing CategoryScreen UI and scrolling issues as defined in issue #794; no out-of-scope modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/views/screens/category_screen.dart`:
- Around line 61-64: Replace the fixed Padding bottom: 150.0 used around the
Column with a responsive layout: remove the hard-coded EdgeInsets.only(bottom:
150.0) and instead wrap the Column (the widget using mainAxisAlignment:
MainAxisAlignment.center and mainAxisSize: MainAxisSize.min) in a Center and/or
SafeArea, or use Expanded/Spacer inside a parent Column or a
LayoutBuilder/MediaQuery-driven padding so empty-state content is vertically
centered on all screen sizes; update the widget (the Padding/Column in
category_screen.dart) to use one of these responsive approaches rather than a
fixed bottom offset.
- Around line 44-49: The ListView in CategoryScreen currently disables user
scrolling by using physics: NeverScrollableScrollPhysics() and also sets
shrinkWrap: true and primary: true which together prevent proper scrolling;
update the ListView configuration in the CategoryScreen widget by removing or
changing the physics to allow user scrolling (e.g., null or a scrollable
physics), set primary to false (or remove it) and remove or set shrinkWrap to
false so the list can scroll normally; adjust only the ListView properties
(physics, shrinkWrap, primary) in the build method where itemCount is defined.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d8dad22-4317-4b7e-b6fe-a07bccc6fcdf

📥 Commits

Reviewing files that changed from the base of the PR and between bf1dbe2 and 0e0323a.

📒 Files selected for processing (1)
  • lib/views/screens/category_screen.dart

Comment on lines +44 to +49
physics: const NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
padding: EdgeInsets.zero,
shrinkWrap: true,
primary: true,
itemCount:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether CategoryScreen still disables primary list scrolling.
fd category_screen.dart --exec rg -n -C2 'NeverScrollableScrollPhysics|shrinkWrap:\s*true|primary:\s*true' {}

Repository: AOSSIE-Org/Resonate

Length of output: 463


Story list is configured to not scroll and will prevent scrolling regressions from being fixed.

Line 44 sets NeverScrollableScrollPhysics(), which disables user scrolling on this ListView. Combined with shrinkWrap: true and primary: true (lines 47-48), this configuration prevents the list from scrolling even if the parent container allows it. This directly conflicts with fixing scrolling regressions.

Suggested fix
-          child: ListView.builder(
-            physics: const NeverScrollableScrollPhysics(),
+          child: ListView.builder(
             scrollDirection: Axis.vertical,
             padding: EdgeInsets.zero,
-            shrinkWrap: true,
-            primary: true,
+            // default scroll behavior for primary content list
             itemCount:
             exploreStoryController.openedCategotyStories.length,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/views/screens/category_screen.dart` around lines 44 - 49, The ListView in
CategoryScreen currently disables user scrolling by using physics:
NeverScrollableScrollPhysics() and also sets shrinkWrap: true and primary: true
which together prevent proper scrolling; update the ListView configuration in
the CategoryScreen widget by removing or changing the physics to allow user
scrolling (e.g., null or a scrollable physics), set primary to false (or remove
it) and remove or set shrinkWrap to false so the list can scroll normally;
adjust only the ListView properties (physics, shrinkWrap, primary) in the build
method where itemCount is defined.

Comment on lines +61 to +64
padding: const EdgeInsets.only(bottom: 150.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,// take the least size needed
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid fixed bottom: 150 for empty-state positioning.

Line 61 hard-codes vertical offset, which can look misaligned on smaller/larger screens. Use centering/safe-area-driven layout instead for responsive behavior.

Suggested fix
-            : Padding(
-          padding: const EdgeInsets.only(bottom: 150.0),
-          child: Column(
+            : Center(
+          child: Column(
             mainAxisAlignment: MainAxisAlignment.center,
             mainAxisSize: MainAxisSize.min,// take the least size needed
             children: [
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
padding: const EdgeInsets.only(bottom: 150.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,// take the least size needed
: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,// take the least size needed
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/views/screens/category_screen.dart` around lines 61 - 64, Replace the
fixed Padding bottom: 150.0 used around the Column with a responsive layout:
remove the hard-coded EdgeInsets.only(bottom: 150.0) and instead wrap the Column
(the widget using mainAxisAlignment: MainAxisAlignment.center and mainAxisSize:
MainAxisSize.min) in a Center and/or SafeArea, or use Expanded/Spacer inside a
parent Column or a LayoutBuilder/MediaQuery-driven padding so empty-state
content is vertically centered on all screen sizes; update the widget (the
Padding/Column in category_screen.dart) to use one of these responsive
approaches rather than a fixed bottom offset.

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.

CategoryScreen has broken scrolling and poor UX

1 participant