Skip to content

Build your personal knowledge base with Trilium Notes

fix(llm): keep a single hover on the notes a search found

Elian Doran0ebbbe7031a2
diff --git a/apps/client/src/widgets/react/NoteLink.css b/apps/client/src/widgets/react/NoteLink.css
new file mode 100644
index 0000000000..477cd9daaf
--- /dev/null
+++ b/apps/client/src/widgets/react/NoteLink.css
@@ -0,0 +1,4 @@
+/* The gap is a margin rather than a space, so the link's hover underline does not run under it. */
+.tn-link > .note-link-icon {
+ margin-inline-end: 0.25em;
+}
diff --git a/apps/client/src/widgets/react/NoteLink.tsx b/apps/client/src/widgets/react/NoteLink.tsx
index 4b5854274f..ce5f9ea9f9 100644
--- a/apps/client/src/widgets/react/NoteLink.tsx
+++ b/apps/client/src/widgets/react/NoteLink.tsx
@@ -1,3 +1,5 @@
+import "./NoteLink.css";
+
import type { HighlightedTokenInfo } from "@triliumnext/commons";
import clsx from "clsx";
import { HTMLAttributes } from "preact";
@@ -121,7 +123,7 @@ export function NewNoteLink({ notePath, viewScope, noContextMenu, showNoteIcon,
data-no-context-menu={noContextMenu}
{...linkProps}
>
- {icon && <><Icon icon={icon} />&nbsp;</>}
+ {icon && <Icon icon={icon} className="note-link-icon" />}
{title}
</a>
);
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ToolCallViews.css b/apps/client/src/widgets/type_widgets/llm_chat/ToolCallViews.css
index 9590eee8f2..d662d19c90 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/ToolCallViews.css
+++ b/apps/client/src/widgets/type_widgets/llm_chat/ToolCallViews.css
@@ -11,20 +11,7 @@
}
.llm-chat-note-result {
- position: relative;
padding: 0.3rem 0.5rem;
- border-radius: 6px;
-
- &:hover {
- background: var(--hover-item-background-color);
- }
-
- /* Stretches the note link over the row, so the whole row opens the note. */
- .llm-chat-note-result-header > a::after {
- content: "";
- position: absolute;
- inset: 0;
- }
}
.llm-chat-note-result-header {
@@ -39,9 +26,6 @@
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
- color: var(--main-text-color);
- font-weight: 500;
- text-decoration: none;
}
}