Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit 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. 📝 WalkthroughWalkthroughAdds 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (15)
crates/template/assets/enhance.system.jinja (3)
1-1: Defensive default for language filterIf
summary_languageis 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 instructionSame 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 defaultEnsure 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
📒 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.tsapps/desktop/src/components/settings/views/general.tsxcrates/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: stringis correctly reflected inConfigGeneraland 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
SelectContentandSelectItemare used in the new Summary language selector. No unused imports introduced.
84-145: Schema, defaults, hydration, and persistence are consistent
summaryLanguageadded to the zod schema (required enum).- Default set to
"en", hydrated fromconfig.data.general.summary_language ?? "en".- Persisted as
summary_languageinnextGeneral.This end-to-end mapping matches the backend’s
summary_languagefield.
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 addedAdded “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.
| #[specta(type = String)] | ||
| #[schemars(with = "String", regex(pattern = "^[a-zA-Z]{2}$"))] | ||
| pub summary_language: hypr_language::Language, | ||
| } |
There was a problem hiding this comment.
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.
No description provided.