Skip to content

fix: navbarcleanup#71

Merged
DengreSarthak merged 3 commits into
StabilityNexus:mainfrom
SIDDHANTCOOKIE:feat/header-nav-cleanup
Mar 27, 2026
Merged

fix: navbarcleanup#71
DengreSarthak merged 3 commits into
StabilityNexus:mainfrom
SIDDHANTCOOKIE:feat/header-nav-cleanup

Conversation

@SIDDHANTCOOKIE

@SIDDHANTCOOKIE SIDDHANTCOOKIE commented Mar 26, 2026

Copy link
Copy Markdown
Member

Addressed Issues:

  • Removed header quick links (Home, Auctions, Create, Dashboard) from the navbar.
  • Kept logo as the home navigation entry (/), so no separate home button is needed.
  • Kept Create Auction on the right and added a Dashboard button to its right.
  • Updated Next.js Image usage for logo to remove legacy objectFit prop warning.
  • Fixed WalletConnect SSR/runtime issue (indexedDB is not defined) by making wagmi_config server-safe:
    • Server: uses createConfig + transports (no browser wallet init).
    • Client: uses getDefaultConfig (RainbowKit connectors as expected).

Files changed

  • components/layout/navbar.tsx
  • config.ts

Screenshots/Recordings:

After:
Screenshot 2026-03-26 210256

Before:
Screenshot 2026-03-26 210438

Additional Notes:

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: Gemini

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • New Features

    • Added a Dashboard button to the navigation bar
  • Refactor

    • Replaced path-based link highlighting with two explicit action buttons (Create Auction and Dashboard); both remain hidden on small screens
    • Standardized logo image sizing and fit for consistent display
    • Improved wallet/config initialization to better handle server vs. client environments

@SIDDHANTCOOKIE SIDDHANTCOOKIE changed the title navbarcleanup fix: navbarcleanup Mar 26, 2026
@coderabbitai

coderabbitai Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Removed pathname-based active navigation and animations from the Navbar, replacing the desktop link list with two static action buttons. Introduced environment-aware wagmi configuration: server builds use explicit createConfig with per-chain transports; client uses getDefaultConfig with chains and ssr enabled.

Changes

Cohort / File(s) Summary
Navbar Refactor
components/layout/navbar.tsx
Removed pathname-based active-nav logic and related imports (usePathname, framer-motion, cn, navItems). Replaced desktop link list with two explicit action buttons ("Create Auction", "Dashboard") hidden on small screens. Converted Image sizing props to numeric values and moved objectFit into style.
Wagmi Configuration
config.ts
Extracted chains constant; changed wagmi_config to environment-dependent export: server (typeof window === 'undefined') uses createConfig with ssr: true and explicit per-chain HTTP transports; client uses getDefaultConfig with chains and ssr: true. Added createConfig/http imports and formatted file trailing newline.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Server as Server (build/SSR)
    participant Client as Client (browser)
    participant Chains as Chains list
    participant WC as WalletConnect

    Dev->>Server: Import config.ts on server
    Server->>Chains: read chains constant
    Server->>WC: read NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID
    Server->>Server: makeServerConfig() -> createConfig(ssr: true, transports per-chain)
    Server-->>Dev: export wagmi_config (server config)

    Dev->>Client: Bundle served to browser
    Client->>Chains: read chains constant
    Client->>WC: read NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID
    Client->>Client: getDefaultConfig({ chains, ssr: true, projectId })
    Client-->>Dev: export wagmi_config (client config)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

Typescript Lang

Poem

🐇 I hopped through code with nimble paws,
Links fell away for cleaner laws,
Two buttons stand where paths once lay,
Wagmi splits for night and day,
A tiny hop—deployment hoorays! 🎉

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "navbarcleanup" is vague and generic, failing to clearly convey the scope of changes which include navbar modifications and a critical wagmi config fix for SSR/runtime issues. Revise the title to be more descriptive and specific, such as "fix: remove navbar links and add Dashboard button" or "fix: navbar cleanup and SSR wagmi config", to better reflect the actual changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/layout/navbar.tsx`:
- Around line 24-45: Three user-facing labels in the navbar are hardcoded
("HAH!", "Create Auction", "Dashboard"); replace them with i18n resource
lookups: import and use your translation function/hook (e.g., useTranslation/t
or i18n.t) inside the component and replace the literal strings used in the Link
that renders the brand (currently "HAH!") and the Link children for
href="/create" and href="/dashboard" with translation keys (e.g., navbar.brand,
navbar.createAuction, navbar.dashboard). Add those keys to the locale resource
files for all supported locales and ensure the component renders the translated
values.

In `@config.ts`:
- Around line 49-57: The wagmi_config currently hardcodes projectId inside the
getDefaultConfig call; change it to read from an environment variable (e.g.
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID) instead, update the getDefaultConfig call
in config.ts to use process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID (with an
optional fallback or throw if missing), and add the suggested
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID entry to your .env file so different
environments can override the WalletConnect projectId; reference wagmi_config,
getDefaultConfig, and projectId when making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 22fcc596-4ca5-4d29-b649-e9f434d10f13

📥 Commits

Reviewing files that changed from the base of the PR and between a954222 and 6cc71a6.

📒 Files selected for processing (2)
  • components/layout/navbar.tsx
  • config.ts

Comment on lines +24 to +45
<span className="text-3xl font-bold text-primary">HAH!</span>
</Link>
<nav className="hidden md:flex items-center space-x-4">
{navItems.map((item) => {
const isActive = item.path === "/"
? pathname === "/"
: pathname === item.path || pathname.startsWith(`${item.path}/`);
return (
<Link
key={item.path}
href={item.path}
className={cn(
"text-sm font-medium transition-colors hover:text-primary relative py-1.5",
isActive
? "text-foreground"
: "text-muted-foreground"
)}
>
{item.name}
{isActive && (
<motion.div
className="absolute -bottom-px left-0 h-[2px] w-full bg-primary"
layoutId="navbar-underline"
/>
)}
</Link>
);
})}
</nav>
</div>

<div className="flex items-center gap-2">
<ConnectButton accountStatus={"address"} showBalance={false} />
<ModeToggle />
<Button
size="sm"
variant="default"
asChild
className="hidden md:flex"
>
<Link href="/create">Create Auction</Link>
</Button>
<div className="flex items-center gap-2">
<ConnectButton accountStatus={"address"} showBalance={false} />
<ModeToggle />
<Button
size="sm"
variant="default"
asChild
className="hidden md:flex"
>
<Link href="/create">Create Auction</Link>
</Button>
<Button
size="sm"
variant="outline"
asChild
className="hidden md:flex"
>
<Link href="/dashboard">Dashboard</Link>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Externalize newly changed UI labels for i18n compliance.

Line 24, Line 37, and Line 45 use hardcoded user-facing strings ("HAH!", "Create Auction", "Dashboard"). These should come from locale resources instead of inline literals.

As per coding guidelines, "User-visible strings should be externalized to resource files (i18n)".

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

In `@components/layout/navbar.tsx` around lines 24 - 45, Three user-facing labels
in the navbar are hardcoded ("HAH!", "Create Auction", "Dashboard"); replace
them with i18n resource lookups: import and use your translation function/hook
(e.g., useTranslation/t or i18n.t) inside the component and replace the literal
strings used in the Link that renders the brand (currently "HAH!") and the Link
children for href="/create" and href="/dashboard" with translation keys (e.g.,
navbar.brand, navbar.createAuction, navbar.dashboard). Add those keys to the
locale resource files for all supported locales and ensure the component renders
the translated values.

Comment thread config.ts
SIDDHANTCOOKIE and others added 2 commits March 26, 2026 21:34
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config.ts`:
- Around line 36-47: The config currently sets ssr: true but does not persist
wallet state across SSR boundaries; update makeServerConfig/createConfig to
include cookie-backed storage by calling createStorage({ storage: cookieStorage
}) and pass that storage into the config, then in app/layout.tsx read cookies
from request headers and call cookieToInitialState(cookie) to produce an
initialState, and finally pass that initialState into WagmiProvider in
components/providers.tsx so connected wallets survive full-page SSR renders;
ensure you import cookieStorage, createStorage, and cookieToInitialState from
wagmi and wire them to makeServerConfig, app/layout.tsx, and WagmiProvider
respectively.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 97457cd2-8260-4c49-a888-07b24536e428

📥 Commits

Reviewing files that changed from the base of the PR and between 6cc71a6 and f82f934.

📒 Files selected for processing (1)
  • config.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config.ts`:
- Around line 36-47: The current dual-config pattern creates different objects
at module-eval time (makeServerConfig / createConfig vs getDefaultConfig) and
causes hydration mismatches when components/providers.tsx imports wagmi_config
and passes it to WagmiProvider; refactor to a single config factory (use
createConfig with ssr: true) and lazy-initialize on the client inside the
provider (e.g. initialize the config in components/providers.tsx using
useState/useEffect) or expose a getConfig() factory that always returns the same
shape and only calls client-only code inside an effect so WagmiProvider always
receives a consistent config object between server and client.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1b57420e-ae43-4345-81f0-8e8e51ddb33d

📥 Commits

Reviewing files that changed from the base of the PR and between f82f934 and 24326a0.

📒 Files selected for processing (1)
  • config.ts

Comment thread config.ts
Comment on lines +36 to +47
const makeServerConfig = () =>
createConfig({
chains,
transports: {
[mordor.id]: http(mordor.rpcUrls.default.http[0]),
[citrea_testnet.id]: http(citrea_testnet.rpcUrls.default.http[0]),
[mainnet.id]: http(),
[polygon.id]: http(),
[base.id]: http(),
},
ssr: true,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Dual-config architecture risks hydration mismatch.

The typeof window === 'undefined' check at module evaluation time creates fundamentally different config objects: createConfig() on server vs getDefaultConfig() on client. Since components/providers.tsx imports wagmi_config at module scope and passes it directly to WagmiProvider, the server-rendered output and client hydration use incompatible configs. This can cause React hydration warnings and potential runtime inconsistencies with wallet state.

A safer approach is to use a single config factory with ssr: true and lazy-initialize on the client, or wrap the client-specific initialization in a useState/useEffect pattern within the provider component.

#!/bin/bash
# Check if providers.tsx handles the config in a way that could mitigate hydration issues
rg -n "wagmi_config|useState|useEffect" components/providers.tsx -A 3 -B 1

Also applies to: 49-57

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

In `@config.ts` around lines 36 - 47, The current dual-config pattern creates
different objects at module-eval time (makeServerConfig / createConfig vs
getDefaultConfig) and causes hydration mismatches when components/providers.tsx
imports wagmi_config and passes it to WagmiProvider; refactor to a single config
factory (use createConfig with ssr: true) and lazy-initialize on the client
inside the provider (e.g. initialize the config in components/providers.tsx
using useState/useEffect) or expose a getConfig() factory that always returns
the same shape and only calls client-only code inside an effect so WagmiProvider
always receives a consistent config object between server and client.

@DengreSarthak DengreSarthak merged commit 77909ab into StabilityNexus:main Mar 27, 2026
2 checks passed
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