Skip to content

Conversation

@HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Dec 16, 2025

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

image

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Summary by CodeRabbit

  • Improvements
    • Redesigned the teaser banner layout to be fully responsive, switching from a horizontal structure to a stacked design that adapts to different screen sizes.
    • Enhanced visual presentation with improved typography, responsive spacing, and updated icon sizing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

This change reworks the teaser banner component in a single Svelte file, transitioning from a two-column horizontal layout to a responsive stacked layout. The markup is reorganized into two stacked sections with alternating alignment based on viewport size. New CSS classes are introduced for the banner container with explicit width, height, and responsive padding/margin behavior. The logo styling is refactored from inline styles to a reusable container class. Typography and sizing are updated with responsive rules, while the underlying link behavior and semantic structure remain intact.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify responsive behavior across multiple viewport sizes to ensure the stacked layout displays correctly at different breakpoints
  • Validate that content reorganization maintains proper visual hierarchy and doesn't introduce unintended spacing or alignment issues
  • Review new CSS classes (banner-container, logo-container) for potential side effects or conflicts with existing stylesheets
  • Confirm accessibility features are preserved with the updated DOM structure and class-based styling
  • Check that the updated arrow icon and typography responsive classes scale appropriately across all target viewports

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: add responsiveness to mobile banner for imagine' directly aligns with the main change: converting the teaser banner to a responsive layout for mobile viewports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-mobile-responsiveness-for-imagine-banner-in-website

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 2

🧹 Nitpick comments (3)
src/routes/contact-us/enterprise/+page.svelte (1)

227-227: Consider alignment between placeholder and validation pattern.

The placeholder https://appwrite.io suggests a full URL with protocol is expected, but the validation pattern on line 224 makes the https:// prefix optional. Users might enter "appwrite.io" without the protocol and still pass validation.

Ensure this behavior aligns with backend expectations and data processing requirements.

src/routes/(marketing)/(components)/teaser/teaser-banner.svelte (2)

122-146: Verify the font size dip at small breakpoint is intentional.

The .banner-text-introducing font size decreases from 20px (mobile) to 18px (sm breakpoint), then increases back to 20px (md breakpoint). This creates an unusual "dip" in the middle range:

  • < 640px: 20px
  • 640px–767px: 18px
  • ≥ 768px: 20px

Typically, font sizes either increase or remain constant as viewport width grows. Please verify this progression matches the design specification.


172-195: Consider simplifying logo-container sizing.

Several observations:

  1. Unusual responsive pattern: Like the text, logo dimensions decrease at the sm breakpoint (143px → 120px) then increase again at md (back to 143px), creating a size "dip."

  2. Sub-pixel precision: Values like 143.384px, 35.785px, and 1.348px suggest design tool exports, but browsers round to whole pixels anyway. This precision doesn't affect rendering.

  3. Redundant constraints: Setting explicit width/height on the container while using w-auto h-auto on the <img> (line 77) may be redundant—the image's intrinsic dimensions or a single constraint should suffice.

Consider:

  • Verifying the sm → md size progression matches design intent
  • Rounding dimensions to whole pixels for clarity
  • Letting the image's natural aspect ratio dictate sizing
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24d3950 and 4ec211a.

