fix: restore and stabilize tab navigation with Alpine.js
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.12) (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Type Check (push) Has been cancelled
CI / Summary (push) Has been cancelled

- Fixed navigation blockage by moving Alpine state to body scope
- Resolved CSS display conflicts between legacy .active class and x-show
- Synchronized legacy auth logic with Alpine global state
- Redirected legacy switchTab calls to Alpine events
- Removed obsolete tabs.js and updated home section initialization
- Added E2E navigation test placeholder
This commit is contained in:
root
2026-03-24 12:19:57 +00:00
parent 5c7116557d
commit 69e14afedf
7 changed files with 64 additions and 64 deletions
+16 -3
View File
@@ -91,14 +91,27 @@ async function checkAuth() {
if (response.ok) {
const data = await response.json();
// Log for debugging
console.log('Auth check successful for:', data.user.username);
// Dispatch event for Alpine.js global state
window.dispatchEvent(new CustomEvent('auth-success', {
detail: { username: data.user.full_name || data.user.username }
}));
// Set global auth state in case dispatch was too early
if (window.Alpine) {
const body = document.querySelector('body');
if (body && body.__x) {
body.__x.$data.isAuthenticated = true;
body.__x.$data.username = data.user.full_name || data.user.username;
}
}
return true;
} else {
}
else {
// Token invalid, remove it and redirect
removeToken();
redirectToLogin();