diff --git a/.github/workflows/package_size.yml b/.github/workflows/package_size.yml deleted file mode 100644 index a0a6548..0000000 --- a/.github/workflows/package_size.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Package Size Report - -on: pull_request - -permissions: - pull-requests: write - contents: read - -jobs: - pkg-size-report: - name: Package Size Report - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 20 - - - name: Package size report - uses: pkg-size/action@v1.1.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index dac4dcc..2d0ac37 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "clsx": "^2.1.1", "dayjs": "^1.11.13", "dotenv": "^16.4.5", + "echarts": "^5.5.1", "electron-store": "^10.0.0", "electron-updater": "^6.3.4", "electron-vite": "^2.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index afbe2d6..a5f2c3d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,6 +44,9 @@ importers: dotenv: specifier: ^16.4.5 version: 16.4.5 + echarts: + specifier: ^5.5.1 + version: 5.5.1 electron-store: specifier: ^10.0.0 version: 10.0.0 @@ -2354,6 +2357,9 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + echarts@5.5.1: + resolution: {integrity: sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==} + ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -4793,6 +4799,9 @@ packages: '@swc/wasm': optional: true + tslib@2.3.0: + resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} + tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} @@ -5224,6 +5233,9 @@ packages: zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + zrender@5.6.0: + resolution: {integrity: sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==} + snapshots: 7zip-bin@5.2.0: {} @@ -7516,6 +7528,11 @@ snapshots: eastasianwidth@0.2.0: {} + echarts@5.5.1: + dependencies: + tslib: 2.3.0 + zrender: 5.6.0 + ee-first@1.1.1: {} ejs@3.1.10: @@ -10230,6 +10247,8 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + tslib@2.3.0: {} + tslib@2.7.0: {} tsx@4.19.1: @@ -10658,3 +10677,7 @@ snapshots: readable-stream: 4.5.2 zod@3.23.8: {} + + zrender@5.6.0: + dependencies: + tslib: 2.3.0 diff --git a/src/main/index.ts b/src/main/index.ts index 225b07b..042d1cc 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -174,8 +174,6 @@ app.whenReady().then(async () => { setupPeriodicSave() setupIPCListeners() }) - - emailService.scheduleEmailSend() }) function handleUserLogout() { @@ -191,7 +189,6 @@ function setupIPCListeners() { if (savedUser) { startActivityMonitoring() currentSiteTimeTrackers = store.get('siteTimeTrackers', []) - emailService.scheduleEmailSend() } }) ipcMain.on('test-email-send', async () => await emailService.testEmailSend()) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 4af810d..e4374d5 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -12,6 +12,7 @@ const Login = lazy(() => import('./Login')) const Signup = lazy(() => import('./Signup')) const Versions = lazy(() => import('./Versions')) const HelloWorld = () =>

Hello World!

+const BarChart = lazy(() => import('./BarChart')) const App = (props: ComponentProps) => { const [isLoggedIn, setIsLoggedIn] = useAuth() @@ -87,10 +88,11 @@ render( Loading...}> - + + diff --git a/src/renderer/src/BarChart.tsx b/src/renderer/src/BarChart.tsx new file mode 100644 index 0000000..5d00b4a --- /dev/null +++ b/src/renderer/src/BarChart.tsx @@ -0,0 +1,51 @@ +import { onMount, onCleanup } from 'solid-js' +import * as echarts from 'echarts' + +const BarChart = () => { + let chartDiv: HTMLElement | null | undefined + + onMount(() => { + // Initialize the chart + const myChart = echarts.init(chartDiv, 'dark') + + // Specify the chart options + const options = { + title: { + text: 'Deep Work Hours' + }, + animationDuration: 3000, + tooltip: {}, + xAxis: { + type: 'category', + data: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: 'Hours', + type: 'bar', + data: [5, 6, 7, 8, 4, 3, 6] // Example data + } + ] + } + + // Set the options to the chart + myChart.setOption(options) + + // Add resize listener to make the chart responsive + window.addEventListener('resize', () => { + myChart.resize() + }) + + // Clean up the chart on unmount + onCleanup(() => { + myChart.dispose() + }) + }) + + return
+} + +export default BarChart