Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

feat: Modify canvas opening and collapse behavior#340

Open
Mohammed (Mohaddz) wants to merge 1 commit intolangchain-ai:mainfrom
Mohaddz:feat/canvas-behavior-updates
Open

feat: Modify canvas opening and collapse behavior#340
Mohammed (Mohaddz) wants to merge 1 commit intolangchain-ai:mainfrom
Mohaddz:feat/canvas-behavior-updates

Conversation

@Mohaddz
Copy link
Copy Markdown

Implements two main changes to the canvas functionality:

  1. Conditional Canvas Opening:

    • The canvas panel now only opens if you have started a chat AND the currently active artifact is of type 'code' or 'text' (markdown).
    • This prevents the canvas from appearing for other artifact types or when no relevant file is being worked on.
  2. Explicit Canvas Collapse/Expand:

    • A new state isCanvasPanelCollapsed is added to the CanvasComponent.
    • A collapse/expand button is added to the ArtifactHeader. This button toggles the isCanvasPanelCollapsed state.
    • If the canvas panel is collapsed, it and its resizable handle are hidden.
    • The chat panel dynamically adjusts its size:
      • If the canvas is collapsed, the chat panel expands to take the full width.
      • If the chat is collapsed, the canvas panel expands to take the full width.

These changes provide you with more control over the canvas visibility and ensure it's only present when relevant.

Implements two main changes to the canvas functionality:

1.  Conditional Canvas Opening:
    - The canvas panel now only opens if you have started a chat AND the currently active artifact is of type 'code' or 'text' (markdown).
    - This prevents the canvas from appearing for other artifact types or when no relevant file is being worked on.

2.  Explicit Canvas Collapse/Expand:
    - A new state `isCanvasPanelCollapsed` is added to the `CanvasComponent`.
    - A collapse/expand button is added to the `ArtifactHeader`. This button toggles the `isCanvasPanelCollapsed` state.
    - If the canvas panel is collapsed, it and its resizable handle are hidden.
    - The chat panel dynamically adjusts its size:
        - If the canvas is collapsed, the chat panel expands to take the full width.
        - If the chat is collapsed, the canvas panel expands to take the full width.

These changes provide you with more control over the canvas visibility and ensure it's only present when relevant.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2025

google-labs-jules[bot] is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant