From b5884a448b1209047b894dbded6a03eb89cde31d Mon Sep 17 00:00:00 2001
From: Zane <75694352+zanesq@users.noreply.github.com>
Date: Wed, 28 May 2025 14:33:02 -0700
Subject: [PATCH] ui-v2 cleanup (#2701)
---
.husky/pre-commit | 6 +
ui-v2/.stylelintrc.json | 4 +-
ui-v2/electron/main.ts | 2 +-
ui-v2/eslint.config.cjs | 21 +-
ui-v2/lib/utils.ts | 8 +-
ui-v2/package-lock.json | 106 ++++-
ui-v2/package.json | 3 +-
ui-v2/src/App.tsx | 8 -
ui-v2/src/components/BrandCard.tsx | 44 +-
ui-v2/src/components/DarkModeToggle.tsx | 11 +-
ui-v2/src/components/DateDisplay.tsx | 26 +-
ui-v2/src/components/GooseLogo.tsx | 42 ++
ui-v2/src/components/Home.tsx | 12 +
ui-v2/src/components/Timeline.tsx | 104 +++--
ui-v2/src/components/TimelineContext.tsx | 8 +-
ui-v2/src/components/TimelineDots.tsx | 46 +-
ui-v2/src/components/ValueCard.tsx | 44 +-
ui-v2/src/components/chat/ChatDock.tsx | 9 +-
ui-v2/src/components/chat/ChatIcons.tsx | 62 ++-
ui-v2/src/components/chat/ChatInput.tsx | 36 +-
ui-v2/src/components/chat/FloatingChat.tsx | 25 +-
.../components/filters/FloatingFilters.tsx | 26 +-
ui-v2/src/components/icons.tsx | 64 ++-
ui-v2/src/components/icons/Goose.tsx | 396 ++++++++++++++++++
ui-v2/src/components/tiles/ChartTile.tsx | 74 ++--
ui-v2/src/components/tiles/ClockTile.tsx | 48 +--
ui-v2/src/components/tiles/HighlightTile.tsx | 33 +-
ui-v2/src/components/tiles/ListTile.tsx | 35 +-
ui-v2/src/components/tiles/PieChartTile.tsx | 93 ++--
ui-v2/src/components/ui/chart.tsx | 130 +++---
ui-v2/src/components/ui/tooltip.tsx | 19 +-
ui-v2/src/contexts/TimelineContext.tsx | 13 +-
ui-v2/src/hooks/useTimelineStyles.ts | 15 +-
ui-v2/src/layout/MainLayout.tsx | 124 +-----
ui-v2/src/lib/utils.ts | 14 +-
ui-v2/src/routeTree.gen.ts | 44 +-
ui-v2/src/routeTree.ts | 4 +-
ui-v2/src/routes/__root.tsx | 14 +-
ui-v2/src/routes/index.tsx | 22 +-
ui-v2/src/styles/main.css | 73 ++--
ui-v2/src/test/types.d.ts | 32 +-
ui-v2/tsconfig.electron.json | 1 +
42 files changed, 1201 insertions(+), 700 deletions(-)
delete mode 100644 ui-v2/src/App.tsx
create mode 100644 ui-v2/src/components/GooseLogo.tsx
create mode 100644 ui-v2/src/components/Home.tsx
create mode 100644 ui-v2/src/components/icons/Goose.tsx
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 5e42aa6b..f2796dca 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -5,3 +5,9 @@ if git diff --cached --name-only | grep -q "^ui/desktop/"; then
. "$(dirname -- "$0")/_/husky.sh"
cd ui/desktop && npx lint-staged
fi
+
+# Only auto-format ui-v2 TS code if relevant files are modified
+if git diff --cached --name-only | grep -q "^ui-v2/"; then
+ . "$(dirname -- "$0")/_/husky.sh"
+ cd ui-v2 && npx lint-staged
+fi
diff --git a/ui-v2/.stylelintrc.json b/ui-v2/.stylelintrc.json
index 8ab0fc41..90d8df78 100644
--- a/ui-v2/.stylelintrc.json
+++ b/ui-v2/.stylelintrc.json
@@ -4,9 +4,11 @@
"at-rule-no-unknown": [
true,
{
- "ignoreAtRules": ["tailwind", "apply", "variants", "responsive", "screen"]
+ "ignoreAtRules": ["tailwind", "apply", "variants", "responsive", "screen", "theme", "custom-variant"]
}
],
+ "at-rule-no-deprecated": null,
+ "custom-property-pattern": null,
"no-descending-specificity": null
}
}
diff --git a/ui-v2/electron/main.ts b/ui-v2/electron/main.ts
index ef0890e4..d9a1b963 100644
--- a/ui-v2/electron/main.ts
+++ b/ui-v2/electron/main.ts
@@ -27,7 +27,7 @@ async function createWindow() {
// Create the browser window with headless options when needed
const mainWindow = new BrowserWindow({
titleBarStyle: process.platform === 'darwin' ? 'hidden' : 'default',
- trafficLightPosition: process.platform === 'darwin' ? { x: 16, y: 10 } : undefined,
+ ...(process.platform === 'darwin' ? { trafficLightPosition: { x: 16, y: 10 } } : {}),
frame: false,
width: 1200,
height: 800,
diff --git a/ui-v2/eslint.config.cjs b/ui-v2/eslint.config.cjs
index 4bb86216..56456936 100644
--- a/ui-v2/eslint.config.cjs
+++ b/ui-v2/eslint.config.cjs
@@ -89,8 +89,18 @@ module.exports = [
navigator: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
- Blob: 'readonly',
+ setInterval: 'readonly',
+ clearTimeout: 'readonly',
+ clearInterval: 'readonly',
+ requestAnimationFrame: 'readonly',
+ localStorage: 'readonly',
+ HTMLDivElement: 'readonly',
+ HTMLTextAreaElement: 'readonly',
+ HTMLFormElement: 'readonly',
HTMLInputElement: 'readonly',
+ MutationObserver: 'readonly',
+ IntersectionObserver: 'readonly',
+ Blob: 'readonly',
SVGSVGElement: 'readonly',
},
},
@@ -106,6 +116,15 @@ module.exports = [
},
},
},
+ // UI components (shadcn/ui) - more relaxed rules
+ {
+ files: ['src/components/ui/**/*.{ts,tsx}'],
+ rules: {
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
+ '@typescript-eslint/no-explicit-any': 'off',
+ 'react/prop-types': 'off',
+ },
+ },
// Test configuration
{
files: ['**/*.test.{ts,tsx}', 'src/test/**/*.{ts,tsx}'],
diff --git a/ui-v2/lib/utils.ts b/ui-v2/lib/utils.ts
index bd0c391d..a7c26636 100644
--- a/ui-v2/lib/utils.ts
+++ b/ui-v2/lib/utils.ts
@@ -1,6 +1,6 @@
-import { clsx, type ClassValue } from "clsx"
-import { twMerge } from "tailwind-merge"
+import { clsx, type ClassValue } from 'clsx';
+import { twMerge } from 'tailwind-merge';
-export function cn(...inputs: ClassValue[]) {
- return twMerge(clsx(inputs))
+export function cn(...inputs: ClassValue[]): string {
+ return twMerge(clsx(inputs));
}
diff --git a/ui-v2/package-lock.json b/ui-v2/package-lock.json
index 7c776f38..005112e7 100644
--- a/ui-v2/package-lock.json
+++ b/ui-v2/package-lock.json
@@ -10,6 +10,7 @@
"dependencies": {
"@radix-ui/react-tooltip": "^1.2.7",
"@tanstack/react-router": "^1.120.5",
+ "@tanstack/react-router-devtools": "^1.120.11",
"@tanstack/router": "^0.0.1-beta.53",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
@@ -3437,14 +3438,14 @@
}
},
"node_modules/@tanstack/react-router": {
- "version": "1.120.5",
- "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.120.5.tgz",
- "integrity": "sha512-A+YRftGwAeFBxa8DF5ujNYqkSEbjCa1KjxDNYr+jWj16jjTxrz/XqgOJCv5ZfbAqqqOa3yLYoQbWa7OGz5jHuA==",
+ "version": "1.120.11",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.120.11.tgz",
+ "integrity": "sha512-VpG8gT+kibsdF9yQIOMfnCGe1pmUlrAG/fOoTm0gru1OEkJ2Tzc80codqiocRHQ9ULmlB4H/Zx56EZyQyF3ELw==",
"license": "MIT",
"dependencies": {
"@tanstack/history": "1.115.0",
"@tanstack/react-store": "^0.7.0",
- "@tanstack/router-core": "1.120.5",
+ "@tanstack/router-core": "1.120.10",
"jsesc": "^3.1.0",
"tiny-invariant": "^1.3.3",
"tiny-warning": "^1.0.3"
@@ -3461,6 +3462,28 @@
"react-dom": ">=18.0.0 || >=19.0.0"
}
},
+ "node_modules/@tanstack/react-router-devtools": {
+ "version": "1.120.11",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-router-devtools/-/react-router-devtools-1.120.11.tgz",
+ "integrity": "sha512-bk34Kn7SubkUq3TbVN6wfALvOZ63ou/dzPqhijZAwHKXpatE90BwB/Y8mLhcoH+64iXtpf/ZP2lqqsrxLXz0pw==",
+ "license": "MIT",
+ "dependencies": {
+ "@tanstack/router-devtools-core": "^1.120.10",
+ "solid-js": "^1.9.5"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "@tanstack/react-router": "^1.120.11",
+ "react": ">=18.0.0 || >=19.0.0",
+ "react-dom": ">=18.0.0 || >=19.0.0"
+ }
+ },
"node_modules/@tanstack/react-store": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@tanstack/react-store/-/react-store-0.7.0.tgz",
@@ -3498,9 +3521,9 @@
}
},
"node_modules/@tanstack/router-core": {
- "version": "1.120.5",
- "resolved": "https://registry.npmjs.org/@tanstack/router-core/-/router-core-1.120.5.tgz",
- "integrity": "sha512-IXLNv3j7rpTL/YNCWHijZgrnxFuvD4Nz/nUiGSak4x5BKzlnuZEso81xFcIuczVrEW72NxZv8IfzpR5M5Tuc0A==",
+ "version": "1.120.10",
+ "resolved": "https://registry.npmjs.org/@tanstack/router-core/-/router-core-1.120.10.tgz",
+ "integrity": "sha512-AmEJAYt+6w/790zTnfddVhnK1QJCnd96H4xg1aD65Oohc8+OTQBxgWky/wzqwhHRdkdsBgRT7iWac9x5Y8UrQA==",
"license": "MIT",
"dependencies": {
"@tanstack/history": "1.115.0",
@@ -3515,6 +3538,34 @@
"url": "https://github.com/sponsors/tannerlinsley"
}
},
+ "node_modules/@tanstack/router-devtools-core": {
+ "version": "1.120.10",
+ "resolved": "https://registry.npmjs.org/@tanstack/router-devtools-core/-/router-devtools-core-1.120.10.tgz",
+ "integrity": "sha512-fysPrKH7dL/G/guHm0HN+ceFEBZnbKaU9R8KZHo/Qzue7WxQV+g4or2EWnbBJ8/aF+C/WYgxR1ATFqfZEjHSfg==",
+ "license": "MIT",
+ "dependencies": {
+ "clsx": "^2.1.1",
+ "goober": "^2.1.16"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "@tanstack/router-core": "^1.120.10",
+ "csstype": "^3.0.10",
+ "solid-js": ">=1.9.5",
+ "tiny-invariant": "^1.3.3"
+ },
+ "peerDependenciesMeta": {
+ "csstype": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@tanstack/router/node_modules/@tanstack/store": {
"version": "0.0.1-beta.52",
"resolved": "https://registry.npmjs.org/@tanstack/store/-/store-0.0.1-beta.52.tgz",
@@ -8712,6 +8763,15 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/goober": {
+ "version": "2.1.16",
+ "resolved": "https://registry.npmjs.org/goober/-/goober-2.1.16.tgz",
+ "integrity": "sha512-erjk19y1U33+XAMe1VTvIONHYoSqE4iS7BYUZfHaqeohLmnC0FdxEh7rQU+6MZ4OajItzjZFSRtVANrQwNq6/g==",
+ "license": "MIT",
+ "peerDependencies": {
+ "csstype": "^3.0.10"
+ }
+ },
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
@@ -13234,6 +13294,27 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/seroval": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/seroval/-/seroval-1.3.2.tgz",
+ "integrity": "sha512-RbcPH1n5cfwKrru7v7+zrZvjLurgHhGyso3HTyGtRivGWgYjbOmGuivCQaORNELjNONoK35nj28EoWul9sb1zQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/seroval-plugins": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/seroval-plugins/-/seroval-plugins-1.3.2.tgz",
+ "integrity": "sha512-0QvCV2lM3aj/U3YozDiVwx9zpH0q8A60CTWIv4Jszj/givcudPb48B+rkU5D51NJ0pTpweGMttHjboPa9/zoIQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "seroval": "^1.0"
+ }
+ },
"node_modules/serve-static": {
"version": "1.16.2",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
@@ -13541,6 +13622,17 @@
"node": ">= 6.0.0"
}
},
+ "node_modules/solid-js": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.9.7.tgz",
+ "integrity": "sha512-/saTKi8iWEM233n5OSi1YHCCuh66ZIQ7aK2hsToPe4tqGm7qAejU1SwNuTPivbWAYq7SjuHVVYxxuZQNRbICiw==",
+ "license": "MIT",
+ "dependencies": {
+ "csstype": "^3.1.0",
+ "seroval": "~1.3.0",
+ "seroval-plugins": "~1.3.0"
+ }
+ },
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
diff --git a/ui-v2/package.json b/ui-v2/package.json
index 25fc31d2..3a721621 100644
--- a/ui-v2/package.json
+++ b/ui-v2/package.json
@@ -29,11 +29,12 @@
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,css}\" \"electron/**/*.{ts,tsx,js,jsx,css}\"",
"format": "npm run prettier:fix && npm run lint:style:fix",
"check-all": "npm run typecheck && npm run lint && npm run prettier",
- "prepare": "cd ../.. && husky install"
+ "prepare": "cd .. && npx husky"
},
"dependencies": {
"@radix-ui/react-tooltip": "^1.2.7",
"@tanstack/react-router": "^1.120.5",
+ "@tanstack/react-router-devtools": "^1.120.11",
"@tanstack/router": "^0.0.1-beta.53",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
diff --git a/ui-v2/src/App.tsx b/ui-v2/src/App.tsx
deleted file mode 100644
index b8d9fe6a..00000000
--- a/ui-v2/src/App.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import React from 'react';
-import { MainLayout } from './layout/MainLayout';
-
-const App: React.FC = (): React.ReactElement => {
- return ;
-};
-
-export default App;
diff --git a/ui-v2/src/components/BrandCard.tsx b/ui-v2/src/components/BrandCard.tsx
index d2512043..a01a5cec 100644
--- a/ui-v2/src/components/BrandCard.tsx
+++ b/ui-v2/src/components/BrandCard.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import { ReactElement } from 'react';
interface BrandCardProps {
date?: Date;
@@ -7,14 +7,14 @@ interface BrandCardProps {
// Array of congratulatory messages for past days
const pastDayMessages = [
- { title: "Great work!", message: "You accomplished so much" },
- { title: "Well done!", message: "Another successful day" },
- { title: "Fantastic job!", message: "Making progress every day" },
- { title: "Nice one!", message: "Another day in the books" },
- { title: "Awesome work!", message: "Keep up the momentum" }
+ { title: 'Great work!', message: 'You accomplished so much' },
+ { title: 'Well done!', message: 'Another successful day' },
+ { title: 'Fantastic job!', message: 'Making progress every day' },
+ { title: 'Nice one!', message: 'Another day in the books' },
+ { title: 'Awesome work!', message: 'Keep up the momentum' },
];
-export default function BrandCard({ date, className = '' }: BrandCardProps) {
+export default function BrandCard({ date, className = '' }: BrandCardProps): ReactElement {
const isToday = date ? new Date().toDateString() === date.toDateString() : true;
// Get a consistent message for each date
@@ -28,15 +28,12 @@ export default function BrandCard({ date, className = '' }: BrandCardProps) {
const pastMessage = date ? getPastDayMessage(date) : pastDayMessages[0];
return (
-
{/* Logo */}
-
+ `}
+ >