From eeeb67e62c02570efa2ba847e4cba96741d714c4 Mon Sep 17 00:00:00 2001 From: seventy-seven <163976745+sberry007@users.noreply.github.com> Date: Thu, 1 Oct 2026 23:45:13 +0800 Subject: [PATCH] feat(editor): widen query editor scrollbar on hover --- .../src/components/editor/QueryEditor.vue | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/components/editor/QueryEditor.vue b/apps/desktop/src/components/editor/QueryEditor.vue index 9179f72446..4b2b908d7e 100644 --- a/apps/desktop/src/components/editor/QueryEditor.vue +++ b/apps/desktop/src/components/editor/QueryEditor.vue @@ -2809,20 +2809,37 @@ defineExpose({ contain: size layout style; } +/* Matches the geometry of the custom-drawn data grid scrollbars (DataGrid.vue): + a fixed 10px track with a 4px visual thumb widening on hover/drag, transparent + track, capsule thumb, colors from the same --foreground color-mix. The thin + idle look comes from a transparent border (background-clip: padding-box); + hover drops the border to fill the full track. Partial border widths are not + honored on scrollbar part state changes, so the hover endpoint is the full + 10px track rather than the grid's 6px. Changing the track width on hover + would squeeze the content and cause a reflow flicker, so it stays constant. */ [data-query-editor-root] :deep(.cm-scroller::-webkit-scrollbar) { - width: 5px; - height: 5px; + width: 10px; + height: 10px; } -[data-query-editor-root] :deep(.cm-scroller::-webkit-scrollbar-track) { - background: rgba(127, 127, 127, 0.1); +[data-query-editor-root] :deep(.cm-scroller::-webkit-scrollbar-track), +[data-query-editor-root] :deep(.cm-scroller::-webkit-scrollbar-corner) { + background: transparent; } [data-query-editor-root] :deep(.cm-scroller::-webkit-scrollbar-thumb) { - background: rgba(127, 127, 127, 0.7); + background: color-mix(in oklch, var(--foreground) 30%, transparent); + background-clip: padding-box; + border: 3px solid transparent; border-radius: 999px; } +[data-query-editor-root] :deep(.cm-scroller::-webkit-scrollbar-thumb:hover), +[data-query-editor-root] :deep(.cm-scroller::-webkit-scrollbar-thumb:active) { + background: color-mix(in oklch, var(--foreground) 48%, transparent); + border: 0 solid transparent; +} + @supports not selector(::-webkit-scrollbar) { [data-query-editor-root] :deep(.cm-scroller) { scrollbar-width: thin;