Skip to content

Commit d62c76d

Browse files
authored
FIX: do not display empty state while fetching bot conversations (#1320)
* FIX: do not display empty state while fetching bot conversations * skip test in playwright and fix implementation * tiny css fix, missing padding
1 parent f1b7cc8 commit d62c76d

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ export default {
9393
@tracked loadedSevenDayLabel = false;
9494
@tracked loadedThirtyDayLabel = false;
9595
@tracked loadedMonthLabels = new Set();
96-
page = 0;
96+
@tracked isLoading = true;
9797
isFetching = false;
98+
page = 0;
9899
totalTopicsCount = 0;
99100

100101
constructor() {
@@ -123,7 +124,9 @@ export default {
123124
}
124125

125126
get emptyStateComponent() {
126-
return AiBotSidebarEmptyState;
127+
if (!this.isLoading) {
128+
return AiBotSidebarEmptyState;
129+
}
127130
}
128131

129132
get text() {
@@ -214,6 +217,8 @@ export default {
214217
this.attachScrollListener();
215218
} catch {
216219
this.isFetching = false;
220+
} finally {
221+
this.isLoading = false;
217222
}
218223
}
219224

assets/stylesheets/modules/ai-bot-conversations/common.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ body.has-ai-conversations-sidebar {
389389
color: var(--primary-high);
390390
font-size: var(--font-down-2);
391391

392+
&__progress {
393+
margin-left: 0.5em;
394+
}
395+
392396
&:hover,
393397
&:focus-visible {
394398
.d-icon {

spec/system/ai_bot/homepage_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,17 @@
137137
expect(page).to have_no_css(".ai-bot-upload")
138138
end
139139

140-
xit "allows removing an upload before submission" do
140+
it "allows removing an upload before submission" do
141+
skip "TODO: fix this test for playwright"
142+
141143
ai_pm_homepage.visit
142144
expect(ai_pm_homepage).to have_homepage
143145

144146
file_path = file_from_fixtures("logo.png", "images").path
145147
attach_file([file_path]) { find(".ai-bot-upload-btn", visible: true).click }
146-
147148
expect(page).to have_css(".ai-bot-upload", count: 1)
148149

150+
# TODO: for some reason this line fails in playwright
149151
find(".ai-bot-upload__remove").click
150152

151153
expect(page).to have_no_css(".ai-bot-upload")

0 commit comments

Comments
 (0)