-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Selected Filters in myHistory #332
Add Selected Filters in myHistory #332
Conversation
class="x-text1-sm x-text-lead-50 x-line-clamp-1" | ||
> | ||
<span v-for="filter in suggestion.selectedFilters" :key="filter.id" class="x-pr-8"> | ||
{{ filter.label ?? filter.id }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filter.id
should not be needed as soon as this empathyco/x#1325 is implemented
Check PR 332 preview 👀 |
Check PR 332 preview 👀 |
@@ -16,12 +16,28 @@ | |||
@click="closeModal" | |||
data-test="my-history-query" | |||
:suggestion="suggestion" | |||
suggestionClass="x-suggestion" | |||
suggestionClass="x-suggestion x-w-[320px]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have 320px
as value in the theme's spacing
v-if="suggestion.selectedFilters && suggestion.selectedFilters.length > 0" | ||
class="x-text1-sm x-flex x-text-lead-50" | ||
> | ||
<p class="x-line-clamp-1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a line clamp of 1 is overkill, this should be done just with x-truncate
.
The width limit should be here, not in the parent.
{{ label(filter) }} | ||
</span> | ||
</p> | ||
<p class="x-pl-8">({{ suggestion.selectedFilters.length }})</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're adding extra 8px
between the last filter and the filter count with this padding.
Also this should be an span
<p class="x-pl-8">({{ suggestion.selectedFilters.length }})</p> | |
<span>({{ suggestion.selectedFilters.length }})</span> |
<p>{{ suggestion.query }}</p> | ||
<p class="hover:x-underline">{{ suggestion.query }}</p> | ||
<div | ||
v-if="suggestion.selectedFilters && suggestion.selectedFilters.length > 0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v-if="suggestion.selectedFilters && suggestion.selectedFilters.length > 0" | |
v-if="suggestion.selectedFilters && suggestion.selectedFilters.length" |
> | ||
<HistoryIcon class="max-desktop:x-icon-lg" /> | ||
|
||
<div class="x-flex x-flex-col x-gap-2"> | ||
<p>{{ suggestion.query }}</p> | ||
<p class="hover:x-underline">{{ suggestion.query }}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way you only get the underline when hovering this specific element. This underline should appear when you hover anywhere in the parent.
Use tailwind group for this
src/tailwind/plugin-options.js
Outdated
@@ -17,6 +17,9 @@ module.exports = { | |||
paddingTop: theme('spacing.24'), | |||
paddingBottom: theme('spacing.24') | |||
} | |||
}, | |||
'.history-query.suggestion-group:hover': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the hover decorations to all HQ, including the ones in the empathize.
You can deactivate the text decoration in the history query with tailwind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still here and it's not needed
The filters under the HQs in the empathize are missing |
class="x-text1-sm x-text-lead-50 x-line-clamp-1" | ||
> | ||
<span v-for="filter in suggestion.selectedFilters" :key="filter.id" class="x-pr-8"> | ||
{{ filter.label ?? filter.id }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{ filter.label ?? filter.id }} | |
{{ filter.label }} |
You can accept this commit by pointing to x-components "3.0.1-alpha.1"
Check PR 332 preview 👀 |
v-if="suggestion.selectedFilters && suggestion.selectedFilters.length" | ||
class="x-text1-sm x-flex x-gap-8 x-text-lead-50" | ||
> | ||
<div class="x-line-clamp-1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're still using line clamp instead of truncate.
Also, this should have a width of 320px aprox.
" | ||
class="x-text1-sm x-flex x-text-lead-50" | ||
> | ||
<div class="x-line-clamp-1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this line clamp with truncate
<p>{{ suggestion.query }}</p> | ||
<div class="x-group x-flex x-flex-col x-gap-2"> | ||
<p class="group-hover:x-underline">{{ suggestion.query }}</p> | ||
<div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big chunk that is duplicated here and in the empathize, moving it to it's own component might be a good idea.
src/tailwind/plugin-options.js
Outdated
@@ -17,6 +17,9 @@ module.exports = { | |||
paddingTop: theme('spacing.24'), | |||
paddingBottom: theme('spacing.24') | |||
} | |||
}, | |||
'.history-query.suggestion-group:hover': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still here and it's not needed
…filters-in-my-history # Conflicts: # package-lock.json # package.json
Check PR 332 preview 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gj!
The HQ in mobile don't have the filters, I think it's because mobile uses the PredictiveLayer
component instead of the full width one
}); | ||
</script> | ||
|
||
<style scoped></style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<style scoped></style> |
suggestion: { | ||
type: HistoryQuery, | ||
required: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the whole suggestion
suggestion: { | |
type: HistoryQuery, | |
required: true | |
filtersList: { | |
type: HistoryQuery['selectedFilters'], | |
required: true |
<div class="x-group x-flex x-flex-col x-gap-2"> | ||
<p class="group-hover:x-underline">{{ suggestion.query }}</p> | ||
|
||
<HistoryQueryFilters class="x-w-192" :suggestion="suggestion"></HistoryQueryFilters> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<HistoryQueryFilters class="x-w-192" :suggestion="suggestion"></HistoryQueryFilters> | |
<HistoryQueryFilters class="x-w-192" :suggestion="suggestion"/> |
Also, the list of filters could be have more width here, bump it to something around 250-320
|
||
<script> | ||
import { defineComponent } from 'vue'; | ||
import { HistoryQuery } from '@empathyco/x-components/history-queries'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're importing the component instead of the type.
Check PR 332 preview 👀 |
Check PR 332 preview 👀 |
Check PR 332 preview 👀 |
EMP-2293
Implement
selectedFilters
in myHistory aside panel.Test:
Choose & query and filter with one or more filters, check the aside panel & see filters shown below the query