-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: Scrolling issues on deployment page #254
Conversation
WalkthroughThe pull request introduces modifications to three components related to deployment management in a web service application. The Changes
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/TableDeployments.tsx
(1 hunks)apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/[deploymentSlug]/releases/DeploymentPageContent.tsx
(3 hunks)apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/page.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/TableDeployments.tsx
🔇 Additional comments (3)
apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/[deploymentSlug]/releases/DeploymentPageContent.tsx (3)
66-67
: LGTM: Environment blocks limit improves layout stability
The introduction of numEnvironmentBlocks
with a maximum of 3 helps prevent layout issues with many environments.
141-142
:
Consider accessibility implications of hidden scrollbars
The scrollbar-none
class hides scrollbars which might affect accessibility. Users who rely on visible scrollbars for navigation might have difficulty understanding that the content is scrollable.
Consider using scrollbar-thin
instead of scrollbar-none
to maintain visual feedback while keeping the design clean:
- <div className="scrollbar-none flex w-[calc(100vw-267px)] flex-col">
- <Table className="scrollbar-none">
+ <div className="scrollbar-thin scrollbar-thumb-neutral-700 scrollbar-track-neutral-800 flex w-[calc(100vw-267px)] flex-col">
+ <Table className="scrollbar-thin scrollbar-thumb-neutral-700 scrollbar-track-neutral-800">
Line range hint 141-192
: Verify responsive behavior across different screen sizes
The component uses complex viewport-based calculations and conditional rendering. Please ensure to test the following scenarios:
- Different screen sizes (especially mobile viewports)
- Different numbers of environment blocks
- Long release names that might cause overflow
- Browser zoom levels
@@ -28,7 +28,7 @@ export default async function SystemDeploymentsPage({ | |||
{deployments.length === 0 ? ( | |||
<DeploymentGettingStarted systemId={system.id} /> | |||
) : ( | |||
<div className="scrollbar-thin scrollbar-thumb-neutral-800 scrollbar-track-neutral-900 container mx-auto h-[calc(100vh-40px)] overflow-auto p-8"> | |||
<div className="scrollbar-thin scrollbar-thumb-neutral-800 scrollbar-track-neutral-900 container mx-auto h-[calc(100%-49px)] overflow-auto p-8"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Height calculation change needs to be consistent across similar components
The codebase shows inconsistent usage of height calculations, with most components using viewport-based (100vh
) calculations while only a few use percentage-based (100%
). This change in the deployments page appears to be part of a gradual transition, but similar components still use viewport-based heights:
apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/environments/page.tsx
usesh-[calc(100vh-53px)]
apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/deployments/[deploymentSlug]/layout.tsx
usesh-[calc(100vh-53px-49px)]
apps/webservice/src/app/[workspaceSlug]/(app)/systems/[systemSlug]/runbooks/[runbookId]/layout.tsx
usesh-[calc(100vh-53px-49px)]
For consistent behavior across the application, similar components should follow the same height calculation approach. Consider updating related system components to use percentage-based calculations if this new approach proves more reliable.
🔗 Analysis chain
Verify scrollbar behavior across different viewport sizes
The change from viewport-based (100vh
) to percentage-based (100%
) height calculation could affect the scrolling behavior differently on various screen sizes. While this change likely fixes the immediate scrolling issues, we should ensure it works well across different viewport sizes and zoom levels.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for other viewport-dependent height calculations that might need similar updates
rg "h-\[calc\(100vh" --type tsx
Length of output: 61
Script:
#!/bin/bash
# Check for other viewport-dependent height calculations that might need similar updates
# Using ripgrep without file type restriction since tsx extension might not be recognized
rg "h-\[calc\(100vh"
# Also check for percentage-based height calculations for comparison
rg "h-\[calc\(100%"
Length of output: 4697
<div | ||
className={cn( | ||
"flex h-[60px] items-center gap-2 overflow-auto px-4 backdrop-blur-sm", | ||
numEnvironmentBlocks === 3 && | ||
"max-w-[calc(100vw-256px-737px)]", | ||
numEnvironmentBlocks === 2 && | ||
"max-w-[calc(100vw-256px-491px)]", | ||
numEnvironmentBlocks === 1 && | ||
"max-w-[calc(100vw-256px-246px)]", | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider extracting width calculations into constants
The max-width calculations use magic numbers that make maintenance difficult. Consider extracting these values into named constants for better maintainability:
+ const SIDEBAR_WIDTH = 256;
+ const ENVIRONMENT_BLOCK_WIDTH = 246;
+
<div
className={cn(
"flex h-[60px] items-center gap-2 overflow-auto px-4 backdrop-blur-sm",
- numEnvironmentBlocks === 3 && "max-w-[calc(100vw-256px-737px)]",
- numEnvironmentBlocks === 2 && "max-w-[calc(100vw-256px-491px)]",
- numEnvironmentBlocks === 1 && "max-w-[calc(100vw-256px-246px)]",
+ numEnvironmentBlocks === 3 && `max-w-[calc(100vw-${SIDEBAR_WIDTH}px-${ENVIRONMENT_BLOCK_WIDTH * 3}px)]`,
+ numEnvironmentBlocks === 2 && `max-w-[calc(100vw-${SIDEBAR_WIDTH}px-${ENVIRONMENT_BLOCK_WIDTH * 2}px)]`,
+ numEnvironmentBlocks === 1 && `max-w-[calc(100vw-${SIDEBAR_WIDTH}px-${ENVIRONMENT_BLOCK_WIDTH}px)]`,
)}
>
Also, consider adding a comment explaining how these width calculations were derived.
📝 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.
<div | |
className={cn( | |
"flex h-[60px] items-center gap-2 overflow-auto px-4 backdrop-blur-sm", | |
numEnvironmentBlocks === 3 && | |
"max-w-[calc(100vw-256px-737px)]", | |
numEnvironmentBlocks === 2 && | |
"max-w-[calc(100vw-256px-491px)]", | |
numEnvironmentBlocks === 1 && | |
"max-w-[calc(100vw-256px-246px)]", | |
)} | |
const SIDEBAR_WIDTH = 256; | |
const ENVIRONMENT_BLOCK_WIDTH = 246; | |
<div | |
className={cn( | |
"flex h-[60px] items-center gap-2 overflow-auto px-4 backdrop-blur-sm", | |
numEnvironmentBlocks === 3 && | |
`max-w-[calc(100vw-${SIDEBAR_WIDTH}px-${ENVIRONMENT_BLOCK_WIDTH * 3}px)]`, | |
numEnvironmentBlocks === 2 && | |
`max-w-[calc(100vw-${SIDEBAR_WIDTH}px-${ENVIRONMENT_BLOCK_WIDTH * 2}px)]`, | |
numEnvironmentBlocks === 1 && | |
`max-w-[calc(100vw-${SIDEBAR_WIDTH}px-${ENVIRONMENT_BLOCK_WIDTH}px)]`, | |
)} |
Summary by CodeRabbit
New Features
Bug Fixes
Chores