Skip to content

Build your personal knowledge base with Trilium Notes

chore(search): remove redundant border on mobile

Elian Doran04b91308b181
diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionOptions.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionOptions.tsx
index 02b52bf9e3..c62b538af5 100644
--- a/apps/client/src/widgets/ribbon/SearchDefinitionOptions.tsx
+++ b/apps/client/src/widgets/ribbon/SearchDefinitionOptions.tsx
@@ -1,4 +1,5 @@
import { AttributeType } from "@triliumnext/commons";
+import clsx from "clsx";
import { ComponentChildren, VNode } from "preact";
import { useEffect, useMemo, useRef } from "preact/hooks";
@@ -106,8 +107,9 @@ export const SEARCH_OPTIONS: SearchOption[] = [
}
];
-function SearchOption({ note, title, titleIcon, children, help, attributeName, attributeType, additionalAttributesToDelete }: {
+function SearchOption({ note, className, title, titleIcon, children, help, attributeName, attributeType, additionalAttributesToDelete }: {
note: FNote;
+ className?: string;
title: string,
titleIcon?: string,
children?: ComponentChildren,
@@ -117,7 +119,7 @@ function SearchOption({ note, title, titleIcon, children, help, attributeName, a
additionalAttributesToDelete?: { type: "label" | "relation", name: string }[]
}) {
return (
- <tr className={attributeName}>
+ <tr className={clsx(attributeName, className)}>
<td className="title-column">
{titleIcon && <><Icon icon={titleIcon} />{" "}</>}
{title}
@@ -161,6 +163,7 @@ function SearchStringOption({ note, refreshResults, error, ...restProps }: Searc
return <>
<SearchOption
title={t("search_string.title_column")}
+ className={clsx({ "has-error": !!error })}
help={<>
<strong>{t("search_string.search_syntax")}</strong> - {t("search_string.also_see")} <a href="#" data-help-page="search.html">{t("search_string.complete_help")}</a>
<ul style="marigin-bottom: 0;">
diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.css b/apps/client/src/widgets/ribbon/SearchDefinitionTab.css
index 118f61de27..f3c6e0f263 100644
--- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.css
+++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.css
@@ -147,14 +147,20 @@ body.mobile .search-definition-widget {
gap: 0.5em;
}
- .search-setting-table tr.searchString td:nth-of-type(2) {
- flex-grow: 1;
- }
-
- .search-setting-table tr.searchString .button-column {
- flex-grow: 0;
- flex-shrink: 0;
- width: 64px;
+ .search-setting-table tr.searchString {
+ td:nth-of-type(2) {
+ flex-grow: 1;
+ }
+
+ .button-column {
+ flex-grow: 0;
+ flex-shrink: 0;
+ width: 64px;
+ }
+
+ &.has-error {
+ border-bottom: 0;
+ }
}
.search-setting-table tr.ancestor > td > div {