FIX: ensures thread panel closes on escape (#29651)

`chatThreadPane.isOpened` was returning `false` when it should return `true` due to an incorrect matching on the route.

Note that visiting a thread will focus the composer and the first escape will blur the input, only the second will close the panel.
This commit is contained in:
Joffrey JAFFEUX 2024-11-08 09:19:24 +09:00 committed by GitHub
parent 5a00a041f1
commit fc5c0270f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -10,7 +10,10 @@ export default class ChatThreadPane extends ChatChannelPane {
}
get isOpened() {
return this.router.currentRoute.name === "chat.channel.thread";
return (
this.router.currentRoute.name === "chat.channel.thread" ||
this.router.currentRoute.name === "chat.channel.thread.index"
);
}
get selectedMessageIds() {

View File

@ -28,6 +28,14 @@ RSpec.describe "Chat | composer | shortcuts | thread", type: :system do
expect(side_panel_page).to have_open_thread
end
end
it "closes the thread panel" do
chat_page.visit_thread(thread_1)
thread_page.composer.cancel_shortcut # ensures we are not focused in the composer
page.send_keys(:escape)
expect(side_panel_page).to have_no_open_thread
end
end
describe "ArrowUp" do