fix: improve Quick Prompt popup UX and settings design

- Fix window lifecycle: await renderer load before showing, debounce
  blur handler to prevent dropdown-induced dismiss
- Increase window height from 72px to 520px for response display
- Rewrite ModelSelector with tier-grouped upward-opening dropdown,
  reasoning effort controls, and Brain icon for reasoning models
- Rewrite QuickPromptInput with visible model trigger, animated
  chevron, auto-resize textarea, and proper stop button
- Improve QuickPromptResponse with compact thinking block, markdown
  code/pre/link styling, and refined spacing
- Polish QuickPromptActions with consistent sizing and hover states
- Redesign settings QuickPromptSettingsSection: replace flat radio
  list with compact grouped dropdown selector, only show reasoning
  effort when selected model supports it, combine hotkey toggle
  into single row
- Add markdown code block, inline code, and link CSS styles
- Fix dropdown animation direction for upward-opening selector
- Handle message-complete event in QuickPromptApp

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-04-13 12:14:29 +02:00
co-authored by Copilot
parent fb5970cfa7
commit 952e69da9f
9 changed files with 413 additions and 245 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ async function bootstrap(): Promise<void> {
const hotkeySettings = workspace.settings.quickPrompt ?? createDefaultQuickPromptSettings();
globalHotkeyService.register(hotkeySettings, () => {
const win = ensureQuickPromptWindow();
if (win) toggleQuickPromptWindow(win);
if (win) void toggleQuickPromptWindow(win);
});
// Re-register hotkey when settings change
+22 -6
View File
@@ -9,7 +9,8 @@ const { app, BrowserWindow, screen } = electron;
export function createQuickPromptWindow(): BrowserWindowType {
const window = new BrowserWindow({
width: 680,
height: 72,
height: 520,
minHeight: 72,
show: false,
frame: false,
transparent: true,
@@ -19,6 +20,7 @@ export function createQuickPromptWindow(): BrowserWindowType {
maximizable: false,
minimizable: false,
fullscreenable: false,
focusable: true,
title: 'Aryx Quick Prompt',
icon: resolveWindowIconPath({
appPath: app.getAppPath(),
@@ -39,23 +41,37 @@ export function createQuickPromptWindow(): BrowserWindowType {
void window.loadFile(join(__dirname, '../../dist/renderer/quickprompt.html'));
}
// Hide on blur — but only if the window itself loses focus (not from
// devtools or transient focus changes during show/hide).
window.on('blur', () => {
if (window.isVisible()) {
window.webContents.send('quick-prompt:hide');
window.hide();
}
// Small delay: avoid hiding during transient focus shifts (e.g. model
// selector dropdown causing a brief blur → refocus cycle).
setTimeout(() => {
if (window.isVisible() && !window.isFocused()) {
window.webContents.send('quick-prompt:hide');
window.hide();
}
}, 100);
});
return window;
}
export function toggleQuickPromptWindow(window: BrowserWindowType): void {
export async function toggleQuickPromptWindow(window: BrowserWindowType): Promise<void> {
if (window.isVisible()) {
window.webContents.send('quick-prompt:hide');
window.hide();
return;
}
// Wait for the renderer to finish loading before showing — on the very
// first activation the page may still be loading from disk/dev-server.
if (window.webContents.isLoading()) {
await new Promise<void>((resolve) => {
window.webContents.once('did-finish-load', () => resolve());
});
}
centerOnActiveDisplay(window);
window.webContents.send('quick-prompt:show');
window.show();