feat(docs): update architecture documentation references and enhance handover details
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / playwright-tests (push) Successful in 57s
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / playwright-tests (push) Successful in 57s
- Added references to the architecture target image, refactor roadmap, and binding Shinkan rules in CLAUDE.md and HANDOVER.md for better project clarity. - Updated the Dashboard component to improve user authentication handling and optimize data loading, enhancing overall performance and user experience. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
1c268555f6
commit
7043addd15
8 files changed
+446
-40
No files matched your search
@@ -21,19 +21,13 @@ function formatCappedCount(n, capped) {
|
||||
}
|
||||
|
||||
function Dashboard() {
|
||||
const [profile, setProfile] = useState(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [trainingHome, setTrainingHome] = useState(null)
|
||||
const [trainingHomeErr, setTrainingHomeErr] = useState(null)
|
||||
const [phase0Stats, setPhase0Stats] = useState(null)
|
||||
const [phase0Err, setPhase0Err] = useState(null)
|
||||
const { user } = useAuth()
|
||||
const { user, loading: authLoading } = useAuth()
|
||||
const tenantClubDepKey = useMemo(() => getTenantClubDependencyKey(user), [user])
|
||||
|
||||
useEffect(() => {
|
||||
loadData()
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (!user?.id) {
|
||||
setTrainingHome(null)
|
||||
@@ -45,20 +39,7 @@ function Dashboard() {
|
||||
setTrainingHomeErr(null)
|
||||
try {
|
||||
const today = new Date().toISOString().slice(0, 10)
|
||||
const [upcomingRaw, reviewPendingRaw, plannedPool] = await Promise.all([
|
||||
api.listTrainingUnits({
|
||||
assigned_to_me: true,
|
||||
status: 'planned',
|
||||
start_date: today,
|
||||
sort: 'asc',
|
||||
limit: 8,
|
||||
}),
|
||||
api.listTrainingUnits({
|
||||
assigned_to_me: true,
|
||||
debrief_pending: true,
|
||||
sort: 'desc',
|
||||
limit: 8,
|
||||
}),
|
||||
const [plannedPoolRaw, reviewPendingRaw] = await Promise.all([
|
||||
api.listTrainingUnits({
|
||||
assigned_to_me: true,
|
||||
status: 'planned',
|
||||
@@ -66,15 +47,25 @@ function Dashboard() {
|
||||
sort: 'asc',
|
||||
limit: 40,
|
||||
}),
|
||||
api.listTrainingUnits({
|
||||
assigned_to_me: true,
|
||||
debrief_pending: true,
|
||||
sort: 'desc',
|
||||
limit: 8,
|
||||
}),
|
||||
])
|
||||
const noteHits = (plannedPool || []).filter((u) => {
|
||||
const tn = (u.trainer_notes || '').trim()
|
||||
const n = (u.notes || '').trim()
|
||||
return Boolean(tn || n)
|
||||
}).slice(0, 5)
|
||||
const plannedPool = Array.isArray(plannedPoolRaw) ? plannedPoolRaw : []
|
||||
const upcoming = plannedPool.slice(0, 8)
|
||||
const noteHits = plannedPool
|
||||
.filter((u) => {
|
||||
const tn = (u.trainer_notes || '').trim()
|
||||
const n = (u.notes || '').trim()
|
||||
return Boolean(tn || n)
|
||||
})
|
||||
.slice(0, 5)
|
||||
if (!cancelled) {
|
||||
setTrainingHome({
|
||||
upcoming: Array.isArray(upcomingRaw) ? upcomingRaw : [],
|
||||
upcoming,
|
||||
reviewPending: Array.isArray(reviewPendingRaw) ? reviewPendingRaw : [],
|
||||
plannedWithNotes: noteHits,
|
||||
})
|
||||
@@ -146,18 +137,7 @@ function Dashboard() {
|
||||
}
|
||||
}, [user?.id, tenantClubDepKey])
|
||||
|
||||
const loadData = async () => {
|
||||
try {
|
||||
const profileData = await api.getCurrentProfile()
|
||||
setProfile(profileData)
|
||||
} catch (err) {
|
||||
console.error('Failed to load data:', err)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
if (authLoading) {
|
||||
return (
|
||||
<div className="app-page" style={{ padding: '2rem 0', textAlign: 'center' }}>
|
||||
<div className="spinner"></div>
|
||||
@@ -182,7 +162,7 @@ function Dashboard() {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{profile && <EmailVerificationBanner profile={profile} />}
|
||||
{user ? <EmailVerificationBanner profile={user} /> : null}
|
||||
|
||||
{user?.id ? (
|
||||
<>
|
||||
|
||||
Reference in new issue
Block a user