Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 15 additions & 25 deletions frontend/electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
// },
// }
// }
}
})
6 changes: 3 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -150,4 +150,4 @@
"esbuild"
]
}
}
}
20 changes: 10 additions & 10 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 38 additions & 39 deletions frontend/src/renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,44 @@
-->
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1, width=device-width" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; connect-src blob: *; script-src 'self' 'unsafe-eval' 'unsafe-inline' *; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' *; font-src 'self' data: *; img-src 'self' data: file: * blob: vikingdb:; frame-src * file:" />
<title>MineContext</title>
<style>
html,
body {
margin: 0;
}

#spinner {
position: fixed;
width: 100vw;
height: 100vh;
flex-direction: row;
justify-content: center;
align-items: center;
display: flex;
}
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1, width=device-width" />
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; connect-src blob: *; script-src 'self' 'unsafe-eval' 'unsafe-inline' *; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' *; font-src 'self' data: *; img-src 'self' data: file: * blob: vikingdb:; frame-src * file:" />
<title>MineContext</title>
<style>
html,
body {
margin: 0;
}

#spinner img {
width: 100px;
height: 100px;
border-radius: 50px;
}
</style>
</head>
#spinner {
position: fixed;
width: 100vw;
height: 100vh;
flex-direction: row;
justify-content: center;
align-items: center;
display: flex;
}

<body>
<div id="root"></div>
<div id="spinner">
<img src="/src/assets/images/logo.png" />
</div>
<script>
console.time('init')
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
#spinner img {
width: 100px;
height: 100px;
border-radius: 50px;
}
</style>
</head>

<body>
<div id="root"></div>
<div id="spinner">
<img src="/src/assets/images/logo.png" />
</div>

<script type="module" src="/src/main.tsx"></script>
</body>

</html>
1 change: 0 additions & 1 deletion frontend/src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function AppContent(): React.ReactElement {
})
const scheduleNextCheck = useMemoizedFn(() => {
statusCheckIntervalRef.current = setTimeout(() => {
console.log('scheduleNextCheck', backendStatus)
if (backendStatus !== 'running') {
checkInitialStatus()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,19 @@ const HeatmapEntry: FC<HeatmapEntryProps> = (props) => {
selectedDate={selectedDays}
/>
)}
renderWeekday={(props) => {
const { label, cellSize, index } = props
return (
<div
style={{
height: cellSize,
justifyContent: 'space-around'
}} // 使用 cellSize
className="flex items-center text-xs text-gray-500">
{index % 2 === 0 ? '' : label}
</div>
)
}}
/>
<div className="grid grid-cols-4 gap-[8px] mt-[10px]">
{currentDetailData.map((item) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -341,7 +342,7 @@ const ToDoCard: FC<ToDoCardProps> = (props) => {
useEffect(() => {
// Need to refresh the task list after clicking a date on the heatmap
if (selectedDays) {
fetchTasks()
fetchTasks(dayjs(selectedDays))
}
}, [selectedDays])

Expand Down
1 change: 1 addition & 0 deletions frontend/src/renderer/src/types/electron.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ interface EventLoopAPI {
}
interface serverPushAPI {
pushHomeLatestActivity: (callback: (data: Activity) => void) => any
[propName: string]: (...args: any[]) => any
}

declare global {
Expand Down
Loading