From e98f5fc8459614734a06c0d721fdaa7ca7ffd022 Mon Sep 17 00:00:00 2001 From: pythonlearner1025 Date: Wed, 16 Sep 2026 16:32:25 -0700 Subject: [PATCH] fix(editor,kite3d): Resources headers match the panel, and the CLI keeps its execute bit The Resources tab's three section headers drew on var(--pt-app-background-color). In the dark theme that colour is lighter than the panel, so a collapsed header read as a selected row. The headers now draw on var(--main-app-background), the same variable the left panel draws on, so a collapsed header looks like any other row. Their hover rule named --pt-minimal-button-background-color-hover, which no stylesheet defines, so hover painted nothing. Hover now uses var(--pt-app-background-color): opaque, one step lighter, the lift a tree row shows. tsc writes dist/cli.js without the execute bit. A project that links the package by path keeps its bin symlink across rebuilds, so the next npx kite3d dev failed with "Permission denied" (exit 126) until someone ran chmod +x. The build script now chmods dist/cli.js to 755 after tsc. Proof: headless Chrome 153 on the terminator-next project, port 4472, CI=1, --no-open. Header and panel both read rgb(28, 33, 38) after the fix; the header read rgb(47, 52, 60) before it. Six theme combinations match. The sticky header stays opaque over scrolled rows. npm run typecheck, npm run lint, npm test -w packages/kite3d (5 files, 8 tests) and npm run test:scripts (2 tests) all pass. The new test fails on a build made with the old script. --- packages/editor/src/renderer.scss | 7 +++++-- packages/kite3d/package.json | 2 +- packages/kite3d/test/cli-bin.test.ts | 13 +++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 packages/kite3d/test/cli-bin.test.ts diff --git a/packages/editor/src/renderer.scss b/packages/editor/src/renderer.scss index a930673d..6e95e190 100644 --- a/packages/editor/src/renderer.scss +++ b/packages/editor/src/renderer.scss @@ -230,10 +230,13 @@ button.kite3d-status-chip { top: 0; user-select: none; z-index: 1; - background: var(--pt-app-background-color); + // The panel's own colour, so a collapsed header reads as a row and not as a selection. + // Both colours here are opaque, so rows scrolling under the sticky header stay hidden. + background: var(--main-app-background); } .resources-section-header:hover{ - background: var(--pt-minimal-button-background-color-hover); + // One step lighter than the panel, the lift a hovered tree row shows. + background: var(--pt-app-background-color); } .resources-section-title{ flex: 1 1 auto; diff --git a/packages/kite3d/package.json b/packages/kite3d/package.json index f63020c6..f84958e3 100644 --- a/packages/kite3d/package.json +++ b/packages/kite3d/package.json @@ -17,7 +17,7 @@ "node": ">=20" }, "scripts": { - "build": "rimraf dist && tsc -p tsconfig.build.json", + "build": "rimraf dist && tsc -p tsconfig.build.json && node -e \"require('fs').chmodSync('dist/cli.js', 0o755)\"", "typecheck": "tsc --noEmit", "lint": "eslint src test --ext ts --report-unused-disable-directives --max-warnings 0 && eslint template --ext js --report-unused-disable-directives --max-warnings 0", "test": "vitest run" diff --git a/packages/kite3d/test/cli-bin.test.ts b/packages/kite3d/test/cli-bin.test.ts new file mode 100644 index 00000000..4859093b --- /dev/null +++ b/packages/kite3d/test/cli-bin.test.ts @@ -0,0 +1,13 @@ +import {stat} from 'node:fs/promises' +import {resolve} from 'node:path' +import {describe, expect, it} from 'vitest' + +describe('the built cli', () => { + // Guards the owner's report from the terminator project: tsc writes dist/cli.js without the + // execute bit, so a project that links this package by path fails on npx kite3d dev with + // "Permission denied". The build runs before the tests, in CI and in AGENTS.md. + it('keeps the execute bit that the bin link needs', async () => { + const {mode} = await stat(resolve('dist/cli.js')) + expect(mode & 0o111).toBe(0o111) + }) +})