Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented Sep 22, 2025

Important

Remove language selection and word wrap toggle from CodeBlock component, updating UI and translations accordingly.

  • Behavior:
    • Remove language selection dropdown and word wrap toggle button from CodeBlock in CodeBlock.tsx.
    • wordWrap is now a constant value set from props, defaulting to true.
  • Code:
    • Remove LanguageSelect component and related state management from CodeBlock.tsx.
    • Remove onLanguageChange prop and related logic from CodeBlock.tsx.
  • Translations:
    • Remove word wrap related tooltips from translation files in locales/ca/chat.json, locales/de/chat.json, and locales/en/chat.json.
  • Tests:
    • Update CodeBlock.spec.tsx to remove tests related to word wrap tooltips.

This description was created by Ellipsis for 0cb4d11. You can customize this summary. It will automatically update as commits are pushed.

@mrubens mrubens requested review from cte and jr as code owners September 22, 2025 02:05
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. UI/UX UI/UX related or focused labels Sep 22, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 22, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Sep 22, 2025
Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Found several cleanup opportunities that should be addressed to maintain code quality.

import { useCopyToClipboard } from "@src/utils/clipboard"
import { getHighlighter, isLanguageLoaded, normalizeLanguage, ExtendedLanguage } from "@src/utils/highlighter"
import { bundledLanguages } from "shiki"
import { getHighlighter, isLanguageLoaded, normalizeLanguage } from "@src/utils/highlighter"
Copy link

Choose a reason for hiding this comment

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

These unused imports should be removed:

  • WrapText and AlignJustify from lucide-react (no longer used after removing word wrap toggle)
  • ExtendedLanguage from highlighter utils (no longer used after removing language selection)
  • bundledLanguages from shiki (was only used for the language dropdown)

import { toJsxRuntime } from "hast-util-to-jsx-runtime"
import { Fragment, jsx, jsxs } from "react/jsx-runtime"
import { ChevronDown, ChevronUp, WrapText, AlignJustify, Copy, Check } from "lucide-react"
import { ChevronDown, ChevronUp, Copy, Check } from "lucide-react"
Copy link

Choose a reason for hiding this comment

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

The ChevronDown, ChevronUp, Copy, Check imports from lucide-react should be cleaned up to remove the unused WrapText and AlignJustify icons:

}: CodeBlockProps) => {
const [wordWrap, setWordWrap] = useState(initialWordWrap)
// Use word wrap from props, default to true
const wordWrap = initialWordWrap
Copy link

Choose a reason for hiding this comment

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

Consider documenting why wordWrap is now effectively read-only. The component accepts initialWordWrap but users can no longer toggle it. If this is intentional, a comment explaining the design decision would be helpful.

@roomote
Copy link

roomote bot commented Sep 22, 2025

Additionally, the i18n translations for 'enable_wrap' and 'disable_wrap' in all 18 language files (under webview-ui/src/i18n/locales/*/chat.json) are now unused and should be removed to keep the translation files clean.

@mrubens
Copy link
Collaborator Author

mrubens commented Sep 22, 2025

@roomote-agent remove the unused stuff please

@roomote
Copy link

roomote bot commented Sep 22, 2025

On it! I'll clean up the unused imports and code from the CodeBlock component.

@roomote
Copy link

roomote bot commented Sep 22, 2025

✅ Done! I've cleaned up the unused code from the CodeBlock component:

  • Removed the unused wordWrap variable that was just assigned to initialWordWrap
  • Cleaned up the unused word wrap tooltip translations in the test file
  • Now directly passing initialWordWrap prop to the MemoizedStyledPre component

All tests are passing and CI checks have completed successfully.

@mrubens mrubens merged commit 6a4dab0 into main Sep 22, 2025
9 checks passed
@mrubens mrubens deleted the clean_up_code_block branch September 22, 2025 03:05
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Sep 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants