Skip to content

Feat/1.4.0#27

Merged
Sealt merged 18 commits into
mainfrom
feat/1.4.0
Jun 23, 2026
Merged

Feat/1.4.0#27
Sealt merged 18 commits into
mainfrom
feat/1.4.0

Conversation

@Sealt

@Sealt Sealt commented Jun 23, 2026

Copy link
Copy Markdown
Member

No description provided.

@Sealt
Sealt requested a review from AEnjoy as a code owner June 23, 2026 17:30

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces several new features, including a Pomodoro timer card, GPA backup/restore functionality, and new pages for competitions, exchange programs, major transfers, and organizations. It also refactors the API layer to use a unified request utility with robust token refresh and error handling, while removing legacy admin pages and endpoints. The code review feedback suggests moving page-level lifecycles from the nested Pomodoro component to its parent page, simplifying a redundant conditional check in the hexToRgba helper, and removing an unused formatDateTime function.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +635 to +645
Taro.useDidShow(() => {
restoreState()
})

Taro.useDidHide(() => {
stopTimer()
if (isRunning.value) {
syncRemainingFromTimestamp()
}
persistState()
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In Taro, page lifecycle hooks like useDidShow and useDidHide are designed for Page components. When used inside nested custom components (like PomodoroCard.vue), they may not trigger reliably or at all depending on the Taro version and platform.

It is safer to manage these page-level lifecycles in the parent Page component (src/pages/home/index.vue) and trigger the corresponding methods on this component via template refs or props.

// TODO: Move page-level lifecycles (useDidShow/useDidHide) to the parent Page component and call component methods via refs.

Comment on lines +748 to +768
const hexToRgba = (hex, alpha) => {
if (!hex) {
return `rgba(148, 163, 184, ${alpha})`
}

const normalized = hex.replace('#', '')
const length = normalized.length === 3 ? 1 : 2
const values = normalized.length === 3
? normalized.split('').map((item) => parseInt(item.repeat(2), 16))
: [
parseInt(normalized.slice(0, 2), 16),
parseInt(normalized.slice(2, 4), 16),
parseInt(normalized.slice(4, 6), 16),
]

if (length === 1) {
return `rgba(${values[0]}, ${values[1]}, ${values[2]}, ${alpha})`
}

return `rgba(${values[0]}, ${values[1]}, ${values[2]}, ${alpha})`
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The hexToRgba function contains a redundant conditional check if (length === 1) where both branches return the exact same string template. We can simplify this by removing the redundant length variable and the if statement.

const hexToRgba = (hex, alpha) => {
  if (!hex) {
    return `rgba(148, 163, 184, ${alpha})`
  }

  const normalized = hex.replace('#', '')
  const values = normalized.length === 3
    ? normalized.split('').map((item) => parseInt(item.repeat(2), 16))
    : [
        parseInt(normalized.slice(0, 2), 16),
        parseInt(normalized.slice(2, 4), 16),
        parseInt(normalized.slice(4, 6), 16),
      ]

  return `rgba(${values[0]}, ${values[1]}, ${values[2]}, ${alpha})`
}

Comment on lines +120 to +132
const formatDateTime = (value) => {
if (!value) {
return ''
}

const date = new Date(value)

if (Number.isNaN(date.getTime())) {
return value
}

return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The formatDateTime helper function is defined but never used anywhere in the script or template of this component. It should be removed to keep the codebase clean.

@Sealt
Sealt merged commit 6955d94 into main Jun 23, 2026
4 checks passed
@Sealt
Sealt deleted the feat/1.4.0 branch June 23, 2026 17:37
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