mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
fix(run): integrate the Run Anything command field into the popup (#5111)
The Run Anything command field now sits directly on the popup surface. A single inset divider shows keyboard focus. The command row is 14 px shorter, giving the scrollable results the extra space in short windows.
This commit is contained in:
@@ -39,9 +39,15 @@ test("Run Anything keeps its command field and shortcuts visible as its results
|
||||
|
||||
const popup = page.getByRole("dialog", { name: "Run Anything", exact: true });
|
||||
const field = popup.getByLabel("Command line", { exact: true });
|
||||
const fieldSurface = field.locator("..");
|
||||
const commandRow = fieldSurface.locator("..");
|
||||
const results = popup.getByRole("listbox", { name: "Run Anything entries" });
|
||||
const hint = popup.getByText(/Enter to run, Tab to complete|Tab to complete, Enter to run/);
|
||||
await expect(field).toBeFocused();
|
||||
await expect(fieldSurface).toHaveCSS("box-shadow", "none");
|
||||
await expect(commandRow).toHaveCSS("border-bottom-width", "1px");
|
||||
await expect(commandRow).toHaveCSS("border-left-width", "0px");
|
||||
const focusedDivider = await commandRow.evaluate((el) => getComputedStyle(el).borderBottomColor);
|
||||
await page.setViewportSize({ width: 560, height: 340 });
|
||||
await expect
|
||||
.poll(async () => {
|
||||
@@ -69,6 +75,7 @@ test("Run Anything keeps its command field and shortcuts visible as its results
|
||||
await field.press("Shift+Tab");
|
||||
const history = popup.getByRole("button", { name: "Clear History" });
|
||||
await expect(history).toBeFocused();
|
||||
await expect(commandRow).not.toHaveCSS("border-bottom-color", focusedDivider);
|
||||
await history.press("Enter");
|
||||
await expect(history).toBeHidden();
|
||||
await expect(field).toBeFocused();
|
||||
|
||||
@@ -49,7 +49,15 @@
|
||||
}
|
||||
.query {
|
||||
flex: none;
|
||||
padding: var(--space-2);
|
||||
margin-inline: var(--space-3);
|
||||
border-bottom: 1px solid var(--border-popup);
|
||||
}
|
||||
.query:focus-within {
|
||||
border-bottom-color: var(--focus-ring);
|
||||
}
|
||||
.query .commandField {
|
||||
min-height: 29px;
|
||||
padding-inline: var(--space-0-5);
|
||||
}
|
||||
.rows {
|
||||
flex: 1 1 auto;
|
||||
|
||||
@@ -144,6 +144,8 @@ function RunAnythingPopup({ root }: { root: string }) {
|
||||
ref={field}
|
||||
data-autofocus
|
||||
leadingIcon="run-anything"
|
||||
variant="bare"
|
||||
className={styles.commandField}
|
||||
clearable={false}
|
||||
role="combobox"
|
||||
aria-autocomplete="list"
|
||||
|
||||
Reference in New Issue
Block a user