abby icon indicating copy to clipboard operation
abby copied to clipboard

style: improve remote confix ux

Open edriste opened this issue 6 months ago โ€ข 2 comments

This PR addresses issue #174. I changed the input for strings to textareas and made modals scrollable.

Before:

image

After:

image

Also made sure that there is no overflow on the previews anymore.

Before:

image

After:

image

Summary by CodeRabbit

  • New Features

    • Updated the flag value input for string types to a multi-line, auto-resizing textarea for improved usability.
  • Style

    • Enhanced the display of feature flag values with better width constraints and text truncation for a cleaner layout.
    • Improved modal content handling by adding a maximum height and scrollability for lengthy content.
  • Chores

    • Added "react-textarea-autosize" as a new dependency.

edriste avatar Jul 24 '25 12:07 edriste

The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

Name Status Preview Comments Updated (UTC)
abby-docs โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Jul 24, 2025 0:59am

vercel[bot] avatar Jul 24 '25 12:07 vercel[bot]

Walkthrough

A new dependency, "react-textarea-autosize", was added. The AddFeatureFlagModal now uses an auto-resizing textarea for string flag values. Dropdown.tsx updates a type alias to align with a different Radix UI type. FeatureFlag.tsx and Modal.tsx receive minor UI and layout adjustments for improved display and scrolling.

Changes

File(s) Change Summary
apps/web/package.json Added "react-textarea-autosize" v^8.5.9 to dependencies.
apps/web/src/components/AddFeatureFlagModal.tsx Replaced single-line input for "STRING" flag with multi-line auto-resizing textarea using TextareaAutosize.
apps/web/src/components/Dropdown.tsx Updated ItemProps type alias to extend DropdownMenu.DropdownMenuItemProps instead of DropdownMenu.MenuItemProps.
apps/web/src/components/FeatureFlag.tsx Added overflow and truncation classes to value display; reformatted a template literal for readability.
apps/web/src/components/Modal.tsx Limited modal content height to 60vh and enabled vertical scrolling for overflow.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AddFeatureFlagModal
  participant TextareaAutosize

  User->>AddFeatureFlagModal: Open modal to add/edit flag
  AddFeatureFlagModal->>TextareaAutosize: Render textarea for STRING flag value
  User->>TextareaAutosize: Enter multi-line text
  TextareaAutosize->>AddFeatureFlagModal: Auto-resize textarea as user types
  AddFeatureFlagModal->>User: Display updated flag value

Estimated code review effort

๐ŸŽฏ 2 (Simple) | โฑ๏ธ ~7 minutes

[!NOTE]

โšก๏ธ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


๐Ÿ“œ Recent review details

Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between e763d1a9a46f8b3183e983ee1c826e7c5f80c8f2 and b1b5d1751b6e4e04ba759d33020d296a8e5d81d9.

โ›” Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
๐Ÿ“’ Files selected for processing (5)
  • apps/web/package.json (1 hunks)
  • apps/web/src/components/AddFeatureFlagModal.tsx (2 hunks)
  • apps/web/src/components/Dropdown.tsx (1 hunks)
  • apps/web/src/components/FeatureFlag.tsx (4 hunks)
  • apps/web/src/components/Modal.tsx (1 hunks)
๐Ÿ”‡ Additional comments (7)
apps/web/package.json (1)

118-118: LGTM! Dependency addition supports the UX improvements.

The react-textarea-autosize package addition is appropriate for implementing auto-resizing textareas in place of single-line inputs, which aligns with the PR's objective to improve remote config UX.

apps/web/src/components/Modal.tsx (1)

53-55: Well-implemented scrollable modal solution.

The addition of max-h-[60vh] overflow-y-auto effectively constrains modal height while enabling scrolling when content exceeds the viewport. The 60vh limit provides good balance between content visibility and preventing oversized modals.

apps/web/src/components/Dropdown.tsx (1)

44-44: Good type system refinement.

Updating the type alias to use DropdownMenuItemProps instead of MenuItemProps improves type precision and aligns with the current Radix UI type definitions.

apps/web/src/components/FeatureFlag.tsx (2)

194-196: Good formatting improvement for readability.

The multi-line template literal formatting improves code readability without changing the functionality of the JSON preview generation.


262-275: Excellent overflow prevention implementation.

The addition of overflow-hidden to container divs and max-w-[150px] truncate to code elements effectively prevents layout breaking while maintaining content visibility. This directly addresses the PR objective of ensuring no overflow in preview sections.

Also applies to: 287-300, 312-325

apps/web/src/components/AddFeatureFlagModal.tsx (2)

17-17: Appropriate import for textarea functionality.

The import of TextareaAutosize supports the replacement of single-line inputs with auto-resizing textareas, which directly implements the PR's UX improvement objectives.


128-135: Excellent textarea implementation for improved UX.

The replacement of the Input component with TextareaAutosize perfectly addresses the PR objective of accommodating longer text entries. The styling is comprehensive and consistent, including:

  • Auto-resizing behavior with resize-none to prevent manual resize conflicts
  • Proper focus states and accessibility
  • Overflow handling to prevent layout issues
  • Consistent design system integration
โœจ Finishing Touches
  • [ ] ๐Ÿ“ Generate Docstrings
๐Ÿงช Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch improve-remote-config-ux

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
๐Ÿชง 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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.

coderabbitai[bot] avatar Jul 24 '25 12:07 coderabbitai[bot]