Skip to content

Sync pnpm-lock.yaml after removing @openrouter/sdk#4

Merged
halilibrahimcelik merged 3 commits into
development-03from
copilot/sub-pr-3
Mar 2, 2026
Merged

Sync pnpm-lock.yaml after removing @openrouter/sdk#4
halilibrahimcelik merged 3 commits into
development-03from
copilot/sub-pr-3

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 2, 2026

CI was failing because pnpm-lock.yaml still referenced @openrouter/sdk after it was removed from package.json. Ran pnpm install --no-frozen-lockfile to 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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wikimasters Ready Ready Preview, Comment Mar 2, 2026 11:03pm

Co-authored-by: halilibrahimcelik <92088301+halilibrahimcelik@users.noreply.github.com>
Copilot AI changed the title [WIP] Add UI enhancements and AI-powered article summarization to wiki viewer Fix auth fallback, unused dep, abort handling, page-view dedup, and several UX/type issues Mar 2, 2026
@halilibrahimcelik halilibrahimcelik marked this pull request as ready for review March 2, 2026 22:53
Copilot AI review requested due to automatic review settings March 2, 2026 22:53
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

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/sdk was removed from dependencies, but the repo still contains pnpm-lock.yaml that 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.

Comment on lines 111 to +115
setCurrentTextIndex((prev) => (prev + 1) % textArray.length);
setCurrentCharIndex(0);
timeout = setTimeout(() => {}, pauseDuration);
timeout = setTimeout(() => {
executeTypingAnimation();
}, pauseDuration);
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines 96 to +101

const fetchPageView = async () => {
const newCount = await incrementPageViews(article.id);
if (isMounted) {
setLocalPageViews(newCount);
sessionStorage.setItem(sessionKey, "1");
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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 uses AI. Check for mistakes.
@halilibrahimcelik
Copy link
Copy Markdown
Owner

@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>
Copilot AI changed the title Fix auth fallback, unused dep, abort handling, page-view dedup, and several UX/type issues Sync pnpm-lock.yaml after removing @openrouter/sdk Mar 2, 2026
@halilibrahimcelik halilibrahimcelik merged commit 47ca5ab into development-03 Mar 2, 2026
2 checks passed
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.

3 participants