Skip to content

Commit af01839

Browse files
committed
fix: UI issues
1 parent a088531 commit af01839

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

src/components/Features/AuditContent.vue

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
>. Patterns detected:
4949
<strong>{{ patternsFound.join(', ') }}</strong>
5050
</div>
51-
<div class="results-list">
51+
<div class="audit-content__results-list">
5252
<Card
5353
v-for="(result, index) in results"
5454
:key="index"
@@ -241,7 +241,6 @@ const issuesSummary = computed(() => {
241241

242242
<style lang="scss" scoped>
243243
.audit-content {
244-
// Info banner
245244
&__info {
246245
margin-bottom: var(--space-6);
247246
@@ -254,7 +253,6 @@ const issuesSummary = computed(() => {
254253
}
255254
}
256255
257-
// Loading skeleton
258256
&__loading {
259257
display: flex;
260258
flex-direction: column;
@@ -281,7 +279,6 @@ const issuesSummary = computed(() => {
281279
margin-bottom: var(--space-6);
282280
}
283281
284-
// Result cards
285282
&__result-card {
286283
margin-bottom: var(--space-4);
287284
border-left: 3px solid var(--accent-blue);
@@ -323,11 +320,15 @@ const issuesSummary = computed(() => {
323320
word-break: break-all;
324321
}
325322
323+
&__results-list {
324+
display: flex;
325+
flex-direction: column;
326+
}
327+
326328
&__issue-count {
327329
flex-shrink: 0;
328330
}
329331
330-
// Issues list
331332
&__issues-list {
332333
display: flex;
333334
flex-direction: column;
@@ -380,14 +381,8 @@ const issuesSummary = computed(() => {
380381
}
381382
}
382383
383-
// No issues message
384384
&__no-issues {
385385
margin-top: var(--space-6);
386386
}
387387
}
388-
389-
.results-list {
390-
display: flex;
391-
flex-direction: column;
392-
}
393388
</style>

src/components/Features/SearchContent.vue

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@
6464
class="search-content__results-container"
6565
>
6666
<div class="search-content__summary" aria-live="polite" aria-atomic="true">
67-
Found {{ matchesSummary }} {{ negateSearch ? 'NOT' : '' }} containing "<strong>{{
68-
searchTerm
69-
}}</strong
70-
>"
67+
<template v-if="negateSearch">
68+
Found {{ matchesSummary }} NOT containing "<strong>{{ searchTerm }}</strong
69+
>"
70+
</template>
71+
<template v-else>
72+
Found {{ matchesSummary }} containing "<strong>{{ searchTerm }}</strong
73+
>"
74+
</template>
7175
</div>
72-
<div class="results-list">
76+
<div class="search-content__results-list">
7377
<Card
7478
v-for="(result, index) in results"
7579
:key="index"
@@ -304,8 +308,11 @@ const matchesByScope = computed(() => {
304308
305309
results.value.forEach((result) => {
306310
const sourceType = result.sourceType || 'Unknown'
307-
const matchCount = result.matches.reduce((sum, m) => sum + (m.count || 1), 0)
308-
scopeMap.set(sourceType, (scopeMap.get(sourceType) || 0) + matchCount)
311+
// For exclusive search, count items; for inclusive search, count matches
312+
const count = negateSearch.value
313+
? 1
314+
: result.matches.reduce((sum, m) => sum + (m.count || 1), 0)
315+
scopeMap.set(sourceType, (scopeMap.get(sourceType) || 0) + count)
309316
})
310317
311318
return Array.from(scopeMap.entries())
@@ -314,14 +321,18 @@ const matchesByScope = computed(() => {
314321
})
315322
316323
const matchesSummary = computed(() => {
317-
const total = totalMatches.value
324+
const total = negateSearch.value ? results.value.length : totalMatches.value
318325
if (matchesByScope.value.length === 0) return ''
319326
320327
const scopeBreakdown = matchesByScope.value
321328
.map(({ scope, count }) => `${count} in ${scope}`)
322329
.join(', ')
323330
324-
return `${total} ${pluralize(total, 'match', 'matches')}: ${scopeBreakdown}`
331+
const unit = negateSearch.value
332+
? pluralize(total, 'item', 'items')
333+
: pluralize(total, 'match', 'matches')
334+
335+
return `${total} ${unit}: ${scopeBreakdown}`
325336
})
326337
327338
function getResultMatchCount(
@@ -378,7 +389,7 @@ function getResultMatchCount(
378389
}
379390
380391
// Results list
381-
.results-list {
392+
&__results-list {
382393
display: flex;
383394
flex-direction: column;
384395
gap: var(--space-5);

0 commit comments

Comments
 (0)