Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
dev_server.log
5 changes: 3 additions & 2 deletions app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { LANGUAGES } from "@/lib/constants"
import { useLanguage } from "@/lib/i18n"

import { useTheme } from "@/components/ThemeProvider"
import { SafeHtml } from "@/components/SafeHtml"

export default function Profile() {
const { data: session } = useSession()
Expand Down Expand Up @@ -89,7 +90,7 @@ export default function Profile() {
<p className="text-slate-900 dark:text-white text-3xl font-bold">{stats?.hoursStudied || 0}h</p>
</div>
<p className="text-slate-500 dark:text-text-secondary text-xs mt-2">
{t("dashboard.learned_minutes", Math.round((stats?.hoursStudied || 0) * 60))}
<SafeHtml text={t("dashboard.learned_minutes", Math.round((stats?.hoursStudied || 0) * 60))} />
</p>
</div>
</div>
Expand Down Expand Up @@ -218,7 +219,7 @@ export default function Profile() {
title={t("profile.coming_soon")}
description={t("profile.coming_soon_desc")}
actionLabel={t("profile.go_back")}
onAction={() => setActiveTab("overview")}
actionHref="/profile"
Comment on lines 221 to +222
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Keep Go Back wired to the local tab state.

activeTab only lives in component state at Line 24. By switching Line 222 to actionHref, this CTA stops explicitly returning users to "overview" and now relies on navigation instead. components/EmptyState.tsx only invokes the tab-reset logic in the onAction branch, so this can leave users stuck on the placeholder view.

Suggested fix
               actionLabel={t("profile.go_back")}
-              actionHref="/profile"
+              onAction={() => setActiveTab("overview")}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
actionLabel={t("profile.go_back")}
onAction={() => setActiveTab("overview")}
actionHref="/profile"
actionLabel={t("profile.go_back")}
onAction={() => setActiveTab("overview")}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/profile/page.tsx` around lines 221 - 222, The "Go Back" CTA was changed
from invoking the local tab reset to a hard navigation (actionHref), which
bypasses the component state (activeTab) and leaves users stuck on the
EmptyState; restore the tab-reset behavior by wiring the CTA to call the
component's tab setter instead of using actionHref — replace actionHref usage
for the "Go Back" instance with an onAction callback that calls the local
setActiveTab("overview") (or the existing tab-reset handler) so
EmptyState.onAction is invoked and activeTab returns to "overview"; reference
the activeTab state, its setter (setActiveTab), the actionLabel prop and
EmptyState.onAction to locate where to change the prop.

/>
</div>
)
Expand Down
38 changes: 29 additions & 9 deletions dev_server.log
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
npm error code ETIMEDOUT
npm error errno ETIMEDOUT
npm error network request to https://registry.npmjs.org/next failed, reason:
npm error network This is a problem related to network connectivity.
npm error network In most cases you are behind a proxy or have bad network settings.
npm error network
npm error network If you are behind a proxy, please make sure that the
npm error network 'proxy' config is set properly. See: 'npm help config'
npm error A complete log of this run can be found in: /home/jules/.npm/_logs/2026-03-12T14_03_17_778Z-debug-0.log

> study-app@0.1.0 dev
> next dev

▲ Next.js 16.1.6 (Turbopack)
- Local: http://localhost:3000
- Network: http://192.168.0.2:3000

✓ Starting...
⚠ The "middleware" file convention is deprecated. Please use "proxy" instead. Learn more: https://nextjs.org/docs/messages/middleware-to-proxy
✓ Ready in 3.2s
○ Compiling /profile ...
GET /profile 200 in 5.9s (compile: 5.3s, proxy.ts: 145ms, render: 448ms)
[auth][error] MissingSecret: Please define a `secret`. Read more at https://errors.authjs.dev#missingsecret
at assertConfig (/app/.next/dev/server/chunks/node_modules_@auth_core_56a04589._.js:513:16)
at Auth (/app/.next/dev/server/chunks/node_modules_@auth_core_56a04589._.js:5330:204)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
at async AppRouteRouteModule.do (/app/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.dev.js:5:37866)
GET /profile 200 in 239ms (compile: 78ms, proxy.ts: 9ms, render: 153ms)
[auth][error] MissingSecret: Please define a `secret`. Read more at https://errors.authjs.dev#missingsecret
at assertConfig (/app/.next/dev/server/chunks/node_modules_@auth_core_56a04589._.js:513:16)
at Auth (/app/.next/dev/server/chunks/node_modules_@auth_core_56a04589._.js:5330:204)
at async AppRouteRouteModule.do (/app/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.dev.js:5:37866)
GET /api/auth/session 500 in 46ms (compile: 31ms, render: 15ms)
[auth][error] MissingSecret: Please define a `secret`. Read more at https://errors.authjs.dev#missingsecret
at assertConfig (/app/.next/dev/server/chunks/node_modules_@auth_core_56a04589._.js:513:16)
at Auth (/app/.next/dev/server/chunks/node_modules_@auth_core_56a04589._.js:5330:204)
at async AppRouteRouteModule.do (/app/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.dev.js:5:37866)
GET /api/auth/session 500 in 17ms (compile: 10ms, render: 7ms)