Skip to content

Refactor ApexAIPage into modular components with chat-first layout#91

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-apexai-page-components
Draft

Refactor ApexAIPage into modular components with chat-first layout#91
Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-apexai-page-components

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

ApexAIPage.jsx was a ~325-line monolith mixing hero content, sidebar panels, chat UI, and inline styles. The chat interface was pushed far below the fold, burying the core product interaction behind decorative content.

Component extraction (components/apexai/)

Component Responsibility
HeroSection Badge, title, tagline, stats — pure display
FeatureGrid 4 capability cards — moved below the fold
MessageBubble Single message with user/assistant styling
LoadingIndicator Animated typing dots
ChatInput Input + send form
ChatWindow Composes header + messages + input
BottomCTA Black CTA strip

ApexAIPage.jsx is now an ~80-line state orchestrator:

<section className="flex-1 flex flex-col lg:flex-row border-b-4 border-black min-h-[600px]">
  <div className="lg:w-[360px] xl:w-[400px] ... flex flex-col p-6 sm:p-8">
    <HeroSection />
  </div>
  <div className="flex-1 flex flex-col min-h-[500px] lg:min-h-0">
    <ChatWindow messages={messages} isLoading={isLoading} ... />
  </div>
</section>

Layout & UX changes

  • Chat-first: Desktop shows a split viewport — compact hero sidebar (360px) + chat filling remaining width/height. Chat is visible without scrolling.
  • Removed: Quick Commands panel and Session Stats sidebar.
  • Status indicator: Green/yellow dot in chat header reflects Ready/Analyzing state.
  • Mobile: Hero stacks above chat (min-h-[500px] guard on chat window).
  • FeatureGrid + BottomCTA remain accessible below the fold.

Technical cleanup

  • Removed non-functional <style jsx> block (Styled JSX is Next.js only; had no effect in Vite). Scrollbar styles moved to index.css as .apex-scrollbar.
  • Dropped unused messagesEndRef, quickPrompts, and handleQuickPrompt.
  • handleSendMessage de-async'd; marked with TODO for real API wiring.

Copilot AI changed the title [WIP] Refactor ApexAIPage.jsx into modular reusable components Refactor ApexAIPage into modular components with chat-first layout May 26, 2026
Copilot AI requested a review from kunalverma2512 May 26, 2026 10:33
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.

Refactor ApexAIPage.jsx into Modular Reusable Components with Improved Responsive Architecture

2 participants