openclaw - 💡(How to fix) Fix [Feature]: 我在查看思考过程时,界面能保持在我滚动到的位置,而不是自动跳转到最新的思考内容。 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#53719Fetched 2026-04-08 01:24:26
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1
---
title: "🔧 Fix: Lock chat scroll when user scrolls up to view thinking/reasoning content"
labels: ["bug", "enhancement", "ui/ux", "priority-medium"]
---

Root Cause

🔍 Root Cause Analysis

Code Example

---
title: "🔧 Fix: Lock chat scroll when user scrolls up to view thinking/reasoning content"
labels: ["bug", "enhancement", "ui/ux", "priority-medium"]
---

## 🐛 Bug Description

When the thinking/reasoning process is streaming and the user scrolls up to view earlier thinking content, the UI **automatically scrolls back to the bottom** when new thinking content arrives. This interrupts the user's reading flow and makes it difficult to review the thinking process.

**Current Behavior:**
1. User sends a question that triggers reasoning/thinking
2. Thinking content starts streaming
3. User scrolls up to read earlier thinking steps
4. **New thinking content arrives → UI auto-scrolls to bottom**5. User loses their reading position

**Expected Behavior (like DeepSeek):**
1. User sends a question that triggers reasoning/thinking
2. Thinking content starts streaming
3. User scrolls up to read earlier thinking steps
4. **UI stays at user's scroll position**5. "New content below" indicator appears
6. User clicks indicator to return to latest content

## 🎯 User Impact

This affects all users who:
- Use the reasoning/thinking feature
- Want to review the AI's thought process
- Need to understand complex multi-step reasoning

**Severity:** Medium-High - significantly degrades UX for a core feature

## 🔍 Root Cause Analysis

The issue is in `ui/src/ui/app-scroll.ts`:

1. `scheduleChatScroll()` is called with `force=true` when messages are sent
2. The retry logic doesn't respect user scroll position
3. No mechanism to detect when user intentionally scrolls up to read content

## 💡 Proposed Solution

Add **scroll lock** mechanism:

1. **Detect intentional scroll-up**: When user scrolls up > 600px from bottom
2. **Lock auto-scroll**: Set `chatScrollLocked = true`
3. **Respect lock**: Don't auto-scroll when locked, even with `force=true`
4. **Show indicator**: Display "New content below" button
5. **Unlock on return**: Clear lock when user scrolls back to bottom

## 📝 Implementation Status

**Already implemented locally** - Ready for PR review

### Files Modified:

1. `ui/src/ui/app-scroll.ts`:
   - Added `chatScrollLocked` state
   - Added `SCROLL_LOCK_THRESHOLD = 600`
   - Modified `handleChatScroll()` to detect scroll-up
   - Modified `scheduleChatScroll()` to respect lock (including retry logic)
   - Added `unlockChatScroll()` function

2. `ui/src/ui/app.ts`:
   - Added `chatScrollLocked` private state
   - Added `unlockChatScroll()` method

3. `ui/src/ui/views/chat.ts`:
   - Updated button text: "New messages""New content below"

## 🧪 Test Scenarios

### Scenario 1: User at bottom (normal behavior)

---

### Scenario 2: User scrolls up (lock behavior)

---

### Scenario 3: User returns to bottom manually

---

## 🔗 Related Files

- `ui/src/ui/app-scroll.ts` - Core scroll logic
- `ui/src/ui/app.ts` - App state and methods
- `ui/src/ui/views/chat.ts` - Chat UI rendering

## 📚 References

- DeepSeek thinking process scroll behavior (reference implementation)
- Similar pattern: Slack/Discord message history scroll lock

## 🚀 Priority

**Priority:** Medium-High
**Estimated Effort:** 2-4 hours (already implemented)
**Impact:** All users of reasoning/thinking feature

---

**Note:** I have already implemented the fix locally. Happy to submit a PR if the approach looks good!

---

cd /home/admin/openclaw/workspace/temp/openclaw-src

# 创建分支
git checkout -b feature/thinking-scroll-lock

# 添加修改的文件
git add ui/src/ui/app-scroll.ts
git add ui/src/ui/app.ts
git add ui/src/ui/views/chat.ts

# 提交
git commit -m "feat(ui): lock chat scroll when user scrolls up to view thinking content

- Add chatScrollLocked state to track manual scroll-up behavior
- Respect user scroll position during thinking/reasoning streaming
- Show 'New content below' indicator when scroll is locked
- Auto-unlock when user scrolls back to bottom

Fixes: #[issue-number]"

# 推送
git push origin feature/thinking-scroll-lock

---

---
title: "🔧 Fix: Lock chat scroll when user scrolls up to view thinking/reasoning content"
labels: ["bug", "enhancement", "ui/ux", "priority-medium"]
---

## 🐛 Bug Description

When the thinking/reasoning process is streaming and the user scrolls up to view earlier thinking content, the UI **automatically scrolls back to the bottom** when new thinking content arrives. This interrupts the user's reading flow and makes it difficult to review the thinking process.

**Current Behavior:**
1. User sends a question that triggers reasoning/thinking
2. Thinking content starts streaming
3. User scrolls up to read earlier thinking steps
4. **New thinking content arrives → UI auto-scrolls to bottom**5. User loses their reading position

**Expected Behavior (like DeepSeek):**
1. User sends a question that triggers reasoning/thinking
2. Thinking content starts streaming
3. User scrolls up to read earlier thinking steps
4. **UI stays at user's scroll position**5. "New content below" indicator appears
6. User clicks indicator to return to latest content

## 🎯 User Impact

This affects all users who:
- Use the reasoning/thinking feature
- Want to review the AI's thought process
- Need to understand complex multi-step reasoning

**Severity:** Medium-High - significantly degrades UX for a core feature

## 🔍 Root Cause Analysis

The issue is in `ui/src/ui/app-scroll.ts`:

1. `scheduleChatScroll()` is called with `force=true` when messages are sent
2. The retry logic doesn't respect user scroll position
3. No mechanism to detect when user intentionally scrolls up to read content

## 💡 Proposed Solution

Add **scroll lock** mechanism:

1. **Detect intentional scroll-up**: When user scrolls up > 600px from bottom
2. **Lock auto-scroll**: Set `chatScrollLocked = true`
3. **Respect lock**: Don't auto-scroll when locked, even with `force=true`
4. **Show indicator**: Display "New content below" button
5. **Unlock on return**: Clear lock when user scrolls back to bottom

## 📝 Implementation Status

**Already implemented locally** - Ready for PR review

### Files Modified:

1. `ui/src/ui/app-scroll.ts`:
   - Added `chatScrollLocked` state
   - Added `SCROLL_LOCK_THRESHOLD = 600`
   - Modified `handleChatScroll()` to detect scroll-up
   - Modified `scheduleChatScroll()` to respect lock (including retry logic)
   - Added `unlockChatScroll()` function

2. `ui/src/ui/app.ts`:
   - Added `chatScrollLocked` private state
   - Added `unlockChatScroll()` method

3. `ui/src/ui/views/chat.ts`:
   - Updated button text: "New messages""New content below"

## 🧪 Test Scenarios

### Scenario 1: User at bottom (normal behavior)

---

### Scenario 2: User scrolls up (lock behavior)

---

### Scenario 3: User returns to bottom manually

---

## 🔗 Related Files

- `ui/src/ui/app-scroll.ts` - Core scroll logic
- `ui/src/ui/app.ts` - App state and methods
- `ui/src/ui/views/chat.ts` - Chat UI rendering

## 📚 References

- DeepSeek thinking process scroll behavior (reference implementation)
- Similar pattern: Slack/Discord message history scroll lock

## 🚀 Priority

**Priority:** Medium-High
**Estimated Effort:** 2-4 hours (already implemented)
**Impact:** All users of reasoning/thinking feature

---

**Note:** I have already implemented the fix locally. Happy to submit a PR if the approach looks good!

---

cd /home/admin/openclaw/workspace/temp/openclaw-src

# 创建分支
git checkout -b feature/thinking-scroll-lock

# 添加修改的文件
git add ui/src/ui/app-scroll.ts
git add ui/src/ui/app.ts
git add ui/src/ui/views/chat.ts

# 提交
git commit -m "feat(ui): lock chat scroll when user scrolls up to view thinking content

- Add chatScrollLocked state to track manual scroll-up behavior
- Respect user scroll position during thinking/reasoning streaming
- Show 'New content below' indicator when scroll is locked
- Auto-unlock when user scrolls back to bottom

Fixes: #[issue-number]"

# 推送
git push origin feature/thinking-scroll-lock
RAW_BUFFERClick to expand / collapse

Summary

---
title: "🔧 Fix: Lock chat scroll when user scrolls up to view thinking/reasoning content"
labels: ["bug", "enhancement", "ui/ux", "priority-medium"]
---

## 🐛 Bug Description

When the thinking/reasoning process is streaming and the user scrolls up to view earlier thinking content, the UI **automatically scrolls back to the bottom** when new thinking content arrives. This interrupts the user's reading flow and makes it difficult to review the thinking process.

**Current Behavior:**
1. User sends a question that triggers reasoning/thinking
2. Thinking content starts streaming
3. User scrolls up to read earlier thinking steps
4. **New thinking content arrives → UI auto-scrolls to bottom**5. User loses their reading position

**Expected Behavior (like DeepSeek):**
1. User sends a question that triggers reasoning/thinking
2. Thinking content starts streaming
3. User scrolls up to read earlier thinking steps
4. **UI stays at user's scroll position**5. "New content below" indicator appears
6. User clicks indicator to return to latest content

## 🎯 User Impact

This affects all users who:
- Use the reasoning/thinking feature
- Want to review the AI's thought process
- Need to understand complex multi-step reasoning

**Severity:** Medium-High - significantly degrades UX for a core feature

## 🔍 Root Cause Analysis

The issue is in `ui/src/ui/app-scroll.ts`:

1. `scheduleChatScroll()` is called with `force=true` when messages are sent
2. The retry logic doesn't respect user scroll position
3. No mechanism to detect when user intentionally scrolls up to read content

## 💡 Proposed Solution

Add **scroll lock** mechanism:

1. **Detect intentional scroll-up**: When user scrolls up > 600px from bottom
2. **Lock auto-scroll**: Set `chatScrollLocked = true`
3. **Respect lock**: Don't auto-scroll when locked, even with `force=true`
4. **Show indicator**: Display "New content below" button
5. **Unlock on return**: Clear lock when user scrolls back to bottom

## 📝 Implementation Status

**Already implemented locally** - Ready for PR review

### Files Modified:

1. `ui/src/ui/app-scroll.ts`:
   - Added `chatScrollLocked` state
   - Added `SCROLL_LOCK_THRESHOLD = 600`
   - Modified `handleChatScroll()` to detect scroll-up
   - Modified `scheduleChatScroll()` to respect lock (including retry logic)
   - Added `unlockChatScroll()` function

2. `ui/src/ui/app.ts`:
   - Added `chatScrollLocked` private state
   - Added `unlockChatScroll()` method

3. `ui/src/ui/views/chat.ts`:
   - Updated button text: "New messages" → "New content below"

## 🧪 Test Scenarios

### Scenario 1: User at bottom (normal behavior)
  1. Send message → thinking starts
  2. Stay at bottom
  3. Expected: Auto-scroll follows new content ✅

### Scenario 2: User scrolls up (lock behavior)
  1. Send message → thinking starts
  2. Scroll up > 600px
  3. Expected: Stay at scroll position, show "New content below" ✅
  4. Click indicator
  5. Expected: Scroll to bottom, resume auto-scroll ✅

### Scenario 3: User returns to bottom manually
  1. Send message → thinking starts
  2. Scroll up
  3. Scroll back to bottom manually
  4. Expected: Auto-scroll resumes ✅

## 🔗 Related Files

- `ui/src/ui/app-scroll.ts` - Core scroll logic
- `ui/src/ui/app.ts` - App state and methods
- `ui/src/ui/views/chat.ts` - Chat UI rendering

## 📚 References

- DeepSeek thinking process scroll behavior (reference implementation)
- Similar pattern: Slack/Discord message history scroll lock

## 🚀 Priority

**Priority:** Medium-High
**Estimated Effort:** 2-4 hours (already implemented)
**Impact:** All users of reasoning/thinking feature

---

**Note:** I have already implemented the fix locally. Happy to submit a PR if the approach looks good!

🔗 提交链接


💡 后续

提交 Issue 后,如果需要提交 PR:

cd /home/admin/openclaw/workspace/temp/openclaw-src

