Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some screens for horizontal view #107

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cp-sneh-s
Copy link
Collaborator

@cp-sneh-s cp-sneh-s commented Oct 22, 2024

Changelog

[Quick description and/or mentions to other PRs]

Breaking Changes

  • [List breaking changes]

New Features

  • Added Scrolling Property for these screen :- SpaceInfoOnboard, JoinSpaceComponent,DatePickerDialog
  • Added remeberSaveable property for CreateSpaceOnboard

Bug Fixes

  • SpaceInfoOnboard :- Fixed this for horizontal view.
  • JoinSpaceComponent :- Fixed this for horizontal view.
  • JourneyTimelineScreen :- Fixed timeline dialog for horizontal view.
  • CreateSpaceOnboard :- Fixed name change things while rotate the device.
GroupOnboard.mp4
CreateOrJoinGroupScreen.mp4
GroupNameNameScreen.mp4

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced DatePicker component with vertical scrolling for improved usability when selecting dates.
    • Added vertical scrolling to the JoinSpaceComponent and SpaceInfoOnboard, allowing for better navigation of overflowing content.
  • Improvements

    • Updated state management in CreateSpaceOnboard to retain spaceName across configuration changes.
    • Improved layout of buttons in JoinSpaceComponent and SpaceInfoOnboard for better visual clarity.

These changes enhance user experience and interface interactivity across various components.

Copy link

coderabbitai bot commented Oct 22, 2024

Walkthrough

The pull request introduces several modifications across multiple files, primarily focusing on enhancing the user interface of various components within the onboarding flow. Key changes include the addition of vertical scrolling capabilities to the DatePicker, JoinSpaceComponent, and SpaceInfoOnboard components, allowing for better usability when dealing with extensive content. Additionally, the CreateSpaceOnboard component has been updated to use rememberSaveable for state management, ensuring the spaceName variable retains its value across configuration changes.

Changes

File Path Change Summary
app/src/main/java/com/canopas/yourspace/ui/component/DatePicker.kt Added imports for layout enhancements; updated ShowDatePicker to enable vertical scrolling in DatePicker.
app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/CreateSpaceOnboard.kt Changed spaceName state management from remember to rememberSaveable for configuration change persistence.
app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/JoinOrCreateSpaceOnboard.kt Updated JoinSpaceComponent to use fillMaxSize() and added vertical scrolling; modified button padding.
app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/SpaceInfoOnboard.kt Added vertical scrolling to SpaceInfoOnboard; refactored button modifier parameters for clarity.

Suggested reviewers

  • cp-megh-l

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7ae6c68 and 868c5c9.

📒 Files selected for processing (1)
  • app/src/main/java/com/canopas/yourspace/ui/component/DatePicker.kt (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/com/canopas/yourspace/ui/component/DatePicker.kt

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or Summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

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

🧹 Outside diff range and nitpick comments (3)
app/src/main/java/com/canopas/yourspace/ui/component/DatePicker.kt (1)

54-61: LGTM: Improved DatePicker layout for better usability.

The addition of a scrollable Box wrapper for the DatePicker enhances its usability in horizontal view, addressing the PR objective. The implementation is clean and follows Jetpack Compose best practices.

Consider adding a content description to the Box for improved accessibility:

 Box(modifier = Modifier
     .verticalScroll(rememberScrollState())
-    .fillMaxWidth()
+    .fillMaxWidth(),
+    contentDescription = stringResource(R.string.date_picker_content_description)
 ) {
     DatePicker(
         state = datePickerState
     )
 }
app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/SpaceInfoOnboard.kt (1)

36-36: LGTM: Vertical scrolling added and modifiers reformatted.

The addition of vertical scrolling to the main Column Composable addresses the PR objective of fixing screens for horizontal view. The reformatting of button modifiers improves code readability without changing functionality.

Consider extracting the common modifier properties for both buttons into a separate variable to reduce duplication:

val buttonModifier = Modifier
    .fillMaxWidth()
    .padding(horizontal = 16.dp)

PrimaryButton(
    modifier = buttonModifier,
    // ... other properties
)

PrimaryOutlinedButton(
    modifier = buttonModifier,
    // ... other properties
)

Also applies to: 54-56, 66-68

app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/JoinOrCreateSpaceOnboard.kt (1)

78-80: LGTM: Improved layout and scrolling for JoinSpaceComponent.

The changes to use fillMaxSize() and add vertical scrolling are appropriate for addressing horizontal view issues. This ensures the component adapts well to different screen orientations and allows scrolling when content exceeds the screen height.

Consider wrapping the verticalScroll modifier in a weight(1f) modifier to ensure the column takes up all available space while still allowing scrolling:

.weight(1f)
.verticalScroll(rememberScrollState())

This change would ensure that the column expands to fill the available space before enabling scrolling, which can improve the layout in some cases.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f1ab24d and 7ae6c68.

📒 Files selected for processing (4)
  • app/src/main/java/com/canopas/yourspace/ui/component/DatePicker.kt (3 hunks)
  • app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/CreateSpaceOnboard.kt (2 hunks)
  • app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/JoinOrCreateSpaceOnboard.kt (3 hunks)
  • app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/SpaceInfoOnboard.kt (4 hunks)
🧰 Additional context used
🔇 Additional comments (5)
app/src/main/java/com/canopas/yourspace/ui/component/DatePicker.kt (1)

3-6: LGTM: New imports for enhanced layout capabilities.

The added imports from androidx.compose.foundation.layout are appropriate for implementing a scrollable container for the DatePicker. This change aligns with the PR objective of improving the UI for horizontal view.

app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/CreateSpaceOnboard.kt (1)

43-43: Excellent use of rememberSaveable for state preservation

The change from remember to rememberSaveable is a great improvement. This modification ensures that the spaceName state is preserved across configuration changes, such as screen rotations. It directly addresses the issue mentioned in the PR objectives regarding name changes when the device is rotated.

Benefits of this change:

  1. Improved user experience: Users won't lose their input when rotating the device.
  2. Consistency with Jetpack Compose best practices for handling state that needs to survive configuration changes.
  3. No negative impact on performance or functionality.
app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/SpaceInfoOnboard.kt (1)

11-12: LGTM: Necessary imports added for vertical scrolling.

The addition of rememberScrollState and verticalScroll imports is appropriate for implementing vertical scrolling in the Composable, which aligns with the PR objective of fixing screens for horizontal view.

app/src/main/java/com/canopas/yourspace/ui/flow/onboard/components/JoinOrCreateSpaceOnboard.kt (2)

10-11: LGTM: Necessary imports for vertical scrolling.

The addition of rememberScrollState and verticalScroll imports is appropriate for implementing vertical scrolling, which aligns with the PR objectives of fixing screens for horizontal view.


104-106: LGTM: Improved button layout.

The addition of top padding to the PrimaryButton enhances the visual separation and improves the overall layout. This change contributes to a better user experience, which aligns with the PR objectives of improving the UI for different view orientations.

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.

1 participant