Skip to content

feat: Implement "Explain Code" feature in the UI #34

@Aashutosh-Mishra

Description

@Aashutosh-Mishra

Is your feature request related to a problem?

Our extension is excellent at translating code, but sometimes users need to understand what a piece of code does, not just its equivalent in another language. We have a backend /v1/explain endpoint that can generate these explanations, but there is currently no way to access this feature from the extension's user interface.

Describe the solution you'd like

  1. Add a new tab titled "Explain" to the injected UI, alongside the existing language tabs.
  2. When a user clicks the "Explain" tab, the extension should send the selected code to our /v1/explain backend endpoint.
  3. The text response from the endpoint should be displayed in the content panel for that tab. The explanation should be formatted for readability (e.g., preserving paragraphs and line breaks).
  4. Since the explanation isn't code, the "Copy" button should still work, but syntax highlighting is not needed for this panel.

Additional context

This feature will add significant value, turning CodeTranslateAI into both a translation and a learning tool. It's a great feature for someone who wants to work on the frontend UI components of the extension.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions