Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(dictation): keep the pill's right-click menu inside its window at Center and Bottom Left (#2212)

void3e57c9d06baf
diff --git a/src/App.jsx b/src/App.jsx
index 82d0763fa..27e744f34 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -597,6 +597,8 @@ export default function App() {
panelStartPosition,
horizontalDirection: voiceHorizontalDirection,
});
+ const voicePillPopoverAlign =
+ panelStartPosition === "center" ? "center" : voiceHorizontalDirection;
const voicePillTravelDuration =
liveTranscript.open && liveTranscript.entrancePhase === "encapsulate"
? LIVE_TRANSCRIPT_ENTRANCE_TIMING.encapsulateMs
@@ -672,7 +674,7 @@ export default function App() {
<PillTooltip
content={canReopenLiveTranscript ? t("transcriptionPreview.label") : micTooltip}
disabled={anyPanelMounted}
- align={panelStartPosition === "center" ? "center" : voiceHorizontalDirection}
+ align={voicePillPopoverAlign}
>
<VoicePill
ref={buttonRef}
@@ -767,6 +769,7 @@ export default function App() {
{!anyPanelMounted && isCommandMenuOpen && (
<PillCommandMenu
buttonRef={buttonRef}
+ align={voicePillPopoverAlign}
isRecording={isRecording}
agentAllowed={agentAllowed}
meetingAllowed={meetingAllowed}
diff --git a/src/components/dictation/PillCommandMenu.tsx b/src/components/dictation/PillCommandMenu.tsx
index 44a1607e0..9a56d1970 100644
--- a/src/components/dictation/PillCommandMenu.tsx
+++ b/src/components/dictation/PillCommandMenu.tsx
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
interface PillCommandMenuProps {
buttonRef: React.RefObject<HTMLDivElement | null>;
+ align: "left" | "right" | "center";
isRecording: boolean;
agentAllowed: boolean;
meetingAllowed: boolean;
@@ -22,6 +23,7 @@ interface PillCommandMenuProps {
*/
export function PillCommandMenu({
buttonRef,
+ align,
isRecording,
agentAllowed,
meetingAllowed,
@@ -53,10 +55,15 @@ export function PillCommandMenu({
return () => document.removeEventListener("mousedown", handleClickOutside);
}, [buttonRef, onClose]);
+ // The pill docks against a physical window edge and the window clips anything past it (#2064),
+ // so the menu anchors on that same side, never on a logical start/end.
+ const alignClass =
+ align === "right" ? "right-0" : align === "left" ? "left-0" : "left-1/2 -translate-x-1/2";
+
return (
<div
ref={menuRef}
- className="absolute bottom-full end-0 mb-3 w-48 overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-lg backdrop-blur-sm"
+ className={`absolute bottom-full ${alignClass} mb-3 w-48 overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-lg backdrop-blur-sm`}
onMouseEnter={() => {
setWindowInteractivity(true);
}}
diff --git a/test/components/pillCommandMenu.test.js b/test/components/pillCommandMenu.test.js
index 87bda0c43..9d671f9b9 100644
--- a/test/components/pillCommandMenu.test.js
+++ b/test/components/pillCommandMenu.test.js
@@ -15,6 +15,7 @@ async function renderMenu(t, props) {
return renderToStaticMarkup(
createElement(mod.PillCommandMenu, {
buttonRef: { current: null },
+ align: "right",
isRecording: false,
agentAllowed: true,
meetingAllowed: true,
@@ -38,6 +39,31 @@ test("the command menu hides Ask Assistant while a recording is active", async (
assert.doesNotMatch(recordingMarkup, /askAssistant/);
});
+// #2064: a menu always anchored on the pill's right edge hung past the window's left edge (and
+// was clipped) whenever the pill docked at the left or center.
+test("the command menu anchors on the pill's docked side", async (t) => {
+ const menuClasses = async (align) => {
+ const markup = await renderMenu(t, { align });
+ return markup.match(/^<div class="([^"]*)"/)[1].split(" ");
+ };
+
+ const right = await menuClasses("right");
+ assert.ok(right.includes("right-0"));
+ assert.ok(!right.includes("left-0"));
+
+ const left = await menuClasses("left");
+ assert.ok(left.includes("left-0"));
+ assert.ok(!left.includes("right-0"));
+
+ const center = await menuClasses("center");
+ assert.ok(center.includes("left-1/2") && center.includes("-translate-x-1/2"));
+
+ // The dock is a physical screen edge, so a logical anchor would flip sides in RTL.
+ for (const classes of [right, left, center]) {
+ assert.ok(!classes.includes("end-0") && !classes.includes("start-0"));
+ }
+});
+
test("the command menu offers a meeting recording only while idle and allowed", async (t) => {
assert.match(await renderMenu(t, {}), /startMeetingRecording/);
assert.doesNotMatch(await renderMenu(t, { isRecording: true }), /startMeetingRecording/);