Skip to content

Commit

Permalink
Merge branch 'blakeblackshear:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
weitheng authored Oct 30, 2024
2 parents 69116e3 + bb80a7b commit fee8a52
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
16 changes: 14 additions & 2 deletions web/src/components/input/InputWithTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,17 +523,29 @@ export default function InputWithTags({

const handleInputKeyDown = useCallback(
(e: React.KeyboardEvent<HTMLInputElement>) => {
const event = e.target as HTMLInputElement;

if (!currentFilterType && (e.key === "Home" || e.key === "End")) {
const position = e.key === "Home" ? 0 : event.value.length;
event.setSelectionRange(position, position);
}

if (
e.key === "Enter" &&
inputValue.trim() !== "" &&
filterSuggestions(suggestions).length == 0
) {
e.preventDefault();

handleSearch(inputValue);
}
},
[inputValue, handleSearch, filterSuggestions, suggestions],
[
inputValue,
handleSearch,
filterSuggestions,
suggestions,
currentFilterType,
],
);

// effects
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/overlay/detail/ObjectLifecycle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ function getLifecycleItemDescription(lifecycleItem: ObjectLifecycleSequence) {
)} detected for ${label}`;
} else {
title = `${
lifecycleItem.data.sub_label
lifecycleItem.data.label
} recognized as ${lifecycleItem.data.attribute.replaceAll("_", " ")}`;
}
return title;
Expand Down
7 changes: 6 additions & 1 deletion web/src/components/overlay/detail/SearchDetailDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ export default function SearchDetailDialog({
views.splice(index, 1);
}

if (search.data.type != "object") {
if (!search.has_clip) {
const index = views.indexOf("video");
views.splice(index, 1);
}

if (search.data.type != "object" || !search.has_clip) {
const index = views.indexOf("object lifecycle");
views.splice(index, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/settings/SearchSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function SearchSettings({
<Slider
value={[columns]}
onValueChange={([value]) => setColumns(value)}
max={6}
max={8}
min={2}
step={1}
className="flex-grow"
Expand Down
6 changes: 5 additions & 1 deletion web/src/hooks/use-api-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export function useApiFilterArgs<
const filter: { [key: string]: unknown } = {};

rawParams.forEach((value, key) => {
if (value != "true" && value != "false" && isNaN(parseFloat(value))) {
if (
value != "true" &&
value != "false" &&
(/[^0-9,]/.test(value) || isNaN(parseFloat(value)))
) {
filter[key] = value.includes(",") ? value.split(",") : [value];
} else {
if (value != undefined) {
Expand Down
2 changes: 2 additions & 0 deletions web/src/views/search/SearchView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export default function SearchView({
"sm:grid-cols-4": columns === 4,
"sm:grid-cols-5": columns === 5,
"sm:grid-cols-6": columns === 6,
"sm:grid-cols-7": columns === 7,
"sm:grid-cols-8": columns === 8,
},
);

Expand Down

0 comments on commit fee8a52

Please sign in to comment.