Skip to content

Fix : Add an Appointment modal UI and scrolling behaviour#190

Open
swathi2006 wants to merge 4 commits intoAOSSIE-Org:mainfrom
swathi2006:fix-appointment-modal-ui
Open

Fix : Add an Appointment modal UI and scrolling behaviour#190
swathi2006 wants to merge 4 commits intoAOSSIE-Org:mainfrom
swathi2006:fix-appointment-modal-ui

Conversation

@swathi2006
Copy link

@swathi2006 swathi2006 commented Feb 13, 2026

Closes #188

📝 Description

This PR improves the usability of the "Add Appointment" modal when the keyboard opens .

Previously:

  • The modal became compressed
  • Some input fields were partially hidden
  • Scrolling inside the form was difficult

Now:

  • Form layout remains stable
  • Inputs stay accessible while typing
  • Scrolling behaviour is smoother and more usable

🔧 Changes Made

  • Improved modal layout
  • Enhanced ScrollView behaviour
  • Adjusted styling for better usability when keyboard is open

📷 Screenshots or Visual Changes (if applicable)

image image image

🤝 Collaboration

Collaborated with: Self

✅ 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

  • Style

    • Improved Add Appointment modal layout with increased side padding and cleaner visual presentation.
    • Updated appointment title placeholder text for clarity and consistency.
  • Bug Fixes / Usability

    • Improved form scrolling and keyboard handling with platform-aware behavior to prevent content overlap.
    • Ensured smoother tap/scroll interactions within the form for more reliable input entry.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

Wrapped the Add Appointment modal form in a Platform-aware KeyboardAvoidingView, removed transparent={true}, adjusted ScrollView keyboard/content props and modal padding, and updated the appointment title placeholder casing in CalendarScreen.jsx.

Changes

Cohort / File(s) Summary
Modal & Form Layout
Frontend/src/Screens/CalendarScreen.jsx
Removed transparent={true} from Modal, wrapped modal form with KeyboardAvoidingView using platform-aware behavior, restructured ScrollView nesting, and adjusted modalContent padding (left/right) and layout (flex: 1).
ScrollView / Keyboard UX & Text
Frontend/src/Screens/CalendarScreen.jsx
Added contentContainerStyle: { flexGrow: 1, paddingBottom: 20 }, keyboardShouldPersistTaps="handled", preserved showsVerticalScrollIndicator={false}, and changed placeholder text from "Appointment title" to "Appointment Title".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰
I hopped into a modal, soft and bright,
Padded the corners so each field stays in sight,
I fenced off the keys that used to intrude,
Now scrolls flow kindly and forms stay shrewd. 🥕✨

🚥 Pre-merge checks | ✅ 5 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (2 files):

⚔️ Frontend/src/Screens/CalendarScreen.jsx (content)
⚔️ README.md (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing the Add Appointment modal UI and scrolling behavior when the keyboard opens, which is the primary objective of the PR.
Linked Issues check ✅ Passed The PR implements all key requirements from issue #188: wrapping content with KeyboardAvoidingView, enhancing ScrollView with proper contentContainerStyle and keyboardShouldPersistTaps, removing modal transparency, and adjusting styling for better keyboard accessibility.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing the keyboard overlap and scrolling issues in the Add Appointment modal as specified in issue #188, with no unrelated modifications detected.
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 docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch fix-appointment-modal-ui
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉


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
Contributor

@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

🤖 Fix all issues with AI agents
In `@Frontend/src/Screens/CalendarScreen.jsx`:
- Around line 426-430: The Modal was made opaque by commenting out
transparent={true}, which hides the overlay and combined with modalContent's
flex:1 makes the dialog full-screen; either restore transparent={true} on the
Modal (so the overlay rgba(0,0,0,0.5) and centered dialog work) and handle
keyboard by wrapping the modal inner content with KeyboardAvoidingView (or
adjust styles) or, if you intend a full-screen form, remove the overlay wrapper
and ensure modalContent is styled for full-screen form layout; update the Modal
invocation (isAddAppointmentModalVisible, hideAddAppointmentModal) and the
modalContent/overlay structure accordingly.
- Around line 835-849: The modalContent style uses flex: 1 which makes the
dialog expand to full height and breaks formatting; replace flex: 1 with a
maxHeight (e.g., maxHeight: '90%') so the dialog can grow with keyboard input
but remain centered, remove or replace the "// ⭐ IMPORTANT" comment with a
concise explanation (e.g., "// allow vertical growth but don't fill screen") and
fix the trailing brace/comma formatting so the object closes on a single line;
locate and update the modalContent style object in CalendarScreen.jsx
accordingly.
🧹 Nitpick comments (2)
Frontend/src/Screens/CalendarScreen.jsx (2)

454-458: Inconsistent indentation on the new ScrollView props.

The new props have mismatched leading whitespace — contentContainerStyle is indented with extra spaces (16), keyboardShouldPersistTaps differently, and showsVerticalScrollIndicator with yet another indent. This harms readability.

Also, for a keyboard-aware scrolling form, consider wrapping the modal content with KeyboardAvoidingView (with behavior="padding" on iOS) instead of relying solely on ScrollView — the ScrollView alone won't automatically scroll the focused input into view on all platforms.


905-907: Minor formatting: multiple properties on one line.

Split for readability:

Suggested format
   formContainer: {
-    marginBottom: 20,paddingBottom:20,
+    marginBottom: 20,
+    paddingBottom: 20,
   },

Comment on lines 835 to 849
modalContent: {
backgroundColor: '#fff',
borderRadius: 24,
paddingLeft: 24,
paddingRight:24,
width: '100%',
maxWidth: 400,
flex: 1, // ⭐ IMPORTANT
shadowColor: '#000',
shadowOffset: {width: 0, height: 10},
shadowOpacity: 0.15,
shadowRadius: 20,
elevation: 10,
}
,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

flex: 1 makes the modal content fill the entire screen; formatting is broken.

  1. flex: 1 causes modalContent to stretch to fill its parent, turning the dialog into a full-height panel. If a centered dialog is intended, use maxHeight (e.g., maxHeight: '90%') instead of flex: 1 so content can grow with the keyboard but still look like a modal.

  2. The // ⭐ IMPORTANT comment doesn't explain why it's important — replace with a meaningful comment or remove it.

  3. The closing } and , on separate lines (848–849) is malformed formatting.

