Conversation
Co-authored-by: Justineo <1726061+Justineo@users.noreply.github.com>
Co-authored-by: Justineo <1726061+Justineo@users.noreply.github.com>
Co-authored-by: Justineo <1726061+Justineo@users.noreply.github.com>
Co-authored-by: Justineo <1726061+Justineo@users.noreply.github.com>
Co-authored-by: Justineo <1726061+Justineo@users.noreply.github.com>
Co-authored-by: Justineo <1726061+Justineo@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new “Issue Awards” page (EN + ZH) and wires it into the site navigation with localized copy.
Changes:
- Add new routes:
/issue-awards/and/zh/issue-awards/ - Introduce
IssueAwardspage component that embeds the hashtag timeline - Add i18n strings and nav entry for the new page
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/issue-awards.astro | Adds the English route that renders the IssueAwards page component. |
| src/pages/zh/issue-awards.astro | Adds the Chinese route that renders the IssueAwards page component. |
| src/components/pages/IssueAwards.astro | Implements the Issue Awards page UI + X/Twitter timeline embed and theme syncing logic. |
| src/i18n/ui.ts | Adds localized nav label for the new page. |
| src/i18n/pages.ts | Adds page copy (title/description/etc.) for the Issue Awards page in EN/ZH. |
| src/consts.ts | Adds the new nav item pointing to /issue-awards/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| document.addEventListener('astro:page-load', applyTheme) | ||
| prefersDarkQuery.addEventListener('change', applyTheme) | ||
| document.addEventListener('click', handleClick) | ||
| document.addEventListener('astro:before-swap', () => { | ||
| prefersDarkQuery.removeEventListener('change', applyTheme) | ||
| document.removeEventListener('click', handleClick) | ||
| }) |
There was a problem hiding this comment.
The cleanup logic is incomplete: this script registers an astro:page-load listener and an anonymous astro:before-swap listener, but only removes the media-query and click listeners. With client-side navigation, revisiting this page can accumulate multiple astro:page-load/astro:before-swap handlers. Use named handler functions and unregister all listeners (including astro:page-load and astro:before-swap) during cleanup (and/or self-remove the before-swap handler after it runs).
| document.addEventListener('astro:page-load', applyTheme) | |
| prefersDarkQuery.addEventListener('change', applyTheme) | |
| document.addEventListener('click', handleClick) | |
| document.addEventListener('astro:before-swap', () => { | |
| prefersDarkQuery.removeEventListener('change', applyTheme) | |
| document.removeEventListener('click', handleClick) | |
| }) | |
| function handlePageLoad() { | |
| applyTheme() | |
| } | |
| function handleBeforeSwap() { | |
| document.removeEventListener('astro:page-load', handlePageLoad) | |
| prefersDarkQuery.removeEventListener('change', applyTheme) | |
| document.removeEventListener('click', handleClick) | |
| document.removeEventListener('astro:before-swap', handleBeforeSwap) | |
| } | |
| document.addEventListener('astro:page-load', handlePageLoad) | |
| prefersDarkQuery.addEventListener('change', applyTheme) | |
| document.addEventListener('click', handleClick) | |
| document.addEventListener('astro:before-swap', handleBeforeSwap) |
| >#迷惑issue大赏</a | ||
| > |
There was a problem hiding this comment.
The <a> tag is formatted in a way that splits the closing tag across lines (</a then >), which hurts readability and can confuse formatters/linters. Please format it as a normal <a ...>…</a> block.
| >#迷惑issue大赏</a | |
| > | |
| > | |
| #迷惑issue大赏 | |
| </a> |
Description
Linked Issues
Additional context