Docker Build and Push / build-image (push) Successful in 4m9s
1. 回滚键盘遮挡统一方案 (真机测试不通过, 需求搁置): 恢复 TaskDetail/ UserPicker/CopyTaskPopup/ProjectManage 与 useKeyboardInset 到 9fea1a5^, 删除 useKeyboardInsetWatcher / .kb-safe / interactive-widget=resizes-content 2. 任务详情页样式随 1 一并恢复提交前状态 (含底部拷贝/删除按钮) 3. 列表视图换列改为卡片拖动: 新 useRowDrag (长按 400ms 行抬起, 左右 80px/列步进, 行尾徽标显示目标列, 松手落列), 移除长按 ActionSheet —— 旧长按与复选框/行点击互相误触, 抬手合成 click 落在控件上触发状态切换 4. 看板拖动防误触: 任务区禁长按文字选择与系统菜单 (输入框除外); pointercancel 只放弃不提交; 拖动结束 350ms 内抑制 click 误开详情; 状态点/⋯/子任务行 pointerdown 不冒泡, 不发起拖动 5. 看板横滑扩展到整屏: .page-transition 补 height:100% 打通 app-main → page-with-navbar 百分比链, board-wrap 撑满剩余高度 已验证: kb-safe/Watcher/onLongPress 残留引用清零, 逐文件 diff 审阅通过; 本机无 Node 运行时, 未跑 vite build
54 lines
2.4 KiB
React
54 lines
2.4 KiB
React
import { Routes, Route, Navigate, useLocation } from 'react-router-dom'
|
|
import MobileShell from './layouts/MobileShell.jsx'
|
|
import LoginPage from './pages/LoginPage.jsx'
|
|
import MacroPage from './pages/MacroPage.jsx'
|
|
import MonitorPage from './pages/MonitorPage.jsx'
|
|
import ServerDetail from './pages/monitor/ServerDetail.jsx'
|
|
import MePage from './pages/MePage.jsx'
|
|
import CheckinPage from './pages/checkin/CheckinPage.jsx'
|
|
import TaskPage from './pages/task/TaskPage.jsx'
|
|
import { useAuth } from './auth/AuthContext.jsx'
|
|
|
|
// 默认落地页: 打卡 (V0.2 起打卡是第一个 Tab 且为默认选中)
|
|
const HOME_PATH = '/checkin'
|
|
|
|
// 已登录访问 /login 自动回默认页
|
|
function RedirectIfAuthed({ children }) {
|
|
const { user, loading } = useAuth()
|
|
if (loading) return null
|
|
if (user) return <Navigate to={HOME_PATH} replace />
|
|
return children
|
|
}
|
|
|
|
// 未登录访问受保护页面 → 跳 /login
|
|
function RequireAuth({ children }) {
|
|
const { user, loading } = useAuth()
|
|
const location = useLocation()
|
|
if (loading) return <div className="page-loading">加载中...</div>
|
|
if (!user) return <Navigate to="/login" state={{ from: location }} replace />
|
|
return children
|
|
}
|
|
|
|
export default function App() {
|
|
return (
|
|
<Routes>
|
|
<Route path="/login" element={<RedirectIfAuthed><LoginPage /></RedirectIfAuthed>} />
|
|
<Route element={<RequireAuth><MobileShell /></RequireAuth>}>
|
|
{/* 打卡为默认首页 */}
|
|
<Route path="/" element={<Navigate to={HOME_PATH} replace />} />
|
|
<Route path="/checkin" element={<CheckinPage />} />
|
|
{/* 任务模块 (V0.2): 首屏(最近项目+当前项目) / 项目列表 / 深链 (T-VW-08/09) */}
|
|
<Route path="/task" element={<TaskPage />} />
|
|
<Route path="/task/list" element={<TaskPage />} />
|
|
<Route path="/task/:pid" element={<TaskPage />} />
|
|
{/* 宏观: 报警 / 新闻 / 油价 / 经济数据 / 策略研究 / 经济文章 (V0.2 原首页并入, 默认新闻) */}
|
|
<Route path="/macro" element={<Navigate to="/macro/news" replace />} />
|
|
<Route path="/macro/*" element={<MacroPage />} />
|
|
<Route path="/monitor" element={<MonitorPage />} />
|
|
<Route path="/monitor/server/:uuid" element={<ServerDetail />} />
|
|
<Route path="/me" element={<MePage />} />
|
|
</Route>
|
|
<Route path="*" element={<Navigate to={HOME_PATH} replace />} />
|
|
</Routes>
|
|
)
|
|
} |