Skip to content

Commit

Permalink
Explore tweaks (#13744)
Browse files Browse the repository at this point in the history
* Fix loading indicator and explore view when entering a search term

* don't hide iOS video mute button

* use searchTerm instead of search for trigger
  • Loading branch information
hawkeye217 authored Sep 14, 2024
1 parent d5acd11 commit c17524b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
11 changes: 8 additions & 3 deletions web/src/components/overlay/detail/SearchDetailDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function ObjectDetailsTab({
<div className="flex flex-col gap-1.5">
<div className="text-sm text-primary/40">Description</div>
<Textarea
className="md:h-64"
className="h-64"
placeholder="Description of the tracked object"
value={desc}
onChange={(e) => setDesc(e.target.value)}
Expand Down Expand Up @@ -447,8 +447,13 @@ function VideoTab({ search, config }: VideoTabProps) {
/>
</div>
</div>
{!isLoading && (
<div className="absolute right-2 top-2 flex items-center">
{!isLoading && reviewItem && (
<div
className={cn(
"absolute top-2 flex items-center",
isIOS ? "right-8" : "right-2",
)}
>
<Tooltip>
<TooltipTrigger>
<Chip
Expand Down
16 changes: 9 additions & 7 deletions web/src/views/search/SearchView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ export default function SearchView({

{uniqueResults?.length == 0 &&
isLoading &&
searchFilter &&
Object.keys(searchFilter).length !== 0 && (
(searchTerm ||
(searchFilter && Object.keys(searchFilter).length !== 0)) && (
<ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" />
)}

Expand Down Expand Up @@ -319,11 +319,13 @@ export default function SearchView({
</>
)}
</div>
{searchFilter && Object.keys(searchFilter).length === 0 && (
<div className="scrollbar-container flex size-full flex-col overflow-y-auto">
<ExploreView onSelectSearch={onSelectSearch} />
</div>
)}
{searchFilter &&
Object.keys(searchFilter).length === 0 &&
!searchTerm && (
<div className="scrollbar-container flex size-full flex-col overflow-y-auto">
<ExploreView onSelectSearch={onSelectSearch} />
</div>
)}
</div>
);
}

0 comments on commit c17524b

Please sign in to comment.