📒 Files selected for processing (2)
  • src/routes/(marketing)/(components)/teaser/teaser-banner.svelte (4 hunks)
  • src/routes/contact-us/enterprise/+page.svelte (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: assets
  • GitHub Check: tests
🔇 Additional comments (2)
src/routes/(marketing)/(components)/teaser/teaser-banner.svelte (2)

54-54: LGTM: Responsive container classes.

The combination of Tailwind utilities and custom banner-container class provides appropriate responsive behavior with scaling padding and explicit height control at the medium breakpoint.


67-99: LGTM: Well-structured responsive layout.

The refactored layout appropriately stacks content vertically on mobile (flex-col) and switches to horizontal alignment on larger viewports (sm:flex-row). The semantic grouping of "Introducing + Logo" and "Build something real + Arrow" sections provides clear visual hierarchy across breakpoints.

<input
required
pattern="^(https?:\/\/)?[\w\-]+(\.[\w\-]+)+(\/.*)?$"
pattern="^(https:\/\/www\.|https:\/\/)?([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+)[a-zA-Z0-9\-\._~:\/\?#[\]@!\$&'\(\)\*\+,;=.]*$"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, find and examine the actual file
echo "=== Finding the file ==="
find . -name "+page.svelte" -path "*/contact-us/enterprise/*" 2>/dev/null

echo -e "\n=== Reading the file around line 224 ==="
if [ -f "src/routes/contact-us/enterprise/+page.svelte" ]; then
  sed -n '215,235p' "src/routes/contact-us/enterprise/+page.svelte" | cat -n
else
  echo "File not found at expected location"
fi

Repository: appwrite/website

Length of output: 1853


🏁 Script executed:

#!/bin/bash
# Test URL validation regex against common valid and invalid inputs

PATTERN='^(https:\/\/www\.|https:\/\/)?([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+)[a-zA-Z0-9\-\._~:\/\?#[\]@!\$&'"'"'\(\)\*\+,;=.]*$'

# Valid URLs that should match
echo "Testing valid URLs:"
echo "appwrite.io" | grep -P "$PATTERN" && echo "✓ appwrite.io matches" || echo "✗ appwrite.io doesn't match"
echo "https://appwrite.io" | grep -P "$PATTERN" && echo "✓ https://appwrite.io matches" || echo "✗ https://appwrite.io doesn't match"
echo "https://www.appwrite.io" | grep -P "$PATTERN" && echo "✓ https://www.appwrite.io matches" || echo "✗ https://www.appwrite.io doesn't match"
echo "https://appwrite.io/path" | grep -P "$PATTERN" && echo "✓ https://appwrite.io/path matches" || echo "✗ https://appwrite.io/path doesn't match"
echo "https://sub.appwrite.io" | grep -P "$PATTERN" && echo "✓ https://sub.appwrite.io matches" || echo "✗ https://sub.appwrite.io doesn't match"

# Invalid URLs that should NOT match
echo -e "\nTesting invalid URLs:"
echo "not-a-url" | grep -P "$PATTERN" && echo "✗ not-a-url matches (should reject)" || echo "✓ not-a-url rejected"
echo "http://appwrite" | grep -P "$PATTERN" && echo "✗ http://appwrite matches (should reject)" || echo "✓ http://appwrite rejected"
echo "ftp://appwrite.io" | grep -P "$PATTERN" && echo "✗ ftp://appwrite.io matches (should reject)" || echo "✓ ftp://appwrite.io rejected"

# Edge cases
echo -e "\nTesting edge cases:"
echo "https://appwrite.io:8080" | grep -P "$PATTERN" && echo "✓ Port number matches" || echo "✗ Port number doesn't match"
echo "appwrite.io" | grep -P "$PATTERN" && echo "! No protocol matches (is this intended?)" || echo "! No protocol rejected"

Repository: appwrite/website

Length of output: 561


Address optional protocol handling in URL validation regex.

The regex pattern allows URLs without a protocol (e.g., "appwrite.io" matches), which conflicts with your placeholder showing "https://appwrite.io" as the expected format. If only HTTPS URLs are intended, make the protocol required by removing the trailing ?:

pattern="^https:\/\/(www\.)?([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+)..."

The regex correctly handles port numbers, rejects non-HTTPS protocols, and validates domain structure. However, the character class escaping is inconsistent—within [...], most special characters don't require backslashes. Consider simplifying or switching to the browser's native type="url" validation for better maintainability.

🤖 Prompt for AI Agents
In src/routes/contact-us/enterprise/+page.svelte around line 224, the URL
validation regex currently permits URLs without a protocol which conflicts with
the placeholder expecting "https://..."; make the protocol mandatory by changing
the pattern to require the "https://" prefix (remove the optional `?`), adjust
the start of the pattern to ^https:\/\/(www\.)?..., keep validation for domain
and optional port/path but ensure only https is accepted, and while editing
simplify the character-class escaping inside [...] (or switch the input to use
the browser's native type="url" for maintainability).

@HarshMN2345 HarshMN2345 force-pushed the fix-mobile-responsiveness-for-imagine-banner-in-website branch from 4ec211a to ea7dc24 Compare December 16, 2025 17:16
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

♻️ Duplicate comments (2)
src/routes/(marketing)/(components)/teaser/teaser-banner.svelte (2)

87-87: Verify arrow animation direction.

The arrow icon uses group-hover:-translate-x-0.5 which translates the arrow left on hover. For a right-pointing arrow, users typically expect it to move right (positive x direction).

If the intention is to create a "pull" effect, this is acceptable, but please confirm this matches the design intent.

If you want the arrow to move right on hover, apply this diff:

-                    class="h-4 w-4 flex-shrink-0 transition group-hover:-translate-x-0.5 sm:h-5 sm:w-5"
+                    class="h-4 w-4 flex-shrink-0 transition group-hover:translate-x-0.5 sm:h-5 sm:w-5"

</comment_end>


105-115: Fixed width causes overflow on narrow devices (duplicate concern).

As flagged in the previous review, the fixed width: 360px at line 106 will cause horizontal overflow on devices narrower than 360px, such as iPhone SE (320px) and Galaxy Fold (280px closed).

The previous review suggestion to use max-width: 360px with width: 100% remains valid and should be implemented.

Apply this diff as suggested in the previous review:

 .banner-container {
-    width: 360px;
+    width: 100%;
+    max-width: 360px;
     height: 110px;
 }

</comment_end>

🧹 Nitpick comments (2)
src/routes/(marketing)/(components)/teaser/teaser-banner.svelte (2)

67-69: Consider removing redundant gap class.

The sm:gap-4 and md:gap-[1rem] both evaluate to 16px (since gap-4 = 1rem), making the md:gap-[1rem] class redundant.

Apply this diff to simplify:

-            class="relative z-10 mx-auto flex w-full flex-col items-center justify-center gap-1 [max-inline-size:108rem] sm:flex-row sm:items-center sm:justify-between sm:gap-4 md:gap-[1rem]"
+            class="relative z-10 mx-auto flex w-full flex-col items-center justify-center gap-1 [max-inline-size:108rem] sm:flex-row sm:items-center sm:justify-between sm:gap-4"

</comment_end>


172-195: Consider rounding sub-pixel dimensions to whole pixels.

The logo container uses highly precise sub-pixel values (e.g., 143.384px, 35.785px, 1.348px, 0.634px, 10.75px), likely exported from a design tool. Browsers typically round these values during rendering, so the extra precision may not provide visual benefit.

For cleaner, more maintainable code, consider rounding to whole pixels unless the design explicitly requires sub-pixel accuracy.

Example:

 .logo-container {
     display: flex;
-    width: 143.384px;
-    height: 35.785px;
-    padding: 1.348px 0.634px 1.348px 0;
+    width: 143px;
+    height: 36px;
+    padding: 1px 1px 1px 0;
     justify-content: center;
     align-items: flex-end;
-    gap: 10.75px;
+    gap: 11px;
     flex-shrink: 0;
 }

</comment_end>

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ec211a and ea7dc24.

📒 Files selected for processing (1)
  • src/routes/(marketing)/(components)/teaser/teaser-banner.svelte (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: tests
  • GitHub Check: assets
  • GitHub Check: build
🔇 Additional comments (2)
src/routes/(marketing)/(components)/teaser/teaser-banner.svelte (2)

71-79: LGTM!

The top line section structure with introducing text and logo is well-organized and uses appropriate responsive classes.

</comment_end>


122-146: Verify the unusual responsive font sizing pattern.

Both .banner-text-introducing and .banner-text-right use an uncommon responsive pattern where font sizes decrease at the sm breakpoint and then increase again at md:

  • Introducing: 20px (mobile) → 18px (sm) → 20px (md)
  • Right text: 16px (mobile) → 15px (sm) → 16px (md)

Typically, responsive typography scales progressively upward as viewport widens. This down-then-up pattern is unusual. If this matches your design specifications, no action is needed. Otherwise, consider a progressive scale.

</comment_end>

Also applies to: 148-170

@HarshMN2345 HarshMN2345 merged commit 6b47c0e into main Dec 16, 2025
6 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-mobile-responsiveness-for-imagine-banner-in-website branch December 16, 2025 17:47
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.

3 participants