From 3f0f9dd270baa683f5c8c711d200f552e13b03b9 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 13:52:21 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Improve=20Login=20acc?= =?UTF-8?q?essibility=20and=20add=20loading=20states?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replaced browser alert() with managed state for login errors. - Added loading state and spinner to the LoginView login button. - Added visually hidden labels and ARIA attributes for better accessibility in LoginView. - Added ARIA labels to icon-only buttons in ChatView and Sidebar. - Added LoadingIcon to components/Icons.tsx. Co-authored-by: BenjaminWie <54136562+BenjaminWie@users.noreply.github.com> --- .Jules/palette.md | 3 +++ App.tsx | 4 ++-- components/ChatView.tsx | 2 ++ components/Icons.tsx | 4 +++- components/LoginView.tsx | 41 ++++++++++++++++++++++++++++++++-------- components/Sidebar.tsx | 2 +- 6 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 .Jules/palette.md diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 0000000..5fccd9b --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,3 @@ +## 2024-05-22 - [Login Accessibility & Loading States] +**Learning:** Replacing browser `alert()` with managed state in the Login component allows for better UX (loading spinners, inline error messages) and improved accessibility (ARIA attributes). +**Action:** Always prefer inline validation over `alert()` for better user experience and screen reader support. Use `sr-only` for hidden labels. diff --git a/App.tsx b/App.tsx index 28169f5..d2bae80 100644 --- a/App.tsx +++ b/App.tsx @@ -100,9 +100,9 @@ const App: React.FC = () => { const user = users.find(u => u.email.toLowerCase() === email.toLowerCase() && u.status === 'aktiv'); if (user) { setCurrentUser(user); - } else { - alert("Zugang verweigert. Nur verifizierte Wohnpro-Bewohner können sich im Wohnpro Guide anmelden."); + return true; } + return false; }; const sendMessage = async (text: string) => { diff --git a/components/ChatView.tsx b/components/ChatView.tsx index 43534f2..bedfca7 100644 --- a/components/ChatView.tsx +++ b/components/ChatView.tsx @@ -164,12 +164,14 @@ const ChatView: React.FC = ({ messages, onSendMessage, onEnterVoi onClick={onEnterVoice} className="p-3.5 text-gray-400 hover:text-green-600 transition-all rounded-full hover:bg-gray-50 active:scale-90" title="Sprachmodus" + aria-label="Sprachmodus starten" > diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index cb713bf..fb8530c 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -27,7 +27,7 @@ const Sidebar: React.FC = ({ isOpen, onClose, sessions, currentVie
Wohnpro Guide -