Skip to content

fix: improve calendar screen layout spacing - #29

Merged
SharkyBytes merged 1 commit into
AOSSIE-Org:mainfrom
navaneeth0041:fix/calendar-page-spacing
Oct 6, 2025
Merged

fix: improve calendar screen layout spacing#29
SharkyBytes merged 1 commit into
AOSSIE-Org:mainfrom
navaneeth0041:fix/calendar-page-spacing

Conversation

@navaneeth0041

@navaneeth0041 navaneeth0041 commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Closes #28

📝 Description

This PR fixes layout and spacing issues in the Calendar Screen where the calendar component appeared too close to the app bar, creating a cramped and awkward appearance. The changes improve the overall visual hierarchy and ensure proper spacing across different device screen sizes.

Problem
The calendar was extending too close to the status bar/app bar area, with insufficient spacing between UI elements, making the interface look cluttered and unprofessional.

Solution
Implemented proper spacing using Flutter's SafeArea widget and added strategic margins and padding throughout the calendar component to create a more polished and user-friendly interface.

🔧 Changes Made

  • Added SafeArea widget to respect device safe areas (status bar, notches, rounded corners)
  • Added top spacing (8px) after SafeArea to create breathing room from the app bar
  • Added horizontal margins (8px) to the calendar container to prevent edge-to-edge display
  • Added spacing (12px) between the calendar widget and the time scale section
  • Updated calendar container border radius to round all corners (instead of just bottom corners) for a more consistent design
  • Added internal padding (8px) inside the calendar container for better visual balance

📷 Screenshots or Visual Changes (if applicable)

Before
image

The calendar was positioned too close to the app bar with no proper spacing, creating a cramped appearance.

After
image

The calendar now has proper spacing from the app bar, horizontal margins, and better separation from the time scale, resulting in a cleaner, more professional look.

✅ Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if applicable).
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • New Features

    • Streamlined “Create with AI” flow: opens Chat directly with your initial message for faster interaction.
  • Style

    • Polished Calendar screen layout: respects device safe areas and adds clearer spacing around the calendar and time scale for improved readability.
  • Refactor

    • Internal layout restructuring of the Calendar screen to simplify composition without changing calendar behavior.

@coderabbitai

coderabbitai Bot commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

CalendarScreen layout wrapped in SafeArea with added margins/padding; calendar container styling adjusted without changing data logic. Removed Home screen import, kept Chat screen import. “Create-with-AI” now navigates directly to ChatScreen via Navigator.push with initial_message. Markers configuration unchanged; spacing around header/calendar corrected.

Changes

Cohort / File(s) Summary
Calendar layout and navigation
lib/screens/calendar/calendar_screen.dart
- Wrap build content in SafeArea; add vertical spacing and delegate layout to _buildCalendar with margins/padding
- Refactor calendar container styling (horizontal margin, internal padding); keep calendar data/markers unchanged
- Remove HomeScreen import; retain ChatScreen import
- Update create-with-AI flow to Navigator.push to ChatScreen with initial_message

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CalendarScreen
  participant Navigator
  participant ChatScreen

  User->>CalendarScreen: Tap "Create with AI"
  CalendarScreen->>Navigator: push(ChatScreen, args: initial_message)
  activate Navigator
  Navigator->>ChatScreen: Instantiate with initial_message
  deactivate Navigator
  ChatScreen-->>User: Display chat UI initialized
  note over CalendarScreen,ChatScreen: Layout: Calendar wrapped in SafeArea to avoid app bar overlap
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hopped through dates with tidy cheer,
A SafeArea blanket now keeps things clear.
No more headers squishing the view—
The calendar breathes, serene and true.
With a push, I bounce to chat’s bright light,
Initial whispers guide the night.
Thump-thump—ship it right!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The changeset includes refactoring of the AI-assisted chat navigation flow and import adjustments for the ChatScreen, which are unrelated to the calendar layout spacing fix described in issue #28. Extract or remove the chat navigation and import modifications into a separate pull request so this changeset remains focused solely on the calendar layout improvements.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the primary change of improving layout spacing on the calendar screen, aligning directly with the modifications made to margins, padding, and SafeArea implementation without extraneous detail or noise.
Linked Issues Check ✅ Passed The pull request implements all coding objectives from issue #28 by adding a SafeArea, top and horizontal spacing, internal padding, and full corner rounding to prevent the app bar from overlapping the calendar grid, thereby fulfilling the expected behavior of clear separation and unobstructed interactive elements.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/screens/calendar/calendar_screen.dart (1)

