Skip to content

feat: add "My" footer tab and personal page with six blocks#76

Open
gushishang wants to merge 1 commit into
mainfrom
codex/add-my-page-to-footer
Open

feat: add "My" footer tab and personal page with six blocks#76
gushishang wants to merge 1 commit into
mainfrom
codex/add-my-page-to-footer

Conversation

@gushishang
Copy link
Copy Markdown
Member

Motivation

  • Provide a personal "My" page reachable from the footer that mirrors the Home layout and surfaces user-specific content in six categorized blocks (published/favorited/supported for Experiments and Discussions).

Description

  • Added a new route /my and a src/views/My.vue page that reuses the existing Block component and Home-style grid to render six ListBlock sections assembled from server query results.
  • Implemented data loading in My.vue via six getData('/Contents/QueryExperiments') calls combining Category (Experiment/Discussion) and Special (null/Favorite/Support), and the page requires login (opens login modal if not authenticated).
  • Added a new "My" tab to the footer navigation in src/components/utils/Footer.vue that links to /my.
  • Added i18n keys for footer.my and myPage.* block titles in src/i18n/{zh,en,de,ja,fr}.ts so the UI is localized.

Testing

  • Ran the i18n consistency check with npm run lint:i18n which passed.
  • Built the production bundle with npm run build (TypeScript + Vite + PWA steps) which completed successfully.

Codex Task

@gushishang
Copy link
Copy Markdown
Member Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4627ad8b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/views/My.vue
Comment on lines +82 to +86
onMounted(async () => {
if (!checkLogin(false)) {
showLoginModel()
isLoading.value = false
return
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Refresh data after login when page is cached

This page only loads data in onMounted, but the route is marked keepAlive, so when an unauthenticated user opens /my, the component returns early and stays cached with empty blocks; after completing login and returning to /my, onMounted will not run again and the page remains empty until a full reload. Please trigger the same load flow on activation or on userLogin so cached instances recover.

Useful? React with 👍 / 👎.

Comment thread src/views/My.vue
Comment on lines +89 to +97
const [publishedExp, publishedDiscussion, favoriteExp, favoriteDiscussion, supportExp, supportDiscussion] =
await Promise.all([
querySummaries('Experiment', null),
querySummaries('Discussion', null),
querySummaries('Experiment', 'Favorite'),
querySummaries('Discussion', 'Favorite'),
querySummaries('Experiment', 'Support'),
querySummaries('Discussion', 'Support'),
])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Guard parallel queries so loading state always clears

The six requests are awaited with Promise.all without any error handling, and getData can throw on transport failures (see src/services/api/getData.ts catch path). If one request rejects, isLoading is never set to false and the page stays in a perpetual loading state with an unhandled rejection. Wrap the load in try/finally (and optionally handle per-block failures) so the UI can recover.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant