Skip to content

[Portal] Redesign header with improved mobile menu layout #7138

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

Merged

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented May 23, 2025


PR-Codex overview

This PR focuses on enhancing the layout and structure of the Header component and adding new links for SDKs in the Header and DocSearch components.

Detailed summary

  • Increased width of the Button in DocSearch from w-56 to w-64.
  • Removed commented-out isNewSDK function in DocSearch.
  • Added new sdkLinks array with links for various SDKs.
  • Restructured Header layout to improve responsiveness and organization.
  • Updated mobile menu to include new SDK, API, and support sections.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Refactor

    • Improved the header layout with a two-row design for enhanced navigation clarity on desktop and mobile.
    • Updated the mobile menu to a full-screen overlay featuring distinct navigation categories and simplified access.
    • Added a new "Connect" top-level link and introduced an "SDKs" category with relevant links.
  • Style

    • Increased the width of the "Search Docs" button for better visibility.
  • Chores

    • Removed unused helper code from the search component.

Copy link

vercel bot commented May 23, 2025

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2025 11:23pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
login ⬜️ Skipped (Inspect) May 23, 2025 11:23pm
thirdweb_playground ⬜️ Skipped (Inspect) May 23, 2025 11:23pm
thirdweb-www ⬜️ Skipped (Inspect) May 23, 2025 11:23pm
wallet-ui ⬜️ Skipped (Inspect) May 23, 2025 11:23pm

@vercel vercel bot temporarily deployed to Preview – wallet-ui May 23, 2025 04:49 Inactive
Copy link

changeset-bot bot commented May 23, 2025

⚠️ No Changeset found

Latest commit: 41971d7

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 vercel bot temporarily deployed to Preview – thirdweb_playground May 23, 2025 04:49 Inactive
@vercel vercel bot temporarily deployed to Preview – login May 23, 2025 04:49 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www May 23, 2025 04:49 Inactive
Copy link

coderabbitai bot commented May 23, 2025

"""

Walkthrough

The Header component was refactored to implement a two-row layout, separating navigation and controls for improved clarity and responsiveness. The mobile navigation was restructured into a full-screen overlay with vertical sections for categories, and the burger menu toggle was repositioned. The DocSearch component's search button width was increased, and an unused helper function was removed.

Changes

File(s) Change Summary
apps/portal/src/app/Header.tsx Refactored Header into two rows with separated desktop and mobile nav; added "Connect" link; introduced sdkLinks; redesigned burger menu as full-screen overlay with vertical category sections; repositioned controls and links.
apps/portal/src/components/others/DocSearch.tsx Increased search button width from 56 to 64 units; removed commented-out helper function.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Header
    participant DesktopNav
    participant MobileMenu
    participant BurgerMenuButton

    User->>Header: Loads page
    Header->>DesktopNav: Render (if screen ≥ xl)
    Header->>BurgerMenuButton: Render (always visible)
    User->>BurgerMenuButton: Click (on mobile)
    BurgerMenuButton->>MobileMenu: Toggle visibility
    User->>MobileMenu: Click navigation link
    MobileMenu->>MobileMenu: Close overlay
Loading

"""

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

📜 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 70c896e and 41971d7.

📒 Files selected for processing (2)
  • apps/portal/src/app/Header.tsx (5 hunks)
  • apps/portal/src/components/others/DocSearch.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/portal/src/components/others/DocSearch.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/portal/src/app/Header.tsx (2)
apps/portal/src/components/others/DocSearch.tsx (1)
  • DocSearch (312-388)
apps/dashboard/src/@/components/ui/button.tsx (1)
  • Button (67-67)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Size
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/portal/src/app/Header.tsx (3)

29-33: Good addition of Connect link to main navigation.

The Connect link with the TableOfContentsIcon provides clear navigation to the Connect section and aligns well with the overall navigation structure.


196-241: Well-structured responsive top row layout.

The top row implementation effectively separates the logo/branding from the controls, with appropriate responsive behavior. The conditional rendering for different screen sizes (xl breakpoint) is properly implemented, and the button handlers are correctly wired.


244-312: Clean desktop navigation implementation with good organization.

The bottom row navigation is well-structured with clear groupings of related links (Products, Tools, SDKs, APIs, Support). The use of flex layout and proper spacing creates a clean, organized interface. The onClick handlers consistently close the burger menu when needed.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.

@joaquim-verges joaquim-verges marked this pull request as ready for review May 23, 2025 04:49
@joaquim-verges joaquim-verges requested review from a team as code owners May 23, 2025 04:49
@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label May 23, 2025
Copy link
Member Author

joaquim-verges commented May 23, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.68%. Comparing base (3489ece) to head (41971d7).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7138   +/-   ##
=======================================
  Coverage   55.68%   55.68%           
=======================================
  Files         904      904           
  Lines       58324    58324           
  Branches     4113     4113           
=======================================
  Hits        32476    32476           
  Misses      25743    25743           
  Partials      105      105           
Flag Coverage Δ
packages 55.68% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

🔭 Outside diff range comments (1)
apps/portal/src/app/Header.tsx (1)

103-106: ⚠️ Potential issue

/react-native/v5 not recognised by DocSearch tag helper

connectLinks now points to "/react-native/v5", but getTagsFromHref() in DocSearch.tsx still only checks for "/react-native/v0".
The new link will therefore be shown without the “React Native” tag in search results.

-  if (href.includes("/react-native/v0")) {
+  if (href.includes("/react-native/v0") || href.includes("/react-native/v5")) {

Update the helper (and any related analytics) to keep tag filtering consistent.

♻️ Duplicate comments (1)
apps/portal/src/app/Header.tsx (1)

266-271: Repeat of previous comment: please add rel="noopener noreferrer" to the second GitHub link as well.

🧹 Nitpick comments (3)
apps/portal/src/components/others/DocSearch.tsx (1)

358-362: Prefer responsive width over a hard-coded w-64

A fixed width of 16rem can look cramped on very small viewports and excessively wide on very large ones.
Consider allowing the button to grow with its container and clamp it only on medium+ breakpoints:

-              className="flex w-64 justify-between px-3"
+              className="flex justify-between px-3 w-full md:w-64"

This keeps the current desktop appearance (md:w-64) while letting mobile screens use the full width.

apps/portal/src/app/Header.tsx (2)

175-186: Duplicate ThemeSwitcher instances can be reduced

Maintaining two separate components (one hidden on xl, the other shown on xl) duplicates state & logic.
Tailwind allows the same element to change style across breakpoints:

-          <div className="hidden xl:flex">
-            <ThemeSwitcher />
-          </div>
-
-          <div className="flex items-center gap-1 xl:hidden">
-            <ThemeSwitcher className="border-none bg-transparent" />
+          <ThemeSwitcher
+            className="border-none bg-transparent
+                       xl:border xl:bg-card" /* example — adjust as needed */
+          />

This removes duplication and guarantees both breakpoints act on the same underlying component.


188-193: Add rel="noopener noreferrer" to external links opened in a new tab

For security and performance it’s best practice to add rel="noopener noreferrer" whenever target="_blank" is used:

-            <Link
-              href="https://github.com/thirdweb-dev"
-              target="_blank"
-              className="text-foreground"
+            <Link
+              href="https://github.com/thirdweb-dev"
+              target="_blank"
+              rel="noopener noreferrer"
+              className="text-foreground"

(Apply the same change to the GitHub link in the bottom row.)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 005acce and 32d463f.

📒 Files selected for processing (2)
  • apps/portal/src/app/Header.tsx (2 hunks)
  • apps/portal/src/components/others/DocSearch.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Build Packages
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)

Comment on lines 276 to 387
{showBurgerMenu && (
<div className="fixed inset-0 top-sticky-top-height z-50 overflow-auto bg-card p-6 xl:hidden">
<div className="flex flex-col gap-6">
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Connect</h3>
{connectLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
icon={link.icon}
/>
))}
</div>

<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Products</h3>
{links.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>

<div className="hidden xl:block">
<DocSearch variant="search" />
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Tools</h3>
{toolLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>

<div className="xl:px-1">
<DropdownLinks
links={apisLinks}
onLinkClick={() => setShowBurgerMenu(false)}
category="APIs"
/>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">APIs</h3>
{apisLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>

<div className="xl:px-1">
<DropdownLinks
links={supportLinks}
onLinkClick={() => setShowBurgerMenu(false)}
category="Support"
/>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Support</h3>
{supportLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>

<NavLink
name="Changelog"
href="/changelog"
onClick={() => {
setShowBurgerMenu(false);
}}
onClick={() => setShowBurgerMenu(false)}
/>

<Link
href="https://github.com/thirdweb-dev"
target="_blank"
className="hidden text-muted-foreground transition-colors hover:text-foreground xl:block"
>
<GithubIcon className="mx-2 size-6" />
</Link>
</div>
</nav>
</div>
</div>
)}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve accessibility & scroll-lock when the mobile menu is open

The full-screen overlay lacks:

  1. Focus trapping / aria-modal="true" so keyboard users are not lost behind the overlay.
  2. Body scroll lock – scrolling the page behind the menu may lead to context loss on close.

A minimal improvement:

-        <div className="fixed inset-0 top-sticky-top-height z-50 overflow-auto bg-card p-6 xl:hidden">
+        <div
+          role="dialog"
+          aria-modal="true"
+          className="fixed inset-0 top-sticky-top-height z-50 overflow-auto bg-card p-6 xl:hidden"
+          onWheel={(e) => e.stopPropagation()} /* optional: crude scroll-lock */
+        >

For a more complete solution, consider reusing your existing Dialog component (as done for DocSearch) which already handles focus-trapping and background scroll locking.

📝 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
{showBurgerMenu && (
<div className="fixed inset-0 top-sticky-top-height z-50 overflow-auto bg-card p-6 xl:hidden">
<div className="flex flex-col gap-6">
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Connect</h3>
{connectLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
icon={link.icon}
/>
))}
</div>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Products</h3>
{links.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>
<div className="hidden xl:block">
<DocSearch variant="search" />
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Tools</h3>
{toolLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>
<div className="xl:px-1">
<DropdownLinks
links={apisLinks}
onLinkClick={() => setShowBurgerMenu(false)}
category="APIs"
/>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">APIs</h3>
{apisLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>
<div className="xl:px-1">
<DropdownLinks
links={supportLinks}
onLinkClick={() => setShowBurgerMenu(false)}
category="Support"
/>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Support</h3>
{supportLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>
<NavLink
name="Changelog"
href="/changelog"
onClick={() => {
setShowBurgerMenu(false);
}}
onClick={() => setShowBurgerMenu(false)}
/>
<Link
href="https://github.com/thirdweb-dev"
target="_blank"
className="hidden text-muted-foreground transition-colors hover:text-foreground xl:block"
>
<GithubIcon className="mx-2 size-6" />
</Link>
</div>
</nav>
</div>
</div>
)}
{showBurgerMenu && (
- <div className="fixed inset-0 top-sticky-top-height z-50 overflow-auto bg-card p-6 xl:hidden">
+ <div
+ role="dialog"
+ aria-modal="true"
+ className="fixed inset-0 top-sticky-top-height z-50 overflow-auto bg-card p-6 xl:hidden"
+ onWheel={(e) => e.stopPropagation()} /* optional: crude scroll-lock */
+ >
<div className="flex flex-col gap-6">
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Connect</h3>
{connectLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
icon={link.icon}
/>
))}
</div>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Products</h3>
{links.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Tools</h3>
{toolLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">APIs</h3>
{apisLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>
<div className="flex flex-col gap-4">
<h3 className="font-semibold text-lg">Support</h3>
{supportLinks.map((link) => (
<NavLink
key={link.name}
name={link.name}
href={link.href}
onClick={() => setShowBurgerMenu(false)}
/>
))}
</div>
<NavLink
name="Changelog"
href="/changelog"
onClick={() => setShowBurgerMenu(false)}
/>
</div>
- </div>
+ </div>
)}
🤖 Prompt for AI Agents
In apps/portal/src/app/Header.tsx between lines 276 and 347, the mobile menu
overlay lacks accessibility features like focus trapping and aria-modal
attribute, and it does not lock body scroll when open. To fix this, wrap the
overlay content in a component that manages focus trapping and sets
aria-modal="true", such as the existing Dialog component used elsewhere in the
app. Additionally, implement body scroll locking while the menu is open to
prevent background scrolling and context loss. This will improve keyboard
navigation and user experience for screen reader users.

Copy link
Contributor

github-actions bot commented May 23, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 61.7 KB (-0.1% 🔽) 1.3 s (-0.1% 🔽) 222 ms (+181.66% 🔺) 1.5 s
thirdweb (cjs) 344.59 KB (+0.06% 🔺) 6.9 s (+0.06% 🔺) 629 ms (+4.56% 🔺) 7.6 s
thirdweb (minimal + tree-shaking) 5.69 KB (0%) 114 ms (0%) 59 ms (+1278.65% 🔺) 173 ms
thirdweb/chains (tree-shaking) 531 B (0%) 11 ms (0%) 31 ms (+1788.75% 🔺) 41 ms
thirdweb/react (minimal + tree-shaking) 19.54 KB (0%) 391 ms (0%) 91 ms (+768.99% 🔺) 482 ms

@joaquim-verges joaquim-verges force-pushed the _Portal_Redesign_header_with_improved_mobile_menu_layout branch from 32d463f to 6b73f43 Compare May 23, 2025 04:57
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground May 23, 2025 04:57 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui May 23, 2025 04:57 Inactive
@vercel vercel bot temporarily deployed to Preview – login May 23, 2025 04:57 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www May 23, 2025 04:57 Inactive
@joaquim-verges joaquim-verges force-pushed the _Portal_Redesign_header_with_improved_mobile_menu_layout branch from 6b73f43 to 70c896e Compare May 23, 2025 18:30
@vercel vercel bot temporarily deployed to Preview – login May 23, 2025 18:30 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground May 23, 2025 18:30 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www May 23, 2025 18:30 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui May 23, 2025 18:30 Inactive
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

♻️ Duplicate comments (1)
apps/portal/src/app/Header.tsx (1)

315-387: Mobile menu accessibility issues remain unaddressed.

The mobile menu overlay still lacks the accessibility improvements mentioned in previous reviews, including focus trapping, aria-modal="true", and scroll lock functionality. These are important for keyboard navigation and screen reader users.

As suggested in the previous review, consider using the existing Dialog component which already handles these accessibility concerns, or implement the minimal improvements with role="dialog", aria-modal="true", and scroll lock handling.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6b73f43 and 70c896e.

📒 Files selected for processing (2)
  • apps/portal/src/app/Header.tsx (5 hunks)
  • apps/portal/src/components/others/DocSearch.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/portal/src/components/others/DocSearch.tsx
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/portal/src/app/Header.tsx (2)

196-312: Well-implemented responsive header layout.

The two-row header design effectively separates navigation concerns and provides good responsive behavior. The conditional rendering based on screen size breakpoints and the logical grouping of navigation elements enhance both usability and maintainability.


29-33: Good addition of Connect link with consistent structure.

The new "Connect" link follows the established pattern with proper icon integration and maintains consistency with the existing navigation structure.

Comment on lines +148 to +179
const sdkLinks = [
{
name: "TypeScript",
href: "/typescript/v5",
icon: TypeScriptIcon,
},
{
name: "React",
href: "/react/v5",
icon: ReactIcon,
},
{
name: "React Native",
href: "/react-native/v5",
icon: ReactIcon,
},
{
name: ".NET",
href: "/dotnet",
icon: DotNetIcon,
},
{
name: "Unity",
href: "/unity",
icon: UnityIcon,
},
{
name: "Unreal Engine",
href: "/unreal-engine",
icon: UnrealEngineIcon,
},
];
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Eliminate code duplication between sdkLinks and connectLinks.

The newly added sdkLinks array duplicates most entries from the existing connectLinks array (lines 87-127), differing only by the missing "Overview" entry. This violates the DRY principle and creates maintenance overhead.

Consider deriving sdkLinks from connectLinks to eliminate duplication:

-const sdkLinks = [
-  {
-    name: "TypeScript",
-    href: "/typescript/v5",
-    icon: TypeScriptIcon,
-  },
-  {
-    name: "React",
-    href: "/react/v5",
-    icon: ReactIcon,
-  },
-  {
-    name: "React Native",
-    href: "/react-native/v5",
-    icon: ReactIcon,
-  },
-  {
-    name: ".NET",
-    href: "/dotnet",
-    icon: DotNetIcon,
-  },
-  {
-    name: "Unity",
-    href: "/unity",
-    icon: UnityIcon,
-  },
-  {
-    name: "Unreal Engine",
-    href: "/unreal-engine",
-    icon: UnrealEngineIcon,
-  },
-];
+const sdkLinks = connectLinks.filter(link => link.name !== "Overview");
📝 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
const sdkLinks = [
{
name: "TypeScript",
href: "/typescript/v5",
icon: TypeScriptIcon,
},
{
name: "React",
href: "/react/v5",
icon: ReactIcon,
},
{
name: "React Native",
href: "/react-native/v5",
icon: ReactIcon,
},
{
name: ".NET",
href: "/dotnet",
icon: DotNetIcon,
},
{
name: "Unity",
href: "/unity",
icon: UnityIcon,
},
{
name: "Unreal Engine",
href: "/unreal-engine",
icon: UnrealEngineIcon,
},
];
-const sdkLinks = [
- {
- name: "TypeScript",
- href: "/typescript/v5",
- icon: TypeScriptIcon,
- },
- {
- name: "React",
- href: "/react/v5",
- icon: ReactIcon,
- },
- {
- name: "React Native",
- href: "/react-native/v5",
- icon: ReactIcon,
- },
- {
- name: ".NET",
- href: "/dotnet",
- icon: DotNetIcon,
- },
- {
- name: "Unity",
- href: "/unity",
- icon: UnityIcon,
- },
- {
- name: "Unreal Engine",
- href: "/unreal-engine",
- icon: UnrealEngineIcon,
- },
-];
+const sdkLinks = connectLinks.filter(link => link.name !== "Overview");
🤖 Prompt for AI Agents
In apps/portal/src/app/Header.tsx between lines 87-127 and 148-179, the sdkLinks
array duplicates most entries from the connectLinks array except for the
"Overview" entry. To fix this, refactor sdkLinks to be derived from connectLinks
by filtering out the "Overview" entry instead of redefining the entire array.
This will eliminate duplication and reduce maintenance overhead.

@joaquim-verges joaquim-verges force-pushed the _Portal_Redesign_header_with_improved_mobile_menu_layout branch from 70c896e to 41971d7 Compare May 23, 2025 23:15
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground May 23, 2025 23:15 Inactive
@vercel vercel bot temporarily deployed to Preview – login May 23, 2025 23:15 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui May 23, 2025 23:15 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www May 23, 2025 23:15 Inactive
@joaquim-verges joaquim-verges merged commit ebd58f4 into main May 24, 2025
24 checks passed
@joaquim-verges joaquim-verges deleted the _Portal_Redesign_header_with_improved_mobile_menu_layout branch May 24, 2025 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Portal Involves changes to the Portal (docs) codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant