Skip to content

feat: add issue-award page#4

Closed
Justineo wants to merge 6 commits intosxzz:mainfrom
Justineo:main
Closed

feat: add issue-award page#4
Justineo wants to merge 6 commits intosxzz:mainfrom
Justineo:main

Conversation

@Justineo
Copy link
Copy Markdown

@Justineo Justineo commented Feb 4, 2026

  • This PR contains AI-generated code, but I have carefully reviewed it myself. Otherwise, my PR may be closed.
    • I understand that my PR is more likely to be rejected or requested for changes if it contains AI-generated code that I do not fully understand.

Description

Linked Issues

Additional context

Copilot AI and others added 6 commits February 4, 2026 17:52
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>
Copilot AI review requested due to automatic review settings February 4, 2026 09:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 IssueAwards page 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.

Comment on lines +83 to +89
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)
})
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
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)

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +49
>#迷惑issue大赏</a
>
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
>#迷惑issue大赏</a
>
>
#迷惑issue大赏
</a>

Copilot uses AI. Check for mistakes.
@sxzz sxzz closed this Feb 4, 2026
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.

4 participants