8000 CodeAccordion consolidations, editor UI breakout for diffs/fragments. by sachasayan · Pull Request #3011 · RooCodeInc/Roo-Code · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

CodeAccordion consolidations, editor UI breakout for diffs/fragments. #3011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sachasayan
Copy link
@sachasayan sachasayan commented Apr 28, 2025

Context

Need: As a user, I want verbose outputs to be broken out of the chat stream so I can analyze them in more detail.

Need: As a user, I want the chat feed to have less visual clutter so I can better understand what the agent is doing.

As Roo becomes more agentic and outputs larger volumes of code (diffs, edits, reads, etc.) it becomes more important to understand what it is doing at a high level and less important for granular details to make it to the chat stream — however, these artifacts (or details) should still remain accessible to the user for closer inspection when necessary. Roo does this a bit already, but implementations vary right now — some outputs are presented as accordions, some are presented in-line, and some are presented as previews in new tabs.

This PR addresses these needs by starting a transitional sunset of the CodeAccordion component — if a code change is voluminous enough that it needs to have a mechanism for hiding it, then we don't need it in the stream at all — instead, we can prepare a preview of it in a new tab if the user needs to take a look.

Note: While this PR is in draft, basic colouring has been added to all forms of output from the user/llm to implicitly categorize them. My expectation/goal is to refine this coloring before merge — no visual work has been done yet. Right now, it's all just architectural movement, capturing all the cases, etc.

TODO

✅ Transitional state: Replace 'verbose' CodeAccordions with ViewOutputBlocks
✅ Consolidate all verbose output variants of into ViewOutputBlocks or ViewOutputBlock variants.
✅ Refine previewing function.
✅ Convert all styling to Tailwind.
✅ Refine styling.
✅ Confirm/fix tests.
✅ Build translations.

Screenshots

highlight


Important

Consolidates verbose outputs using ViewOutputBlock, introduces content providers for API requests and tool outputs, and updates i18n files.

  • Behavior:
    • Replaces CodeAccordion with ViewOutputBlock for verbose outputs in ChatRow.tsx and MarkdownBlock.tsx.
    • Introduces ApiRequestContentProvider and ToolOutputContentProvider in extension.ts for handling API requests and tool outputs.
    • Adds new message types showApiRequestDetails and showToolOutput in webviewMessageHandler.ts.
  • Components:
    • Adds ApiRequestDetailsBlock.tsx for displaying API request details.
    • Adds ViewOutputBlock.tsx for handling large code outputs.
  • Mocks:
    • Adds mock for execa in src/__mocks__/execa.js and updates jest.config.js.
  • i18n:
    • Updates translation files for multiple languages to include new strings related to viewing outputs and API requests.

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

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 28, 2025
@hannesrudolph hannesrudolph added the UI/UX UI/UX related or focused label Apr 28, 2025
@sachasayan sachasayan force-pushed the ui-consolidate-code-accordions branch from c387cb4 to 05bf6a0 Compare April 28, 2025 19:18
Copy link
changeset-bot bot commented Apr 28, 2025

⚠️ No Changeset found

Latest commit: 6a89cc7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sachasayan sachasayan force-pushed the ui-consolidate-code-accordions branch 2 times, most recently from 20352ef to 9d3804f Compare April 29, 2025 14:01
@sachasayan
Copy link
Author

New interim styling. We'll need a separate PR to fix spacing and introduce timeline-like formatting. I don't want this one to get too ambitious.

Screenshot 2025-04-29 at 10 45 36 AM

@sachasayan sachasayan force-pushed the ui-consolidate-code-accordions branch from cc90c7c to d2d4623 Compare April 29, 2025 15:18
@sachasayan
Copy link
Author

@cte This shouldn't have any adverse conflicts with #3019, I think, but I want to check with you — I'm taking this in a totally different direction where large code blocks are pulled out of the chat stream and into the editor.

@sachasayan sachasayan force-pushed the ui-consolidate-code-accordions branch from d2d4623 to 13875da Compare April 29, 2025 17:51
@sachasayan sachasayan marked this pull request as ready for review April 29, 2025 18:24
@sachasayan sachasayan requested review from mrubens and cte as code owners April 29, 2025 18:24
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Apr 29, 2025
"viewDefinitions": "Visualizza definizioni",
"viewFileList": "Visualizza elenco file",
"viewSearchResults": "Visualizza risultati ricerca"
},
"directoryOperations": {
Copy link

Choose a reason for hiding this comment

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

Duplicate key detected: 'directoryOperations' is defined more than once in the JSON file. Please merge the two definitions into one to avoid unexpected behavior.

Copy link
ellipsis-dev bot commented Apr 29, 2025

This pull request is quite large, with changes spanning across multiple components, including localization updates, new features, and refactoring. To make the review process more manageable, it would be beneficial to split the localization updates into a separate pull request from the feature additions and refactoring. This will help reviewers focus on each aspect more effectively and ensure a smoother integration process. Thank you for your understanding and cooperation!

@sachasayan
Copy link
Author

@mrubens @cte Ready for review.

Context:

As Roo becomes more agentic and as models get better we care more about the broad strokes and less about the details flying by at 100tk/s. Generally, the goal here is to start pulling together the styling in the Chat Stream and to quiet the noise down a bit while still giving users access to verbose outputs if they need them.

Quick walkthrough:

ChatRow refactor and 'mildly' unified UI.

Still more work to do here but, the actions (tool use, api calls, diffs) now have unified styling and some of the components have been broken out.

Screenshot 2025-04-29 at 2 46 29 PM

View API Requests in Editor Pane

No more code accordions to view a thousand-line API request. Now we break that content out into a preview tab:

Screen.Recording.2025-04-29.at.2.31.50.PM.mov

...And the same for Diffs-within-Markdown, Diff Tools, and other code fragments:

Screenshot 2025-04-29 at 2 32 59 PM

...which means no more of this:

Screenshot 2025-04-29 at 2 35 41 PM

@sachasayan sachasayan changed the title Draft: CodeAccordion consolidations. CodeAccordion consolidations, editor UI breakout for diffs/fragments. Apr 29, 2025
@elianiva
Copy link

nice, this looks wayyy better than the current one, some nitpicks though

image

i feel like this takes up too much space, we can reduce the whitespace IMO

image

i like this one a bit better (the inner padding, i mean)

btw, did you intentionally make the rounded corners different? some are more rounded than the others. i think it'll look better if they are more consistent

@sachasayan
Copy link
Author

i feel like this takes up too much space, we can reduce the whitespace IMO

You're right. Let's nip-tuck this, I'll do a quick additional commit.

btw, did you intentionally make the rounded corners different? some are more rounded than the others. i think it'll look better if they are more consistent

I evened them up a bit after I took the screenshot. But tbh there's like fifty of these and they all had independent hard-coded styling and markup. It's going to take a few PRs to chase them all down, DRY everything, and start building a 'universal' styling language. Right now I want to get this mechanism in so there's no rebasing every 2-3 days because... this is a lot of code in a very 'hot' part of the codebase.

@samhvw8
Copy link
Collaborator
samhvw8 commented Apr 30, 2025

@sachasayan love this, sometime when view large api request will make webview crash, this pr will solve that problems as well 🙆

Comment on lines 93 to 100
"chat": {
"shellIntegration": {
"troubleshootingGuide": "guia de resolució de problemes"
},
"copyAsMarkdown": "Copia com a markdown",
"response": "Resposta",
"arguments": "Arguments",
"filePathFormat": " ({{filePath}})"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure we want to add these to common - do they already exist in chat.json?

})
}
}}
title={t("chat:apiRequest.viewDetailsTooltip") ?? "View API Request Details"}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need inline English fallbacks for translations - they'll just use what's in the English json file if a match isn't found.

Suggested change
title={t("chat:apiRequest.viewDetailsTooltip") ?? "View API Request Details"}>
title={t("chat:apiRequest.viewDetailsTooltip")}>


import CodeAccordian, { removeLeadingNonAlphanumeric } from "../common/CodeAccordian"
import CodeBlock, { CODE_BLOCK_BG_COLOR } from "../common/CodeBlock"
import CodeAccordian, { removeLeadingNonAlphanumeric } from "../common/CodeAccordian" // Restore CodeAccordian import
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mind doing a pass over this to remove unnecessary comments? The models are so bad at leaving these in despite whatever instructions I come up with.

Copy link
Author
@sachasayan sachasayan Apr 30, 2025

Choose a reason for hiding this comment

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

Yep. I have a regex I've been using, by the way. I'll throw it in the pre-commit hook or a bot or something like that when I get a chance:

\/\/[^\S\n]+(?:Add|Remove|Update|Import|Restore).{1,30}(\n)
  • Two forward slashes
  • One or more whitespace non-newline characters
  • One of the words "Add", "Remove", "Update", "Import", or "Restore".
  • Between 1 and 3 other characters (except newline)
  • Newline

@mrubens
Copy link
Collaborator
mrubens commented Apr 30, 2025

I like the idea in general of cleaning up the chat-view and getting rid of accordions, thank you for taking this on.

I agree with the feedback around getting to consistent corner rounding if we can, though I hear you on how many conflicts a PR like this is going to have to deal with.

Getting into more fine-grained visual feedback - I find the new colored/bordered elements to be very visually prominent compared to user messages, task headers, question options, etc. It seems like most of the time they're just informational, so I wonder if we should dial back the prominence a bit.

SmartManoj pushed a commit to SmartManoj/Roo-Code that referenced this pull request May 6, 2025
* feat: add copy button to code blocks

* Adding ability to copy Code blocks

* feat: add OpenRouter base URL and balance display component

---------

Co-authored-by: ShlomoCode <78599753+ShlomoCode@users.noreply.github.com>
@sachasayan sachasayan force-pushed the ui-consolidate-code-accordions branch from ca4ad1b to f21cfc2 Compare May 7, 2025 20:18
@sachasayan sachasayan force-pushed the ui-consolidate-code-accordions branch 5 times, most recently from e5b2e25 to cc30011 Compare May 12, 2025 21:05
@sachasayan sachasayan force-pushed the ui-consolidate-code-accordions branch from cc30011 to c5c81d9 Compare May 12, 2025 23:34
@sachasayan
Copy link
Author

This is good to go as long as tests are passing @mrubens @cte.

@samhvw8
Copy link
Collaborator
samhvw8 commented May 13, 2025

Love it, waiting it on air 💯

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Changes Requested] in Roo Code Roadmap May 27, 2025
@daniel-lxs daniel-lxs assigned mrubens and unassigned mrubens May 27, 2025
@hannesrudolph
Copy link
Collaborator

@sachasayan Thanks for your PR.

Since there's been no activity for a few weeks after changes were requested, we're moving this back to draft status. Please update the PR or let us know your plans. If you're no longer working on it, consider closing it or creating a fresh issue using our issue-first approach.

We appreciate your contribution and look forward to your updates!

@hannesrudolph hannesrudolph moved this from PR [Changes Requested] to PR [Draft / In Progress] in Roo Code Roadmap May 27, 2025
@hannesrudolph hannesrudolph marked this pull request as draft May 27, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR - Draft / In Progress size:XXL This PR changes 1000+ lines, ignoring generated files. UI/UX UI/UX related or focused
Projects
Status: PR [Draft / In Progress]
Development

Successfully merging this pull request may close these issues.

6 participants
0