Skip to content

feat: settings auto scroll toggle#1293

Merged
zerob13 merged 2 commits intodevfrom
feat-disable-auto-scroll
Feb 3, 2026
Merged

feat: settings auto scroll toggle#1293
zerob13 merged 2 commits intodevfrom
feat-disable-auto-scroll

Conversation

@zhangmo8
Copy link
Collaborator

@zhangmo8 zhangmo8 commented Feb 2, 2026

close #1292

image

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

  • New Features
    • Added an Auto-scroll toggle in Settings (default: on) to control automatic scrolling during content generation.
    • Setting is actionable from the UI and synchronized at runtime across windows.
    • Message list behavior now respects the Auto-scroll setting (automatic follow disabled when turned off).
    • Added translations for the new setting across multiple locales (en, ja, zh-CN, da, fa, fr, he, ko, pt-BR, ru, zh-HK, zh-TW).

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Event Constants
src/main/events.ts, src/renderer/src/events.ts
Added AUTO_SCROLL_CHANGED to CONFIG_EVENTS.
Presenter / Main logic
src/main/presenter/configPresenter/index.ts, src/main/presenter/configPresenter/uiSettingsHelper.ts
Added getAutoScrollEnabled() and setAutoScrollEnabled(); setter emits AUTO_SCROLL_CHANGED to windows.
Type Definitions
src/shared/types/presenters/legacy.presenters.d.ts
Added synchronous getAutoScrollEnabled() and setAutoScrollEnabled(enabled: boolean) signatures to IConfigPresenter.
Renderer store & IPC
src/renderer/src/stores/uiSettingsStore.ts
Added autoScrollEnabled state (default true), load/save via presenter, setAutoScrollEnabled() setter, and IPC listener registration for CONFIG_EVENTS.AUTO_SCROLL_CHANGED.
Settings UI
src/renderer/settings/components/CommonSettings.vue
Added toggle row, computed autoScrollEnabled, and handler to update store on change.
Message list integration
src/renderer/src/components/message/MessageList.vue
Injected uiSettingsStore; passed autoScrollEnabled into scroll composable and updated watcher to respect the setting.
Scroll composable
src/renderer/src/composables/message/useMessageScroll.ts
Added optional autoScrollEnabled?: Ref<boolean> option and guard to skip auto-follow when disabled.
Localization
src/renderer/src/i18n/*/settings.json
src/renderer/src/i18n/en-US/settings.json, .../ja-JP/..., .../zh-CN/..., .../da-DK/..., .../fa-IR/..., .../fr-FR/..., .../he-IL/..., .../ko-KR/..., .../pt-BR/..., .../ru-RU/..., .../zh-HK/..., .../zh-TW/...
Added autoScrollEnabled translation key across many locales.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • zerob13

Poem

🐰 I twitch my nose, a toggle made bright,
No more wild scrolls in the middle of night.
Read as it grows, keep the view snug and still,
A little hop of joy — calm pages, my thrill!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a toggle in settings to control auto-scrolling behavior.
Linked Issues check ✅ Passed The PR implements the feature requested in #1292: a user-accessible way to disable auto-scrolling during text generation, allowing users to read from the top.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the auto-scroll toggle feature across the UI, settings storage, and event handling with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-disable-auto-scroll

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

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

Comment on lines 10 to 12
"searchPreview": "Search Preview",
"autoScrollEnabled": "Auto-scroll while generating",
"searchAssistantModel": "Assistant Model",
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 | 🟠 Major

🧩 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 ✓")
PY

Repository: 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.

@zerob13 zerob13 merged commit 5aa6abf into dev Feb 3, 2026
2 checks passed
zerob13 pushed a commit that referenced this pull request Feb 4, 2026
* feat: settings auto scroll toggle

* feat: i18n support
@coderabbitai coderabbitai bot mentioned this pull request Feb 4, 2026
@zhangmo8 zhangmo8 deleted the feat-disable-auto-scroll branch February 5, 2026 02:38
zerob13 added a commit that referenced this pull request Feb 5, 2026
* feat(agent): add question tool flow

* feat(mcp): implement real Apple Maps search using URL scheme (#1289)

* feat: support voice.ai (#1291)

* feat: remove custome tiptap (#1295)

* feat: settings auto scroll toggle (#1293)

* feat: settings auto scroll toggle

* feat: i18n support

* fix(renderer): remove specific event listeners instead of all

* feat: add tooltip for filling default API URL in settings (#1296)

* refactor(question): simplify question request UI to single-choice interface

* fix(chat): restore pending question state

* fix: review issues

---------

Co-authored-by: Qi Jin <jin.qi1@northeastern.edu>
Co-authored-by: xiaomo <wegi866@gmail.com>
zerob13 added a commit that referenced this pull request Feb 5, 2026
* chore: typecheck with tsgo (#1278)

* feat: image left align

* feat: app settings skills (#1283)

* docs: add spec for app-settings

* feat: implement chat-driven settings control with skill gating

Add a safe, validated API for modifying DeepChat application settings via natural language. Settings changes are controlled by a dedicated 'deepchat-settings' skill to ensure tools are only available when contextually relevant.

Key features:
- Skill-gated tool injection: settings tools only appear when deepchat-settings skill is active
- Safe settings apply API with Zod validation and strict allowlist
- Support for toggles (sound, copy COT, chat mode) and enums (language, theme, font size)
- Defense-in-depth: runtime skill verification before applying changes
- Deep-linked settings navigation for unsupported/complex settings
- Comprehensive test coverage for validation, mapping, and skill gating

Changes:
- Add ChatSettingsToolHandler with validated apply/open methods
- Integrate with AgentToolManager for tool definition gating
- Create deepchat-settings built-in skill with clear activation rules
- Add shared types for requests/responses (chatSettings.ts)
- Implement settings window navigation with SECTION_ALIASES
- Add unit tests for handler and integration tests for tool gating
- Translate spec documents (plan.md, spec.md, tasks.md) to Chinese
- Fix type errors in getCurrentValue and OPEN_SECTION_VALUES

* refactor: remove chatMode from settings control and add permission service

Remove chatMode setting from the allowlist as it requires conversation-scoped updates that are better handled separately. Add permission checking for settings window opening to provide user control over settings navigation.

Key changes:
- Remove setChatMode tool and related schemas from ChatSettingsToolHandler
- Add SettingsPermissionService for managing tool approvals (one-time and session)
- Add permission check for deepchat_settings_open tool
- Update PermissionHandler to handle settings permission grants
- Add rememberable flag to permission request structure
- Update AgentToolManager to consume approvals before opening settings
- Add settingsPermissionService to main presenter index
- Clear settings approvals when conversation ends
- Update spec documents to reflect removed chatMode feature
- Remove chatMode-related tests and types

This ensures settings window opening requires explicit user approval and provides a cleaner separation of concerns for chat mode management.

* docs: translate to en

* chore: yo browser less context (#1284)

* docs: add specs for yo browesr context manager

* feat(yo-browser): improve skill description and add yo_browser_cdp_send to offload whitelist

* refactor(yobrowser): remove skill gating and make CDP tools always available in agent mode

* refactor(yobrowser): add CDP method schema validation with strict enums

- Add enum-based validation for cdp_send method (11 common CDP methods)
- Add detailed union schemas for each method's parameters with examples
- Add normalizeCdpParams method to handle both object and JSON string inputs
- Prevent method typos and provide better type safety for CDP interactions

* fix(yobrowser): add strict tab ID validation in CDP send handler

* chore: update deps

* refactor: agent provider simplification (#1286)

* docs: add spec for agent provider

* refactor(agent): remove BaseAgentProvider layer and simplify provider hierarchy

* feat(mcp): implement real Apple Maps search using URL scheme (#1289)

* feat: support voice.ai (#1291)

* feat: remove custome tiptap (#1295)

* feat: settings auto scroll toggle (#1293)

* feat: settings auto scroll toggle

* feat: i18n support

* fix(renderer): remove specific event listeners instead of all

* feat: add tooltip for filling default API URL in settings (#1296)

* fix: fix model list refresh failed (#1297)

* feat: add question tools  (#1298)

* feat(agent): add question tool flow

* feat(mcp): implement real Apple Maps search using URL scheme (#1289)

* feat: support voice.ai (#1291)

* feat: remove custome tiptap (#1295)

* feat: settings auto scroll toggle (#1293)

* feat: settings auto scroll toggle

* feat: i18n support

* fix(renderer): remove specific event listeners instead of all

* feat: add tooltip for filling default API URL in settings (#1296)

* refactor(question): simplify question request UI to single-choice interface

* fix(chat): restore pending question state

* fix: review issues

---------

Co-authored-by: Qi Jin <jin.qi1@northeastern.edu>
Co-authored-by: xiaomo <wegi866@gmail.com>

* chore: integrated vue-tsgo (#1299)

* chore: integrated vue-tsgo

* chore: update recommendation exteion

* chore: update

* feat: add prompt for ask tool

* chore: version to 0.5.7

---------

Co-authored-by: xiaomo <wegi866@gmail.com>
Co-authored-by: wanna <wanna.w@binarywalk.com>
Co-authored-by: Qi Jin <jin.qi1@northeastern.edu>
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.

[Feature] Is it possible to add a way to ignore the scrolling text on generation and read from the top as it goes?

2 participants