Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
04a6e18
Pluralize results count screen-reader label
johanbissemattsson Jul 30, 2026
18cb1fe
Remove button for more actions
johanbissemattsson Aug 1, 2026
7cb7fc0
Highlight first row when expanding and update styling
johanbissemattsson Aug 4, 2026
fc5385e
Remove footer row for now
johanbissemattsson Aug 4, 2026
0772716
Add active styling
johanbissemattsson Aug 4, 2026
97fbc8b
Re-add simplified footer and results label
johanbissemattsson Aug 4, 2026
ee5dc54
Fix tabbing and arrow key navigation when moving show all row to bottom
johanbissemattsson Aug 6, 2026
5bae9f9
Ensure default result row is selected after loading data
johanbissemattsson Aug 6, 2026
b88206d
Simplify code
johanbissemattsson Aug 6, 2026
e22d3a2
Update styling
johanbissemattsson Aug 6, 2026
324e7c2
Set max height of results
johanbissemattsson Aug 11, 2026
d6cc572
Scroll to active celll
johanbissemattsson Aug 11, 2026
df7d1eb
Simplify styling
johanbissemattsson Aug 12, 2026
9bfe10f
Add action icon on focus
johanbissemattsson Aug 12, 2026
b3a0b0e
Show qualifier suggestions again
johanbissemattsson Aug 25, 2026
9616022
Minor styling adjustments
johanbissemattsson Aug 25, 2026
2717903
Skip trying to place results button above virtual keyboard
johanbissemattsson Aug 25, 2026
6c1e9ba
Another styling adjustment
johanbissemattsson Aug 25, 2026
a592347
Re-add help link on mobile
johanbissemattsson Aug 25, 2026
762c6ab
Fix tests
johanbissemattsson Aug 25, 2026
b8fadd2
Styling fix
johanbissemattsson Aug 25, 2026
eb47e02
Fix supersearch tests
johanbissemattsson Aug 25, 2026
32a8aeb
Fix arrow key handling when clicking on input
johanbissemattsson Aug 25, 2026
f5125ed
Check if input row
johanbissemattsson Aug 25, 2026
6fb0c15
Visual focus on input row
johanbissemattsson Aug 27, 2026
391be8b
styling fixes
jesperengstrom Sep 24, 2026
2f2fe8b
delimiter must be reactive to new data
jesperengstrom Sep 24, 2026
5de5e41
Re-add qualifier suggestion 'add' text, remove focus icon for qualifiers
jesperengstrom Sep 24, 2026
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
9 changes: 5 additions & 4 deletions lxl-web/src/lib/components/DecoratedData2.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,11 @@
{:else if Fmt.DISPLAY in data}
{@render traverse(data[Fmt.DISPLAY], parent, false)}
{:else if Fmt.VALUE in data}
{const hasLimit = limit && limit?.[data[Fmt.PROP]]}
{const showDelimiter =
!!hasLimit && Array.isArray(data[Fmt.VALUE]) && data[Fmt.VALUE].length > hasLimit + 1}
{#if showDelimiter && Array.isArray(data[Fmt.VALUE])}
{const hasLimit = $derived(limit && limit?.[data[Fmt.PROP]])}
{const showDelimiter = $derived(
!!hasLimit && Array.isArray(data[Fmt.VALUE]) && data[Fmt.VALUE].length > hasLimit + 1
)}
{#if hasLimit && showDelimiter && Array.isArray(data[Fmt.VALUE])}
<!-- show delimiter -->
{const expanded = $derived(limitState && limitState[data[Fmt.PROP]].expanded)}
{@render traverse(
Expand Down
111 changes: 42 additions & 69 deletions lxl-web/src/lib/components/supersearch/Suggestion.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
import { Fmt, LensType } from '$lib/types/xl';
import getInstanceData from '$lib/utils/getInstanceData';
import SuggestionImage from './SuggestionImage.svelte';
import MoreIcon from '~icons/bi/three-dots';
import dropdownMenu from '$lib/actions/dropDownMenu/index.svelte.js';
import type { Snippet } from 'svelte';
import IconReturnKey from '~icons/bi/arrow-return-left';
import IconAddQualifier from '~icons/bi/arrow-up-left';

type Props = {
item: SuperSearchResultItem;
getCellId?: (cellIndex: number) => string;
isFocusedRow?: () => boolean;
isFocusedCell?: (cellIndex: number) => boolean;
leadingContent?: Snippet;
};

const { item, getCellId, isFocusedCell, leadingContent }: Props = $props();
const { item, getCellId, isFocusedRow, isFocusedCell, leadingContent }: Props = $props();
const resourceId = $derived(stripAnchor(trimSlashes(relativizeUrl(item?.['@id']))));
const primaryAddQualifierLink = $derived(item?.qualifiers?.[0]?._q || resourceId);

Expand All @@ -36,31 +37,18 @@
</script>

{#snippet resourceSnippet(item: SuperSearchResultItem)}
{#if item.qualifiers?.length}
<span
class="text-subtle order-1 ml-auto hidden rounded-sm px-1.5 py-0.5 text-xs whitespace-nowrap sm:inline"
>
{page.data.t('general.add')}

<span class="hidden lowercase lg:inline">
{item.qualifiers[0].label}
</span>
</span>
{/if}
<div class="resource grid grid-cols-[40px_minmax(0,1fr)] items-center gap-2">
<div class="resource grid grid-cols-[40px_minmax(0,1fr)] items-center gap-2 px-1 lg:px-0">
<SuggestionImage {item} />
<div class="resource-content">
<h2 class="decorated-heading flex gap-1 overflow-hidden text-sm whitespace-nowrap">
<span class="truncate">
<DecoratedData2
data={item[LxlLens.CardHeading]}
showLabels={ShowLabelsOptions.Never}
allowPopovers={false}
allowLinks={false}
parent={Elem.Span}
skipOuter={true}
/>
</span>
<h2 class="decorated-heading truncate overflow-hidden text-base whitespace-nowrap">
<DecoratedData2
data={item[LxlLens.CardHeading]}
showLabels={ShowLabelsOptions.Never}
allowPopovers={false}
allowLinks={false}
parent={Elem.Span}
skipOuter={true}
/>
<!-- only show body > contribution next to header -->
{#if contribution}
<span class="divider">{' · '}</span>
Expand Down Expand Up @@ -131,82 +119,72 @@
</footer>
</div>
</div>
{#if item.qualifiers?.length}
<span class="text-subtle ml-auto px-1.5 py-0.5 text-xs whitespace-nowrap">
<span class="hidden sm:inline">
{page.data.t('general.add')}
<span class="lowercase">
{item.qualifiers[0].label}
</span>
</span>
<IconAddQualifier
class="inline sm:hidden align-baseline text-link size-4"
aria-hidden="true"
/>
</span>
{/if}
{/snippet}

<div class="suggestion flex h-14 items-stretch" class:qualifier={item.qualifiers?.length}>
<div
class="suggestion flex h-13 sm:h-14 items-stretch rounded-md relative"
class:qualifier={item.qualifiers?.length}
>
{#if primaryAddQualifierLink && item.qualifiers?.length}
<a
href={page.data.localizeHref(primaryAddQualifierLink)}
href={resolve(page.data.localizeHref(primaryAddQualifierLink))}
id={getCellId?.(0)}
class:focused-cell={isFocusedCell?.(0)}
class={['mx-1 lg:mx-3 h-full rounded-md', isFocusedCell?.(0) && 'focused-cell']}
>
{@render resourceSnippet(item)}
</a>
<button
type="button"
class="more w-14 items-center justify-center p-0"
id={getCellId?.(1)}
class:focused-cell={isFocusedCell?.(1)}
>
{#key item.qualifiers}
<span
class="more-icon-container text-subtle flex size-10 items-center justify-center rounded-full"
use:dropdownMenu={{
menuItems: [
...item.qualifiers.map((qualifier) => ({
label: `${page.data.t('search.addAs')} ${qualifier.label.toLocaleLowerCase()}`,
href: qualifier._q
})),
{
label: `${page.data.t('search.goToResource')}`,
href: resourceId || ''
}
],
placeAsSibling: true
}}
>
<MoreIcon />
</span>
{/key}
</button>
{:else if resourceId}
<a
href={resolve(page.data.localizeHref(resourceId))}
id={getCellId ? getCellId(0) : ''}
class={['mx-1 lg:mx-3 rounded-md', isFocusedCell?.(0) && 'focused-cell']}
class:focused-cell={isFocusedCell?.(0)}
>
{@render leadingContent?.()}
{@render resourceSnippet(item)}
</a>
{/if}
{#if isFocusedRow?.() && !item.qualifiers?.length}
<div
class="absolute right-4.5 hidden sm:flex pointer-events-none h-full items-center bg-accent-100 justify-center w-12 rounded-r-md"
>
<IconReturnKey class="text-link" aria-hidden={item.qualifiers?.length ? undefined : 'true'} />
</div>
{/if}
</div>

<style lang="postcss">
@reference "tailwindcss";

.suggestion:has(:global(*:hover)) {
background-color: var(--color-accent-50);
}
.suggestion button,
.suggestion a {
display: flex;
align-items: center;
text-decoration: none;
}

.suggestion button:first-child,
.suggestion a:first-child {
flex: 1;
padding: 0 calc(var(--spacing) * 4);
text-align: left;
}

.qualifier.suggestion button:first-child,
.qualifier.suggestion a:first-child {
padding-right: 0;
}

.suggestion button:not(:first-child):last-child,
.suggestion a:not(:first-child):last-child {
text-align: right;
}
Expand All @@ -230,9 +208,4 @@
display: none;
}
}

.more.focused-cell .more-icon-container,
.more:hover .more-icon-container {
background-color: var(--color-accent-100);
}
</style>
Loading
Loading