Skip to content

feat: redesign homepage with new hero, themes bento grid, and features section#205

Merged
afonsojramos merged 5 commits intomainfrom
feat/homepage-redesign
Mar 6, 2026
Merged

feat: redesign homepage with new hero, themes bento grid, and features section#205
afonsojramos merged 5 commits intomainfrom
feat/homepage-redesign

Conversation

@afonsojramos
Copy link
Member

@afonsojramos afonsojramos commented Mar 5, 2026

Summary

  • Redesign homepage hero section with animated gradient orbs, noise texture, and grid background
  • Add 3-card hero showcase (Marketplace, Custom Apps, Extensions) with perspective transform and frosted glass labels
  • Replace theme gallery with a bento grid layout (6 themes with varied card sizes)
  • Add features section with 4 interactive cards (Themes, Extensions, Custom Apps, CLI)
  • Restyle install section with tabbed terminal block, OS auto-detection, and copy button
  • Update community stats (22k+ stars, 18M+ downloads, 20k+ Discord, 200+ marketplace items)
  • Fix SEO component to gracefully handle missing Astro.site config

Test plan

  • Verify homepage renders correctly in both light and dark themes
  • Check hero showcase labels are visible and centered at the top of each card
  • Test install tab switching and OS auto-detection
  • Test copy-to-clipboard functionality
  • Verify responsive layout on mobile (480px, 768px) and desktop
  • Confirm bento grid themes display correctly at all breakpoints
  • Check all links navigate to correct destinations
  • Verify reduced-motion preferences are respected

Summary by CodeRabbit

  • New Features

    • Redesigned hero with animated gradients, dynamic stats, and image showcase
    • Modular homepage sections: Features showcase, Themes bento, and Install quick-start tabs
    • Responsive features grid and theme gallery with improved accessibility, keyboard navigation, and copy-to-clipboard for install commands
    • Font loading optimized for faster rendering
  • Bug Fixes

    • SEO metadata now falls back to origin URL when base site info is unavailable

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 5, 2026

Deploying spicetify-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 73864ae
Status: ✅  Deploy successful!
Preview URL: https://033c3c1d.spicetify-docs.pages.dev
Branch Preview URL: https://feat-homepage-redesign.spicetify-docs.pages.dev

View logs

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Walkthrough

Use Astro.url.origin as a fallback for site base in SEO and replace the monolithic homepage with modular components: HeroSection, ThemesBento, FeaturesGrid, InstallSection; add ArrowIcon and font preconnect/fonts link.

Changes

Cohort / File(s) Summary
SEO
src/components/SEO.astro
Use siteBase = Astro.site ?? Astro.url.origin when building canonicalURL and ogImage (fallback to origin if Astro.site undefined).
Homepage entry
src/pages/index.astro
Replace large inline homepage markup with a single home wrapper that imports/renders new components and supplies a features array; removed in-page scripts/styles in favor of components.
Homepage components
src/components/homepage/HeroSection.astro, src/components/homepage/ThemesBento.astro, src/components/homepage/FeaturesGrid.astro, src/components/homepage/InstallSection.astro
Add new self-contained components (hero, themes bento, features grid, install quick-start). Each includes scoped markup, styles, and component-scoped interactivity (tabs, copy, showcase, responsive layouts).
Icons
src/components/icons/ArrowIcon.astro
Add reusable ArrowIcon SVG component with configurable size and strokeWidth props.
Layout / fonts
src/layouts/BaseLayout.astro
Add font preconnect links and Google Fonts stylesheet for Syne (font loading optimizations).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through code with nimble paws,
New sections stacked without a pause,
Arrows, bento, tabs that click,
Fonts tuned soft and visuals slick,
Hop on, dear devs — the homepage thaws.

🚥 Pre-merge checks | ✅ 3
✅ 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 accurately summarizes the main changes: redesigning the homepage with a new hero section, themes bento grid, and features section, matching the substantial refactoring evident in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/homepage-redesign

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

@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

🧹 Nitpick comments (3)
src/pages/index.astro (3)

1220-1229: Empty media query block can be removed.

This @media (prefers-reduced-motion: no-preference) block contains only a comment and no actual CSS rules. Since the animations are already defined inline on the elements themselves, this block serves no purpose and adds noise.

🧹 Proposed removal
-  `@media` (prefers-reduced-motion: no-preference) {
-    .hero-badge,
-    .hero h1,
-    .hero-subtitle,
-    .hero-actions,
-    .hero-stats,
-    .hero-showcase {
-      /* Animations defined inline above via animation property */
-    }
-  }
-
   `@media` (prefers-reduced-motion: reduce) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/index.astro` around lines 1220 - 1229, Remove the no-op media query
block `@media (prefers-reduced-motion: no-preference)` that only contains a
comment and no CSS rules; locate the block that lists selectors .hero-badge,
.hero h1, .hero-subtitle, .hero-actions, .hero-stats, .hero-showcase and delete
the entire media query wrapper so the stylesheet no longer contains an empty
rule set (animations are already applied inline on the elements).

377-383: Clipboard fallback provides no user feedback.

When navigator.clipboard.writeText() fails, the fallback selects the text but doesn't notify the user to press Ctrl+C/Cmd+C. Users may not realize they need to complete the copy manually.

This is a minor edge case since the Clipboard API has broad support. If you want to improve it:

💡 Optional: Add visual feedback for fallback
       }).catch(function () {
         var range = document.createRange();
         range.selectNodeContents(code);
         var sel = window.getSelection();
         sel.removeAllRanges();
         sel.addRange(range);
+        // Optionally show a tooltip or update button text
+        btn.setAttribute('title', 'Press Ctrl+C to copy');
       });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/index.astro` around lines 377 - 383, The fallback catch block for
navigator.clipboard.writeText() currently only selects the code
(range.selectNodeContents(code); sel.removeAllRanges(); sel.addRange(range);)
but gives no user feedback; update the catch handler to show a transient,
accessible instruction (e.g., a small tooltip/snackbar or alert) telling the
user to press "Ctrl+C" or "⌘+C" to complete the copy, and dismiss it after a
short timeout or when focus changes; ensure the UI element is ARIA-friendly and
is created/removed in the same catch block so users trying the fallback receive
clear guidance.

410-410: Consider moving font import to document head for better performance.

Using @import in CSS for external fonts can block rendering. Moving the font to the document <head> with preconnect allows parallel loading:

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&display=swap" rel="stylesheet">

This is a minor optimization — the current approach works fine with display=swap.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/index.astro` at line 410, The CSS `@import` line "@import
url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&display=swap');"
should be removed from the stylesheet and instead added to the document head:
add preconnect links for "https://fonts.googleapis.com" and
"https://fonts.gstatic.com" (with crossorigin) and include the Google Fonts
stylesheet link for family=Syne with display=swap; update the Astro page
template that renders the head (the file containing the `@import` in
src/pages/index.astro) to emit these <link rel="preconnect"> and <link href=...
rel="stylesheet"> entries so the font loads in parallel and the original `@import`
line is deleted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/pages/index.astro`:
- Around line 387-405: The setupScrollReveal function is dead because no
elements use the 'reveal-on-scroll' class; either remove the unused function and
its invocation (remove setupScrollReveal() and the function definition) or add
the 'reveal-on-scroll' class to the elements you want animated; locate the
setupScrollReveal function and the call to setupScrollReveal() in the file and
apply one of these two fixes (delete both the function and the
setupScrollReveal() invocation if you don't need scroll reveals, or ensure
target elements include class="reveal-on-scroll" so observer.observe(...) sees
nodes).

---

Nitpick comments:
In `@src/pages/index.astro`:
- Around line 1220-1229: Remove the no-op media query block `@media
(prefers-reduced-motion: no-preference)` that only contains a comment and no CSS
rules; locate the block that lists selectors .hero-badge, .hero h1,
.hero-subtitle, .hero-actions, .hero-stats, .hero-showcase and delete the entire
media query wrapper so the stylesheet no longer contains an empty rule set
(animations are already applied inline on the elements).
- Around line 377-383: The fallback catch block for
navigator.clipboard.writeText() currently only selects the code
(range.selectNodeContents(code); sel.removeAllRanges(); sel.addRange(range);)
but gives no user feedback; update the catch handler to show a transient,
accessible instruction (e.g., a small tooltip/snackbar or alert) telling the
user to press "Ctrl+C" or "⌘+C" to complete the copy, and dismiss it after a
short timeout or when focus changes; ensure the UI element is ARIA-friendly and
is created/removed in the same catch block so users trying the fallback receive
clear guidance.
- Line 410: The CSS `@import` line "@import
url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&display=swap');"
should be removed from the stylesheet and instead added to the document head:
add preconnect links for "https://fonts.googleapis.com" and
"https://fonts.gstatic.com" (with crossorigin) and include the Google Fonts
stylesheet link for family=Syne with display=swap; update the Astro page
template that renders the head (the file containing the `@import` in
src/pages/index.astro) to emit these <link rel="preconnect"> and <link href=...
rel="stylesheet"> entries so the font loads in parallel and the original `@import`
line is deleted.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c9649860-8e47-4680-8f5f-a20f34013907

📥 Commits

Reviewing files that changed from the base of the PR and between 2e415ab and 341895e.

📒 Files selected for processing (2)
  • src/components/SEO.astro
  • src/pages/index.astro

…ixes

- Extract HeroSection, ThemesBento, FeaturesGrid, InstallSection components
- Remove ~88 lines of dead CSS (.hero-stats) and dead JS (setupScrollReveal)
- Remove empty prefers-reduced-motion: no-preference block
- Remove redundant bento-2 through bento-6 grid declarations
- Add keyboard navigation (Arrow/Home/End) to install tabs
- Lazy-load 2nd and 3rd hero showcase images
- Replace transition: all with specific properties on .btn and .feature-card
- Alias --accent to var(--color-primary) for single source of truth
- Tokenize hardcoded rgba accent colors into CSS variables
- Deduplicate noise texture into --noise-bg CSS variable
- Add light-mode overrides for hero orbs, showcase cards, install block
- Expand prefers-reduced-motion to cover hover transitions
- Remove backdrop-filter from labels (solid bg sufficient)
- Add aria-labelledby to all section elements
- Add clipboard fallback feedback in catch handler
- Use ArrowIcon component instead of inline SVG duplicates
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.

🧹 Nitpick comments (4)
src/components/homepage/InstallSection.astro (2)

4-4: Remove unused empty Props type.

The empty Props = {} type serves no purpose and can be removed for cleaner code.

♻️ Proposed fix
 ---
 import DiscordIcon from '../icons/DiscordIcon.astro';
-
-type Props = {};
 ---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/homepage/InstallSection.astro` at line 4, The file defines an
unused empty type alias "Props = {}" in InstallSection.astro; remove that
declaration and any references to "Props" if present so the component no longer
includes an unnecessary empty type, keeping the component signature/exports
clean and type-free where not needed.

153-161: Clipboard fallback could provide clearer feedback.

The fallback updates the title attribute, but users may not notice this. Consider briefly changing the button's visual state or adding a small visible tooltip to indicate the fallback action.

♻️ Enhanced fallback with visual feedback
         }).catch(function () {
           // Fallback: select text so user can manually copy
           var range = document.createRange();
           range.selectNodeContents(code);
           var sel = window.getSelection();
           sel.removeAllRanges();
           sel.addRange(range);
           btn.setAttribute('title', 'Text selected — press Ctrl+C to copy');
+          btn.style.outline = '2px solid var(--accent)';
+          setTimeout(function () {
+            btn.style.outline = '';
+          }, 2000);
         });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/homepage/InstallSection.astro` around lines 153 - 161, The
clipboard fallback catch block currently only sets btn.setAttribute('title',
...) which is easy to miss; update the catch handler (the anonymous function in
the Promise.catch where variables range, code, sel, btn are used) to provide
visible feedback: change the button's visible label or add a temporary CSS class
(e.g., "copied-fallback") to btn, optionally show a small inline tooltip element
near the button, and then revert the label/class/tooltip after a short timeout
(e.g., 2s); ensure you still select the code text
(range.selectNodeContents(code)) and that the timeout cleanup removes the
temporary class/tooltip and restores the original title/text.
src/components/homepage/FeaturesGrid.astro (1)

27-49: Consider adding a fallback for unrecognized icon values.

The conditional icon rendering silently shows nothing if an icon name doesn't match. While the current data uses valid names, a typo could cause a missing icon without any warning.

♻️ Add a default/fallback icon
             {feature.icon === 'terminal' && (
               <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
                 <polyline points="4 17 10 11 4 5" /><line x1="12" y1="19" x2="20" y2="19" />
               </svg>
             )}
+            {!['palette', 'puzzle', 'grid', 'terminal'].includes(feature.icon) && (
+              <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
+                <circle cx="12" cy="12" r="10" />
+              </svg>
+            )}
           </div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/homepage/FeaturesGrid.astro` around lines 27 - 49, The
feature-icon block in FeaturesGrid.astro currently renders nothing when
feature.icon doesn't match 'palette'|'puzzle'|'grid'|'terminal'; add a fallback
so typos or unknown values show a default SVG (or an explicit placeholder)
instead of blank output. Modify the JSX/templating around the {feature.icon ===
...} checks to include an else-case (e.g., feature.icon unmatched) that renders
a generic icon SVG inside the same div.feature-icon and/or logs a warning (using
console.warn) referencing feature.icon so you can spot bad data; ensure the
fallback uses the same sizing/stroke attributes so layout stays consistent.
src/components/icons/ArrowIcon.astro (1)

10-10: Add aria-hidden="true" to decorative icon.

This icon is used alongside text labels (e.g., "Get Started", "Browse all themes"), so it's decorative and should be hidden from screen readers to avoid redundant announcements.

♻️ Proposed fix
-<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width={strokeWidth}><line x1="5" y1="12" x2="19" y2="12" /><polyline points="12 5 19 12 12 19" /></svg>
+<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width={strokeWidth} aria-hidden="true"><line x1="5" y1="12" x2="19" y2="12" /><polyline points="12 5 19 12 12 19" /></svg>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/icons/ArrowIcon.astro` at line 10, The SVG in the
ArrowIcon.astro is purely decorative and should be hidden from screen readers;
update the <svg> element in ArrowIcon.astro (the ArrowIcon component) to include
aria-hidden="true" so assistive tech ignores it, keeping existing props like
size and strokeWidth intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/homepage/FeaturesGrid.astro`:
- Around line 27-49: The feature-icon block in FeaturesGrid.astro currently
renders nothing when feature.icon doesn't match
'palette'|'puzzle'|'grid'|'terminal'; add a fallback so typos or unknown values
show a default SVG (or an explicit placeholder) instead of blank output. Modify
the JSX/templating around the {feature.icon === ...} checks to include an
else-case (e.g., feature.icon unmatched) that renders a generic icon SVG inside
the same div.feature-icon and/or logs a warning (using console.warn) referencing
feature.icon so you can spot bad data; ensure the fallback uses the same
sizing/stroke attributes so layout stays consistent.

In `@src/components/homepage/InstallSection.astro`:
- Line 4: The file defines an unused empty type alias "Props = {}" in
InstallSection.astro; remove that declaration and any references to "Props" if
present so the component no longer includes an unnecessary empty type, keeping
the component signature/exports clean and type-free where not needed.
- Around line 153-161: The clipboard fallback catch block currently only sets
btn.setAttribute('title', ...) which is easy to miss; update the catch handler
(the anonymous function in the Promise.catch where variables range, code, sel,
btn are used) to provide visible feedback: change the button's visible label or
add a temporary CSS class (e.g., "copied-fallback") to btn, optionally show a
small inline tooltip element near the button, and then revert the
label/class/tooltip after a short timeout (e.g., 2s); ensure you still select
the code text (range.selectNodeContents(code)) and that the timeout cleanup
removes the temporary class/tooltip and restores the original title/text.

In `@src/components/icons/ArrowIcon.astro`:
- Line 10: The SVG in the ArrowIcon.astro is purely decorative and should be
hidden from screen readers; update the <svg> element in ArrowIcon.astro (the
ArrowIcon component) to include aria-hidden="true" so assistive tech ignores it,
keeping existing props like size and strokeWidth intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 08b64acf-33a0-41ae-9388-4a0f19162d16

📥 Commits

Reviewing files that changed from the base of the PR and between 341895e and 20eb275.

📒 Files selected for processing (7)
  • src/components/homepage/FeaturesGrid.astro
  • src/components/homepage/HeroSection.astro
  • src/components/homepage/InstallSection.astro
  • src/components/homepage/ThemesBento.astro
  • src/components/icons/ArrowIcon.astro
  • src/layouts/BaseLayout.astro
  • src/pages/index.astro

@afonsojramos afonsojramos force-pushed the feat/homepage-redesign branch from 7782b49 to 73864ae Compare March 6, 2026 10:52
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

🧹 Nitpick comments (1)
src/components/homepage/InstallSection.astro (1)

4-4: Unused Props type definition.

The Props type is defined but never used in the component. Consider removing it or using it with Astro.props if props are planned for the future.

♻️ Proposed fix
 ---
 import DiscordIcon from '../icons/DiscordIcon.astro';
-
-type Props = {};
 ---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/homepage/InstallSection.astro` at line 4, The file defines an
