Sync pnpm-lock.yaml after removing @openrouter/sdk#4
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: halilibrahimcelik <92088301+halilibrahimcelik@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses multiple correctness and UX issues across the wiki article viewer/editor and the AI summarization API, plus cleans up routing constants and an unused dependency.
Changes:
- Harden AI API error handling/parsing and remove a stale OpenRouter SDK dependency.
- Fix wiki article viewer behavior (abort handling, clipboard guard, page-view dedup) and UI prop/class issues.
- Clean up routing/auth correctness (remove auth fallback, fix editor back link, rename route constant and update usages).
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
types/index.ts |
Renames the route enum entry to NEW_ARTICLE to match its actual destination. |
package.json |
Removes unused @openrouter/sdk dependency. |
components/ui/text-type.jsx |
Attempts to fix inter-sentence pause scheduling in typing animation. |
components/ui/shiny-text.jsx |
Adds "use client" directive required for motion hooks. |
components/features/wikicards/wiki-editor.tsx |
Prevents /wiki/undefined by falling back to Routes.HOME when articleId is missing. |
components/features/wikicards/wiki-article-viewer.tsx |
Adds abort-controller lifecycle handling, clipboard guard, session-based page-view dedup, and fixes Tailwind max-height utility. |
components/features/navbar/navbar.tsx |
Updates “New Article” link to the renamed route constant. |
app/wiki/[id]/page.tsx |
Removes mockUserId fallback and uses user.id directly after redirecting auth. |
app/api/ai/route.ts |
Adds non-2xx handling, JSON parse guards, and response shape validation before accessing choices[0]. |
Comments suppressed due to low confidence (1)
package.json:28
@openrouter/sdkwas removed fromdependencies, but the repo still containspnpm-lock.yamlthat references it. Keeping lockfiles in sync avoids confusion and prevents pnpm installs (or future CI changes) from pulling a removed package; regenerate/update the lockfile(s) (or remove the unused one) as part of this dependency change.
"dependencies": {
"@aws-sdk/client-s3": "^3.993.0",
"@base-ui/react": "^1.2.0",
"@neondatabase/serverless": "^1.0.2",
"@react-email/render": "^2.0.4",
"@reduxjs/toolkit": "^2.11.2",
"@stackframe/stack": "^2.8.67",
"@tabler/icons-react": "^3.36.1",
"@uiw/react-md-editor": "^4.0.11",
"@upstash/redis": "^1.36.2",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| setCurrentTextIndex((prev) => (prev + 1) % textArray.length); | ||
| setCurrentCharIndex(0); | ||
| timeout = setTimeout(() => {}, pauseDuration); | ||
| timeout = setTimeout(() => { | ||
| executeTypingAnimation(); | ||
| }, pauseDuration); |
There was a problem hiding this comment.
The new setTimeout(() => executeTypingAnimation(), pauseDuration) is very likely cleared immediately by the effect cleanup when setIsDeleting(false) / setCurrentTextIndex triggers a re-render, so the inter-sentence pause still won’t be observed. Additionally, the scheduled callback closes over stale isDeleting/displayedText values. Consider implementing the pause by delaying the state transition to the next sentence (or using a ref-based timer that isn’t cleared on the next render) rather than calling executeTypingAnimation() from the old closure.
|
|
||
| const fetchPageView = async () => { | ||
| const newCount = await incrementPageViews(article.id); | ||
| if (isMounted) { | ||
| setLocalPageViews(newCount); | ||
| sessionStorage.setItem(sessionKey, "1"); |
There was a problem hiding this comment.
The page-view dedup key is only written to sessionStorage after incrementPageViews() resolves. If the server action increments successfully but the client request fails/aborts before the response is received, the key won’t be set and a refresh/back-nav can increment again (still causing inflated counts / milestone email spam). Set the session key before starting the increment request and wrap the call in try/catch (optionally clearing the key on failure) to ensure dedup holds even under network errors.
| const fetchPageView = async () => { | |
| const newCount = await incrementPageViews(article.id); | |
| if (isMounted) { | |
| setLocalPageViews(newCount); | |
| sessionStorage.setItem(sessionKey, "1"); | |
| // Mark this article's page view as counted for this session before starting the request | |
| sessionStorage.setItem(sessionKey, "1"); | |
| const fetchPageView = async () => { | |
| try { | |
| const newCount = await incrementPageViews(article.id); | |
| if (isMounted) { | |
| setLocalPageViews(newCount); | |
| } | |
| } catch (error) { | |
| // Clear the key on failure so a later navigation can retry | |
| sessionStorage.removeItem(sessionKey); |
|
@copilot code review[agent] build failed: To fix this issue, sync npm and pnpm by running pnpm install and pushing the updated pnpm-lock.yaml file. |
Co-authored-by: halilibrahimcelik <92088301+halilibrahimcelik@users.noreply.github.com>
CI was failing because
pnpm-lock.yamlstill referenced@openrouter/sdkafter it was removed frompackage.json. Ranpnpm install --no-frozen-lockfileto regenerate the lockfile in sync with the current dependency manifest.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.