Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0fdd6a24bb
ℹ️ 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".
| export default async function Page() { | ||
| const { posts } = postsJson; | ||
| const lastThreePosts: Post[] = posts.slice(0, 3); | ||
| const nowPlaying = await getNowPlaying(); |
There was a problem hiding this comment.
Keep Spotify off the homepage critical path
When Redis or Spotify is slow or unreachable, this await runs before any homepage JSX is returned and outside local error handling. The underlying Redis operations and fetch calls can reject, and the Spotify requests no longer have abort timeouts, so the otherwise static / route can either fail completely or remain blocked until the deployment timeout; keep this optional widget behind a guarded streaming boundary or otherwise catch and bound the lookup.
Useful? React with 👍 / 👎.
| } | ||
| } | ||
|
|
||
| const accessToken = await getAccessToken(); |
There was a problem hiding this comment.
Check the production cache before refreshing the token
On every production homepage request, this refreshes the Spotify access token before consulting the one-hour Redis cache. Consequently, even a cache hit incurs an external request, and a token-endpoint error response returns null before the valid cached track can be read; moving the cache lookup ahead of getAccessToken() preserves the cache's latency and availability benefits.
Useful? React with 👍 / 👎.
| marginLeft: "1rem", | ||
| marginTop: "1.25rem", | ||
| maxWidth: "calc(100% - 1rem)", | ||
| width: "fit-content", |
There was a problem hiding this comment.
Constrain long track text to the viewport
On narrow viewports or for Spotify metadata containing a long unbroken track or artist name, this fit-content flex link has no maximum width and its text child has neither min-width: 0 nor forced wrapping. The row can therefore grow wider than the homepage section and introduce horizontal scrolling; constrain the link to the available width and restore wrapping or clamping on the text child.
Useful? React with 👍 / 👎.
| if (res.status === 204 || !res.ok) { | ||
| return null; |
There was a problem hiding this comment.
Distinguish Spotify failures from an idle player
When the currently-playing endpoint responds with an error such as 401, 429, or 5xx, this condition treats it exactly like the valid 204 “nothing playing” response. getNowPlaying() then makes another request to the recently-played endpoint and can cache an older track for the full one-hour TTL even though the current state was simply unavailable; reserve null for the valid empty response and propagate or explicitly handle error statuses.
Useful? React with 👍 / 👎.
Reverts f104457 (#174), restoring the previous Spotify recently-played implementation:
SpotifyRecentlyPlayed.tsxback toRecentlyPlayed.tsxand restores the earlier fetching/presentation splitapp/page.tsx) wiring for the trackapp/globals.cssapp/utils/spotify.tsLint and typecheck pass.
🤖 Generated with Claude Code