From 33fe20021afc45312d6f53645cc3424b20543c73 Mon Sep 17 00:00:00 2001 From: Kshitij <160704796+kshitij-ka@users.noreply.github.com> Date: Sun, 3 May 2026 00:16:05 +0530 Subject: [PATCH] refactor: remove emoji icons and normalize dashes in client UI. --- web/client/src/api/standards.js | 2 +- web/client/src/components/StandardModal.jsx | 9 +------ web/client/src/pages/Categories.jsx | 30 --------------------- web/client/src/pages/Home.jsx | 11 ++++---- web/client/src/pages/Recommend.jsx | 9 +++---- web/client/src/pages/Standards.jsx | 6 ++--- 6 files changed, 13 insertions(+), 54 deletions(-) diff --git a/web/client/src/api/standards.js b/web/client/src/api/standards.js index 232e374..3a18846 100644 --- a/web/client/src/api/standards.js +++ b/web/client/src/api/standards.js @@ -13,7 +13,7 @@ async function safeFetch(url, options = {}) { try { res = await fetch(url, options); } catch (networkErr) { - const err = new Error(`Network error — is the server running? (${networkErr.message})`); + const err = new Error(`Network error - is the server running? (${networkErr.message})`); err.cause = networkErr; throw err; } diff --git a/web/client/src/components/StandardModal.jsx b/web/client/src/components/StandardModal.jsx index d048795..9c68814 100644 --- a/web/client/src/components/StandardModal.jsx +++ b/web/client/src/components/StandardModal.jsx @@ -86,9 +86,7 @@ export default function StandardModal({ standard, onClose }) { ref={closeBtnRef} onClick={onClose} aria-label={t("modal.closeLabel")} - > - ✕ - + /> {/* Standard detail */} @@ -128,7 +126,6 @@ export default function StandardModal({ standard, onClose }) { {/* AI chat panel */}

- {t("modal.askAI")}

@@ -136,15 +133,11 @@ export default function StandardModal({ standard, onClose }) {
{messages.map((m, i) => (
- {m.role === "ai" && ( - - )}

{m.text}

))} {asking && (
- diff --git a/web/client/src/pages/Categories.jsx b/web/client/src/pages/Categories.jsx index 6eb4012..9e83ed5 100644 --- a/web/client/src/pages/Categories.jsx +++ b/web/client/src/pages/Categories.jsx @@ -4,33 +4,6 @@ import { useTranslation } from "react-i18next"; import { fetchCategories } from "../api/standards"; import "./Categories.css"; -const CATEGORY_ICONS = { - "Adhesives": "🧲", - "Bitumen and Tar Products": "🛣️", - "Builder's Hardware": "🔩", - "Building Limes": "🪨", - "Cement and Concrete": "🏗️", - "Concrete Reinforcement": "⚙️", - "Doors, Windows and Shutters": "🚪", - "Electrical Installations": "⚡", - "Floor, Wall, Roof Coverings and Finishes": "🏛️", - "Gypsum Building Materials": "🏺", - "Light Metal and Their Alloys": "🔧", - "Paints, Varnishes and Allied Products": "🎨", - "Pipes and Fittings": "🔧", - "Sanitary Appliances and Water Fittings": "🚿", - "Stones": "🪨", - "Structural Shapes": "📐", - "Structural Steels": "🏗️", - "Thermal Insulation Materials": "🌡️", - "Threaded Fasteners and Rivets": "🔩", - "Timber": "🪵", - "Water Proofing and Damp Proofing Materials": "💧", - "Welding Electrodes and Wires": "🔌", - "Wire Ropes and Wire Products": "🪢", - "Wood Products": "🪵", - "Wood Products for Building": "🏠", -}; export default function Categories() { const { t } = useTranslation(); @@ -76,9 +49,6 @@ export default function Categories() { role="listitem" onClick={() => navigate(`/standards?category=${encodeURIComponent(cat.name)}`)} > - {cat.name} {t("categories.standardCount", { count: cat.count })} diff --git a/web/client/src/pages/Home.jsx b/web/client/src/pages/Home.jsx index 5cd8a0c..8433618 100644 --- a/web/client/src/pages/Home.jsx +++ b/web/client/src/pages/Home.jsx @@ -23,10 +23,10 @@ export default function Home() { }; const PILLARS = [ - { icon: "⚡", titleKey: "home.pillar_instantRetrieval_title", bodyKey: "home.pillar_instantRetrieval_body" }, - { icon: "📐", titleKey: "home.pillar_sectionDetail_title", bodyKey: "home.pillar_sectionDetail_body" }, - { icon: "🗂", titleKey: "home.pillar_categories_title", bodyKey: "home.pillar_categories_body" }, - { icon: "🔒", titleKey: "home.pillar_officialSource_title", bodyKey: "home.pillar_officialSource_body" }, + { titleKey: "home.pillar_instantRetrieval_title", bodyKey: "home.pillar_instantRetrieval_body" }, + { titleKey: "home.pillar_sectionDetail_title", bodyKey: "home.pillar_sectionDetail_body" }, + { titleKey: "home.pillar_categories_title", bodyKey: "home.pillar_categories_body" }, + { titleKey: "home.pillar_officialSource_title", bodyKey: "home.pillar_officialSource_body" }, ]; return ( @@ -116,9 +116,8 @@ export default function Home() {
- {PILLARS.map(({ icon, titleKey, bodyKey }) => ( + {PILLARS.map(({ titleKey, bodyKey }) => (
-

{t(titleKey)}

{t(bodyKey)}

diff --git a/web/client/src/pages/Recommend.jsx b/web/client/src/pages/Recommend.jsx index bb4f101..409b211 100644 --- a/web/client/src/pages/Recommend.jsx +++ b/web/client/src/pages/Recommend.jsx @@ -128,8 +128,8 @@ export default function Recommend() { {loading && (
- - + +
)} @@ -232,10 +232,9 @@ function LatencyBadge({ label, ms, accent, bold }) { ); } -function LoadingStep({ icon, label, delay }) { +function LoadingStep({ label, delay }) { return (
- {label}
); @@ -251,7 +250,7 @@ function SearchIcon() { } function SpinIcon() { - return ; + return
@@ -131,7 +129,7 @@ export default function Standards() { {loading ? t("standards.searching") : t("standards.found", { count: meta.total })} - {!loading && meta.total > 0 && ` — ${t("standards.page", { page: meta.page, total: meta.totalPages })}`} + {!loading && meta.total > 0 && ` -- ${t("standards.page", { page: meta.page, total: meta.totalPages })}`}

)}