Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 23, 2025

Overview

This PR removes all LiveChat functionality and references from the codebase, as it's no longer needed and routes are configured for the home page only. This cleanup removes over 800 lines of unused code and reduces the production bundle size by approximately 19 KB.

Changes Made

Deleted Files and Directories

  • LiveChat Page: Removed entire src/pages/LiveChat/ directory including index.tsx and components/PageLayout.tsx
  • Chat Components: Removed entire src/components/chat/ directory containing 8 component files:
    • AdminLogin.tsx, ChatHeader.tsx, Message.tsx, MessageInput.tsx
    • MessageList.tsx, NameInput.tsx, types.ts, useChatState.ts
  • Main Chat Interface: Removed src/components/ChatInterface.tsx

Updated Files

src/config/i18n.ts

  • Removed entire chat object from Translation interface (17 properties)
  • Removed chat translations from both French and English language objects
  • Removed unused liveChat key from buttons translations

src/components/ContactButtons.tsx

  • Changed Google Meet button label from t.buttons.liveChat to hardcoded "Google Meet" string

src/components/ContactCard.tsx

  • Removed ChatInterface import
  • Removed showChat state variable
  • Removed conditional rendering block for chat interface (18 lines)

public/sitemap.xml

  • Removed /livechat URL entry to reflect current routing structure

Impact

Bundle Size Reduction

  • Main JS bundle: 47.11 KB → 32.40 KB (14.71 KB / 31% reduction)
  • CSS bundle: 28.10 KB → 23.97 KB (4.13 KB / 15% reduction)
  • Total production bundle reduction: ~18.84 KB

Code Quality

  • 825 lines of unused code removed
  • ✅ All linting checks passing
  • ✅ All builds successful
  • ✅ CodeQL security scan shows 0 alerts
  • ✅ No remaining references to removed functionality

Testing

  • ✅ Verified successful build with npm run build
  • ✅ Verified linting passes with npm run lint
  • ✅ Confirmed no broken imports or references remain
  • ✅ Verified Google Meet button still functions correctly with direct link

Notes

The Google Meet button now uses a hardcoded label and directly opens the Google Chat room URL. The application maintains its core functionality while being significantly lighter and more maintainable.

Original prompt

Complete LiveChat Removal from hlsitech.com

Objective

Remove ALL LiveChat functionality and references from the codebase since it's no longer needed and routes are configured for home page only.

Files and Folders to DELETE

1. Delete Entire LiveChat Page Folder

  • src/pages/LiveChat/index.tsx
  • src/pages/LiveChat/components/PageLayout.tsx
  • Entire src/pages/LiveChat/ directory

2. Delete Entire Chat Components Folder

  • src/components/chat/AdminLogin.tsx
  • src/components/chat/ChatHeader.tsx
  • src/components/chat/Message.tsx
  • src/components/chat/MessageInput.tsx
  • src/components/chat/MessageList.tsx
  • src/components/chat/NameInput.tsx
  • src/components/chat/types.ts
  • src/components/chat/useChatState.ts
  • Entire src/components/chat/ directory

3. Delete Main Chat Interface

  • src/components/ChatInterface.tsx

Files to UPDATE (Remove Chat References)

4. Update src/config/i18n.ts

Remove the entire chat object from both fr and en translations (lines ~90-183):

DELETE these sections:

chat: {
  title: "Chat en direct",
  enterName: "Entrez votre nom pour commencer",
  namePlaceholder: "Votre nom",
  startChat: "Commencer le chat",
  privacyNotice: "...",
  messagePlaceholder: "Tapez votre message...",
  initialGreeting: "Bonjour {name} ! Comment puis-je vous aider aujourd'hui ?",
  defaultResponse: "Merci pour votre message ! Je vous répondrai sous peu.",
  chooseLanguage: "Choisissez votre langue de chat :",
  french: "Français",
  english: "Anglais",
  adminLogin: "Connexion administrateur",
  emailPlaceholder: "Email",
  passwordPlaceholder: "Mot de passe",
  loginButton: "Se connecter",
  invalidCredentials: "Email ou mot de passe invalide",
  adminMode: "Mode administrateur",
},