289-291: Fix TimeOfDay overflow (hour 23 → 24 is invalid)

Adding 1 hour can produce hour=24. Use modulo 24 to prevent invalid TimeOfDay.

-          endTime: TimeOfDay(hour: createdAt.hour + 1, minute: createdAt.minute),
+          endTime: TimeOfDay(hour: (createdAt.hour + 1) % 24, minute: createdAt.minute),
-          endTime: TimeOfDay(hour: meetingDate.hour + 1, minute: meetingDate.minute),
+          endTime: TimeOfDay(hour: (meetingDate.hour + 1) % 24, minute: meetingDate.minute),

Also applies to: 329-331

🧹 Nitpick comments (3)
lib/screens/calendar/calendar_screen.dart (3)

343-360: Wrap SafeArea around the loading state too

Currently SafeArea is only applied when not loading; the skeleton can overlap status bars/notches. Wrap the ternary with SafeArea for consistency.

-    body: _isLoading
-        ? const CalendarLoadingSkeleton()
-        : SafeArea(
-            child: Column(
+    body: SafeArea(
+      child: _isLoading
+          ? const CalendarLoadingSkeleton()
+          : Column(
             children: [
               // ...
-            ),
-          ),
+            ),
+      ),

364-365: Align horizontal gutters (8 px vs 16 px)

Time scale uses 16 px horizontal padding; calendar container uses 8 px margin, causing slight misalignment. Bump calendar margin to 16 px for visual consistency.

-    margin: const EdgeInsets.symmetric(horizontal: 8), 
+    margin: const EdgeInsets.symmetric(horizontal: 16),

Also applies to: 458-459


372-374: Avoid hard stop at 2025-12-31

Hard-coded lastDay will freeze navigation in 2026. Make it dynamic.

-        lastDay: DateTime.utc(2025, 12, 31),
+        lastDay: DateTime.utc(DateTime.now().year + 1, 12, 31),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b45cda4 and 113234e.

📒 Files selected for processing (1)
  • lib/screens/calendar/calendar_screen.dart (4 hunks)
🔇 Additional comments (2)
lib/screens/calendar/calendar_screen.dart (2)

15-15: Verify ChatScreen constructor; pass initial message via RouteSettings or a dedicated param

ChatScreen(arguments: {...}) will fail unless the widget defines a named parameter arguments. If ChatScreen reads ModalRoute.of(context)!.settings.arguments, pass it via MaterialPageRoute.settings.

-      MaterialPageRoute(
-        builder: (context) => ChatScreen(
-          arguments: {'initial_message': message}
-        ),
-      ),
+      MaterialPageRoute(
+        builder: (context) => ChatScreen(),
+        settings: RouteSettings(arguments: {'initial_message': message}),
+      ),

If ChatScreen expects a prop instead, prefer ChatScreen(initialMessage: message).

Also applies to: 755-762


430-435: Confirm intent of markersMaxCount: 0

Setting this to 0 suppresses default markers, relying entirely on your custom markerBuilder (which draws the green pill). If that’s the goal, all good; otherwise, increase the count.

@navaneeth0041

Copy link
Copy Markdown
Contributor Author

@SharkyBytes can u take a look at this

@SharkyBytes

Copy link
Copy Markdown
Collaborator

LGTM! @navaneeth0041

@navaneeth0041

Copy link
Copy Markdown
Contributor Author

@SharkyBytes So, as this is done I can open other issues and start working right?

@SharkyBytes

Copy link
Copy Markdown
Collaborator

Yeah @navaneeth0041! You can proceed with the new issues tilll that:)
And I would say please firstly discuss on the Discord channel too

@SharkyBytes
SharkyBytes merged commit 66af231 into AOSSIE-Org:main Oct 6, 2025
1 check passed
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.

BUG: Calendar App Bar Overlaps with Main Calendar Content

2 participants