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

Improve main search design #1273

Merged
merged 29 commits into from
Nov 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d755d4b
Add search match highlighting for event title, description and series
LukasKalbertodt Oct 14, 2024
5c99431
Add search match highlighting for series
LukasKalbertodt Oct 29, 2024
668f0f5
Add search match highlighting for realms
LukasKalbertodt Oct 29, 2024
8ed121a
Improve tab order of text matches in search timeline
LukasKalbertodt Nov 4, 2024
3fc0d76
Improve GraphQL type generation for Search
LukasKalbertodt Nov 4, 2024
e9c6d91
Add our custom series icon and use it instead of "part of series:"
LukasKalbertodt Nov 4, 2024
34d07e4
Add `/path/to/realm/s/<seriesID>` route (for internal and OC IDs)
LukasKalbertodt Nov 5, 2024
ff7795f
Improve `ThumbnailStack` design for series
LukasKalbertodt Nov 5, 2024
b67950f
Rework search page design
LukasKalbertodt Nov 5, 2024
066fff1
Fix missing margin of "search unavailable" card
LukasKalbertodt Nov 6, 2024
80e2cc8
Fix `key` value in `highlightText`
LukasKalbertodt Nov 6, 2024
09d2cd9
Make it possible to navigate search result by arrow keys
LukasKalbertodt Nov 6, 2024
7ffc67b
Hide mobile virtual keyboard when pressing virtual "enter" in search
LukasKalbertodt Nov 7, 2024
0887c36
Refactor duplicate code and add `totalHits` to all `SearchResult<*>`
LukasKalbertodt Nov 7, 2024
107e433
Add `duration` to `SearchResults` API and experimentally show it in m…
LukasKalbertodt Nov 7, 2024
fdda221
Add code for debugging/profiling search performance
LukasKalbertodt Nov 7, 2024
35375b4
Remove second 250ms debounce in search
LukasKalbertodt Nov 7, 2024
a890bfe
Lazily render text match timelines
LukasKalbertodt Nov 7, 2024
55e4cba
Fix search sometimes ignoring some inputs
LukasKalbertodt Nov 7, 2024
4506f9f
Polish search design a bit more
LukasKalbertodt Nov 11, 2024
6a967d9
Change highlight color to neutral-color
LukasKalbertodt Nov 11, 2024
295dc11
Move "rerender route" hack to only rerender the main part
LukasKalbertodt Nov 11, 2024
709b30d
Pass new route information to `onNav` listeners in router
LukasKalbertodt Nov 11, 2024
63cc1ed
Rename function to better match its use
LukasKalbertodt Nov 11, 2024
37feeb6
Improve search menu/field handling on mobile
LukasKalbertodt Nov 11, 2024
676ea42
Respect `preventDefault()` in Link's onClick handler
LukasKalbertodt Nov 11, 2024
22f3765
Increase realm icon/circle size in search results a bit
LukasKalbertodt Nov 12, 2024
b42d436
Change dummy series thumbnail stack pattern to cube-thingy
LukasKalbertodt Nov 14, 2024
267ea28
Address review comments
LukasKalbertodt Nov 18, 2024
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: 4 additions & 5 deletions frontend/src/layout/header/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useRef } from "react";
import React, { useEffect, useRef } from "react";
import { useTranslation } from "react-i18next";
import { HiOutlineSearch } from "react-icons/hi";
import { ProtoButton, screenWidthAtMost } from "@opencast/appkit";
Expand All @@ -14,7 +14,7 @@ import {
} from "../../routes/Search";
import { focusStyle } from "../../ui";
import { Spinner } from "@opencast/appkit";
import { currentRef, useDebounce } from "../../util";
import { currentRef } from "../../util";
import { BREAKPOINT as NAV_BREAKPOINT } from "../Navigation";
import { COLORS } from "../../color";
import { useUser } from "../../User";
Expand All @@ -28,7 +28,6 @@ export const SearchField: React.FC<SearchFieldProps> = ({ variant }) => {
const { t } = useTranslation();
const router = useRouter();
const ref = useRef<HTMLInputElement>(null);
const { debounce } = useDebounce();
owi92 marked this conversation as resolved.
Show resolved Hide resolved

// If the user is unknown, then we are still in the initial loading phase.
// We don't want users to input anything into the search field in that
Expand Down Expand Up @@ -85,14 +84,14 @@ export const SearchField: React.FC<SearchFieldProps> = ({ variant }) => {
const defaultValue = getSearchParam("q");


const search = useCallback(debounce((expression: string) => {
const search = (expression: string) => {
const filters = {
itemType: isValidSearchItemType(getSearchParam("f")),
start: getSearchParam("start"),
end: getSearchParam("end"),
};
router.goto(SearchRoute.url({ query: expression, ...filters }), onSearchRoute);
}, 250), []);
};

return (
<div css={{
Expand Down