From 501789c7bfb7d91a440ac395d1134f2852f315e0 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Fri, 5 Jun 2026 12:13:47 +0200 Subject: [PATCH] Device Card: improve truncation (#30533) Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- assets/js/components/Config/DeviceTags.vue | 8 +++++++- prettier.config.js | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/js/components/Config/DeviceTags.vue b/assets/js/components/Config/DeviceTags.vue index 3164af52b..91380573a 100644 --- a/assets/js/components/Config/DeviceTags.vue +++ b/assets/js/components/Config/DeviceTags.vue @@ -10,7 +10,7 @@
{{ $t(`config.deviceValue.${entry.name}`) }}
-
+
{{ fmtDeviceValue(entry) }}
@@ -175,6 +175,12 @@ export default { }, }, methods: { + truncateClasses(entry) { + // don't truncate numeric values + return typeof entry.value === "string" + ? "overflow-hidden text-truncate" + : "text-nowrap flex-shrink-0"; + }, valueClasses(entry) { if (entry.error) { return "value--error"; diff --git a/prettier.config.js b/prettier.config.js index e44a6e160..5c97e87c6 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -3,4 +3,9 @@ export default { printWidth: 100, trailingComma: "es5", plugins: ["prettier-plugin-sh"], + // mirror .editorconfig for editors that resolve prettier config without it (e.g. Zed) + overrides: [ + { files: ["*.vue", "*.sh"], options: { useTabs: true, tabWidth: 4 } }, + { files: "*.css", options: { useTabs: true, tabWidth: 2 } }, + ], };