Skip to content

Conversation

christian-bromann
Copy link
Member

Problem

The demo banner was positioned with fixed top-0 right-0 left-0 at the global layout level, which caused it to overlap or be clipped by the sidebar navigation. This created a visual bug where the banner would not display properly within the sidebar layout structure.

Screenshot 2025-06-02 at 10 54 26 PM

Solution

  • Extracted demo banner logic from the main layout into a dedicated DemoBanner component
  • Created a reusable Header component to consolidate header structure across all app pages
  • Integrated the demo banner into the header component so it positions correctly within each page's layout
  • Removed duplicate header code across multiple pages for better maintainability

Changes Made

  • ✅ Created DemoBanner component in apps/web/src/components/ui/demo.tsx
  • ✅ Created reusable Header component
  • ✅ Refactored 7 pages to use the new Header component:
    • /agents/page.tsx
    • /inbox/page.tsx
    • /page.tsx (chat)
    • /rag/page.tsx
    • /tools/page.tsx
    • /tools/playground/page.tsx
  • ✅ Removed demo banner from global layout (apps/web/src/app/(app)/layout.tsx)
  • ✅ Eliminated ~140 lines of duplicate header code

Benefits

  • 🎯 Fixes visual bug - Demo banner now displays correctly without sidebar conflicts
  • 🔄 Improves maintainability - Single source of truth for header structure
  • 🧹 Reduces code duplication - Consolidated repetitive header code across pages
  • 📦 Better component organization - More modular and reusable components

Testing

  • Verified demo banner displays correctly in demo mode
  • Tested all pages maintain proper header structure
  • Confirmed no visual regressions in sidebar layout
  • Validated breadcrumb navigation still works correctly

Note: I don't have access to Supabase and couldn't run the app without it, please verify visual accuracy.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change that improves code structure)
  • New feature
  • Breaking change
  • Documentation update

- Extract demo banner from global fixed positioning to prevent sidebar overlap
- Create reusable DemoBanner component with proper positioning logic
- Consolidate header structure across all app pages using new Header component
- Remove duplicate header code from agents, inbox, chat, rag, tools, and playground pages
- Fix visual bug where demo banner was being cut off by the sidebar layout

Resolves layout conflict where the fixed-positioned demo banner would overlap
or be clipped by the sidebar navigation structure.
Copy link

vercel bot commented Jun 3, 2025

@christian-bromann is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@bracesproul bracesproul left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on reviewing. I like refactoring it out into its own reusable component, however the implementation you pushed means the sidebar covers up part of the UI (breadcrumbs, and OAP logo in sidebar).

If you still want to work on this PR I would request one of two things:

  1. keep the old styling, but use your refactor
  2. update the styling to instead shift everything down, and have the header be above every UI element (also keep your refactor)

Thanks

@christian-bromann
Copy link
Member Author

@bracesproul thanks for the review, I'll try to get back to this asap.

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