From 7aca2d640192ce4e6177d6a8054551d77c30ca15 Mon Sep 17 00:00:00 2001 From: zhangzhongyou Date: Thu, 20 Nov 2025 11:09:46 +0800 Subject: [PATCH] fix: message show problem --- frontend/electron.vite.config.ts | 40 ++++------ frontend/package.json | 6 +- frontend/pnpm-lock.yaml | 20 ++--- frontend/src/renderer/index.html | 77 +++++++++---------- frontend/src/renderer/src/App.tsx | 1 - .../pages/home/components/heatmap/heatmap.tsx | 13 ++++ .../home/components/to-do-card/index.tsx | 3 +- frontend/src/renderer/src/types/electron.d.ts | 1 + 8 files changed, 82 insertions(+), 79 deletions(-) diff --git a/frontend/electron.vite.config.ts b/frontend/electron.vite.config.ts index ed7a11ba..da7fc500 100644 --- a/frontend/electron.vite.config.ts +++ b/frontend/electron.vite.config.ts @@ -62,32 +62,22 @@ export default defineConfig({ }, plugins: [ tailwindcss(), - react({ - // tsDecorators: true, - // plugins: [ - // [ - // '@swc/plugin-styled-components', - // { - // displayName: true, // 开发环境下启用组件名称 - // fileName: false, // 不在类名中包含文件名 - // pure: true, // 优化性能 - // ssr: false // 不需要服务端渲染 - // } - // ] - // ] - }), + react({}), ...(isDev ? [CodeInspectorPlugin({ bundler: 'vite' })] : []), // 只在开发环境下启用 CodeInspectorPlugin - ...visualizerPlugin('renderer') + ...visualizerPlugin('renderer'), + { + name: 'force-arco-adapter-side-effect', + transform(code, id) { + if (id.includes('react-19-adapter')) { + return { + code, + map: null, + moduleSideEffects: true + } + } + return null + } + } ] - // server: { - // proxy: { - // // 代理Express服务 (AI Chat) - // '/api/chat': { - // target: 'http://127.0.0.1:3001', - // changeOrigin: true, - // secure: false, - // }, - // } - // } } }) diff --git a/frontend/package.json b/frontend/package.json index d5a24914..e5344f78 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -50,7 +50,7 @@ "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tooltip": "^1.2.8", "@radix-ui/react-use-controllable-state": "^1.2.2", - "@zhongyao/heatmap": "^0.0.4", + "@zhongyao/heatmap": "^0.0.6", "ahooks": "^3.9.5", "ai": "^5.0.30", "allotment": "^1.20.4", @@ -82,7 +82,7 @@ "zod": "^3.25.76" }, "devDependencies": { - "@arco-design/web-react": "^2.66.4", + "@arco-design/web-react": "latest", "@electron-toolkit/eslint-config-prettier": "^3.0.0", "@electron-toolkit/eslint-config-ts": "^3.0.0", "@electron-toolkit/tsconfig": "^1.0.1", @@ -150,4 +150,4 @@ "esbuild" ] } -} +} \ No newline at end of file diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 0fdf86fa..36c954e7 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -48,8 +48,8 @@ importers: specifier: ^1.2.2 version: 1.2.2(@types/react@19.1.10)(react@19.1.1) '@zhongyao/heatmap': - specifier: ^0.0.4 - version: 0.0.4(dayjs@1.11.18)(react@19.1.1) + specifier: ^0.0.6 + version: 0.0.6(dayjs@1.11.18)(react@19.1.1) ahooks: specifier: ^3.9.5 version: 3.9.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1) @@ -139,8 +139,8 @@ importers: version: 3.25.76 devDependencies: '@arco-design/web-react': - specifier: ^2.66.4 - version: 2.66.4(@types/react@19.1.10)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: latest + version: 2.66.8(@types/react@19.1.10)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) '@electron-toolkit/eslint-config-prettier': specifier: ^3.0.0 version: 3.0.0(eslint@9.33.0(jiti@2.5.1))(prettier@3.6.2) @@ -372,8 +372,8 @@ packages: '@arco-design/color@0.4.0': resolution: {integrity: sha512-s7p9MSwJgHeL8DwcATaXvWT3m2SigKpxx4JA1BGPHL4gfvaQsmQfrLBDpjOJFJuJ2jG2dMt3R3P8Pm9E65q18g==} - '@arco-design/web-react@2.66.4': - resolution: {integrity: sha512-vl7sJBLvbVyJhYRPoQ8kHc8BuXNkJIXca5h9ync2J1TuKglFMLNbQwjIvJLW3ciabqTZ5g1O7H1GQ+lLIEMsWA==} + '@arco-design/web-react@2.66.8': + resolution: {integrity: sha512-V2XDTqeSFq4g6Yk0tSEFO4SMPZ04cGNF6dKfFBM9drEpmj91cU1n9+rd3gmmtcJ2f3SOqbr0itnUsqBWGQ4PvQ==} peerDependencies: react: '>=16' react-dom: '>=16' @@ -2107,8 +2107,8 @@ packages: resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==} engines: {node: '>=10.0.0'} - '@zhongyao/heatmap@0.0.4': - resolution: {integrity: sha512-tFEF+SjjtyKV2v5xNBLdSgAEQuPuduO6j8yZcs/X7jKK40WPRdNKPl8q/msSadjRJtr92/gazANQxt4JU6ZKvw==} + '@zhongyao/heatmap@0.0.6': + resolution: {integrity: sha512-AXQFk4f8CkPSUSi4qasTZtwWPABkSVv6zSMlmlFXtCqYug0tie/pHc81DYkx51lvluQycaX4l40z7m1EHrtSCQ==} peerDependencies: dayjs: ^1.11.19 react: ^16.18.0 @@ -6326,7 +6326,7 @@ snapshots: dependencies: color: 3.2.1 - '@arco-design/web-react@2.66.4(@types/react@19.1.10)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': + '@arco-design/web-react@2.66.8(@types/react@19.1.10)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': dependencies: '@arco-design/color': 0.4.0 '@babel/runtime': 7.28.3 @@ -8508,7 +8508,7 @@ snapshots: '@xmldom/xmldom@0.8.11': {} - '@zhongyao/heatmap@0.0.4(dayjs@1.11.18)(react@19.1.1)': + '@zhongyao/heatmap@0.0.6(dayjs@1.11.18)(react@19.1.1)': dependencies: '@types/react': 19.2.3 dayjs: 1.11.18 diff --git a/frontend/src/renderer/index.html b/frontend/src/renderer/index.html index 18ddc596..4fa1bc85 100644 --- a/frontend/src/renderer/index.html +++ b/frontend/src/renderer/index.html @@ -4,45 +4,44 @@ --> - - - - - MineContext - - + #spinner { + position: fixed; + width: 100vw; + height: 100vh; + flex-direction: row; + justify-content: center; + align-items: center; + display: flex; + } - -
-
- -
- - - - + #spinner img { + width: 100px; + height: 100px; + border-radius: 50px; + } + + + + +
+
+ +
+ + + + + \ No newline at end of file diff --git a/frontend/src/renderer/src/App.tsx b/frontend/src/renderer/src/App.tsx index 9ac97e34..6eac1fbb 100644 --- a/frontend/src/renderer/src/App.tsx +++ b/frontend/src/renderer/src/App.tsx @@ -52,7 +52,6 @@ function AppContent(): React.ReactElement { }) const scheduleNextCheck = useMemoizedFn(() => { statusCheckIntervalRef.current = setTimeout(() => { - console.log('scheduleNextCheck', backendStatus) if (backendStatus !== 'running') { checkInitialStatus() } else { diff --git a/frontend/src/renderer/src/pages/home/components/heatmap/heatmap.tsx b/frontend/src/renderer/src/pages/home/components/heatmap/heatmap.tsx index 901cadc0..73331284 100644 --- a/frontend/src/renderer/src/pages/home/components/heatmap/heatmap.tsx +++ b/frontend/src/renderer/src/pages/home/components/heatmap/heatmap.tsx @@ -241,6 +241,19 @@ const HeatmapEntry: FC = (props) => { selectedDate={selectedDays} /> )} + renderWeekday={(props) => { + const { label, cellSize, index } = props + return ( +
+ {index % 2 === 0 ? '' : label} +
+ ) + }} />
{currentDetailData.map((item) => { diff --git a/frontend/src/renderer/src/pages/home/components/to-do-card/index.tsx b/frontend/src/renderer/src/pages/home/components/to-do-card/index.tsx index d504af6b..165c20e0 100644 --- a/frontend/src/renderer/src/pages/home/components/to-do-card/index.tsx +++ b/frontend/src/renderer/src/pages/home/components/to-do-card/index.tsx @@ -29,6 +29,7 @@ import highPriorityIcon from '@renderer/assets/icons/high-priority.svg' import mediumPriorityIcon from '@renderer/assets/icons/medium-priority.svg' import lowPriorityIcon from '@renderer/assets/icons/low-priority.svg' import doneIcon from '@renderer/assets/icons/done.svg' +import dayjs from 'dayjs' const { Text } = Typography const TextArea = Input.TextArea @@ -341,7 +342,7 @@ const ToDoCard: FC = (props) => { useEffect(() => { // Need to refresh the task list after clicking a date on the heatmap if (selectedDays) { - fetchTasks() + fetchTasks(dayjs(selectedDays)) } }, [selectedDays]) diff --git a/frontend/src/renderer/src/types/electron.d.ts b/frontend/src/renderer/src/types/electron.d.ts index 9187245a..a04a7853 100644 --- a/frontend/src/renderer/src/types/electron.d.ts +++ b/frontend/src/renderer/src/types/electron.d.ts @@ -105,6 +105,7 @@ interface EventLoopAPI { } interface serverPushAPI { pushHomeLatestActivity: (callback: (data: Activity) => void) => any + [propName: string]: (...args: any[]) => any } declare global {