-
Notifications
You must be signed in to change notification settings - Fork 627
feat: settings auto scroll toggle #1293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds an opt-out auto-scroll feature: new CONFIG_EVENTS key, presenter/getter+setter, renderer UI toggle, store persistence and IPC sync, message-list and scroll composable guards to respect the setting, plus localization entries. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SettingsUI as Settings UI
participant Store as uiSettingsStore
participant Presenter as ConfigPresenter (main)
participant IPC
participant MessageList
participant Scroll as useMessageScroll
User->>SettingsUI: toggle auto-scroll
SettingsUI->>Store: setAutoScrollEnabled(value)
Store->>Presenter: setAutoScrollEnabled(value)
Presenter->>IPC: emit CONFIG_EVENTS.AUTO_SCROLL_CHANGED
IPC-->>Store: broadcast AUTO_SCROLL_CHANGED
Store->>MessageList: reactive update autoScrollEnabled
MessageList->>Scroll: pass autoScrollEnabled
Scroll->>Scroll: guard: skip auto-follow if disabled
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
🤖 Fix all issues with AI agents
In `@src/renderer/src/i18n/en-US/settings.json`:
- Around line 10-12: The new i18n key "autoScrollEnabled" was added to en-US
settings.json but is missing from several locale settings.json files; add
"autoScrollEnabled": "<translated string>" to each of the following locale
settings.json files (da-DK, fa-IR, fr-FR, he-IL, ko-KR, pt-BR, ru-RU, zh-HK,
zh-TW) with an appropriate translation, maintain the same JSON key ordering
style as existing entries (place it near "searchPreview" and
"searchAssistantModel"), ensure valid JSON (commas/quotes) and run the i18n/lint
check to confirm all locales now contain the key.
| "searchPreview": "Search Preview", | ||
| "autoScrollEnabled": "Auto-scroll while generating", | ||
| "searchAssistantModel": "Assistant Model", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, find all locale settings.json files and check for the autoScrollEnabled key
python3 <<'PY'
import json
import glob
import os
key = "autoScrollEnabled"
base = "src/renderer/src/i18n"
# All expected locales based on learnings
expected_locales = ["da-DK", "en-US", "fa-IR", "fr-FR", "he-IL", "ja-JP", "ko-KR", "pt-BR", "ru-RU", "zh-CN", "zh-HK", "zh-TW"]
print("=== Checking for 'autoScrollEnabled' key in all locale files ===\n")
# Find all settings.json files
found_locales = {}
for locale in expected_locales:
path = os.path.join(base, locale, "settings.json")
if os.path.exists(path):
with open(path, encoding="utf-8") as f:
try:
data = json.load(f)
has_key = key in data.get("common", {})
found_locales[locale] = {"exists": True, "has_key": has_key}
status = "✓ HAS KEY" if has_key else "✗ MISSING KEY"
print(f"{locale:8} - {status}")
except Exception as e:
print(f"{locale:8} - ERROR: {e}")
found_locales[locale] = {"exists": True, "has_key": False}
else:
print(f"{locale:8} - FILE NOT FOUND")
found_locales[locale] = {"exists": False, "has_key": False}
print("\n=== Summary ===")
missing_files = [l for l, v in found_locales.items() if not v["exists"]]
missing_key = [l for l, v in found_locales.items() if v["exists"] and not v["has_key"]]
if missing_files:
print(f"Missing locale files: {', '.join(missing_files)}")
if missing_key:
print(f"Locales missing the key: {', '.join(missing_key)}")
if not missing_files and not missing_key:
print("All locales have the 'autoScrollEnabled' key ✓")
PYRepository: ThinkInAIXYZ/deepchat
Length of output: 522
Add the new key to all missing locale files.
Line 11 adds the en-US entry, but the i18n rules require this key to exist in every locale. Currently missing from: da-DK, fa-IR, fr-FR, he-IL, ko-KR, pt-BR, ru-RU, zh-HK, and zh-TW. Please add "autoScrollEnabled" to the settings.json files in these locales with appropriate translations.
🤖 Prompt for AI Agents
In `@src/renderer/src/i18n/en-US/settings.json` around lines 10 - 12, The new i18n
key "autoScrollEnabled" was added to en-US settings.json but is missing from
several locale settings.json files; add "autoScrollEnabled": "<translated
string>" to each of the following locale settings.json files (da-DK, fa-IR,
fr-FR, he-IL, ko-KR, pt-BR, ru-RU, zh-HK, zh-TW) with an appropriate
translation, maintain the same JSON key ordering style as existing entries
(place it near "searchPreview" and "searchAssistantModel"), ensure valid JSON
(commas/quotes) and run the i18n/lint check to confirm all locales now contain
the key.
close #1292
This is our current solution for now. Once the agent refactor is completed, we’ll have it take effect directly in the chat list for a more natural experience.
Summary by CodeRabbit