Skip to content

Conversation

@jezweb
Copy link

@jezweb jezweb commented Nov 8, 2025

Problem

Multiple typos in src/services/summarizer.service.ts:

  • buildSystenPrompt should be buildSystemPrompt
  • styleInstructructions misspelled as styleInstructructions

Solution

Fix all typos to use correct spelling.

Changes

  • Line 47: Method call typo
  • Line 76: Method name typo
  • Lines 81, 90: Variable name typo

Impact

  • Improves code readability
  • No functional changes

Summary by CodeRabbit

  • Chores
    • Corrected internal naming inconsistencies to improve code maintainability.

- Fix buildSystenPrompt → buildSystemPrompt (lines 47, 76)
- Fix styleInstructructions → styleInstructions (line 81, 90)
- Improves code readability and professionalism
@coderabbitai
Copy link

coderabbitai bot commented Nov 8, 2025

Walkthrough

The pull request corrects two typos in the summarizer service: renaming buildSystenPrompt to buildSystemPrompt and styleInstructructions to styleInstructions. Usage locations are updated to reference the corrected identifiers with no behavioral changes.

Changes

Cohort / File(s) Summary
Typo fixes
src/services/summarizer.service.ts
Renames method buildSystenPromptbuildSystemPrompt and variable styleInstructructionsstyleInstructions; updates all references accordingly

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Simple identifier corrections with no logic changes
  • Verify that all references to the renamed method and variable have been updated consistently

Poem

A typo here, a typo there—
The rabbit hops through code with care!
"Systen" becomes "System" bright,
"Instructructions" spelled just right! ✨🐰

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: fixing typos in the SummarizerService, which is exactly what the changeset addresses.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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

🧹 Nitpick comments (2)
src/services/summarizer.service.ts (2)

16-17: Consider updating to Zod v4 unified error parameter.

The current error message syntax uses string literals as the second parameter. Zod v4 introduces a unified error parameter for more flexible error customization.

Apply this diff to align with Zod v4 best practices:

     text: z
         .string()
         .trim()
-        .min(50, "Text too short to summarize (minimum 50 characters)")
-        .max(50000, "Text too long (maximum 50,000 characters)"),
+        .min(50, {
+            error: () => "Text too short to summarize (minimum 50 characters)"
+        })
+        .max(50000, {
+            error: () => "Text too long (maximum 50,000 characters)"
+        }),

Based on library documentation.


78-78: Consider using SummaryStyles type for stronger type safety.

The style parameter is currently typed as string, requiring a type assertion at line 90. Using the SummaryStyles type would eliminate the need for the assertion and provide compile-time safety.

Apply this diff to improve type safety:

     private buildSystemPrompt(
         maxLength: number,
-        style: string,
+        style: SummaryStyles,
         language: string,
     ): string {

Then simplify line 90:

-        return `You are a professional text summarizer. ${styleInstructions[style as keyof typeof styleInstructions]}
+        return `You are a professional text summarizer. ${styleInstructions[style]}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a44687a and 101da9d.

📒 Files selected for processing (1)
  • src/services/summarizer.service.ts (3 hunks)
🔇 Additional comments (1)
src/services/summarizer.service.ts (1)

47-47: LGTM! Typo corrections improve code quality.

The renaming of buildSystenPrompt to buildSystemPrompt and styleInstructructions to styleInstructions are accurate corrections that enhance code readability. All usages have been consistently updated.

Also applies to: 76-76, 81-81, 90-90

jezweb pushed a commit to jezweb/full-flare-stack that referenced this pull request Nov 8, 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.

1 participant