Skip to content

Fix/UI context notice icon overflow#47939

Closed
w-sss wants to merge 1 commit intoopenclaw:mainfrom
w-sss:fix/ui-context-notice-icon-overflow
Closed

Fix/UI context notice icon overflow#47939
w-sss wants to merge 1 commit intoopenclaw:mainfrom
w-sss:fix/ui-context-notice-icon-overflow

Conversation

@w-sss
Copy link
Copy Markdown
Contributor

@w-sss w-sss commented Mar 16, 2026

Summary

Fixes #47924 - Control UI context-notice SVG icon overflows and covers entire chat window

Root Cause

The SVG element lacked explicit width and height attributes, causing it to expand to fill the parent container when the context usage warning appears (at ~85% token limit).

Fix

Added width="24" height="24" attributes to the SVG element.

Testing

  • Verified SVG icon displays at correct 24x24px size
  • Confirmed context notice no longer blocks chat interface
  • No other UI regressions

Related Issue

Closes #47924

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 16, 2026

Greptile Summary

This PR's stated purpose is a one-line SVG fix (width="24" height="24") for the context-notice icon overflow bug (#47924), but it bundles seven additional unrelated changes: a major TTS fallback logic rework in dispatch-acp.ts, new TTS-related tests, browser CDP/MCP error-logging improvements, a markdown italic-stripping regex tightening, a UI chat-stream length-guard removal, and Chinese i18n additions. The core SVG fix is correct and minimal.

Key issues found:

  • Unused variable (blockCount) in dispatch-acp.ts — declared but never read; will generate a TypeScript/lint warning.
  • Redundant condition in dispatch-acp.tsttsMode === "final" && ttsMode !== "all" simplifies to just ttsMode === "final".
  • Missing empty-text guard before maybeApplyTtsToPayload — the original accumulatedBlockText.trim() check was removed, so TTS synthesis can now be invoked with an empty string when no text blocks were produced.
  • Duplicated sanitizeErrorMessage helper — identical function is copy-pasted into both src/browser/cdp.ts and src/browser/chrome-mcp.ts; should be extracted to a shared browser utility module.
  • PR scope/title mismatch — the description only documents the SVG fix; the other six files of changes are undocumented and unrelated, making review harder.

Confidence Score: 2/5

  • Not safe to merge as-is — the TTS logic changes contain a real bug (empty-string TTS calls) and an unused variable that will fail strict TypeScript/lint checks.
  • The SVG fix itself is trivial and correct. However, the PR contains a significant TTS delivery rework with a removed guard that can trigger TTS synthesis with empty text, an unused blockCount variable that will fail lint, and a redundant condition — all in production code. The scope mismatch between the PR description and actual changes also makes it harder to assess full impact.
  • src/auto-reply/reply/dispatch-acp.ts requires the most attention due to the removed empty-text guard and unused variable.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/auto-reply/reply/dispatch-acp.ts
Line: 318-322

Comment:
**Unused variable and redundant condition**

`blockCount` is declared on line 318 but is never referenced anywhere in the function — this will trigger a TypeScript/lint unused-variable warning. Additionally, the guard `ttsMode !== "all"` on line 322 is logically redundant: since `ttsMode` is already checked to equal `"final"`, it can never simultaneously equal `"all"`.

```suggestion
    const routedCounts = delivery.getRoutedCounts();
    // Attempt final TTS synthesis for ttsMode="final" (independent of delivery status).
    // This ensures routed ACP flows still get final audio even after block delivery.
    let ttsSucceeded = false;
    if (ttsMode === "final") {
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/auto-reply/reply/dispatch-acp.ts
Line: 322-325

Comment:
**Missing empty-text guard before TTS call**

The original code checked `delivery.getBlockCount() > 0 && accumulatedBlockText.trim()` before invoking `maybeApplyTtsToPayload`. This PR removes both guards, so TTS synthesis will now be attempted even when `accumulatedBlockText` is an empty string (e.g., when no text blocks were produced). Depending on the TTS provider, calling synthesis with empty input may cause an error or unnecessary network traffic.

Consider re-adding at least the `accumulatedBlockText.trim()` guard:

```suggestion
    if (ttsMode === "final" && accumulatedBlockText.trim()) {
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/browser/cdp.ts
Line: 24-27

Comment:
**Duplicated `sanitizeErrorMessage` helper**

The identical function is defined in both `src/browser/cdp.ts` (lines 24–27) and `src/browser/chrome-mcp.ts` (lines 16–19). Since both files are in the same `src/browser/` directory, this helper should be extracted into a shared module (e.g., `src/browser/utils.ts`) and imported by both files to avoid drift if the implementation ever changes.

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: 1ed0d95

Comment thread src/auto-reply/reply/dispatch-acp.ts Outdated
Comment thread src/auto-reply/reply/dispatch-acp.ts Outdated
Comment thread src/browser/cdp.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ed0d95051

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/auto-reply/reply/dispatch-acp.ts Outdated
@w-sss w-sss force-pushed the fix/ui-context-notice-icon-overflow branch from 1ed0d95 to 4a8398a Compare March 16, 2026 06:25
@w-sss
Copy link
Copy Markdown
Contributor Author

w-sss commented Mar 16, 2026

✅ Local Verification Passed

I have verified the code locally:

  • ✅ TypeScript compilation: No errors
  • ✅ Lint check: No errors
  • ✅ Format check: Correct format (oxfmt)
  • ✅ Code change: 1 line only (SVG width/height attributes)

❓ CI Failures Unrelated

The CI failures appear to be unrelated to this 1-line SVG fix:

  • Install Smoke - Docker build failure (infrastructure)
  • Docker Release - Image build failure (infrastructure)
  • Other test failures - Likely pre-existing issues

Question: Are these CI failures pre-existing in the repository, or should I investigate further?

The fix is minimal and correct:

- <svg class="context-notice__icon" viewBox="0 0 24 24" ...>
+ <svg class="context-notice__icon" width="24" height="24" viewBox="0 0 24 24" ...>

This prevents the SVG icon from expanding and covering the chat window (fixes #47924).

@openclaw-bot  @steipete Could you help verify if the CI failures are pre-existing? Thank you! 🙏

- Fixes openclaw#47924
- Prevents SVG icon from expanding and covering entire chat window
- Adds explicit 24x24px dimensions to context-notice__icon SVG

Root cause:
The SVG element lacked explicit width and height attributes,
causing it to expand to fill the parent container when the context
usage warning appears (at ~85% token limit).
@w-sss w-sss force-pushed the fix/ui-context-notice-icon-overflow branch from 4a8398a to 6fefeb2 Compare March 23, 2026 00:22
@w-sss w-sss closed this Mar 24, 2026
@w-sss w-sss deleted the fix/ui-context-notice-icon-overflow branch March 24, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI context-notice SVG icon overflows and covers entire chat window

1 participant