Skip to content
Draft
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
31 changes: 31 additions & 0 deletions src/components/Dashboard/Dashboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,37 @@
font-style: italic;
}

/* Icon inline wrapper — prevents creating new object on every render */
.iconInline {
margin-right: var(--base-size-4, 4px);
display: inline-flex;
}

/* Skeleton loading row header — shared by challenge, goal, and topics loading states */
.skeletonLoadingRow {
margin-bottom: var(--base-size-8, 8px);
}

/* Skeleton flex fill — topic skeleton icon/text row */
.skeletonFlex {
flex: 1;
}

/* Skeleton bottom margin — small (8px) */
.skeletonMbSm {
margin-bottom: var(--base-size-8, 8px);
}

/* Skeleton bottom margin — extra-small (4px) */
.skeletonMbXs {
margin-bottom: var(--base-size-4, 4px);
}

/* Skeleton bottom margin — medium (16px) */
.skeletonMbMd {
margin-bottom: var(--base-size-16, 16px);
}

/* Screen reader only text */
.srOnly {
position: absolute;
Expand Down
16 changes: 8 additions & 8 deletions src/components/Dashboard/daily-focus-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const DailyFocusSection = memo(function DailyFocusSection({
</Heading>
{isAIEnabled && (
<Label variant="success" size="small">
<span style={{ marginRight: '4px', display: 'inline-flex' }}><CopilotIcon size={12} /></span>
<span className={styles.iconInline}><CopilotIcon size={12} /></span>
AI-Powered
</Label>
)}
Expand Down Expand Up @@ -224,7 +224,7 @@ export const DailyFocusSection = memo(function DailyFocusSection({
<div className={styles.focusContent}>
{isChallengeLoading ? (
<div className={styles.challengeCard}>
<Stack direction="horizontal" align="center" justify="space-between" style={{ marginBottom: 8 }}>
<Stack direction="horizontal" align="center" justify="space-between" className={styles.skeletonLoadingRow}>
<Stack direction="horizontal" align="center" gap="condensed">
<Spinner size="small" />
<span className={styles.loadingText}>Generating challenge...</span>
Expand All @@ -242,7 +242,7 @@ export const DailyFocusSection = memo(function DailyFocusSection({
</Button>
)}
</Stack>
<SkeletonBox height="20px" width="70%" style={{ marginBottom: 8 }} />
<SkeletonBox height="20px" width="70%" className={styles.skeletonMbSm} />
<SkeletonBox height="40px" width="100%" />
</div>
) : (
Expand Down Expand Up @@ -275,7 +275,7 @@ export const DailyFocusSection = memo(function DailyFocusSection({
<div className={styles.focusContent}>
{isGoalLoading ? (
<div className={styles.goalCard}>
<Stack direction="horizontal" align="center" justify="space-between" style={{ marginBottom: 8 }}>
<Stack direction="horizontal" align="center" justify="space-between" className={styles.skeletonLoadingRow}>
<Stack direction="horizontal" align="center" gap="condensed">
<Spinner size="small" />
<span className={styles.loadingText}>Generating goal...</span>
Expand All @@ -293,7 +293,7 @@ export const DailyFocusSection = memo(function DailyFocusSection({
</Button>
)}
</Stack>
<SkeletonBox height="40px" width="100%" style={{ marginBottom: 16 }} />
<SkeletonBox height="40px" width="100%" className={styles.skeletonMbMd} />
<SkeletonBox height="8px" width="100%" />
</div>
) : (
Expand All @@ -313,7 +313,7 @@ export const DailyFocusSection = memo(function DailyFocusSection({
<div className={styles.focusContent}>
{isTopicsLoading ? (
<Stack direction="vertical" gap="normal">
<Stack direction="horizontal" align="center" justify="space-between" style={{ marginBottom: 8 }}>
<Stack direction="horizontal" align="center" justify="space-between" className={styles.skeletonLoadingRow}>
<Stack direction="horizontal" align="center" gap="condensed">
<Spinner size="small" />
<span className={styles.loadingText}>Generating learning topics...</span>
Expand All @@ -335,8 +335,8 @@ export const DailyFocusSection = memo(function DailyFocusSection({
<div key={`skeleton-topic-${skeletonIndex}`} className={styles.learnCard}>
<Stack direction="horizontal" align="start" gap="normal">
<SkeletonBox height="44px" width="44px" />
<div style={{ flex: 1 }}>
<SkeletonBox height="16px" width="50%" style={{ marginBottom: 4 }} />
<div className={styles.skeletonFlex}>
<SkeletonBox height="16px" width="50%" className={styles.skeletonMbXs} />
<SkeletonBox height="16px" width="80%" />
</div>
</Stack>
Expand Down
Loading