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 -