Skip to content

Minor fixes 0829#1420

Merged
yujonglee merged 1 commit intomainfrom
minor-fixes-0829
Aug 30, 2025
Merged

Minor fixes 0829#1420
yujonglee merged 1 commit intomainfrom
minor-fixes-0829

Conversation

@duckduckhero
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

📝 Walkthrough

Walkthrough

Removes the Folder button from the Finder ViewSelector UI. Enables tools for modelId "openai/gpt-5" in chat logic and chat-utils, and injects an experimental smoothStream transform into streamText to smooth streaming output. No exported/public signatures changed.

Changes

Cohort / File(s) Summary
Finder ViewSelector UI
apps/desktop/src/components/finder/view-selector.tsx
Removed Folder icon import and disabled the Folder button JSX, so the UI no longer exposes the "folder" view while other view buttons remain.
Chat logic hook: tools + streaming
apps/desktop/src/components/right-panel/hooks/useChatLogic.ts
Added smoothStream import and passed it as experimental_transform into streamText (word-chunk, ~70ms smoothing). Extended tool gating to treat model.modelId === "openai/gpt-5" as tool-enabled.
Chat utils: tool gating
apps/desktop/src/components/right-panel/utils/chat-utils.ts
Included modelId === "openai/gpt-5" in the toolEnabled determination inside prepareMessageHistory.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant UI as Right Panel UI
  participant H as useChatLogic
  participant S as streamText (AI SDK)
  participant T as Tool Executor

  U->>UI: Submit message
  UI->>H: onSend(message, model)
  alt model enables tools (now includes openai/gpt-5)
    H->>T: Prepare/execute tools
    T-->>H: Tool results
  end
  rect rgba(200,230,255,0.25)
    note right of H: Streaming uses experimental_transform = smoothStream (word chunks, ~70ms)
    H->>S: streamText(..., experimental_transform: smoothStream)
    S-->>H: Streamed chunks (smoothed)
  end
  H-->>UI: Append streamed tokens
  UI-->>U: Render incremental output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch minor-fixes-0829

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (1)

209-214: Extract model-gating into shared helper and include “gpt-5” alias
– In useChatLogic.ts (around line 213) add model.modelId === "gpt-5" alongside "openai/gpt-5".
– Do the same in chat-utils.ts (around line 78).
– Extract this list of model IDs + apiBase check into a single helper in chat-utils.ts and import it in useChatLogic.ts to avoid duplication.

🧹 Nitpick comments (2)
apps/desktop/src/components/right-panel/utils/chat-utils.ts (1)

72-80: Extract and centralize tool‐enabled model check and include bare “gpt-5” alias
– Move the gating logic in
• apps/desktop/src/components/right-panel/utils/chat-utils.ts (lines 73–80)
• apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (around line 213)
into a shared helper, e.g. isToolsEnabledModel(modelId, apiBase).
– Add modelId === "gpt-5" alongside "openai/gpt-5" in both locations.

apps/desktop/src/components/finder/view-selector.tsx (1)

15-30: Remove commented-out JSX instead of keeping dead code

Commented blocks add noise and drift. If Folder view is deprecated, delete this JSX. Optional: add a brief commit message “remove Folder view”.

-      {
-        /*
-      <Button
-        variant={currentView === "folder" ? "default" : "ghost"}
-        size="sm"
-        className={cn(
-          "h-8 transition-all",
-          currentView === "folder" ? "px-1.5 py-1 min-w-[70px]" : "w-8 px-0 py-0",
-        )}
-        onClick={() => onViewChange("folder")}
-      >
-        <Folder size={14} />
-        {currentView === "folder" && "Folder"}
-      </Button>
-      */
-      }
+      {/* Folder view intentionally removed */}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 35a8ff3 and d387328.

📒 Files selected for processing (3)
  • apps/desktop/src/components/finder/view-selector.tsx (3 hunks)
  • apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (3 hunks)
  • apps/desktop/src/components/right-panel/utils/chat-utils.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit configuration file

