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

feat(web): add textarea field in property field #1133

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

airslice
Copy link
Contributor

@airslice airslice commented Sep 6, 2024

Overview

It was missing.

What I've done

What I haven't done

How I tested

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • New Features
    • Introduced a multiline input option for the PropertyField component, allowing users to enter longer text entries.
    • Added support for a TextareaField component, enhancing the versatility of text input options.

@github-actions github-actions bot added the web label Sep 6, 2024
Copy link

netlify bot commented Sep 6, 2024

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit 464b588
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/66da878c0afc720008e2d068
😎 Deploy Preview https://deploy-preview-1133--reearth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@airslice airslice changed the title feat(web): add textarea field in property list feat(web): add textarea field in property field Sep 6, 2024
Copy link

coderabbitai bot commented Sep 6, 2024

Walkthrough

The update to the PropertyField component in ProprtyField.tsx introduces support for multiline text input by integrating the TextareaField component. This change allows users to enter longer text when the schema.ui property is set to "multiline." The component's control flow has been modified to accommodate this new input type, enhancing its functionality.

Changes

Files Change Summary
web/src/beta/ui/fields/Properties/ProprtyField.tsx Added support for multiline input by integrating TextareaField when schema.ui is "multiline."

Poem

In a field where properties play,
A rabbit hops and shouts hooray!
With multiline now, we can express,
Our thoughts in a cozy, lengthy mess.
So let the text flow, wide and free,
A joyful change for you and me! 🐇✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 14.47%. Comparing base (bdf32d6) to head (464b588).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
web/src/beta/ui/fields/Properties/ProprtyField.tsx 0.00% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1133      +/-   ##
==========================================
- Coverage   15.18%   14.47%   -0.71%     
==========================================
  Files         642      567      -75     
  Lines       63207    60509    -2698     
  Branches      792      631     -161     
==========================================
- Hits         9600     8761     -839     
+ Misses      53607    51748    -1859     
Flag Coverage Δ
web 14.47% <0.00%> (-0.71%) ⬇️
web-beta 14.47% <0.00%> (-0.71%) ⬇️
web-classic 14.47% <0.00%> (-0.71%) ⬇️
web-utils 14.47% <0.00%> (-0.71%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
web/src/beta/ui/fields/Properties/ProprtyField.tsx 0.00% <0.00%> (ø)

... and 344 files with indirect coverage changes

@airslice airslice merged commit fc813b3 into main Sep 6, 2024
18 checks passed
@airslice airslice deleted the feat/support-multiline-in-property-field branch September 6, 2024 04:43
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: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a8fef02 and 464b588.

Files selected for processing (1)
  • web/src/beta/ui/fields/Properties/ProprtyField.tsx (2 hunks)

Comment on lines +96 to +103
) : schema.ui === "multiline" ? (
<TextareaField
key={schema.id}
commonTitle={schema.name}
value={(value as string) ?? ""}
description={schema.description}
onBlur={handleChange}
/>
Copy link

Choose a reason for hiding this comment

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

Consider using onChange instead of onBlur for the TextareaField.

The TextareaField is correctly integrated to handle multiline inputs. However, using onBlur to handle changes might delay feedback until the user clicks away from the textarea. This could affect user experience, especially in forms where immediate feedback or validation is expected.

Consider changing the event handler to onChange to provide immediate feedback as the user types:

- <TextareaField
-   key={schema.id}
-   commonTitle={schema.name}
-   value={(value as string) ?? ""}
-   description={schema.description}
-   onBlur={handleChange}
- />
+ <TextareaField
+   key={schema.id}
+   commonTitle={schema.name}
+   value={(value as string) ?? ""}
+   description={schema.description}
+   onChange={handleChange}
+ />
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
) : schema.ui === "multiline" ? (
<TextareaField
key={schema.id}
commonTitle={schema.name}
value={(value as string) ?? ""}
description={schema.description}
onBlur={handleChange}
/>
) : schema.ui === "multiline" ? (
<TextareaField
key={schema.id}
commonTitle={schema.name}
value={(value as string) ?? ""}
description={schema.description}
onChange={handleChange}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant