Skip to content

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

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

Fix : Add an Appointment modal UI and scrolling behaviour#190
swathi2006 wants to merge 6 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

    • Increased side padding and slightly larger max height in the Add Appointment modal for a cleaner, more spacious layout.
    • Standardized appointment title placeholder capitalization for clarity.
  • Bug Fixes / Usability

    • Improved keyboard handling with platform-aware behavior to prevent inputs being obscured.
    • Enhanced form scrolling and tap handling to ensure smoother, more reliable input entry within the modal.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Wrapped the Add Appointment modal content in a Platform-aware KeyboardAvoidingView, adjusted ScrollView keyboard/content props and modal padding/maxHeight, removed transparent={true}, 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; added KeyboardAvoidingView inside the modal with behavior conditional on Platform.OS; reorganized nesting / closing tags to place KeyboardAvoidingView inside the modal's ScrollView.
ScrollView / Keyboard UX & Styling
Frontend/src/Screens/CalendarScreen.jsx
Added contentContainerStyle: { flexGrow: 1, paddingBottom: 20 }, keyboardShouldPersistTaps="handled", increased modalContent maxHeight to 95% and added paddingLeft/paddingRight: 24; adjusted placeholder text to "Appointment Title" and minor formatting/style tweaks.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Modal
    participant KAV as KeyboardAvoidingView
    participant Scroll as ScrollView
    participant Inputs as FormInputs
    participant Keyboard as SystemKeyboard

    User->>Modal: Open "Add Appointment"
    Modal->>KAV: Render modal content inside KAV
    KAV->>Scroll: Wrap form in ScrollView (contentContainerStyle set)
    User->>Inputs: Focus text input
    Inputs->>Keyboard: Request keyboard
    Keyboard-->>KAV: Keyboard appears
    KAV->>Scroll: Adjust layout (behavior: ios -> padding, others -> height)
    Scroll->>Inputs: Ensure focused input is visible / allow scrolling
    User->>Inputs: Type / scroll form
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰
I nudged the modal, soft and bright,
Padded the sides to meet the light,
When keys arise and screens encroach,
I hop the form up, calm and coach,
Now typing's easy — hop and write. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: fixing the Add Appointment modal UI and scrolling behaviour, which aligns with the primary objective of resolving the keyboard overlap issue.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #188: wrapping modal content with KeyboardAvoidingView, improving ScrollView behaviour with contentContainerStyle, adjusting modal layout with increased padding and maxHeight, and ensuring inputs remain visible and scrollable when the keyboard is active.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the keyboard overlap issue described in issue #188, including KeyboardAvoidingView implementation, ScrollView adjustments, modal styling enhancements, and placeholder text corrections. No unrelated or extraneous changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • 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.

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,
   },

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.

@swathi2006
Copy link
Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@swathi2006
Copy link
Author

@coderabbitai approve

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

✅ Actions performed

Comments resolved. Auto-approval is disabled; enable reviews.request_changes_workflow to approve automatically.

@swathi2006
Copy link
Author

Hi @shashbha14 ,
I’ve addressed all CodeRabbit suggestions and the PR is now ready for review.
Would love your feedback whenever you’re available. Thanks!

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