Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
client: fix the issues pointed by gemini-code-assist
Adorian Doran93c7b8dea7d7
diff --git a/apps/client/package.json b/apps/client/package.jsonindex 4459d2cb27..dceb6e8b84 100644--- a/apps/client/package.json+++ b/apps/client/package.json@@ -35,6 +35,7 @@"autocomplete.js": "0.38.1","bootstrap": "5.3.8","boxicons": "2.1.4",+ "color": "5.0.2","dayjs": "1.11.18","dayjs-plugin-utc": "0.1.2","debounce": "2.2.0",diff --git a/apps/client/src/services/css_class_manager.ts b/apps/client/src/services/css_class_manager.tsindex 6c26b5dcb1..3b7f8ce1f6 100644--- a/apps/client/src/services/css_class_manager.ts+++ b/apps/client/src/services/css_class_manager.ts@@ -62,10 +62,13 @@ function adjustColorLightness(color: string, lightThemeMaxLightness: number, darreturn;}+ const lightness = labColor.l();+// For the light theme, limit the maximum lightness- const lightThemeColor = labColor.l(Math.min(labColor.l(), lightThemeMaxLightness)).hex();- // For the light theme, limit the minimum lightness- const darkThemeColor = labColor.l(Math.max(labColor.l(), darkThemeMinLightness)).hex();+ const lightThemeColor = labColor.l(Math.min(lightness, lightThemeMaxLightness)).hex();++ // For the dark theme, limit the minimum lightness+ const darkThemeColor = labColor.l(Math.max(lightness, darkThemeMinLightness)).hex();return {lightThemeColor, darkThemeColor};}diff --git a/apps/client/src/utils/css-var.ts b/apps/client/src/utils/css-var.tsindex a0a16402fa..8862478819 100644--- a/apps/client/src/utils/css-var.ts+++ b/apps/client/src/utils/css-var.ts@@ -17,7 +17,7 @@ export class CssVarReader {let number: Number = NaN;if (this.value) {- number = new Number(this.value);+ number = parseFloat(this.value);}return (!isNaN(number.valueOf()) ? number.valueOf() : defaultValue)diff --git a/apps/server/package.json b/apps/server/package.jsonindex f16ea110a6..aff4901b2b 100644--- a/apps/server/package.json+++ b/apps/server/package.json@@ -26,7 +26,6 @@},"dependencies": {"better-sqlite3": "12.4.1",- "color": "5.0.2","node-html-parser": "7.0.1"},"devDependencies": {diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 5b8c5382c3..77e4d877e2 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -184,6 +184,9 @@ importers:boxicons:specifier: 2.1.4version: 2.1.4+ color:+ specifier: 5.0.2+ version: 5.0.2dayjs:specifier: 1.11.18version: 1.11.18@@ -452,9 +455,6 @@ importers:better-sqlite3:specifier: 12.4.1version: 12.4.1- color:- specifier: 5.0.2- version: 5.0.2node-html-parser:specifier: 7.0.1version: 7.0.1@@ -14901,8 +14901,6 @@ snapshots:'@ckeditor/ckeditor5-utils': 47.1.0'@ckeditor/ckeditor5-watchdog': 47.1.0es-toolkit: 1.39.5- transitivePeerDependencies:- - supports-colordependencies:@@ -15680,6 +15678,8 @@ snapshots:'@ckeditor/ckeditor5-ui': 47.1.0'@ckeditor/ckeditor5-utils': 47.1.0ckeditor5: 47.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)+ transitivePeerDependencies:+ - supports-color'@ckeditor/[email protected]':dependencies: