diff --git a/src/renderer/src/AppSidebarLayout.test.ts b/src/renderer/src/AppSidebarLayout.test.ts new file mode 100644 index 00000000..72949c6b --- /dev/null +++ b/src/renderer/src/AppSidebarLayout.test.ts @@ -0,0 +1,20 @@ +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { describe, expect, it } from 'vitest' + +const stylesheet = readFileSync( + join(process.cwd(), 'src', 'renderer', 'src', 'styles.css'), + 'utf8' +).replaceAll('\r\n', '\n') + +describe('primary sidebar layout', () => { + it('keeps the resize hit target from adding space beside the divider', () => { + const rule = stylesheet.match( + /\.primary-sidebar-resize-handle\s*\{([^}]*)\}/u + )?.[1] + + expect(rule).toContain('width: 9px;') + expect(rule).toContain('margin-left: -5px;') + expect(rule).toContain('margin-right: -4px;') + }) +}) diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.css index f32db4ad..994abf03 100644 --- a/src/renderer/src/styles.css +++ b/src/renderer/src/styles.css @@ -2404,6 +2404,7 @@ textarea:focus-visible { min-width: 9px; padding: 0; margin-left: -5px; + margin-right: -4px; background: transparent; cursor: col-resize; touch-action: none;