Skip to content

fix: ui of create new survey trigger#3703

Merged
jobenjada merged 4 commits intoformbricks:mainfrom
SharadK10:fix/ui-create-new-survey-trigger
Oct 14, 2024
Merged

fix: ui of create new survey trigger#3703
jobenjada merged 4 commits intoformbricks:mainfrom
SharadK10:fix/ui-create-new-survey-trigger

Conversation

@SharadK10
Copy link
Contributor

@SharadK10 SharadK10 commented Oct 14, 2024

What does this PR do?

Made minor changes in CSS to fix UI of create new survey trigger page. Now the user can conveniently interact with "Create action" and "Cancel" buttons on the bottom of the card without having to adjust the screen size.

Fixes #3577

REC-20241014210620.mp4

Summary by CodeRabbit

  • New Features

    • Enhanced error handling in the Create New Action tab for better clarity on existing actions.
    • Added a conditional backdrop blur effect to the Modal component.
  • Bug Fixes

    • Adjusted the maximum height of a specific div in the Create New Action tab for improved layout.
    • Modified vertical spacing in the Modal component for a better user experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

Walkthrough

The pull request introduces modifications to the CreateNewActionTab component by adjusting the maximum height of a specific div from 500px to 400px, improving the visual layout. Additionally, the submitHandler function has been enhanced with better error handling for duplicate action names or keys. In the Modal component, the margin class for the DialogContent has been reduced, and a new blur prop has been added to the DialogOverlay for optional backdrop effects. The overall functionality remains unchanged.

Changes

File Path Change Summary
apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CreateNewActionTab.tsx Adjusted maximum height of a div from 500px to 400px. Enhanced submitHandler for better error handling.
packages/ui/components/Modal/index.tsx Modified DialogContent margin from sm:my-8 to sm:my-2. Added blur prop to DialogOverlay.

Assessment against linked issues

Objective Addressed Explanation
UI should not overflow and buttons must be accessible (#[3577])

Possibly related PRs

Suggested labels

enhancement, 🕹️ oss.gg, 🕹️ 150 points

Suggested reviewers

  • jobenjada
  • pandeymangg

Poem

In the garden of code, where rabbits do play,
We've tidied the tabs, made the margins less gray.
With errors now caught, and buttons in sight,
Our surveys will flourish, all day and all night! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b40ed54 and f2682de.

📒 Files selected for processing (2)
  • apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CreateNewActionTab.tsx (1 hunks)
  • packages/ui/components/Modal/index.tsx (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/ui/components/Modal/index.tsx (1)

61-61: Approved: Margin adjustment addresses UI accessibility issue.

The change from sm:my-8 to sm:my-2 reduces the vertical margin of the modal content, which aligns well with the PR objectives. This adjustment should help resolve the UI glitch reported in issue #3577 by providing more space for content and improving access to buttons at the bottom of the card.

To ensure this change doesn't negatively impact other uses of the Modal component, let's verify its usage across the codebase:

✅ Verification successful

Verified: Margin adjustment does not impact other Modal usages.

The search for custom margin classes applied to Modal components returned no additional instances. Therefore, the adjustment from sm:my-8 to sm:my-2 in packages/ui/components/Modal/index.tsx is isolated and does not affect other parts of the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check usage of Modal component and any custom margin classes applied to it.

# Test: Search for Modal component usage
echo "Searching for Modal component usage:"
rg --type typescript --type typescriptreact 'import.*Modal.*from.*components/Modal' -A 5

# Test: Search for custom margin classes applied to Modal
echo "\nSearching for custom margin classes applied to Modal:"
rg --type typescript --type typescriptreact '<Modal.*className=".*m[tbrly]-' -A 5

Length of output: 448


Script:

#!/bin/bash
# Description: Check usage of Modal component and any custom margin classes applied to it.

# Test: Search for Modal component usage in .ts and .tsx files
echo "Searching for Modal component usage:"
rg 'import.*Modal.*from.*components/Modal' --glob '*.ts*' -A 5

# Test: Search for custom margin classes applied to Modal in .ts and .tsx files
echo "\nSearching for custom margin classes applied to Modal:"
rg '<Modal.*className=".*m[tbrly]-' --glob '*.ts*' -A 5

Length of output: 20458

apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/CreateNewActionTab.tsx (1)

174-174: LGTM: Height adjustment improves button accessibility

The reduction of the maximum height from 500px to 400px aligns well with the PR objectives. This change should improve the accessibility of the "Create action" and "Cancel" buttons at the bottom of the card, addressing the UI issue reported in #3577. The modification is simple yet effective, enhancing usability without affecting the component's functionality.


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.

@vercel
Copy link

vercel bot commented Oct 14, 2024

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

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the bug Something isn't working label Oct 14, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2024

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

@jobenjada jobenjada added 🕹️ oss.gg Community issue via oss.gg 🕹️ 50 points labels Oct 14, 2024
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.

makes sense, thanks :)

@jobenjada jobenjada added this pull request to the merge queue Oct 14, 2024
Merged via the queue into formbricks:main with commit e5f17af Oct 14, 2024
@oss-gg
Copy link

oss-gg bot commented Oct 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 🕹️ oss.gg Community issue via oss.gg 🕹️ 50 points

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] UI Glitch in the Create new Survey Trigger

3 participants