Skip to content

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

Open
axelray-dev wants to merge 2 commits 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 2 commits 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
    • Stop auto setSideView; clear when no side elements remain.
    • Remove side-element tracking refs for simpler logic in MessagesContainer.
    • Keep manual open via onElementRefClick; add vitest tests for non-auto-open and clearing.

Written for commit ca22313. 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

@dokterbob
dokterbob requested a review from Copilot July 28, 2026 17:14

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dokterbob

Copy link
Copy Markdown
Collaborator

@codex review

@dokterbob

Copy link
Copy Markdown
Collaborator

@codex review

@dokterbob
dokterbob requested a review from Copilot July 29, 2026 14:06

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dokterbob

Copy link
Copy Markdown
Collaborator

Code looks good to me, but I'm no react buff. Are other maintainers still alive? @hayescode @asvishnyakov @sandangel Anyone of you in a better position to verify quality?

Feedback/approval from other users would also help!

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

3 participants