Also remove from the Translation interface at the top:

chat: {
  title: string;
  enterName: string;
  namePlaceholder: string;
  startChat: string;
  privacyNotice: string;
  messagePlaceholder: string;
  initialGreeting: string;
  defaultResponse: string;
  chooseLanguage: string;
  french: string;
  english: string;
  adminLogin: string;
  emailPlaceholder: string;
  passwordPlaceholder: string;
  loginButton: string;
  invalidCredentials: string;
  adminMode: string;
};

5. Update src/components/ContactButtons.tsx

Change the Google Meet button label from t.buttons.liveChat to t.buttons.googleMeet

Around line 73, change:

<span className={textTransitionClass}>{t.buttons.liveChat}</span>

To:

<span className={textTransitionClass}>Google Meet</span>

6. Update src/components/ContactCard.tsx

Remove chat-related imports and state:

DELETE these lines (~line 3):

import { ChatInterface } from "../../components/ChatInterface";

DELETE this state (~line 22):

const [showChat, setShowChat] = useState(false); // Keeping this state for future use

DELETE the entire chat conditional render (~lines 45-60):

if (showChat) {
  return (
    <div className={`...`}>
      <ChatInterface
        isOpen={true}
        onClose={() => setShowChat(false)}
        isDark={isDark}
        isEmbedded={true}
        t={t}
      />
    </div>
  );
}

7. Update public/sitemap.xml

Remove the /livechat URL entry (lines 69-73):

DELETE:

<url>
  <loc>https://hlsitech.com/livechat</loc>
  <lastmod>2025-10-09</lastmod>
  <changefreq>monthly</changefreq>
  <priority>0.6</priority>
</url>

Expected Results After Cleanup

✅ No LiveChat page or functionality
✅ No chat-related folders or files
✅ Clean i18n translations (no chat keys)
✅ Updated ContactButtons without liveChat reference
✅ Clean ContactCard without chat imports
✅ Updated sitemap without /livechat
✅ Smaller bundle size
✅ No unused code or dependencies

Files Summary

DELETE (11 files + 2 folders):

  • src/pages/LiveChat/ (entire folder)
  • src/components/chat/ (entire folder)
  • src/components/ChatInterface.tsx

UPDATE (4 files):

  • src/config/i18n.ts (remove chat translations)
  • src/components/ContactButtons.tsx (update button label)
  • src/components/ContactCard.tsx (remove chat imports/state)
  • public/sitemap.xml (remove /livechat URL)

Notes

  • The routes file (src/routes/index.tsx) already only has the home route
  • No dependencies need to be removed from package.json (emailjs is used elsewhere)
  • This cleanup will reduce bundle size and remove ~1500+ lines of unused code

This pull request was created as a result of the following prompt from Copilot chat.

Complete LiveChat Removal from hlsitech.com

Objective

Remove ALL LiveChat functionality and references from the codebase since it's no longer needed and routes are configured for home page only.

Files and Folders to DELETE

1. Delete Entire LiveChat Page Folder

  • src/pages/LiveChat/index.tsx
  • src/pages/LiveChat/components/PageLayout.tsx
  • Entire src/pages/LiveChat/ directory

2. Delete Entire Chat Components Folder

  • src/components/chat/AdminLogin.tsx
  • src/components/chat/ChatHeader.tsx
  • src/components/chat/Message.tsx
  • src/components/chat/MessageInput.tsx
  • src/components/chat/MessageList.tsx
  • src/components/chat/NameInput.tsx
  • src/components/chat/types.ts
  • src/components/chat/useChatState.ts
  • Entire src/components/chat/ directory

3. Delete Main Chat Interface

  • src/components/ChatInterface.tsx

Files to UPDATE (Remove Chat References)

4. Update src/config/i18n.ts

Remove the entire chat object from both fr and en translations (lines ~90-183):

DELETE these sections:

chat: {
  title: "Chat en direct",
  enterName: "Entrez votre nom pour commencer",
  namePlaceholder: "Votre nom",
  startChat: "Commencer le chat",
  privacyNotice: "...",
  messagePlaceholder: "Tapez votre message...",
  initialGreeting: "Bonjour {name} ! Comment puis-je vous aider aujourd'hui ?",
  defaultResponse: "Merci pour votre message ! Je vous répondrai sous peu.",
  chooseLanguage: "Choisissez votre langue de chat :",
  french: "Français",
  english: "Anglais",
  adminLogin: "Connexion administrateur",
  emailPlaceholder: "Email",
  passwordPlaceholder: "Mot de passe",
  loginButton: "Se connecter",
  invalidCredentials: "Email ou mot de passe invalide",
  adminMode: "Mode administrateur",
},

Also remove from the Translation interface at the top:

chat: {
  title: string;
  enterName: string;
  namePlaceholder: string;
  startChat: string;
  privacyNotice: string;
  messagePlaceholder: string;
  initialGreeting: string;
  defaultResponse: string;
  chooseLanguage: string;
  french: string;
  english: string;
  adminLogin: string;
  emailPlaceholder: string;
  passwordPlaceholder: string;
  loginButton: string;
  invalidCredentials: string;
  adminMode: string;
};

5. Update src/components/ContactButtons.tsx

Change the Google Meet button label from t.buttons.liveChat to t.buttons.googleMeet

Around line 73, change:

<span className={textTransitionClass}>{t.buttons.liveChat}</span>

To:

<span className={textTransitionClass}>Google Meet</span>

6. Update src/components/ContactCard.tsx

Remove chat-related imports and state:

DELETE these lines (~line 3):

import { ChatInterface } from "../../components/ChatInterface";

DELETE this state (~line 22):

const [showChat, setShowChat] = useState(false); // Keeping this state for future use

DELETE the entire chat conditional render (~lines 45-60):

if (showChat) {
  return (
    <div className={`...`}>
      <ChatInterface
        isOpen={true}
        onClose={() => setShowChat(false)}
        isDark={isDark}
        isEmbedded={true}
        t={t}
      />
    </div>
  );
}

7. Update public/sitemap.xml

Remove the /livechat URL entry (lines 69-73):

DELETE:

<url>
  <loc>https://hlsitech.com/livechat</loc>
  <lastmod>2025-10-09</lastmod>
  <changefreq>monthly</changefreq>
  <priority>0.6</priority>
</url>

Expected Results After Cleanup

✅ No LiveChat page or functionality
✅ No chat-related folders or files
✅ Clean i18n translations (no chat keys)
✅ Updated ContactButtons without liveChat reference
✅ Clean ContactCard without chat imports
✅ Updated sitemap without /livechat
✅ Smaller bundle size
✅ No unused code or dependencies

Files Summary

DELETE (11 files + 2 folders):

  • src/pages/LiveChat/ (entire folder)
  • src/components/chat/ (entire folder)
  • src/components/ChatInterface.tsx

UPDATE (4 files):

  • src/config/i18n.ts (remove chat translations)
  • src/components/ContactButtons.tsx (update button label)
  • src/components/ContactCard.tsx (remove chat imports/state)
  • public/sitemap.xml (remove /livechat URL)

Notes

  • The routes file (src/routes/index.tsx) already only has the home route
  • No dependencies need to be removed from package.json (emailjs is used elsewhere)
  • This cleanup will reduce bundle size and remove ~1500+ lines of unused code

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@docs-page
Copy link

docs-page bot commented Oct 23, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/hlsitechio/hlsitech.com~22

Documentation is deployed and generated using docs.page.

@netlify
Copy link

netlify bot commented Oct 23, 2025

Deploy Preview for hlsitech ready!

Name Link
🔨 Latest commit a79da2a
🔍 Latest deploy log https://app.netlify.com/projects/hlsitech/deploys/68fa77e2a8b2e60009cb3b28
😎 Deploy Preview https://deploy-preview-22.hlsitech.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI and others added 2 commits October 23, 2025 18:43
…nces

Co-authored-by: hlsitechio <68784598+hlsitechio@users.noreply.github.com>
Co-authored-by: hlsitechio <68784598+hlsitechio@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove all LiveChat functionality from codebase Complete LiveChat removal - delete unused chat functionality and reduce bundle size Oct 23, 2025
Copilot AI requested a review from hlsitechio October 23, 2025 18:48
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