Skip to content

fix: fixed the gap issue in 2nd onboarding screen ui#3300

Merged
Dhruwang merged 9 commits intoformbricks:mainfrom
abhayofc:fix/3299-fix-ui-on-2nd-onboarding-screen
Oct 8, 2024
Merged

fix: fixed the gap issue in 2nd onboarding screen ui#3300
Dhruwang merged 9 commits intoformbricks:mainfrom
abhayofc:fix/3299-fix-ui-on-2nd-onboarding-screen

Conversation

@abhayofc
Copy link
Contributor

@abhayofc abhayofc commented Oct 5, 2024

What does this PR do?

This PR fixes the UI of the second onboarding page UI while zooming it out. It reduces the gaps between the boxes.

Fixes #3299

Formbricks.-.Google.Chrome.2024-10-06.00-25-20.webm

zoomedout

How should this be tested?

You can test this fix by following these steps:

  1. Click on the bottom left of your product button
  2. Click on add product button
  3. Click on the Formbricks surveys box
  4. Now zoom out of this screen by pressing CTRL and (-)

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues
  • First PR at Formbricks? Please sign the CLA! Without it we wont be able to merge it 🙏

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR

Summary by CodeRabbit

  • New Features

    • Improved layout for onboarding options by transitioning from a grid to a flexbox design, enhancing responsiveness and user experience.
  • Bug Fixes

    • Ensured the loading state of options defaults to false if not specified, improving reliability during loading scenarios.
  • Enhancements

    • Updated type definitions for better type safety in survey validation logic.

@vercel
Copy link

vercel bot commented Oct 5, 2024

@abhayofc is attempting to deploy a commit to the formbricks Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 5, 2024

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes in the pull request focus on the OnboardingOptionsContainer component within the OnboardingOptionsContainer.tsx file. The primary modification involves updating the layout from a grid to a flexbox configuration for better alignment of options. Additionally, the loading prop for the OptionCard component is now set to default to false if not provided. These adjustments aim to enhance the component's layout and loading behavior while keeping the overall structure intact.

Changes

File Path Change Summary
apps/web/app/(app)/(onboarding)/organizations/components/OnboardingOptionsContainer.tsx Changed class names from grid layout to flexbox layout for outer div. Updated loading prop to default to false.
packages/types/surveys/types.ts Added type ZodIssue from zod library. Updated filtering in validateActions function for type safety.

Assessment against linked issues

Objective Addressed Explanation
Fix UI on 2nd Onboarding Step (#3299)
Boxes should sit closer together (#3299)

Suggested labels

good first issue, 🕹️ 50 points

Suggested reviewers

  • jobenjada
  • gupta-piyush19

Poem

In the onboarding space, we make it right,
Flexbox dances, options in sight.
Closer together, they now align,
A loading fix, oh so fine!
Hopping along, we celebrate,
Changes so grand, we elevate! 🐇✨


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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 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.

@github-actions github-actions bot added bug Something isn't working hacktoberfest complete these issues to gather points for Hacktoberfest 🕹️ 150 points 🕹️ oss.gg Community issue via oss.gg labels Oct 5, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2024

Thank you for following the naming conventions for pull request titles! 🙏

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

🧹 Outside diff range and nitpick comments (2)
apps/web/app/(app)/(onboarding)/organizations/components/OnboardingOptionsContainer.tsx (2)

45-47: Approved: Layout change addresses the gap issue effectively.

The transition from a grid to a flexbox layout effectively addresses the PR objective of fixing the gap issue in the 2nd onboarding screen UI. The conditional class application ensures appropriate layout for different numbers of options, and the use of justify-center should help in reducing gaps between boxes when zoomed out.

Consider adding a flex-wrap class to improve responsiveness on smaller screens:

- "flex w-5/6 justify-center gap-8 text-center md:flex-row lg:w-2/3": options.length >= 3,
- "flex justify-center gap-8": options.length < 3,
+ "flex flex-wrap w-5/6 justify-center gap-8 text-center md:flex-row lg:w-2/3": options.length >= 3,
+ "flex flex-wrap justify-center gap-8": options.length < 3,

This change will allow the options to wrap to the next line on smaller screens, preventing horizontal scrolling.


Line range hint 27-27: Approved: Improved prop handling for OptionCard.

The explicit setting of the loading prop to option.isLoading || false is a good practice. It ensures that the loading prop defaults to false if isLoading is not provided, improving the component's robustness.

Consider using TypeScript's non-null assertion operator to make the code more concise while maintaining type safety:

- loading={option.isLoading || false}
+ loading={option.isLoading!}

This change assumes that isLoading is always defined in the option object, which should be enforced in the OnboardingOptionsContainerProps interface.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d8cb1c5 and 5d5d602.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • apps/web/app/(app)/(onboarding)/organizations/components/OnboardingOptionsContainer.tsx (1 hunks)
🔇 Additional comments (1)
apps/web/app/(app)/(onboarding)/organizations/components/OnboardingOptionsContainer.tsx (1)

Line range hint 1-58: Summary: PR successfully addresses the UI layout issue.

Overall, the changes effectively solve the gap issue in the 2nd onboarding screen UI as intended. The transition from a grid to a flexbox layout, along with the use of justify-center, should reduce gaps between boxes when zoomed out. The code maintains good practices and even improves robustness with the explicit handling of the loading prop.

Minor suggestions for improvements have been made, including:

  1. Adding flex-wrap for better responsiveness on smaller screens.
  2. Using TypeScript's non-null assertion operator for more concise prop handling.

These changes successfully meet the PR objectives while maintaining code quality and responsiveness.

@abhayofc
Copy link
Contributor Author

abhayofc commented Oct 5, 2024

I didn't know that the pnpm.lock file will be ignored so I opened another commit for deleting that file, does this affect something?

Copy link
Member

@jobenjada jobenjada left a comment

Choose a reason for hiding this comment

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

love the UI change!

but we need our pnpm lock file 😬

please update your PR to contain only the chance we want

@jobenjada jobenjada marked this pull request as draft October 6, 2024 21:58
@jobenjada
Copy link
Member

im just converting it to draft to keep an overview

@abhayofc abhayofc marked this pull request as ready for review October 7, 2024 09:21
@abhayofc
Copy link
Contributor Author

abhayofc commented Oct 7, 2024

@jobenjada I have added the pnpm-lock file and also fixed #3304

Copy link
Member

@Dhruwang Dhruwang left a comment

Choose a reason for hiding this comment

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

Thanks @abhayofc , for the fix 😊🚀🙌🏻

@Dhruwang Dhruwang enabled auto-merge October 8, 2024 05:08
@Dhruwang Dhruwang requested a review from jobenjada October 8, 2024 05:43
@Dhruwang Dhruwang added this pull request to the merge queue Oct 8, 2024
Merged via the queue into formbricks:main with commit ed7662b Oct 8, 2024
@oss-gg
Copy link

oss-gg bot commented Oct 8, 2024

Awarding abhayofc: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/abhayofc

@abhayofc abhayofc deleted the fix/3299-fix-ui-on-2nd-onboarding-screen branch October 8, 2024 10:51
@coderabbitai coderabbitai bot mentioned this pull request Dec 17, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working hacktoberfest complete these issues to gather points for Hacktoberfest 🕹️ oss.gg Community issue via oss.gg 🕹️ 150 points

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🕹️] Fix UI on 2nd Onboarding Step

3 participants