From 94a186ec911e78b96961e7c7ee951130c616e989 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 12 Sep 2024 14:28:16 +0200 Subject: [PATCH] fix(ui): render project name consistently (#6329) --- package.json | 2 +- packages/ui/README.md | 8 +----- packages/ui/client/components/FileDetails.vue | 27 ++++++++++++++----- .../components/explorer/ExplorerItem.vue | 2 +- packages/vitest/src/node/logger.ts | 4 ++- test/browser/specs/server-url.test.ts | 8 +++--- test/browser/specs/utils.ts | 5 ++-- 7 files changed, 33 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 2a3c601b0ccd..0c603794a3e4 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "typecheck": "tsc -p tsconfig.check.json --noEmit", "typecheck:why": "tsc -p tsconfig.check.json --noEmit --explainFiles > explainTypes.txt", "ui:build": "vite build packages/ui", - "ui:dev": "vite packages/ui", + "ui:dev": "npm -C packages/ui run dev:client", "ui:test": "npm -C packages/ui run test:run", "test:browser:webdriverio": "pnpm -C test/browser run test:webdriverio", "test:browser:playwright": "pnpm -C test/browser run test:playwright" diff --git a/packages/ui/README.md b/packages/ui/README.md index 0208622e0d53..ae9d1e81a475 100644 --- a/packages/ui/README.md +++ b/packages/ui/README.md @@ -2,20 +2,14 @@ This package is for UI interface of Vitest. -> Work in progress. - ## Development Setup At project root, create terminals with each of the following commands: ```bash -nr dev +nr ui:dev ``` ```bash nr test --api ``` - -```bash -nr ui:dev -``` diff --git a/packages/ui/client/components/FileDetails.vue b/packages/ui/client/components/FileDetails.vue index 7cd54f94ed33..b0ba0590b25c 100644 --- a/packages/ui/client/components/FileDetails.vue +++ b/packages/ui/client/components/FileDetails.vue @@ -111,6 +111,21 @@ debouncedWatch( }, { debounce: 100, immediate: true }, ) + +const projectNameColor = computed(() => { + return getProjectNameColor(current.value?.file.projectName) +}) + +const projectNameTextColor = computed(() => { + switch (projectNameColor.value) { + case 'blue': + case 'green': + case 'magenta': + return 'white' + default: + return 'black' + } +})