Skip to content

added summary language configuration#1328

Merged
yujonglee merged 2 commits intomainfrom
change-summary-language
Aug 13, 2025
Merged

added summary language configuration#1328
yujonglee merged 2 commits intomainfrom
change-summary-language

Conversation

@duckduckhero
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds a new summary_language setting across the desktop settings UI, config types and JS bindings, locales, and the summary template. The UI exposes a Select to choose the summary language, persists it to config.general.summary_language, and templates read that value when rendering summaries.

Changes

Cohort / File(s) Summary of Changes
Desktop Settings UI
apps/desktop/src/components/settings/views/general.tsx
Adds summaryLanguage to form schema/defaults; hydrates from config.data.general.summary_language (default "en"); persists via nextGeneral.summary_language in setConfig; adds Select UI listing SUPPORTED_LANGUAGES; introduces ISO_639_1_CODE alias; imports SelectContent/SelectItem.
Localization Files
apps/desktop/src/locales/en/messages.po, apps/desktop/src/locales/ko/messages.po
Adds two new translation keys ("Summary language", "Language for AI-generated summaries"); updates source anchors for many entries; ko file includes empty translations and some obsolete markers.
Config Schema (Rust)
crates/db-user/src/config_types.rs
Adds pub summary_language: hypr_language::Language to ConfigGeneral with specta/schemars/serde annotations; Default impl sets it to ISO639::En.
Template Logic
crates/template/assets/enhance.system.jinja
Replaces uses of config.general.display_language with config.general.summary_language in instruction text and language-conditional blocks used for summary rendering.
JS Bindings
plugins/db/js/bindings.gen.ts
Extends exported ConfigGeneral type to include optional summary_language?: string.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant DesktopApp as Desktop App (Settings)
  participant DB as Config Store
  participant Template as Summarizer Template

  User->>DesktopApp: Change "Summary language" selection
  DesktopApp->>DB: Save general.summary_language
  User->>DesktopApp: Request summary generation
  DesktopApp->>DB: Read general.summary_language
  DesktopApp->>Template: Render summary using summary_language
  Template-->>DesktopApp: Generated summary text
  DesktopApp-->>User: Display summary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b63f0f5 and 0759c25.

📒 Files selected for processing (2)
  • crates/db-user/src/config_types.rs (2 hunks)
  • plugins/db/js/bindings.gen.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/db-user/src/config_types.rs
  • plugins/db/js/bindings.gen.ts
⏰ 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)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch change-summary-language

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 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

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic analysis

1 issue found across 5 files • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

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 (15)
crates/template/assets/enhance.system.jinja (3)

1-1: Defensive default for language filter

If summary_language is absent or null, renderers/tests may misbehave. Use a safe default to English at render time.

Apply:

-You are a professional assistant that generates enhanced meetings notes while maintaining accuracy, completeness, and professional terminology in {{ config.general.summary_language | language }}.
+You are a professional assistant that generates enhanced meetings notes while maintaining accuracy, completeness, and professional terminology in {{ (config.general.summary_language | default('en')) | language }}.

78-78: Mirror the defensive default in output-language instruction

Same rationale as above; ensure a safe default of English.

-- Write the enhanced note in {{ config.general.summary_language | language }}.
+- Write the enhanced note in {{ (config.general.summary_language | default('en')) | language }}.

117-123: Guard language-conditional blocks with a default

Ensure conditions still work when the setting is missing.

-  {% if config.general.summary_language is not english %}
+  {% if (config.general.summary_language | default('en')) is not english %}
 ...
-  {% if config.general.summary_language is korean %}
+  {% if (config.general.summary_language | default('en')) is korean %}
apps/desktop/src/locales/ko/messages.po (12)

942-945: Add KO translation for “Language for AI-generated summaries”.

Filling this prevents English fallback in the KO locale.

- msgstr ""
+ msgstr "AI 생성 요약의 언어"

1461-1464: Add KO translation for “Summary language”.

Aligns with the adjacent language-setting strings.

- msgstr ""
+ msgstr "요약 언어"

700-703: Localize “Display language”.

Small UX polish for the KO locale.

- msgstr ""
+ msgstr "표시 언어"

1224-1227: Localize helper text “Primary language for the interface”.

Keeps terminology consistent with “Display language”.

- msgstr ""
+ msgstr "앱 인터페이스의 기본 언어"

1377-1380: Localize “Select languages you speak for better transcription”.

Improves clarity for the spoken language selector.

- msgstr ""
+ msgstr "더 정확한 전사를 위해 사용하는 언어를 선택하세요"

1429-1432: Localize “Spoken languages”.

Match phrasing used in the related helper text.

- msgstr ""
+ msgstr "사용하는 언어"

358-361: Localize “Add specific terms or jargon for improved transcription accuracy”.

Completes the “Custom Vocabulary” section localization.

- msgstr ""
+ msgstr "전사 정확도를 높이기 위해 특정 용어나 전문 용어를 추가하세요"

670-673: Localize “Custom Vocabulary”.

Short, natural phrasing for KO.

- msgstr ""
+ msgstr "맞춤 어휘"

523-526: Localize “Choose whether to save your recordings locally.”

Complements the “Save recordings” label.

- msgstr ""
+ msgstr "녹음을 로컬에 저장할지 여부를 선택하세요."

1308-1311: Localize “Save recordings”.

Consistent with the helper string just above.

- msgstr ""
+ msgstr "녹음 저장"

16-19: Localize “Type terms separated by commas (e.g., Blitz Meeting, PaC Squad)”.

KO guidance for the vocabulary input.

- msgstr ""
+ msgstr "쉼표로 구분하여 용어를 입력하세요 (예: Blitz Meeting, PaC Squad)"

1397-1400: Localize “Share usage data”.

Improves consistency across General settings.

- msgstr ""
+ msgstr "사용 데이터 공유"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 16b2eeb and b63f0f5.

📒 Files selected for processing (6)
  • apps/desktop/src/components/settings/views/general.tsx (6 hunks)
  • apps/desktop/src/locales/en/messages.po (12 hunks)
  • apps/desktop/src/locales/ko/messages.po (12 hunks)
  • crates/db-user/src/config_types.rs (2 hunks)
  • crates/template/assets/enhance.system.jinja (3 hunks)
  • plugins/db/js/bindings.gen.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit Configuration File

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

Files:

  • plugins/db/js/bindings.gen.ts
  • apps/desktop/src/components/settings/views/general.tsx
  • crates/db-user/src/config_types.rs
🔇 Additional comments (6)
plugins/db/js/bindings.gen.ts (1)

169-169: Bindings match backend schema addition

summary_language: string is correctly reflected in ConfigGeneral and aligns with the Rust model and serialization mapping.

apps/desktop/src/components/settings/views/general.tsx (3)

27-27: Import additions are correct and used

SelectContent and SelectItem are used in the new Summary language selector. No unused imports introduced.


84-145: Schema, defaults, hydration, and persistence are consistent

  • summaryLanguage added to the zod schema (required enum).
  • Default set to "en", hydrated from config.data.general.summary_language ?? "en".
  • Persisted as summary_language in nextGeneral.

This end-to-end mapping matches the backend’s summary_language field.


237-271: Summary language UI select is wired correctly

  • Displays human-readable names via LANGUAGES_ISO_639_1.
  • Options sourced from SUPPORTED_LANGUAGES.
  • Changes propagate via field.onChange, which triggers the mutation through the form watcher.

Looks good.

apps/desktop/src/locales/en/messages.po (2)

942-945: New translation key added

Added “Language for AI-generated summaries” with correct anchoring to the settings view. Matches UI addition.


1461-1464: New label translation added

“Summary language” key and value are present and consistent with the TSX usage.

Comment on lines 48 to 51
#[specta(type = String)]
#[schemars(with = "String", regex(pattern = "^[a-zA-Z]{2}$"))]
pub summary_language: hypr_language::Language,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add serde default for backward compatibility of existing rows

Older rows won’t have summary_language in their stored JSON. Without a serde default, serde_json::from_str will fail and unwrap() will panic at runtime. Provide a field-level default to keep deserialization resilient.

Apply this diff to the field:

         #[specta(type = String)]
         #[schemars(with = "String", regex(pattern = "^[a-zA-Z]{2}$"))]
+        #[serde(default = "default_summary_language")]
         pub summary_language: hypr_language::Language,

Add this helper outside the struct to supply the default (no need for Language: Default):

fn default_summary_language() -> hypr_language::Language {
    hypr_language::ISO639::En.into()
}
🤖 Prompt for AI Agents
In crates/db-user/src/config_types.rs around lines 48 to 51, the
summary_language field lacks a serde default which breaks deserialization of
older rows; add a field-level serde default attribute (e.g. #[serde(default =
"default_summary_language")]) to the summary_language field and implement a
helper function outside the struct named default_summary_language that returns
hypr_language::ISO639::En.into() so missing JSON entries deserialize to English
instead of causing a panic.

@yujonglee yujonglee merged commit c0f1c2d into main Aug 13, 2025
7 checks passed
@yujonglee yujonglee deleted the change-summary-language branch August 13, 2025 23:29
@coderabbitai coderabbitai bot mentioned this pull request Oct 13, 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