# 创建分支
git checkout -b feature/thinking-scroll-lock

# 添加修改的文件
git add ui/src/ui/app-scroll.ts
git add ui/src/ui/app.ts
git add ui/src/ui/views/chat.ts

# 提交
git commit -m "feat(ui): lock chat scroll when user scrolls up to view thinking content

- Add chatScrollLocked state to track manual scroll-up behavior
- Respect user scroll position during thinking/reasoning streaming
- Show 'New content below' indicator when scroll is locked
- Auto-unlock when user scrolls back to bottom

Fixes: #[issue-number]"

# 推送
git push origin feature/thinking-scroll-lock

Problem to solve

我在查看思考过程时,界面能保持在我滚动到的位置,而不是自动跳转到最新的思考内容。

Proposed solution

---
title: "🔧 Fix: Lock chat scroll when user scrolls up to view thinking/reasoning content"
labels: ["bug", "enhancement", "ui/ux", "priority-medium"]
---

## 🐛 Bug Description

When the thinking/reasoning process is streaming and the user scrolls up to view earlier thinking content, the UI **automatically scrolls back to the bottom** when new thinking content arrives. This interrupts the user's reading flow and makes it difficult to review the thinking process.

**Current Behavior:**
1. User sends a question that triggers reasoning/thinking
2. Thinking content starts streaming
3. User scrolls up to read earlier thinking steps
4. **New thinking content arrives → UI auto-scrolls to bottom**5. User loses their reading position

**Expected Behavior (like DeepSeek):**
1. User sends a question that triggers reasoning/thinking
2. Thinking content starts streaming
3. User scrolls up to read earlier thinking steps
4. **UI stays at user's scroll position**5. "New content below" indicator appears
6. User clicks indicator to return to latest content

## 🎯 User Impact

This affects all users who:
- Use the reasoning/thinking feature
- Want to review the AI's thought process
- Need to understand complex multi-step reasoning

**Severity:** Medium-High - significantly degrades UX for a core feature

## 🔍 Root Cause Analysis

The issue is in `ui/src/ui/app-scroll.ts`:

1. `scheduleChatScroll()` is called with `force=true` when messages are sent
2. The retry logic doesn't respect user scroll position
3. No mechanism to detect when user intentionally scrolls up to read content

## 💡 Proposed Solution

Add **scroll lock** mechanism:

1. **Detect intentional scroll-up**: When user scrolls up > 600px from bottom
2. **Lock auto-scroll**: Set `chatScrollLocked = true`
3. **Respect lock**: Don't auto-scroll when locked, even with `force=true`
4. **Show indicator**: Display "New content below" button
5. **Unlock on return**: Clear lock when user scrolls back to bottom

## 📝 Implementation Status

**Already implemented locally** - Ready for PR review

### Files Modified:

1. `ui/src/ui/app-scroll.ts`:
   - Added `chatScrollLocked` state
   - Added `SCROLL_LOCK_THRESHOLD = 600`
   - Modified `handleChatScroll()` to detect scroll-up
   - Modified `scheduleChatScroll()` to respect lock (including retry logic)
   - Added `unlockChatScroll()` function

2. `ui/src/ui/app.ts`:
   - Added `chatScrollLocked` private state
   - Added `unlockChatScroll()` method

3. `ui/src/ui/views/chat.ts`:
   - Updated button text: "New messages" → "New content below"

## 🧪 Test Scenarios

### Scenario 1: User at bottom (normal behavior)
  1. Send message → thinking starts
  2. Stay at bottom
  3. Expected: Auto-scroll follows new content ✅

### Scenario 2: User scrolls up (lock behavior)
  1. Send message → thinking starts
  2. Scroll up > 600px
  3. Expected: Stay at scroll position, show "New content below" ✅
  4. Click indicator
  5. Expected: Scroll to bottom, resume auto-scroll ✅

### Scenario 3: User returns to bottom manually
  1. Send message → thinking starts
  2. Scroll up
  3. Scroll back to bottom manually
  4. Expected: Auto-scroll resumes ✅

## 🔗 Related Files

- `ui/src/ui/app-scroll.ts` - Core scroll logic
- `ui/src/ui/app.ts` - App state and methods
- `ui/src/ui/views/chat.ts` - Chat UI rendering

