Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit a2e8dd2

Browse files
committed
DEV: Cleanup
1 parent 1e55b8e commit a2e8dd2

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

assets/javascripts/initializers/ai-conversations-sidebar.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ export default {
137137
this.loadedThirtyDayLabel = false;
138138
this.loadedMonthLabels.clear();
139139

140-
// Build links again with the new topic
141-
const allTopics = [topic, ...this.topics];
142-
this.topics = allTopics;
140+
this.topics = [topic, ...this.topics];
143141
this.buildSidebarLinks();
144142

145143
this.watchForTitleUpdate(topic);

spec/system/ai_bot/homepage_spec.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@
179179
header.click_bot_button
180180

181181
expect(ai_pm_homepage).to have_homepage
182-
sidebar.find(
183-
".sidebar-section[data-section-name='ai-conversations-history'] a.sidebar-section-link",
184-
).click
182+
ai_pm_homepage.click_fist_sidebar_conversation
185183
expect(topic_page).to have_topic_title(pm.title)
186184
end
187185

@@ -193,9 +191,7 @@
193191
expect(header).to have_icon_in_bot_button(icon: "shuffle")
194192

195193
# Go to a PM and assert that the icon is still shuffle
196-
sidebar.find(
197-
".sidebar-section[data-section-name='ai-conversations-history'] a.sidebar-section-link",
198-
).click
194+
ai_pm_homepage.click_fist_sidebar_conversation
199195
expect(header).to have_icon_in_bot_button(icon: "shuffle")
200196

201197
# Go back home and assert that the icon is now robot again

spec/system/page_objects/components/ai_pm_homepage.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def click_new_question_button
4040
page.find(".ai-new-question-button").click
4141
end
4242

43+
def click_fist_sidebar_conversation
44+
page.find(
45+
".sidebar-section[data-section-name='ai-conversations-history'] a.sidebar-section-link:not(.date-heading)",
46+
).click
47+
end
48+
4349
def persona_selector
4450
PageObjects::Components::SelectKit.new(".persona-llm-selector__persona-dropdown")
4551
end

0 commit comments

Comments
 (0)