Skip to content

套用「星際 HUD」設計重構整體 UI,修正頭像裁切與圖示顯示問題#10

Merged
Retsomm merged 2 commits into
mainfrom
dev
Jul 12, 2026
Merged

套用「星際 HUD」設計重構整體 UI,修正頭像裁切與圖示顯示問題#10
Retsomm merged 2 commits into
mainfrom
dev

Conversation

@Retsomm

@Retsomm Retsomm commented Jul 12, 2026

Copy link
Copy Markdown
Owner
  • index.css/Navbar 全面改成星際 HUD 視覺(星點背景、掃描線、青橘配色、JetBrains Mono)
  • 個人資料頁改成合併式 hero 面板,帳號設定改清單樣式
  • 修正頭像拖曳/縮放的座標計算 bug,改用實際圖片尺寸算可拖曳範圍
  • 修正 favicon 未跳脫 XML 特殊字元、置中偏移的問題
  • 改用 Claude Design 提供的正式圖示套件取代暫用版本,補回被誤刪的 manifest.webmanifest

Summary by CodeRabbit

  • New Features

    • Added avatar repositioning with drag and zoom controls.
    • Added profile stage progression display with XP progress and growth history.
    • Added support for multi-size app icons and updated font loading.
  • Improvements

    • Refreshed the app’s visual design, including navigation, cards, quizzes, progress indicators, and account screens.
    • Updated branding with a new EasyLearn logo treatment.
    • Improved mobile navigation and safe-area support.
    • Updated app theme colors and background styling.

- index.css/Navbar 全面改成星際 HUD 視覺(星點背景、掃描線、青橘配色、JetBrains Mono)
- 個人資料頁改成合併式 hero 面板,帳號設定改清單樣式
- 修正頭像拖曳/縮放的座標計算 bug,改用實際圖片尺寸算可拖曳範圍
- 修正 favicon 未跳脫 XML 特殊字元、置中偏移的問題
- 改用 Claude Design 提供的正式圖示套件取代暫用版本,補回被誤刪的 manifest.webmanifest

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
easy-learn Ready Ready Preview, Comment Jul 12, 2026 4:16am

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Retsomm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3bf3c14e-e81d-44fc-9f55-bba3104bb4c1

📥 Commits

Reviewing files that changed from the base of the PR and between ecc691d and 3286926.

📒 Files selected for processing (1)
  • src/components/AccountHeader.tsx
📝 Walkthrough

Walkthrough

The PR refreshes the application theme and responsive navigation, updates metadata and fonts, adds intrinsic-size avatar positioning, redesigns learning surfaces, and introduces stage-based profile progress with revised account actions.

Changes

Application UI refresh

Layer / File(s) Summary
Application shell and theme
public/manifest.webmanifest, src/app/layout.tsx, src/components/Icons.tsx, src/components/Navbar.tsx, src/index.css
Metadata, fonts, branding, icon registration, global tokens, and responsive navigation styling are updated.
Intrinsic-size avatar editing
src/components/AccountHeader.tsx, src/index.css
Avatar dragging and zooming use intrinsic image dimensions, uploads reset editing state, and repositioning renders an absolutely positioned image.
Learning and statistics surfaces
src/index.css
Cards, quiz states, feedback, notes, statistics, charts, and heatmaps adopt updated borders, typography, colors, and clipped shapes.
Profile progress and account actions
src/screens/Profile.tsx, src/index.css
Profile XP derives stage progress for a new hero and growth-history toggle, while account actions use a stateful list layout.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 標題準確概括了這次的星際 HUD UI 重構,以及頭像裁切與圖示顯示修正。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/index.css (1)

29-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Quote unquoted font family names to satisfy Stylelint value-keyword-case.

Stylelint flags Menlo and Consolas as violating value-keyword-case. Font family names are case-sensitive, so lowercasing them would break font resolution. The correct fix is to quote them.

🔧 Proposed fix
-  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
+  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Consolas', monospace;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/index.css` at line 29, Update the --font-mono declaration to quote the
Menlo and Consolas font family names, preserving their original casing and the
existing fallback order.

Source: Linters/SAST tools

src/app/layout.tsx (1)

33-39: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Prefer next/font over manual Google Fonts <link> tags.

Next.js provides next/font/google which self-hosts fonts, eliminates the network round-trip to fonts.googleapis.com, prevents layout shift, and automatically injects preconnect. The current approach adds render-blocking external requests and a third-party dependency on Google's CDN.

