Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update autofill popup UI (#541)
Leendert de Borstd6c3bd5cc1dc
diff --git a/browser-extensions/chrome/src/app/context/WebApiContext.tsx b/browser-extensions/chrome/src/app/context/WebApiContext.tsxindex fb639d1a7..21e813f9c 100644--- a/browser-extensions/chrome/src/app/context/WebApiContext.tsx+++ b/browser-extensions/chrome/src/app/context/WebApiContext.tsx@@ -19,22 +19,6 @@ export const WebApiProvider: React.FC<{ children: React.ReactNode }> = ({ childrlogout);setWebApiService(service);-- /**- * Handles changes to the API URL in storage.- * Initializes the base URL when the API URL changes.- */- const handleStorageChange = (changes: { [key: string]: chrome.storage.StorageChange }) : void => {- if (changes.apiUrl) {- service.initializeBaseUrl();- }- };-- chrome.storage.onChanged.addListener(handleStorageChange);-- return () : void => {- chrome.storage.onChanged.removeListener(handleStorageChange);- };}, [logout]);if (!webApiService) {diff --git a/browser-extensions/chrome/src/app/pages/CredentialsList.tsx b/browser-extensions/chrome/src/app/pages/CredentialsList.tsxindex a87438d56..65c1adc1f 100644--- a/browser-extensions/chrome/src/app/pages/CredentialsList.tsx+++ b/browser-extensions/chrome/src/app/pages/CredentialsList.tsx@@ -8,7 +8,6 @@ import { useWebApi } from '../context/WebApiContext';import { VaultResponse } from '../../shared/types/webapi/VaultResponse';import ReloadButton from '../components/ReloadButton';import { useAuth } from '../context/AuthContext';-import { StatusResponse } from '../../shared/types/webapi/StatusResponse';import LoadingSpinner from '../components/LoadingSpinner';import { useMinDurationLoading } from '../hooks/useMinDurationLoading';@@ -62,7 +61,7 @@ const CredentialsList: React.FC = () => {} catch (err) {console.error('Refresh error:', err);}- }, [dbContext, webApi, authContext, hideLoading, setIsInitialLoading, setIsLoading]);+ }, [dbContext, webApi, authContext, hideLoading, setIsLoading]);useEffect(() => {/**diff --git a/browser-extensions/chrome/src/app/pages/Home.tsx b/browser-extensions/chrome/src/app/pages/Home.tsxindex 0635e644b..6b1e8fd69 100644--- a/browser-extensions/chrome/src/app/pages/Home.tsx+++ b/browser-extensions/chrome/src/app/pages/Home.tsx@@ -6,7 +6,6 @@ import UnlockSuccess from './UnlockSuccess';import { useNavigate } from 'react-router-dom';import { useDb } from '../context/DbContext';import { useLoading } from '../context/LoadingContext';-import { useWebApi } from '../context/WebApiContext';/*** Home page that shows the correct page based on the user's authentication state.diff --git a/browser-extensions/chrome/src/app/pages/Unlock.tsx b/browser-extensions/chrome/src/app/pages/Unlock.tsxindex 55b5c5e20..bdc4ca763 100644--- a/browser-extensions/chrome/src/app/pages/Unlock.tsx+++ b/browser-extensions/chrome/src/app/pages/Unlock.tsx@@ -24,7 +24,10 @@ const Unlock: React.FC = () => {const { showLoading, hideLoading } = useLoading();useEffect(() => {- const checkStatus = async () => {+ /**+ * Make status call to API which acts as health check.+ */+ const checkStatus = async () : Promise<void> => {const status = await webApi.getStatus();if (!status.supported) {authContext.logout('The browser extension is outdated. Please update to the latest version.');diff --git a/browser-extensions/chrome/src/background/VaultMessageHandler.ts b/browser-extensions/chrome/src/background/VaultMessageHandler.tsindex 705512db4..e1c83fe1c 100644--- a/browser-extensions/chrome/src/background/VaultMessageHandler.ts+++ b/browser-extensions/chrome/src/background/VaultMessageHandler.ts@@ -6,7 +6,6 @@ import { WebApiService } from '../shared/WebApiService';import { Vault } from '../shared/types/webapi/Vault';import { Credential } from '../shared/types/Credential';import { VaultResponse } from '../shared/types/webapi/VaultResponse';-import { StatusResponse } from '../shared/types/webapi/StatusResponse';/*** Store the vault in browser storage.@@ -46,7 +45,6 @@ export async function handleSyncVault(sendResponse: (response: any) => void) : Promise<void> {const webApi = new WebApiService(() => {});- await webApi.initializeBaseUrl();const response = await webApi.getStatus();if (!response.supported) {@@ -312,7 +310,6 @@ async function uploadNewVaultToServer(sqliteClient: SqliteClient, vaultState: Va};const webApi = new WebApiService(() => {});- await webApi.initializeBaseUrl();const response = await webApi.post('Vault', newVault) as { status: number, newRevisionNumber: number };// Check if response is successful (.status === 0)diff --git a/browser-extensions/chrome/src/contentScript/Popup.ts b/browser-extensions/chrome/src/contentScript/Popup.tsindex bb3c038db..3ffb48288 100644--- a/browser-extensions/chrome/src/contentScript/Popup.ts+++ b/browser-extensions/chrome/src/contentScript/Popup.ts@@ -29,11 +29,8 @@ export function createBasePopup(input: HTMLInputElement) : HTMLElement {const popup = document.createElement('div');popup.id = 'aliasvault-credential-popup';- // Get input width- const inputWidth = input.offsetWidth;-// Set popup width to match input width, with min/max constraints- const popupWidth = Math.max(360, Math.min(640, inputWidth));+ const popupWidth = 400;popup.style.cssText = `position: absolute;@@ -41,8 +38,7 @@ export function createBasePopup(input: HTMLInputElement) : HTMLElement {background: ${isDarkMode() ? '#1f2937' : 'white'};border: 1px solid ${isDarkMode() ? '#374151' : '#ccc'};border-radius: 4px;- box-shadow: 0 2px 4px ${isDarkMode() ? 'rgba(0,0,0,0.4)' : 'rgba(0,0,0,0.2)'};- padding: 8px 0;+ box-shadow: 0 2px 10px ${isDarkMode() ? 'rgba(0,0,0,0.6)' : 'rgba(0,0,0,0.4)'};width: ${popupWidth}px;color: ${isDarkMode() ? '#f8f9fa' : '#000000'};font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;@@ -50,8 +46,8 @@ export function createBasePopup(input: HTMLInputElement) : HTMLElement {// Position popup below inputconst rect = input.getBoundingClientRect();- popup.style.top = `${rect.bottom + window.scrollY + 2}px`;- popup.style.left = `${rect.left + window.scrollX}px`;+ popup.style.top = `${rect.bottom + window.scrollY + 6}px`;+ popup.style.left = `${rect.left + window.scrollX + 2}px`;return popup;}@@ -153,8 +149,10 @@ export function createAutofillPopup(input: HTMLInputElement, credentials: Credenconst actionContainer = document.createElement('div');actionContainer.style.cssText = `display: flex;+ padding-left: 8px;+ padding-right: 8px;+ padding-bottom: 8px;gap: 8px;- padding: 8px 16px;`;// Create New button@@ -172,6 +170,7 @@ export function createAutofillPopup(input: HTMLInputElement, credentials: Credenalign-items: center;justify-content: center;gap: 4px;+ transition: background-color 0.2s ease;`;createButton.innerHTML = `@@ -182,6 +181,15 @@ export function createAutofillPopup(input: HTMLInputElement, credentials: CredenNew`;+ // Add hover event listeners+ createButton.addEventListener('mouseenter', () => {+ createButton.style.backgroundColor = isDarkMode() ? '#d68338' : '#f49541'; // primary-600 : primary-500+ });++ createButton.addEventListener('mouseleave', () => {+ createButton.style.backgroundColor = isDarkMode() ? '#374151' : '#f3f4f6';+ });+createButton.addEventListener('click', async () => {const serviceName = await createEditNamePopup(document.title);if (!serviceName) return; // User cancelled@@ -335,13 +343,27 @@ export function createAutofillPopup(input: HTMLInputElement, credentials: Credendisplay: flex;align-items: center;justify-content: center;+ transition: all 0.2s ease;`;+closeButton.innerHTML = `- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">- <line x1="18" y1="6" x2="6" y2="18"></line>- <line x1="6" y1="6" x2="18" y2="18"></line>- </svg>- `;+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">+ <line x1="18" y1="6" x2="6" y2="18"></line>+ <line x1="6" y1="6" x2="18" y2="18"></line>+ </svg>+`;++ // Add hover event listeners+ closeButton.addEventListener('mouseenter', () => {+ closeButton.style.backgroundColor = isDarkMode() ? '#dc2626' : '#ef4444'; // red-600 : red-500+ closeButton.style.color = '#ffffff'; // White text on hover+ });++ closeButton.addEventListener('mouseleave', () => {+ closeButton.style.backgroundColor = isDarkMode() ? '#374151' : '#f3f4f6';+ closeButton.style.color = isDarkMode() ? '#e5e7eb' : '#374151';+ });+closeButton.addEventListener('click', async () => {await disableAutoShowPopup();removeExistingPopup();@@ -497,7 +519,8 @@ function createCredentialList(credentials: Credential[]): HTMLElement[] {font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;transition: background-color 0.2s ease;border-radius: 4px;- margin: 0 4px;+ width: 100%;+ box-sizing: border-box;`;// Create container for credential info (logo + username)@@ -510,6 +533,7 @@ function createCredentialList(credentials: Credential[]): HTMLElement[] {padding: 4px;border-radius: 4px;transition: background-color 0.2s ease;+ min-width: 0; /* Enable text truncation */`;const imgElement = document.createElement('img');@@ -535,7 +559,8 @@ function createCredentialList(credentials: Credential[]): HTMLElement[] {display: flex;flex-direction: column;flex-grow: 1;- min-width: 0; /* Enable text truncation in flex container */+ min-width: 0; /* Enable text truncation */+ margin-right: 8px; /* Add space between text and popout icon */`;// Service name (primary text)@@ -581,6 +606,7 @@ function createCredentialList(credentials: Credential[]): HTMLElement[] {padding: 4px;opacity: 0.6;border-radius: 4px;+ flex-shrink: 0; /* Prevent icon from shrinking */`;popoutIcon.innerHTML = `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">