Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update passkey and credential tab switcher (#776)

Leendert de Borst3d2d726562c7
diff --git a/apps/browser-extension/src/entrypoints/contentScript/Popup.ts b/apps/browser-extension/src/entrypoints/contentScript/Popup.ts
index 39690216b..ea5df9dde 100644
--- a/apps/browser-extension/src/entrypoints/contentScript/Popup.ts
+++ b/apps/browser-extension/src/entrypoints/contentScript/Popup.ts
@@ -1145,12 +1145,9 @@ export async function createAutofillPopup(input: HTMLInputElement, items: Item[]
pillNav.appendChild(passkeysPill);
pillNav.appendChild(credentialsPill);
popup.insertBefore(pillNav, popup.firstChild);
-
- // The passkey hint + list sit directly under the nav, above the credential list.
- popup.insertBefore(passkeySection.hint, credentialList);
popup.insertBefore(passkeySection.list, credentialList);
- const whenPasskeysShown = [passkeySection.hint, passkeySection.list];
+ const whenPasskeysShown = [passkeySection.list];
const whenCredentialsShown = [credentialList, divider, actionContainer];
let showingPasskeys = true;
@@ -1415,7 +1412,7 @@ function createPopoutIcon(itemId: string, rootContainer: HTMLElement): HTMLEleme
* recognisably different from the credential view, the scrollable list of passkey sign-in rows,
* and the passkey count (for the pill-nav label).
*/
-async function createPasskeySection(rootContainer: HTMLElement): Promise<{ hint: HTMLElement; list: HTMLElement; count: number } | null> {
+async function createPasskeySection(rootContainer: HTMLElement): Promise<{ list: HTMLElement; count: number } | null> {
if (!hasPendingConditionalRequest()) {
return null;
}
@@ -1425,14 +1422,6 @@ async function createPasskeySection(rootContainer: HTMLElement): Promise<{ hint:
return null;
}
- /*
- * Hint line (passkey icon + instruction) shown above the list so the passkey view reads
- * clearly differently from the credential view when switching between the two pills.
- */
- const hint = document.createElement('div');
- hint.className = 'av-passkey-hint';
- hint.textContent = await t('content.loginWithPasskey');
-
/*
* Reuse the credential-list scroll styling but cap the height so at most ~3 passkeys are
* visible before the list scrolls, leaving room for the view-switch toggle below.
@@ -1440,6 +1429,14 @@ async function createPasskeySection(rootContainer: HTMLElement): Promise<{ hint:
const list = document.createElement('div');
list.className = 'av-credential-list av-passkey-list';
+ /*
+ * Hint caption as the first row inside the scroll area, so it scrolls away with the list.
+ */
+ const hint = document.createElement('div');
+ hint.className = 'av-passkey-hint';
+ hint.textContent = await t('content.loginWithPasskey');
+ list.appendChild(hint);
+
options.forEach((option) => {
const itemElement = document.createElement('div');
itemElement.className = 'av-credential-item';
@@ -1492,7 +1489,7 @@ async function createPasskeySection(rootContainer: HTMLElement): Promise<{ hint:
list.appendChild(itemElement);
});
- return { hint, list, count: options.length };
+ return { list, count: options.length };
}
/**
diff --git a/apps/browser-extension/src/entrypoints/contentScript/style.css b/apps/browser-extension/src/entrypoints/contentScript/style.css
index 26f3fcc56..b57afd706 100644
--- a/apps/browser-extension/src/entrypoints/contentScript/style.css
+++ b/apps/browser-extension/src/entrypoints/contentScript/style.css
@@ -174,7 +174,7 @@ body {
}
.av-passkey-list {
- max-height: 168px;
+ max-height: 202px;
}
.av-pill-nav {