**/*.{js,ts,tsx,rs}: 1. Do not add any error handling. Keep the existing one.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

Files:

  • apps/desktop/src/components/right-panel/utils/chat-utils.ts
  • apps/desktop/src/components/right-panel/hooks/useChatLogic.ts
  • apps/desktop/src/components/finder/view-selector.tsx
🧬 Code graph analysis (1)
apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (1)
packages/utils/src/ai.ts (1)
  • smoothStream (15-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci (windows, windows-latest)
🔇 Additional comments (4)
apps/desktop/src/components/finder/view-selector.tsx (2)

3-3: Icon import cleanup LGTM

Removing the Folder icon import aligns with the UI change. No unused imports introduced.


5-5: Do not remove “folder” from ViewType – FolderView is still rendered in routes/app.finder.tsx (handles view === "folder") and exported in components/finder/views/folder-view.tsx.

apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (2)

19-19: Import of smoothStream is correct and used

The new import is used below; no unused imports.


349-353: Verify streamText options in @hypr/utils/ai
No local definitions were found for streamText or smoothStream; please confirm that streamText accepts an experimental_transform option and that smoothStream({ delayInMs: 70, chunking: "word" }) returns the expected transformer shape.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/desktop/src/components/right-panel/utils/chat-utils.ts (1)

72-80: Gating consistency: add alias and centralize model checks.

Nice addition for GPT-5. Consider also accepting the bare alias "gpt-5" (like you already do for "gpt-4o") and centralizing this allowlist to avoid future drift with useChatLogic.ts.

Apply locally in this file:

-  const toolEnabled = !!(
-    modelId === "gpt-4.1"
-    || modelId === "openai/gpt-4.1"
-    || modelId === "anthropic/claude-sonnet-4"
-    || modelId === "openai/gpt-4o"
-    || modelId === "gpt-4o"
-    || modelId === "openai/gpt-5"
-    || (apiBase && apiBase.includes("pro.hyprnote.com"))
-  );
+  const TOOL_MODELS = new Set([
+    "gpt-4.1",
+    "openai/gpt-4.1",
+    "anthropic/claude-sonnet-4",
+    "openai/gpt-4o",
+    "gpt-4o",
+    "openai/gpt-5",
+    "gpt-5",
+  ]);
+  const toolEnabled = TOOL_MODELS.has(modelId || "") || !!apiBase?.includes("pro.hyprnote.com");

Optionally, extract TOOL_MODELS to a shared util to keep this in sync with useChatLogic.ts.

apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (1)

209-214: Keep model gating in sync and include alias.

You mirrored GPT-5 here—good. To prevent divergence with chat-utils.ts and to cover both naming styles, consider adding the bare "gpt-5" and centralizing the allowlist.

-      const shouldUseTools = type !== "HyprLocal"
-        && (model.modelId === "gpt-4.1" || model.modelId === "openai/gpt-4.1"
-          || model.modelId === "anthropic/claude-sonnet-4"
-          || model.modelId === "openai/gpt-4o"
-          || model.modelId === "gpt-4o" || apiBase?.includes("pro.hyprnote.com") || model.modelId === "openai/gpt-5");
+      const TOOL_MODELS = new Set([
+        "gpt-4.1",
+        "openai/gpt-4.1",
+        "anthropic/claude-sonnet-4",
+        "openai/gpt-4o",
+        "gpt-4o",
+        "openai/gpt-5",
+        "gpt-5",
+      ]);
+      const shouldUseTools =
+        type !== "HyprLocal" &&
+        (TOOL_MODELS.has(model.modelId) || !!apiBase?.includes("pro.hyprnote.com"));
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d387328 and 98fadea.

📒 Files selected for processing (3)
  • apps/desktop/src/components/finder/view-selector.tsx (3 hunks)
  • apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (3 hunks)
  • apps/desktop/src/components/right-panel/utils/chat-utils.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/components/finder/view-selector.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit configuration file

**/*.{js,ts,tsx,rs}: 1. Do not add any error handling. Keep the existing one.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

Files:

  • apps/desktop/src/components/right-panel/hooks/useChatLogic.ts
  • apps/desktop/src/components/right-panel/utils/chat-utils.ts
🧬 Code graph analysis (1)
apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (1)
packages/utils/src/ai.ts (1)
  • smoothStream (15-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ci (windows, windows-latest)
  • GitHub Check: ci (macos, macos-latest)
🔇 Additional comments (1)
apps/desktop/src/components/right-panel/hooks/useChatLogic.ts (1)

16-23: Import looks good.

smoothStream is imported and used below; no unused import concerns.

@yujonglee yujonglee merged commit ca0e66e into main Aug 30, 2025
11 checks passed
@yujonglee yujonglee deleted the minor-fixes-0829 branch August 30, 2025 02:37
@coderabbitai coderabbitai bot mentioned this pull request Sep 5, 2025
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.

2 participants

Comments