Feature Request: Collapsible/Scrollable Code Blocks in Chat Interface

Hi team,

I have a feature request regarding the UI/UX of the chat interface in Google AI Studio.

Currently, when the model generates long snippets of code, it renders them at full height/size. This drastically blows up the chat window, forcing the user to scroll endlessly through massive code blocks to read the rest of the conversation or prompts.

Proposed Solution:
Implement a maximum height limit for code blocks in the chat, turning long scripts into a compact, scrollable box.
Add an expand/collapse toggle or a “Fullscreen / View Full Code” button to let users expand the code block to its full size when needed.

This simple tweak would significantly improve readability and clean up the overall workspace layout.

Thank you for considering this improvement!

Hi @nk30 ,

Welcome to the community!

AI Studio is compatible with code blocks. If it’s not consistently formatting code that way, try adding a custom instruction like this:

When replying with code, always put ALL code inside a fenced code block with the appropriate language specified (e.g., ```javascript). Never output code as plain text.

That should help keep code properly formatted and much easier to read.

I hope that helps!

-TechRay

chrome_oJFIGNKQog