feat: 前端UI标题栏优化与配置更新

- 更新.gitignore,添加frontend/.next/忽略
- 优化RecordModal、index、recurring、search、stats页面标题栏样式
- 新增frontend/lib/utils.js工具函数
- 更新useCategories.js钩子
- 添加代码优化计划文档

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Developer
2026-03-18 16:33:29 +08:00
co-authored by Claude
parent ad6387e49e
commit 127f491167
9 changed files with 2350 additions and 48 deletions
+20 -5
View File
@@ -1,12 +1,30 @@
import { useState, useEffect, useRef, useMemo } from 'react';
import { useRouter } from 'next/router';
import { isLoggedIn, getTrendStats, getCategoryStats } from '../lib/api';
import { Chart, registerables } from 'chart.js';
import {
Chart,
LineController,
LineElement,
PointElement,
LinearScale,
CategoryScale,
Filler,
Legend,
} from 'chart.js';
import AppShell from '../components/AppShell';
import { Icon } from '../components/icons';
import { getMonthStr, formatMonth } from '../lib/utils';
import { useToast } from '../components/ToastProvider';
Chart.register(...registerables);
Chart.register(
LineController,
LineElement,
PointElement,
LinearScale,
CategoryScale,
Filler,
Legend
);
export default function Stats() {
const router = useRouter();
@@ -35,9 +53,6 @@ export default function Stats() {
loadCategoryData();
}, [router, currentMonth, categoryType]);
const getMonthStr = (date) => `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;
const formatMonth = (date) => `${date.getFullYear()}${date.getMonth() + 1}`;
const loadTrendData = async () => {
setTrendLoading(true);
try {