Skip to content

feat: Modify canvas opening and collapse behavior #340

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mohaddz
Copy link

@Mohaddz Mohaddz commented May 21, 2025

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.
Copy link

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant