The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.
TypeScript code-editorcross-platformdapdatabase-clientdebuggerdesktop-appdeveloper-toolsgithttp-clientideintellijlsprusttauriterminal
fix(templates): keep postfix descriptions inside their rows (#2116)
l0ng-ai558ee395dc9e
diff --git a/e2e/postfixRowLayout.spec.ts b/e2e/postfixRowLayout.spec.tsnew file mode 100644index 000000000..97efab0a4--- /dev/null+++ b/e2e/postfixRowLayout.spec.ts@@ -0,0 +1,28 @@+import { expect, test } from "./fixtures";++test("postfix template descriptions remain inside their rows", async ({ workbench: page }) => {+ await page.keyboard.press("Meta+,");+ await expect(page.getByRole("dialog", { name: "Settings", exact: true })).toBeVisible();+ await page.evaluate(async () => {+ const path = "/src/features/settings/model/staging.ts";+ (await import(/* @vite-ignore */ path)).selectPage("editor.general.postfixCompletion");+ });+ const rows = page.getByRole("list", { name: "Postfix templates" }).getByRole("listitem");+ await expect(rows.first()).toBeVisible();+ for (const language of ["JavaScript / TypeScript", "Rust", "Python", "Go", "Java", "Kotlin"]) {+ await page.getByRole("tab", { name: language, exact: true }).click();+ for (const width of [1000, 640, 520]) {+ await page.setViewportSize({ width, height: 760 });+ const fits = await rows.evaluateAll((rows) =>+ rows.every((row) => {+ const bounds = row.getBoundingClientRect();+ const detail = row.lastElementChild!;+ const range = document.createRange();+ range.selectNodeContents(detail);+ return [...range.getClientRects()].every((r) => r.top >= bounds.top - 1 && r.bottom <= bounds.bottom + 1);+ }),+ );+ expect(fits).toBe(true);+ }+ }+});diff --git a/src/features/templates/settings/LiveTemplatesPage.tsx b/src/features/templates/settings/LiveTemplatesPage.tsxindex 433960651..62a763a63 100644--- a/src/features/templates/settings/LiveTemplatesPage.tsx+++ b/src/features/templates/settings/LiveTemplatesPage.tsx@@ -112,7 +112,9 @@ export function LiveTemplatesPage() {<span className={clsx(styles.itemLabel, isModifiedBuiltin(t.id) && styles.modified)}>{t.abbrev}</span>- <span className={styles.itemDetail}>{t.description}</span>+ <span className={styles.itemDetail} title={t.description}>+ {t.description}+ </span></div>))}</div>diff --git a/src/features/templates/settings/PostfixPage.tsx b/src/features/templates/settings/PostfixPage.tsxindex e333da135..6b2bec52a 100644--- a/src/features/templates/settings/PostfixPage.tsx+++ b/src/features/templates/settings/PostfixPage.tsx@@ -63,7 +63,9 @@ export function PostfixPage() {aria-label={tx`Enable .${t.key}`}/><span className={styles.mono}>.{t.key}</span>- <span className={styles.itemDetail}>{t.description}</span>+ <span className={styles.itemDetail} title={t.description}>+ {t.description}+ </span></div>))}</div>diff --git a/src/features/templates/settings/Settings.module.css b/src/features/templates/settings/Settings.module.cssindex 662c046b9..9146bfaea 100644--- a/src/features/templates/settings/Settings.module.css+++ b/src/features/templates/settings/Settings.module.css@@ -81,6 +81,8 @@color: var(--fg-emphasis);}.itemDetail {+ min-width: 0;+ white-space: nowrap;color: var(--fg-subtle);overflow: hidden;text-overflow: ellipsis;