From 52a31cff2f9d226eb2f71de9824be2a06a653114 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Sun, 1 Mar 2026 02:12:19 +0300 Subject: [PATCH] Use TanStack Table for variables dialog with resizable columns Replace hand-rolled flex layout with @tanstack/vue-table: - Proper with column resizing (drag header borders) - Sticky header row - FlexRender for cell content (reka-ui Editable inline editing) - Use culori via parseColor instead of manual hex parsing --- bun.lock | 5 + package.json | 5 +- src/components/VariablesDialog.vue | 309 +++++++++++++++++------------ 3 files changed, 195 insertions(+), 124 deletions(-) diff --git a/bun.lock b/bun.lock index a31220568..690dfc40a 100644 --- a/bun.lock +++ b/bun.lock @@ -8,6 +8,7 @@ "@open-pencil/cli": "workspace:*", "@open-pencil/core": "workspace:*", "@tailwindcss/vite": "^4.2.1", + "@tanstack/vue-table": "^8.21.3", "@tauri-apps/api": "^2", "@tauri-apps/plugin-dialog": "^2.6.0", "@tauri-apps/plugin-fs": "^2.4.5", @@ -327,8 +328,12 @@ "@tailwindcss/vite": ["@tailwindcss/vite@4.2.1", "", { "dependencies": { "@tailwindcss/node": "4.2.1", "@tailwindcss/oxide": "4.2.1", "tailwindcss": "4.2.1" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7" } }, "sha512-TBf2sJjYeb28jD2U/OhwdW0bbOsxkWPwQ7SrqGf9sVcoYwZj7rkXljroBO9wKBut9XnmQLXanuDUeqQK0lGg/w=="], + "@tanstack/table-core": ["@tanstack/table-core@8.21.3", "", {}, "sha512-ldZXEhOBb8Is7xLs01fR3YEc3DERiz5silj8tnGkFZytt1abEvl/GhUmCE0PMLaMPTa3Jk4HbKmRlHmu+gCftg=="], + "@tanstack/virtual-core": ["@tanstack/virtual-core@3.13.19", "", {}, "sha512-/BMP7kNhzKOd7wnDeB8NrIRNLwkf5AhCYCvtfZV2GXWbBieFm/el0n6LOAXlTi6ZwHICSNnQcIxRCWHrLzDY+g=="], + "@tanstack/vue-table": ["@tanstack/vue-table@8.21.3", "", { "dependencies": { "@tanstack/table-core": "8.21.3" }, "peerDependencies": { "vue": ">=3.2" } }, "sha512-rusRyd77c5tDPloPskctMyPLFEQUeBzxdQ+2Eow4F7gDPlPOB1UnnhzfpdvqZ8ZyX2rRNGmqNnQWm87OI2OQPw=="], + "@tanstack/vue-virtual": ["@tanstack/vue-virtual@3.13.19", "", { "dependencies": { "@tanstack/virtual-core": "3.13.19" }, "peerDependencies": { "vue": "^2.7.0 || ^3.0.0" } }, "sha512-07Fp1TYuIziB4zIDA/moeDKHODePy3K1fN4c4VIAGnkxo1+uOvBJP7m54CoxKiQX6Q9a1dZnznrwOg9C86yvvA=="], "@tauri-apps/api": ["@tauri-apps/api@2.10.1", "", {}, "sha512-hKL/jWf293UDSUN09rR69hrToyIXBb8CjGaWC7gfinvnQrBVvnLr08FeFi38gxtugAVyVcTa5/FD/Xnkb1siBw=="], diff --git a/package.json b/package.json index d16c90c59..b00937eea 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,14 @@ "open-pencil": "bun packages/cli/src/index.ts" }, "dependencies": { + "@open-pencil/cli": "workspace:*", + "@open-pencil/core": "workspace:*", "@tailwindcss/vite": "^4.2.1", + "@tanstack/vue-table": "^8.21.3", "@tauri-apps/api": "^2", "@tauri-apps/plugin-dialog": "^2.6.0", "@tauri-apps/plugin-fs": "^2.4.5", "@tauri-apps/plugin-opener": "^2", - "@open-pencil/cli": "workspace:*", - "@open-pencil/core": "workspace:*", "@vueuse/core": "^14.2.1", "canvaskit-wasm": "^0.40.0", "culori": "^4.0.2", diff --git a/src/components/VariablesDialog.vue b/src/components/VariablesDialog.vue index 769c07ab2..919a48fc1 100644 --- a/src/components/VariablesDialog.vue +++ b/src/components/VariablesDialog.vue @@ -1,5 +1,5 @@