Suggested fix (dialog that grows but doesn't fill the screen)
 modalContent: {
   backgroundColor: '#fff',
   borderRadius: 24,
-  paddingLeft: 24,
-  paddingRight:24,
+  paddingHorizontal: 24,
   width: '100%',
   maxWidth: 400,
-  flex: 1,   // ⭐ IMPORTANT
+  maxHeight: '90%',
   shadowColor: '#000',
   shadowOffset: {width: 0, height: 10},
   shadowOpacity: 0.15,
   shadowRadius: 20,
   elevation: 10,
-}
-,
+},
🤖 Prompt for AI Agents
In `@Frontend/src/Screens/CalendarScreen.jsx` around lines 835 - 849, The
modalContent style uses flex: 1 which makes the dialog expand to full height and
breaks formatting; replace flex: 1 with a maxHeight (e.g., maxHeight: '90%') so
the dialog can grow with keyboard input but remain centered, remove or replace
the "// ⭐ IMPORTANT" comment with a concise explanation (e.g., "// allow
vertical growth but don't fill screen") and fix the trailing brace/comma
formatting so the object closes on a single line; locate and update the
modalContent style object in CalendarScreen.jsx accordingly.

Removed commented-out transparent prop from Modal.
Copy link
Contributor

@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: 1

Caution

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

⚠️ Outside diff range comments (1)
Frontend/src/Screens/CalendarScreen.jsx (1)

453-542: ⚠️ Potential issue | 🟠 Major

Action buttons are now inside the ScrollView — consider wrapping with KeyboardAvoidingView for iOS.

Moving the "Save" and "Cancel" buttons inside the ScrollView (closed at line 542) is reasonable so users can scroll to them when the keyboard is open. However, this PR's objective is keyboard-aware behavior, yet there is no KeyboardAvoidingView wrapping the modal content. On iOS, the keyboard does not automatically resize the modal content the way Android's windowSoftInputMode can — without KeyboardAvoidingView, the bottom of the form may still be obscured on iOS.

A typical pattern:

import { KeyboardAvoidingView, Platform } from 'react-native';

<KeyboardAvoidingView
  behavior={Platform.OS === 'ios' ? 'padding' : undefined}
  style={{ flex: 1 }}
>
  <ScrollView ...>
    {/* form + buttons */}
  </ScrollView>
</KeyboardAvoidingView>
🤖 Fix all issues with AI agents
In `@Frontend/src/Screens/CalendarScreen.jsx`:
- Around line 904-906: The ScrollView is using the styles.formContainer object
(which currently includes paddingBottom: 20) as its style prop, but
paddingBottom on the ScrollView frame doesn't add scrollable space; move
paddingBottom from the formContainer style into the ScrollView's
contentContainerStyle instead. Edit the style object named formContainer to
remove paddingBottom and keep marginBottom, then update the ScrollView where
styles.formContainer is passed (the component rendering the ScrollView) to add
contentContainerStyle={{ paddingBottom: 20 }} (or merge with any existing
contentContainerStyle) so the bottom of the scrollable content gets proper
padding.
🧹 Nitpick comments (1)
Frontend/src/Screens/CalendarScreen.jsx (1)

455-457: Inconsistent indentation on ScrollView props.

The three props have mismatched leading whitespace (contentContainerStyle is indented further than keyboardShouldPersistTaps, which differs from showsVerticalScrollIndicator). This is a minor formatting nit but hurts readability.

             <ScrollView
               style={styles.formContainer}
-                contentContainerStyle={{ flexGrow: 1 }}
-                keyboardShouldPersistTaps="handled"
-               showsVerticalScrollIndicator={false}>
+              contentContainerStyle={{flexGrow: 1}}
+              keyboardShouldPersistTaps="handled"
+              showsVerticalScrollIndicator={false}>

Added KeyboardAvoidingView to improve keyboard handling on iOS devices and adjusted ScrollView padding.
Copy link
Contributor

@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: 1

🤖 Fix all issues with AI agents
In `@Frontend/src/Screens/CalendarScreen.jsx`:
- Around line 455-458: KeyboardAvoidingView in CalendarScreen.jsx is currently
passed behavior={Platform.OS === 'ios' ? 'padding' : undefined}, which makes it
a no-op on Android; change the prop to use 'height' on Android (e.g.
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}) so it actually adjusts
layout on Android, or alternatively enable
android:windowSoftInputMode="adjustResize" in the Android manifest if you prefer
handling it at the native config level.
🧹 Nitpick comments (1)
Frontend/src/Screens/CalendarScreen.jsx (1)

460-464: Inconsistent indentation makes the nesting hard to follow.

The ScrollView props use mixed indentation (some lines indented 16 spaces, the closing > at 15 spaces). This whole block (through to the closing tags at lines 549-550) has inconsistent indentation that obscures the component nesting structure.

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: Appointment form modal inputs hidden when keyboard opens on Android

1 participant