fix: sofortige visuelle Aktivierung der Navigationsbuttons beim Klick

- activeLink direkt beim Klick auf Link setzen, statt auf usePathname zu warten
- verbessert visuelles Feedback bei Navigation
- behebt kurze Verzögerung beim Wechsel der aktiven Navigation
This commit is contained in:
ISA
2025-07-08 10:41:20 +02:00
parent 976f3126f2
commit 0f233ce6e2
6 changed files with 21 additions and 15 deletions

View File

@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
NEXT_PUBLIC_EXPORT_STATIC=false
NEXT_PUBLIC_USE_CGI=false
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.559
NEXT_PUBLIC_APP_VERSION=1.6.560
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
NEXT_PUBLIC_EXPORT_STATIC=true
NEXT_PUBLIC_USE_CGI=true
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.559
NEXT_PUBLIC_APP_VERSION=1.6.560
NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,8 @@
## [1.6.560] 2025-07-08
- feat: Verwende fetch statt window.location.href für Digitalausgang-Schalteraktionen
---
## [1.6.559] 2025-07-08
- circle Button

View File

@@ -45,16 +45,17 @@ const Navigation: React.FC<NavigationProps> = ({ className }) => {
{item.name}
</div>
) : (
<Link href={formatPath(item.path)}>
<div
className={`block px-4 py-2 mb-4 font-bold whitespace-nowrap transition duration-300 text-[1rem] sm:text-[1rem] md:text-[1rem] lg:text-[1rem] xl:text-sm 2xl:text-lg ${
activeLink.startsWith(item.path)
? "bg-sky-500 text-white rounded-r-full xl:mr-4 xl:w-full"
: "text-black hover:bg-gray-200 rounded-r-full"
}`}
>
{item.name}
</div>
<Link
href={formatPath(item.path)}
prefetch={false}
onClick={() => setActiveLink(item.path)} // Sofortige visuelle Rückmeldung
className={`block px-4 py-2 mb-4 font-bold whitespace-nowrap transition duration-300 text-[1rem] sm:text-[1rem] md:text-[1rem] lg:text-[1rem] xl:text-sm 2xl:text-lg ${
activeLink.startsWith(item.path)
? "bg-sky-500 text-white rounded-r-full xl:mr-4 xl:w-full"
: "text-black hover:bg-gray-200 rounded-r-full"
}`}
>
{item.name}
</Link>
)}
</div>

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "cpl-v4",
"version": "1.6.559",
"version": "1.6.560",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cpl-v4",
"version": "1.6.559",
"version": "1.6.560",
"dependencies": {
"@fontsource/roboto": "^5.1.0",
"@headlessui/react": "^2.2.4",

View File

@@ -1,6 +1,6 @@
{
"name": "cpl-v4",
"version": "1.6.559",
"version": "1.6.560",
"private": true,
"scripts": {
"dev": "next dev",