unused type alias "Props" in the InstallSection.astro component; remove the
unused "Props" declaration or consume it via Astro.props if you intend to accept
props. Locate the "Props" type in InstallSection.astro and either delete the
line "type Props = {}" or update the component to use the type with Astro.props
(e.g., annotate the props object with Props) so the type is actually referenced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/homepage/InstallSection.astro`:
- Around line 146-161: The clipboard call in InstallSection.astro should be
guarded because navigator.clipboard may be undefined in non-secure contexts;
before calling navigator.clipboard.writeText(...) check that window.navigator &&
navigator.clipboard && typeof navigator.clipboard.writeText === 'function', and
if not available immediately run the existing fallback flow that selects the
code (using code, range, sel) and updates the UI (btn title, iconCopy/iconCheck
toggles) so no exception is thrown; keep the success path unchanged when
clipboard is present.

---

Nitpick comments:
In `@src/components/homepage/InstallSection.astro`:
- Line 4: The file defines an unused type alias "Props" in the
InstallSection.astro component; remove the unused "Props" declaration or consume
it via Astro.props if you intend to accept props. Locate the "Props" type in
InstallSection.astro and either delete the line "type Props = {}" or update the
component to use the type with Astro.props (e.g., annotate the props object with
Props) so the type is actually referenced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4735efb8-a916-493a-82a9-f7a56fcc9e93

📥 Commits

Reviewing files that changed from the base of the PR and between 20eb275 and 73864ae.

📒 Files selected for processing (1)
  • src/components/homepage/InstallSection.astro

Comment on lines +146 to +161
navigator.clipboard.writeText(code.textContent.trim()).then(function () {
iconCopy.style.display = 'none';
iconCheck.style.display = 'block';
setTimeout(function () {
iconCopy.style.display = 'block';
iconCheck.style.display = 'none';
}, 2000);
}).catch(function () {
// Fallback: select text so user can manually copy
var range = document.createRange();
range.selectNodeContents(code);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
btn.setAttribute('title', 'Text selected — press Ctrl+C to copy');
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Guard against navigator.clipboard being undefined in non-secure contexts.

navigator.clipboard is only available in secure contexts (HTTPS, localhost). In HTTP environments, accessing navigator.clipboard.writeText will throw an error before the .catch() can handle it.

🛡️ Proposed fix to add availability check
-        navigator.clipboard.writeText(code.textContent.trim()).then(function () {
+        if (navigator.clipboard && navigator.clipboard.writeText) {
+          navigator.clipboard.writeText(code.textContent.trim()).then(function () {
-          iconCopy.style.display = 'none';
-          iconCheck.style.display = 'block';
-          setTimeout(function () {
-            iconCopy.style.display = 'block';
-            iconCheck.style.display = 'none';
-          }, 2000);
-        }).catch(function () {
+            iconCopy.style.display = 'none';
+            iconCheck.style.display = 'block';
+            setTimeout(function () {
+              iconCopy.style.display = 'block';
+              iconCheck.style.display = 'none';
+            }, 2000);
+          }).catch(function () {
+            // Fallback: select text so user can manually copy
+            selectCodeText();
+          });
+        } else {
           // Fallback: select text so user can manually copy
+          selectCodeText();
+        }
+
+        function selectCodeText() {
           var range = document.createRange();
           range.selectNodeContents(code);
           var sel = window.getSelection();
           sel.removeAllRanges();
           sel.addRange(range);
           btn.setAttribute('title', 'Text selected — press Ctrl+C to copy');
-        });
+        }
📝 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
navigator.clipboard.writeText(code.textContent.trim()).then(function () {
iconCopy.style.display = 'none';
iconCheck.style.display = 'block';
setTimeout(function () {
iconCopy.style.display = 'block';
iconCheck.style.display = 'none';
}, 2000);
}).catch(function () {
// Fallback: select text so user can manually copy
var range = document.createRange();
range.selectNodeContents(code);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
btn.setAttribute('title', 'Text selected — press Ctrl+C to copy');
});
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(code.textContent.trim()).then(function () {
iconCopy.style.display = 'none';
iconCheck.style.display = 'block';
setTimeout(function () {
iconCopy.style.display = 'block';
iconCheck.style.display = 'none';
}, 2000);
}).catch(function () {
// Fallback: select text so user can manually copy
selectCodeText();
});
} else {
// Fallback: select text so user can manually copy
selectCodeText();
}
function selectCodeText() {
var range = document.createRange();
range.selectNodeContents(code);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
btn.setAttribute('title', 'Text selected — press Ctrl+C to copy');
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/homepage/InstallSection.astro` around lines 146 - 161, The
clipboard call in InstallSection.astro should be guarded because
navigator.clipboard may be undefined in non-secure contexts; before calling
navigator.clipboard.writeText(...) check that window.navigator &&
navigator.clipboard && typeof navigator.clipboard.writeText === 'function', and
if not available immediately run the existing fallback flow that selects the
code (using code, range, sel) and updates the UI (btn title, iconCopy/iconCheck
toggles) so no exception is thrown; keep the success path unchanged when
clipboard is present.

@rxri
Copy link
Member

rxri commented Mar 6, 2026

lemao ig it looks better

@afonsojramos afonsojramos merged commit b5c68ed into main Mar 6, 2026
2 checks passed
@afonsojramos afonsojramos deleted the feat/homepage-redesign branch March 6, 2026 12:20
@rxri
Copy link
Member

rxri commented Mar 6, 2026

It didn't deploy btw

@rxri
Copy link
Member

rxri commented Mar 6, 2026

well - now it did lol

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.

2 participants