From ad2b6b96f3409ca1af5f45b9faddcc87a9651efc Mon Sep 17 00:00:00 2001 From: Vishnu Date: Wed, 7 May 2025 13:56:31 +0530 Subject: [PATCH] Add tooltips to various components and improve styling for better user experience --- .../layout/sidebarRight/SideBarRight.tsx | 4 ++ .../templates/CollaborationPopup.tsx | 38 +++++------ app/src/components/ui/Tools.tsx | 18 ++++-- app/src/components/ui/analysis/ROISummary.tsx | 6 +- .../ui/analysis/ThroughputSummary.tsx | 2 +- app/src/modules/builder/groups/zoneGroup.tsx | 15 +++-- .../visualization/RealTimeVisulization.tsx | 17 +++-- .../floating/DroppedFloatingWidgets.tsx | 2 +- app/src/styles/base/global.scss | 26 ++++++++ app/src/styles/components/input.scss | 2 +- .../components/simulation/analysis.scss | 13 ++-- app/src/styles/components/tools.scss | 14 +++++ app/src/styles/layout/popup.scss | 20 +++--- app/src/styles/layout/sidebar.scss | 63 ++++++++++++++++--- app/src/styles/pages/realTimeViz.scss | 7 ++- 15 files changed, 174 insertions(+), 73 deletions(-) diff --git a/app/src/components/layout/sidebarRight/SideBarRight.tsx b/app/src/components/layout/sidebarRight/SideBarRight.tsx index 97a29d9..0cff6eb 100644 --- a/app/src/components/layout/sidebarRight/SideBarRight.tsx +++ b/app/src/components/layout/sidebarRight/SideBarRight.tsx @@ -66,6 +66,7 @@ const SideBarRight: React.FC = () => { }`} onClick={() => setSubModule("properties")} > +
properties
)} @@ -77,6 +78,7 @@ const SideBarRight: React.FC = () => { }`} onClick={() => setSubModule("simulations")} > +
simulations
diff --git a/app/src/components/templates/CollaborationPopup.tsx b/app/src/components/templates/CollaborationPopup.tsx index d2e1c16..c226b45 100644 --- a/app/src/components/templates/CollaborationPopup.tsx +++ b/app/src/components/templates/CollaborationPopup.tsx @@ -126,29 +126,31 @@ const CollaborationPopup: React.FC = ({
-
-
Who has access
-
-
-
Untitled
-
- {users.length} persons +
+
+
Who has access
+
+
+
Untitled
+
+ {users.length} persons +
-
-
-
-
-
{userName[0]}
- {userName} +
+
+
+
{userName[0]}
+ {userName} +
+
you
-
you
+ {users.map((user, index) => ( + + ))}
- {users.map((user, index) => ( - - ))}
-
+
diff --git a/app/src/components/ui/Tools.tsx b/app/src/components/ui/Tools.tsx index 14bc517..efae4ab 100644 --- a/app/src/components/ui/Tools.tsx +++ b/app/src/components/ui/Tools.tsx @@ -218,6 +218,7 @@ const Tools: React.FC = () => { setActiveTool("cursor"); }} > +
cursor
)} @@ -230,6 +231,7 @@ const Tools: React.FC = () => { setActiveTool("free-hand"); }} > +
free hand
)} @@ -242,6 +244,7 @@ const Tools: React.FC = () => { setActiveTool("delete"); }} > +
delete
)} @@ -315,8 +318,8 @@ const Tools: React.FC = () => { onClick={() => { setActiveTool("draw-wall"); }} - title="Wall" > +
draw wall
{ onClick={() => { setActiveTool("draw-zone"); }} - title="Zone" > +
draw zone
{ onClick={() => { setActiveTool("draw-aisle"); }} - title="Aisle" > +
draw asile
{ onClick={() => { setActiveTool("draw-floor"); }} - title="Floor" > +
draw floor
@@ -366,8 +369,8 @@ const Tools: React.FC = () => { onClick={() => { setActiveTool("measure"); }} - title="Measure" > +
measure scale
@@ -385,6 +388,7 @@ const Tools: React.FC = () => { setActiveTool("pen"); }} > +
pen
@@ -407,6 +411,7 @@ const Tools: React.FC = () => { }); }} > +
save template
@@ -422,6 +427,7 @@ const Tools: React.FC = () => { setActiveTool("comment"); }} > +
comment
{toggleThreeD && ( @@ -433,6 +439,7 @@ const Tools: React.FC = () => { setIsPlaying(!isPlaying); }} > +
play
)} @@ -446,6 +453,7 @@ const Tools: React.FC = () => { }`} onClick={toggleSwitch} > +
toggle view
diff --git a/app/src/components/ui/analysis/ROISummary.tsx b/app/src/components/ui/analysis/ROISummary.tsx index 3923fbd..bf9b410 100644 --- a/app/src/components/ui/analysis/ROISummary.tsx +++ b/app/src/components/ui/analysis/ROISummary.tsx @@ -128,16 +128,16 @@ const ROISummary = ({
+ >
Net Profit
- {roiSummaryData.netProfit} + {roiSummaryData.netProfit ? roiSummaryData.netProfit : roiSummaryData.netLoss}
diff --git a/app/src/components/ui/analysis/ThroughputSummary.tsx b/app/src/components/ui/analysis/ThroughputSummary.tsx index 6a0ad98..57eabd1 100644 --- a/app/src/components/ui/analysis/ThroughputSummary.tsx +++ b/app/src/components/ui/analysis/ThroughputSummary.tsx @@ -16,7 +16,7 @@ const ProductionCapacity = ({ const partialFillPercent = ((progressPercent / 100) * totalBars - barsToFill) * 100; - const isLoading = false; + const isLoading = true; return (
diff --git a/app/src/modules/builder/groups/zoneGroup.tsx b/app/src/modules/builder/groups/zoneGroup.tsx index 1eadd24..3bd9b8d 100644 --- a/app/src/modules/builder/groups/zoneGroup.tsx +++ b/app/src/modules/builder/groups/zoneGroup.tsx @@ -14,8 +14,6 @@ import { useZones, useZonePoints, } from "../../../store/store"; -// import { setZonesApi } from "../../../services/factoryBuilder/zones/setZonesApi"; -// import { deleteZonesApi } from "../../../services/factoryBuilder/zones/deleteZoneApi"; import { getZonesApi } from "../../../services/factoryBuilder/zones/getZonesApi"; import * as CONSTANTS from "../../../types/world/worldConstants"; @@ -37,10 +35,10 @@ const ZoneGroup: React.FC = () => { const { toggleView } = useToggleView(); const { deletePointOrLine, setDeletePointOrLine } = useDeletePointOrLine(); const { removedLayer, setRemovedLayer } = useRemovedLayer(); - const { toolMode, setToolMode } = useToolMode(); + const { toolMode } = useToolMode(); const { movePoint, setMovePoint } = useMovePoint(); - const { deleteTool, setDeleteTool } = useDeleteTool(); - const { activeLayer, setActiveLayer } = useActiveLayer(); + const { setDeleteTool } = useDeleteTool(); + const { activeLayer } = useActiveLayer(); const { socket } = useSocketStore(); const groupsRef = useRef(); @@ -204,6 +202,7 @@ const ZoneGroup: React.FC = () => { socket.emit("v2:zone:set", input); }; + // eslint-disable-next-line react-hooks/exhaustive-deps const updateZoneToBackend = async (zone: { zoneId: string; zoneName: string; @@ -271,6 +270,7 @@ const ZoneGroup: React.FC = () => { socket.emit("v2:zone:delete", input); }; + // eslint-disable-next-line react-hooks/exhaustive-deps const handleDeleteZone = (zoneId: string) => { const updatedZones = zones.filter((zone: any) => zone.zoneId !== zoneId); setZones(updatedZones); @@ -290,7 +290,6 @@ const ZoneGroup: React.FC = () => { ); setZonePoints(updatedzonePoints); } - deleteZoneFromBackend(zoneId); }; @@ -526,11 +525,12 @@ const ZoneGroup: React.FC = () => { setEndPoint(point); } }); + return ( {zones.map((zone: any) => ( - + {zone.points .slice(0, -1) .map((point: [number, number, number], index: number) => { @@ -563,7 +563,6 @@ const ZoneGroup: React.FC = () => { key={index} position={midpoint} rotation={[0, -angle, 0]} - visible={false} > { }); }, [selectedZone]); - useEffect(() => { const handleClickOutside = (event: MouseEvent) => { const editWidgetOptions = document.querySelector( @@ -179,12 +178,22 @@ const RealTimeVisulization: React.FC = () => { -
+
{openConfirmationPopup && ( diff --git a/app/src/modules/visualization/widgets/floating/DroppedFloatingWidgets.tsx b/app/src/modules/visualization/widgets/floating/DroppedFloatingWidgets.tsx index b4a328e..ec86fb6 100644 --- a/app/src/modules/visualization/widgets/floating/DroppedFloatingWidgets.tsx +++ b/app/src/modules/visualization/widgets/floating/DroppedFloatingWidgets.tsx @@ -558,7 +558,7 @@ const DroppedObjects: React.FC = () => { return (