Skip to content

fix: fixed height and width issue#3255

Merged
ogzhanolguncu merged 3 commits intomainfrom
ENG-1794
May 14, 2025
Merged

fix: fixed height and width issue#3255
ogzhanolguncu merged 3 commits intomainfrom
ENG-1794

Conversation

@ogzhanolguncu
Copy link
Contributor

@ogzhanolguncu ogzhanolguncu commented May 13, 2025

What does this PR do?

Fixes #3250

If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Make sure create key dialog submit button is always visible while inner form is scrollable.

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • 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

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary
Screen.Recording.2025-05-13.at.14.25.33.mov

Summary by CodeRabbit

  • Style

    • Improved dialog layout and responsiveness with updated width, height, and overflow styling.
    • Dialog content now adapts better to different screen sizes for a more consistent user experience.
    • Enhanced dialog content transitions with smooth animations and layered content visibility.
    • Updated form input styling for rate limit fields, including responsive width and refined button appearance.
  • New Features

    • Dialog body now supports custom styling through an optional class name property.

@linear
Copy link

linear bot commented May 13, 2025

@changeset-bot
Copy link

changeset-bot bot commented May 13, 2025

⚠️ No Changeset found

Latest commit: d43a539

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented May 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 0:34am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
engineering ⬜️ Ignored (Inspect) Visit Preview May 13, 2025 0:34am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 13, 2025

📝 Walkthrough

"""

Walkthrough

The changes revise dialog component styling in the dashboard application. Dialog containers and content areas now use updated width, height, and flex layout classes to improve layout consistency. The NavigableDialogBody component gains a new className prop for customizable styling, with no changes to functional logic or event handling. Additionally, minor UI adjustments were made to the ratelimit setup inputs and buttons.

Changes

File(s) Change Summary
apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/index.tsx Updated dialog container CSS classes for responsive width and max height; removed fixed min-height on content area.
apps/dashboard/components/dialog-container/navigable-dialog.tsx Added flex layout and max/min height classes to dialog root/content; changed content rendering to use absolute positioning and transitions; NavigableDialogBody accepts optional className prop.
apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/components/ratelimit-setup.tsx Used cn utility for conditional input width classes; updated delete button styling and rendering logic; simplified input wrappers.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DialogContainer
    participant NavigableDialogContent
    participant NavigableDialogBody

    User->>DialogContainer: Open dialog
    DialogContainer->>NavigableDialogContent: Render content with new layout classes and absolute positioning
    NavigableDialogContent->>NavigableDialogBody: Render body with optional className
    NavigableDialogBody-->>NavigableDialogContent: Body displayed with updated styling
    NavigableDialogContent-->>DialogContainer: Content rendered with responsive sizing and animated transitions
    DialogContainer-->>User: Dialog visible with revised layout
Loading

Assessment against linked issues

Objective Addressed Explanation
Make submit button fixed while scrolling the form (#3250) The changes focus on dialog layout and styling; no modification to submit button positioning or scrolling behavior.

Possibly related PRs

Suggested labels

Bug, Improvement

Suggested reviewers

  • perkinsjr
  • mcstepp
  • chronark
    """

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 7351d81 and d43a539.

📒 Files selected for processing (3)
  • apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/components/ratelimit-setup.tsx (4 hunks)
  • apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/index.tsx (1 hunks)
  • apps/dashboard/components/dialog-container/navigable-dialog.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/dashboard/components/dialog-container/navigable-dialog.tsx
  • apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/index.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/components/ratelimit-setup.tsx (2)
apps/dashboard/lib/utils.ts (1)
  • cn (5-7)
internal/ui/src/components/form/form-input.tsx (1)
  • FormInput (18-89)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Test Packages / Test ./packages/nextjs
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: Test Packages / Test ./internal/billing
  • GitHub Check: Test Packages / Test ./packages/api
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./internal/hash
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/components/ratelimit-setup.tsx (5)

4-4: Good addition of the cn utility

Adding the cn utility import enables cleaner, more maintainable conditional class application throughout the component.


92-95: Good responsive design improvement

The conditional styling nicely adapts the input width based on whether there's a single field (full width) or multiple fields (flexible). This creates a better layout when delete buttons are present.


110-110: Button sizing and styling improvement

The explicit size-[34px] and rounded-lg classes provide consistent dimensions and appearance for the delete button, improving the UI consistency.


116-116: Small optimization: null vs empty fragment

Returning null instead of an empty fragment (<></>) is a slight optimization as it avoids creating an unnecessary React fragment when no content is rendered.


140-151: Improved input styling consistency

The refill interval input now has consistent styling with the other inputs, particularly the fixed height and full width. This creates visual alignment with the other form elements and improves the overall appearance.

✨ Finishing Touches
  • 📝 Generate Docstrings

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 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
Copy link
Contributor

github-actions bot commented May 13, 2025

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

@vercel vercel bot temporarily deployed to Preview – dashboard May 13, 2025 11:32 Inactive
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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dc052cf and 7351d81.

📒 Files selected for processing (2)
  • apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/index.tsx (1 hunks)
  • apps/dashboard/components/dialog-container/navigable-dialog.tsx (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/dashboard/components/dialog-container/navigable-dialog.tsx (2)
apps/dashboard/components/dialog-container/dialog-parts.tsx (1)
  • DefaultDialogContentArea (34-43)
apps/dashboard/lib/utils.ts (1)
  • cn (5-7)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./internal/encryption
  • GitHub Check: Test Packages / Test ./internal/billing
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
apps/dashboard/components/dialog-container/navigable-dialog.tsx (3)

65-65: Improved dialog container layout

The addition of flex flex-col max-h-[90vh] classes ensures the dialog content uses a proper flex column layout while setting a reasonable maximum height constraint. This change helps prevent the dialog from overflowing the viewport on smaller screens.


217-217: Enhanced responsive height constraints

Adding responsive minimum height constraints (min-h-[70vh] lg:min-h-[50vh]) is a good approach. This ensures consistent vertical sizing across different viewport sizes - taller on mobile and more compact on larger screens.


229-237: Good enhancement with className customization

Adding the optional className prop to NavigableDialogBody improves component flexibility and reusability. The implementation correctly uses the cn utility to merge custom classes with the default styling.

@vercel vercel bot temporarily deployed to Preview – dashboard May 13, 2025 12:34 Inactive
@mcstepp mcstepp self-assigned this May 13, 2025
Copy link
Collaborator

@mcstepp mcstepp left a comment

Choose a reason for hiding this comment

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

👍

@ogzhanolguncu ogzhanolguncu added this pull request to the merge queue May 14, 2025
Merged via the queue into main with commit 1df84be May 14, 2025
31 checks passed
@ogzhanolguncu ogzhanolguncu deleted the ENG-1794 branch May 14, 2025 16:02
@coderabbitai coderabbitai bot mentioned this pull request May 29, 2025
18 tasks
@coderabbitai coderabbitai bot mentioned this pull request Sep 9, 2025
18 tasks
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.

Make submit button fixed while scrolling the form

2 participants