Skip to content
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

fix(insight): some ui fixes for insight panel #4845

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/atomic/dev/examples/insights.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</atomic-layout-section>
<atomic-layout-section section="facets">
<atomic-facet-manager>
<atomic-insight-facet field="source" label="Source" display-values-as="checkbox"></atomic-insight-facet>
<atomic-insight-facet field="source" label="Source" display-values-as="link"></atomic-insight-facet>
<atomic-insight-facet field="filetype" label="Filetype" display-values-as="checkbox"></atomic-insight-facet>
<atomic-insight-numeric-facet
field="ytlikecount"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ export class AtomicInsightFacet
onToggleCollapse={() => (this.isCollapsed = !this.isCollapsed)}
headerRef={(el) => this.focusTargets.header.setTarget(el)}
></FacetHeader>

{[this.renderValues(), this.renderShowMoreLess()]}
{this.renderBody()}
</FacetContainer>
) : (
<FacetPlaceholder
Expand All @@ -217,6 +216,13 @@ export class AtomicInsightFacet
);
}

private renderBody() {
if (this.isCollapsed) {
return;
}
return [this.renderValues(), this.renderShowMoreLess()];
}

private renderValuesContainer(children: VNode[], query?: string) {
const classes = `mt-3 ${
this.displayValuesAs === 'box' ? 'box-container' : ''
Expand Down Expand Up @@ -249,7 +255,11 @@ export class AtomicInsightFacet
{...this.facetValueProps}
facetCount={value.numberOfResults}
onExclude={() => this.facet.toggleExclude(value)}
onSelect={() => this.facet.toggleSelect(value)}
onSelect={() =>
this.displayValuesAs === 'link'
? this.facet.toggleSingleSelect(value)
: this.facet.toggleSelect(value)
}
facetValue={value.value}
facetState={value.state}
setRef={(btn) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export function buildInsightLayout(element: HTMLElement, widget: boolean) {

${sectionSelector('search')} ${searchBoxSelector} {
flex-grow: 1;
height: 2.6rem;
}

${toggleSelectors.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
@apply relative;

.with-sections:not(.child-result) {
@apply p-6;
padding-top: var(--atomic-layout-spacing-y);
padding-bottom: var(--atomic-layout-spacing-y);
padding-right: var(--atomic-layout-spacing-x);
padding-left: var(--atomic-layout-spacing-x);
}

&(:hover) {
Expand Down
Loading