♻️ Proposed refactor using next/font
+import { JetBrains_Mono, Noto_Sans_TC } from 'next/font/google'
+
+const jetBrainsMono = JetBrains_Mono({
+  subsets: ['latin'],
+  weight: ['400', '500', '700', '800'],
+  variable: '--font-mono',
+})
+
+const notoSansTC = Noto_Sans_TC({
+  subsets: ['latin'],
+  weight: ['400', '500', '700', '900'],
+  variable: '--font-sans',
+})
+
 const RootLayout = ({ children }: { children: React.ReactNode }) => {
   return (
     <ClerkProvider afterSignOutUrl="/">
-      <html lang="zh-TW">
-        <head>
-          <link rel="preconnect" href="https://fonts.googleapis.com" />
-          <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
-          <link
-            href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&family=Noto+Sans+TC:wght@400;500;700;900&display=swap"
-            rel="stylesheet"
-          />
-        </head>
+      <html lang="zh-TW" className={`${jetBrainsMono.variable} ${notoSansTC.variable}`}>
         <body>{children}</body>
       </html>
     </ClerkProvider>
   )
 }

Then update src/index.css to reference the CSS variables set by next/font:

-  --font-sans: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
-  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
+  --font-sans: var(--font-sans), 'Noto Sans TC', system-ui, -apple-system, sans-serif;
+  --font-mono: var(--font-mono), 'SF Mono', Menlo, Consolas, monospace;

As per coding guidelines from Next.js 15+ documentation, next/font is the recommended approach for font loading, providing automatic optimization and self-hosting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/layout.tsx` around lines 33 - 39, Replace the manual Google Fonts
links and preconnect tags in the layout head with Next.js `next/font/google`
font definitions for JetBrains Mono and Noto Sans TC. Configure the fonts to
expose CSS variables, apply those variables through the layout, and update the
global styles in `src/index.css` to use the generated variables while preserving
the existing font weights and typography.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/AccountHeader.tsx`:
- Around line 25-29: Update readAvatarPosition to validate and clamp persisted
x, y, and scale values before returning them, rejecting non-finite values such
as NaN and Infinity and enforcing the component’s existing allowed ranges.
Preserve the default scale of 1 when scale is invalid or absent, and ensure
unsafeMetadata cannot produce out-of-range avatar positioning or sizing.
- Around line 88-93: In the successful upload path of AccountHeader, update
posBeforeEdit to DEFAULT_POS immediately after setPos(DEFAULT_POS) and before
setIsRepositioning(true). Preserve the existing pre-upload baseline capture and
repositioning flow.

---

Nitpick comments:
In `@src/app/layout.tsx`:
- Around line 33-39: Replace the manual Google Fonts links and preconnect tags
in the layout head with Next.js `next/font/google` font definitions for
JetBrains Mono and Noto Sans TC. Configure the fonts to expose CSS variables,
apply those variables through the layout, and update the global styles in
`src/index.css` to use the generated variables while preserving the existing
font weights and typography.

In `@src/index.css`:
- Line 29: Update the --font-mono declaration to quote the Menlo and Consolas
font family names, preserving their original casing and the existing fallback
order.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e5bee709-cb32-436f-8ab2-1c65ccd6ad5e

📥 Commits

Reviewing files that changed from the base of the PR and between 2931137 and ecc691d.

⛔ Files ignored due to path filters (12)
  • public/apple-touch-icon.png is excluded by !**/*.png
  • public/favicon.svg is excluded by !**/*.svg
  • public/icon-1024.png is excluded by !**/*.png
  • public/icon-120.png is excluded by !**/*.png
  • public/icon-180.png is excluded by !**/*.png
  • public/icon-192.png is excluded by !**/*.png
  • public/icon-29.png is excluded by !**/*.png
  • public/icon-40.png is excluded by !**/*.png
  • public/icon-512.png is excluded by !**/*.png
  • public/icon-540.png is excluded by !**/*.png
  • public/icon-60.png is excluded by !**/*.png
  • public/icon-87.png is excluded by !**/*.png
📒 Files selected for processing (7)
  • public/manifest.webmanifest
  • src/app/layout.tsx
  • src/components/AccountHeader.tsx
  • src/components/Icons.tsx
  • src/components/Navbar.tsx
  • src/index.css
  • src/screens/Profile.tsx
💤 Files with no reviewable changes (1)
  • src/components/Icons.tsx

Comment thread src/components/AccountHeader.tsx
Comment thread src/components/AccountHeader.tsx
readAvatarPosition 補上有限數值檢查與範圍限制,避免 unsafeMetadata 遭竄改(NaN/Infinity/超出範圍)導致頭像版位跑版;上傳新照片成功後同步重設 posBeforeEdit,避免取消調整時誤用舊照片的位置設定。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Retsomm
Retsomm merged commit c45823e into main Jul 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant