Skip to content

Refactor navigation to horizontal top header and improve loading states#61

Merged
a-novi merged 10 commits intomainfrom
navigation
Mar 18, 2026
Merged

Refactor navigation to horizontal top header and improve loading states#61
a-novi merged 10 commits intomainfrom
navigation

Conversation

@a-novi
Copy link
Copy Markdown
Contributor

@a-novi a-novi commented Jan 20, 2026

Summary

  • Refactored navigation from left sidebar to horizontal top header
  • Added Leaderboard to navigation and moved it to dashboard route group
  • Reorganized app routes using Next.js route groups for better navigation UX
  • Replaced full-page loading screens with component-level skeletons
  • Added page titles (Sui Analytics) to all pages

Changes

Navigation Refactor

  • Created new NavTabs component with desktop horizontal tabs and mobile hamburger menu
  • Created FilterPopover component for time/token filters (moved from sidebar)
  • Updated DashboardLayout to use centered horizontal navigation with fixed-width left/right sections
  • Updated Logo component with single prop for mobile view
  • Added Leaderboard tab to navigation (between Transactions and Profile)

Route Structure

  • Moved all dashboard pages into (dashboard) route group to share a single layout
  • This prevents header re-mounting when navigating between tabs (smoother UX)
  • Moved Leaderboard page to (dashboard) route group for consistency
  • Removed duplicate leaderboard layout that was causing header duplication
  • Routes remain unchanged: /, /transactions, /transactions/[tx], /profile, /leaderboard

Loading States

  • Removed route-level loading.tsx files (full-page loading screens)
  • Removed LoadingScreen component
  • Fixed outdated leaderboard/loading.tsx that referenced deleted LoadingScreen
  • Created TransactionDetailSkeleton for transaction details page
  • All pages now use component-level loading (skeletons via SWR)

Page Titles & Metadata

  • Added "Sui Analytics" as base page title
  • Created PageTitle component for client-side title updates
  • Each page now has descriptive titles:
    • Bridge Dashboard | Sui Analytics
    • Bridge Transactions | Sui Analytics
    • Leaderboard | Sui Analytics
    • Transaction Details | Sui Analytics
    • Profile | Sui Analytics

Testing

  • ✅ Build passes successfully
  • ✅ All CI checks pass (Build + Trivy scan)
  • ✅ No duplicate headers on any page
  • ✅ Navigation works on desktop and mobile
  • ✅ Page titles display correctly in browser tabs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the navigation system from a left sidebar to a horizontal top header layout, reorganizes the application routes using Next.js route groups for better navigation UX, and replaces full-page loading screens with component-level skeletons for improved user experience.

Changes:

  • Replaced left sidebar navigation with horizontal top tabs on desktop and hamburger menu on mobile
  • Created a (dashboard) route group to consolidate all dashboard pages under a single layout
  • Replaced full-page LoadingScreen with TransactionDetailSkeleton for more granular loading states

Reviewed changes

Copilot reviewed 18 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/layouts/dashboard/layout.tsx Complete rewrite to use horizontal AppBar with centered navigation tabs and fixed-width left/right sections
src/layouts/components/nav-tabs.tsx New component providing horizontal navigation tabs for desktop and collapsible menu for mobile
src/layouts/components/filter-popover.tsx New component consolidating time period and token filters into a popover accessible from the header
src/layouts/dashboard/main.tsx Removed Main component, kept only DashboardContent with simplified padding logic
src/components/logo/logo.tsx Simplified Logo component with new 'single' prop replacing 'isLarge' and 'isSingle' props
src/components/skeletons/transaction-detail-skeleton.tsx New skeleton component for transaction detail page loading state
src/components/loading-screen/loading-screen.tsx Removed full-page loading screen component
src/app/(dashboard)/layout.tsx New layout file for the dashboard route group
src/app/(dashboard)/page.tsx Moved from src/app/page.tsx to dashboard route group
src/app/(dashboard)/transactions/page.tsx New transactions page within dashboard route group
src/app/(dashboard)/transactions/[tx]/page.tsx New transaction detail page within dashboard route group
src/app/(dashboard)/profile/page.tsx New profile page within dashboard route group

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/layouts/components/nav-tabs.tsx
Comment thread src/layouts/components/filter-popover.tsx
Comment thread src/layouts/components/filter-popover.tsx Outdated
Comment thread src/layouts/components/filter-popover.tsx Outdated
Comment thread src/layouts/components/nav-tabs.tsx Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 23 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/app/(dashboard)/layout.tsx:10

  • The profile page previously had disableTimelines={true} in its dedicated layout, which would hide the FilterPopover (time/token filters) on the profile page. After this refactor, all pages in the (dashboard) route group share the same layout without this configuration. This means the FilterPopover will now appear on the profile page, which may not be the intended behavior since profile pages typically don't need time period or token filters.

Consider either:

  1. Adding a mechanism to conditionally hide the FilterPopover on specific routes (e.g., checking pathname in DashboardLayout)
  2. Moving the profile page outside the (dashboard) route group with its own layout
  3. Accepting this change if filters on the profile page are acceptable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/layouts/dashboard/main.tsx
Comment thread src/layouts/dashboard/main.tsx
@a-novi a-novi merged commit a478553 into main Mar 18, 2026
2 checks passed
@a-novi a-novi deleted the navigation branch March 18, 2026 08:51
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