Conversation
There was a problem hiding this comment.
Pull request overview
Adds post-login identity visibility in the header and improves login form usability by focusing the username field on navigation to the login page.
Changes:
- Display the authenticated user’s username next to the user icon in the header dropdown trigger.
- Auto-focus the username input when the login page mounts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/organisms/Login.vue | Adds a template ref + onMounted focus for the username input to streamline login. |
| src/components/molecules/UserDropdown.vue | Renders the current username beside the user icon in the authenticated header control. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @agarny, the layout of the username and icon has been updated. https://akhuoa.github.io/pmrapp-frontend/ Username
Error message
|
|
Thanks @akhuoa, this looks much better! Regarding the error message:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/components/molecules/UserDropdown.vue:103
role="menu"/role="menuitem"introduce the WAI-ARIA menu pattern, which generally requires keyboard support (arrow key navigation, focus management) to be conformant. Currently the dropdown only toggles on click and doesn’t manage focus/keyboard interactions, so assistive tech may announce it as a menu but users can’t interact with it as expected.
Either implement the full menu keyboard behavior (and consider keeping the menu in the DOM via v-show so aria-controls always references an existing element), or drop the menu/menuitem roles and treat it as a simple popup/list.
<template>
<div v-if="authStore.isAuthenticated" ref="dropdownRef" class="relative">
<button
@click="toggleDropdown"
class="nav-link p-2 transition-colors cursor-pointer relative"
:aria-label="buttonLabel"
aria-haspopup="true"
:aria-expanded="isOpen"
:aria-controls="menuId"
>
<UserIcon class="w-5 h-5" />
<span class="absolute top-full left-1/2 transform -translate-x-1/2 -mt-2 text-xs text-gray-700 dark:text-gray-300 max-w-[4.6rem] truncate hidden sm:inline">
{{ authStore.username }}
</span>
<span class="sr-only sm:hidden">
{{ authStore.username }}
</span>
</button>
<div
v-if="isOpen"
:id="menuId"
role="menu"
class="absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-200 dark:border-gray-700 py-1 z-50"
>
<button
@click="confirmLogout"
class="w-full cursor-pointer text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"
role="menuitem"
>
Log out
</button>
</div>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@agarny, thanks for the review. Also added a function to focus on the username input when the user clicks on "Log in" again. e069dbc All these updates are available on https://akhuoa.github.io/pmrapp-frontend/login. |


Fixes #121 and #80.
Changes
The changes are available on https://akhuoa.github.io/pmrapp-frontend/ for testing.