Skip to content

fix(frontend): restore click-to-open for side elements#2982

Open
axelray-dev wants to merge 1 commit into
Chainlit:mainfrom
axelray-dev:fix/side-panel-click-only-2979
Open

fix(frontend): restore click-to-open for side elements#2982
axelray-dev wants to merge 1 commit into
Chainlit:mainfrom
axelray-dev:fix/side-panel-click-only-2979

Conversation

@axelray-dev

@axelray-dev axelray-dev commented Jul 14, 2026

Copy link
Copy Markdown

Summary

Since 2.11.0, the element side panel opened automatically whenever a message with display="side" elements arrived. In 2.10.x the panel only opened when the user clicked the element link. Closing the panel did not stick, because the next side-element update forced it open again.

Changes

  • In MessagesContainer, stop auto-calling setSideView when side elements change.
  • Still clear sideView when no side elements remain so a closed/stale panel does not linger.
  • Leave click-to-open via onElementRefClick unchanged.
  • Add Vitest coverage: new side elements do not auto-open; clearing elements clears an open side view.

Verification

  • Vitest frontend/tests/MessagesContainer.spec.tsx (2 tests)
  • ESLint, Prettier, and frontend typecheck on touched files

Fixes #2979


Summary by cubic

Restores click-to-open for side elements and stops auto-opening the side panel. Fixes #2979.

  • Bug Fixes
    • Removed auto setSideView in MessagesContainer when side elements update.
    • Clear sideView when no side elements remain to avoid stale panels.
    • Keep onElementRefClick for manual open; add Vitest tests to cover non-auto-open and clearing.

Written for commit a76630e. Summary will update on new commits.

Review in cubic

Fixes Chainlit#2979

Co-Authored-By: Codex <codex@openai.com>
@axelray-dev axelray-dev marked this pull request as ready for review July 14, 2026 08:40
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working frontend Pertains to the frontend. unit-tests Has unit tests. labels Jul 14, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

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

Labels

bug Something isn't working frontend Pertains to the frontend. size:M This PR changes 30-99 lines, ignoring generated files. unit-tests Has unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Side panel force-opens on every new display="side" element since 2.11.0 — no way to opt out

1 participant