FIX: correctly closes panels in threads (#31013)

The following case was bugged:

- visit a thread in full page chat
- click channel title
- click back button in channel navbar
- 💥 you would have a channel with limited width as if there was
still the thread showing next to it, but it was empty
This commit is contained in:
Joffrey JAFFEUX
2025-01-27 16:34:56 +01:00
committed by GitHub
parent c20aa5f671
commit a52a8f4663
3 changed files with 29 additions and 23 deletions

View File

@ -139,6 +139,24 @@ RSpec.describe "Navigation", type: :system do
end
end
context "when opening channel settings from thread" do
fab!(:thread) { Fabricate(:chat_thread, channel: category_channel, use_service: true) }
before do
category_channel.update!(threading_enabled: true)
Fabricate(:chat_message, thread: thread, use_service: true)
thread.add(current_user)
end
it "correctly closes the side panel" do
chat_page.visit_thread(thread)
find(".c-navbar__channel-title").click
expect(page).to have_no_selector(".main-chat-outlet.has-side-panel-expanded")
end
end
context "when collapsing full page with no previous state" do
it "redirects to home page" do
chat_page.open