## 📚 References

- DeepSeek thinking process scroll behavior (reference implementation)
- Similar pattern: Slack/Discord message history scroll lock

## 🚀 Priority

**Priority:** Medium-High
**Estimated Effort:** 2-4 hours (already implemented)
**Impact:** All users of reasoning/thinking feature

---

**Note:** I have already implemented the fix locally. Happy to submit a PR if the approach looks good!

🔗 提交链接


💡 后续

提交 Issue 后,如果需要提交 PR:

cd /home/admin/openclaw/workspace/temp/openclaw-src

# 创建分支
git checkout -b feature/thinking-scroll-lock

# 添加修改的文件
git add ui/src/ui/app-scroll.ts
git add ui/src/ui/app.ts
git add ui/src/ui/views/chat.ts

# 提交
git commit -m "feat(ui): lock chat scroll when user scrolls up to view thinking content

- Add chatScrollLocked state to track manual scroll-up behavior
- Respect user scroll position during thinking/reasoning streaming
- Show 'New content below' indicator when scroll is locked
- Auto-unlock when user scrolls back to bottom

Fixes: #[issue-number]"

# 推送
git push origin feature/thinking-scroll-lock

Alternatives considered

No response

Impact

Impact * Explain who is affected, severity/urgency, how often this pain occurs, and practical consequences. Include:

Affected users/systems/channels Severity (annoying, blocks workflow, etc.) Frequency (always/intermittent/edge case) Consequence (delays, errors, extra manual work, etc.)

Evidence/examples

No response

Additional information

No response

extent analysis

Fix Plan

To fix the issue of the chat scroll automatically scrolling back to the bottom when new thinking content arrives, we need to implement a scroll lock mechanism. Here are the steps:

  • Detect intentional scroll-up: When the user scrolls up more than 600px from the bottom, set chatScrollLocked to true.
  • Lock auto-scroll: When chatScrollLocked is true, don't auto-scroll even with force=true.
  • Show indicator: Display a "New content below" button when the scroll is locked.
  • Unlock on return: Clear the lock when the user scrolls back to the bottom.

Code Changes

We need to modify the following files:

  1. ui/src/ui/app-scroll.ts:
    • Add chatScrollLocked state and SCROLL_LOCK_THRESHOLD constant.
    • Modify handleChatScroll() to detect scroll-up and set chatScrollLocked to true.
    • Modify scheduleChatScroll() to respect the lock and not auto-scroll when chatScrollLocked is true.
    • Add unlockChatScroll() function to clear the lock when the user scrolls back to the bottom.
// ui/src/ui/app-scroll.ts
const SCROLL_LOCK_THRESHOLD = 600;
let chatScrollLocked = false;

function handleChatScroll() {
  const scrollPosition = getScrollPosition();
  if (scrollPosition > SCROLL_LOCK_THRESHOLD) {
    chatScrollLocked = true;
  }
}

function scheduleChatScroll(force) {
  if (chatScrollLocked && !force) {
    return;
  }
  // auto-scroll logic
}

function unlockChatScroll() {
  chatScrollLocked = false;
}
  1. ui/src/ui/app.ts:
    • Add chatScrollLocked private state and unlockChatScroll() method.
// ui/src/ui/app.ts
class App {
  private chatScrollLocked = false;

  unlockChatScroll() {
    this.chatScrollLocked = false;
  }
}
  1. ui/src/ui/views/chat.ts:
    • Update button text to "New content below".
<!-- ui/src/ui/views/chat.ts -->
<button>New content below</button>

Verification

To verify that the fix worked, we can test the following scenarios:

  1. User at bottom (normal behavior):
    • Send a message to trigger thinking.
    • Stay at the bottom.
    • Expected: Auto-scroll follows new content.
  2. User scrolls up (lock behavior):
    • Send a message to trigger thinking.
    • Scroll up more than 600px.
    • Expected: Stay at scroll position, show "New content below" indicator.
    • Click the indicator.
    • Expected: Scroll to bottom, resume auto-scroll.
  3. User returns to bottom manually:
    • Send a message to trigger thinking.
    • Scroll up.
    • Scroll

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature]: 我在查看思考过程时,界面能保持在我滚动到的位置,而不是自动跳转到最新的思考内容。 [1 participants]