Skip to content

Commit

Permalink
cleanup: remove deprecated direction prop for tooltip
Browse files Browse the repository at this point in the history
also fix monorepo dep with out of sync types
  • Loading branch information
drew-harris authored and skeptrunedev committed Oct 28, 2024
1 parent 2f81c38 commit 9cd45f5
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 41 deletions.
2 changes: 1 addition & 1 deletion frontends/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"tailwind-gradient-mask-image": "^1.2.0",
"tailwind-scrollbar": "^3.1.0",
"terracotta": "^1.0.3",
"trieve-ts-sdk": "file:../../clients/ts-sdk"
"trieve-ts-sdk": "*"
},
"devDependencies": {
"@types/sanitize-html": "^2.9.5",
Expand Down
6 changes: 0 additions & 6 deletions frontends/dashboard/src/components/NewDatasetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ export const NewDatasetModal = (props: NewDatasetModalProps) => {
<FaRegularCircleQuestion class="h-4 w-4 text-black" />
}
tooltipText="If selected, we will pre-fill the dataset with a random selection of Y-Combinator companies so you can immediately test the product."
direction="right"
/>
</label>
<div class="mt-4 sm:col-span-2 sm:mt-0">
Expand Down Expand Up @@ -273,7 +272,6 @@ export const NewDatasetModal = (props: NewDatasetModalProps) => {
<FaRegularCircleQuestion class="h-4 w-4 text-black" />
}
tooltipText="Change your default embedding model and distance metric."
direction="right"
/>
</button>
<Show when={showAdvanced()}>
Expand All @@ -289,7 +287,6 @@ export const NewDatasetModal = (props: NewDatasetModalProps) => {
<FaRegularCircleQuestion class="h-4 w-4 text-black" />
}
tooltipText="Dense vector models are used for semantic search. jina-base-en provides the best balance of latency and relevance quality. Only change this if you have a specific requirement. Custom models are supported on the enterprise plan."
direction="right"
/>
</label>
<select
Expand Down Expand Up @@ -351,7 +348,6 @@ export const NewDatasetModal = (props: NewDatasetModalProps) => {
<FaRegularCircleQuestion class="h-4 w-4 text-black" />
}
tooltipText="Cosine will almost always be best. Only change if you are confident that your data is unique and requires a different metric."
direction="right"
/>
</label>
<select
Expand Down Expand Up @@ -403,7 +399,6 @@ export const NewDatasetModal = (props: NewDatasetModalProps) => {
<FaRegularCircleQuestion class="h-4 w-4 text-black" />
}
tooltipText="Sparse vector models are used for fulltext search. In contrast to keyword bm25, fulltext is aware of the most important terms in your query. Currently only splade-v3 is offered."
direction="right"
/>
</label>
<p
Expand Down Expand Up @@ -434,7 +429,6 @@ export const NewDatasetModal = (props: NewDatasetModalProps) => {
<FaRegularCircleQuestion class="h-4 w-4 text-black" />
}
tooltipText="BM25 is used for keyword search. It is enabled on all datasets by default."
direction="right"
/>
</label>
<p
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const GeneralServerSettings = (props: {
Embedding Model
</label>
<Tooltip
direction="right"
body={<AiOutlineInfoCircle />}
tooltipText="Embedding Model is only editable on creation"
/>
Expand Down Expand Up @@ -74,7 +73,6 @@ export const GeneralServerSettings = (props: {
Embedding Query Prefix
</label>
<Tooltip
direction="right"
body={<AiOutlineInfoCircle />}
tooltipText="For some embedding models, the training data includes query prefixes. The default for Jina is 'Search for: '. You can experiment with different values."
/>
Expand Down Expand Up @@ -105,7 +103,6 @@ export const GeneralServerSettings = (props: {
Distance Metric
</label>
<Tooltip
direction="right"
body={<AiOutlineInfoCircle />}
tooltipText="Distance Metric is only editable on creation"
/>
Expand Down Expand Up @@ -187,7 +184,6 @@ export const GeneralServerSettings = (props: {
Max Count Limit
</label>
<Tooltip
direction="right"
body={<AiOutlineInfoCircle />}
tooltipText="Sets the maximum limit when counting chunks, applies to search and count routes in the API to prevent DDOS attacks on the server."
/>
Expand Down Expand Up @@ -298,7 +294,6 @@ export const GeneralServerSettings = (props: {
Indexed Only
</label>
<Tooltip
direction="right"
body={<AiOutlineInfoCircle />}
tooltipText="If enabled, only indexed documents will be returned in search results."
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const LLMSettings = (props: {
LLM API Key
</label>
<Tooltip
direction="right"
body={<AiOutlineInfoCircle />}
tooltipText="LLM API Key cannot be viewed after you set it"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ import {
} from "solid-js";
import { ApiContext } from "../../api/trieve";

export type DatasetConfig = Exclude<DatasetConfigurationDTO, "PUBLIC_DATASET"> & {
export type DatasetConfig = Exclude<
DatasetConfigurationDTO,
"PUBLIC_DATASET"
> & {
LLM_API_KEY?: string | null;
PUBLIC_DATASET?: {
enabled: boolean,
api_key: string,
}
enabled: boolean;
api_key: string;
};
};

type SettingsPage = (args: {
Expand Down
13 changes: 0 additions & 13 deletions frontends/dashboard/src/pages/dataset/CrawlingSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="The URL of the site to start the crawl from"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
</div>
<input
Expand Down Expand Up @@ -311,7 +310,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="Prioritize matches on titles in the search results"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<label class="block">Boost Titles</label>
<input
Expand All @@ -328,7 +326,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="Include an OpenAPI spec in the crawl for increased accuracy"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<label class="block">OpenAPI Spec?</label>
<input
Expand Down Expand Up @@ -362,7 +359,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="Check this if the site is a Shopify store"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<label class="block">Shopify?</label>
<input
Expand Down Expand Up @@ -397,7 +393,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="Ignore the sitemap.xml file, checkbox if the site does not have a sitemap or the sitemap is not accurate"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<label class="block">Ignore Sitemap</label>
<input
Expand All @@ -415,7 +410,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="Follow external links in the crawl. Example: if crawling the site trieve.ai, set this to true and add docs.trieve.ai to the include paths to crawl both the main site and the docs site."
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<label class="block">Allow External Links</label>
<input
Expand Down Expand Up @@ -450,7 +444,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="The maximum number of pages to crawl"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<label class="block" for="">
Page Limit
Expand Down Expand Up @@ -509,7 +502,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="If one or more include paths are specified, only pages with URL's that match at least one of the regex patterns will be crawled"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<label>Include URL Regex's</label>
</div>
Expand All @@ -531,7 +523,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="If one or more exclude paths are specified, pages with URL's that match at least one of the regex patterns will not be crawled (even if they match an include path)"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<div>Exclude URL Regex's</div>
</div>
Expand All @@ -552,7 +543,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="HTML for a page is parsed and all elements matching one or more of the include tags are assembled into a div fort the exclude query selectors to apply to. What is left is the content of the page to be indexed for search."
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<div>Include Query Selectors</div>
</div>
Expand All @@ -573,7 +563,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="HTML for a page is parsed and all elements matching one or more of the exclude tags are removed from the page before indexing. Exclude selectors are applied after include selectors."
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<div>Exclude Query Selectors</div>
</div>
Expand All @@ -594,7 +583,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="Once the page is parsed and separated into heading+body chunks, the heading remove strings are removed from the heading."
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<div>Heading Remove Strings</div>
</div>
Expand All @@ -614,7 +602,6 @@ const RealCrawlingSettings = (props: RealCrawlingSettingsProps) => {
<Tooltip
tooltipText="Once the page is parsed and separated into heading+body chunks, the body remove strings are removed from the body."
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
<div>Body Remove Strings</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export const PublicPageSettings = () => {
<Tooltip
tooltipText="Make a UI to display the search with our component. This is revertable"
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction="right"
/>
</div>
<div class="mt-4 flex content-center items-center gap-1.5">
Expand Down
1 change: 0 additions & 1 deletion frontends/search/src/components/BookmarkPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ const BookmarkPopover = (props: BookmarkPopoverProps) => {
</PopoverButton>
}
tooltipText="Manage Groups For This Chunk"
direction="left"
/>
</div>
<Show
Expand Down
1 change: 0 additions & 1 deletion frontends/search/src/components/CTRPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const CTRPopup = (props: Props) => {
</PopoverButton>
}
tooltipText="Register event"
direction="left"
/>
<Transition
show={isOpen()}
Expand Down
3 changes: 0 additions & 3 deletions frontends/search/src/components/ScoreChunk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ const ScoreChunk = (props: ScoreChunkProps) => {
</A>
}
tooltipText="Open chunk to test recommendations for similar chunks"
direction="left"
/>
</Show>
<Show when={currentUserRole() > 0}>
Expand All @@ -292,7 +291,6 @@ const ScoreChunk = (props: ScoreChunkProps) => {
</A>
}
tooltipText="Edit chunk"
direction="left"
/>
</Show>
<Show when={currentUserRole() > 0}>
Expand All @@ -311,7 +309,6 @@ const ScoreChunk = (props: ScoreChunkProps) => {
</button>
}
tooltipText="Delete chunk"
direction="left"
/>
</Show>

Expand Down
1 change: 0 additions & 1 deletion frontends/search/src/components/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ const SearchForm = (props: {
class="flex items-center space-x-1 pb-1 text-sm"
>
<Tooltip
direction="right"
body={
<div
classList={{
Expand Down
1 change: 0 additions & 1 deletion frontends/shared/ui/SelectBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export const Select = <T,>(props: SelectProps<T>) => {
<Tooltip
tooltipText={tooltipText()}
body={<FaRegularCircleQuestion class="h-4 w-4 text-black" />}
direction={props.tooltipDirection}
/>
)}
</Show>
Expand Down
3 changes: 0 additions & 3 deletions frontends/shared/ui/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import { Show, createSignal, onCleanup, onMount } from "solid-js";
import { Portal } from "solid-js/web";
import type { JSX } from "solid-js/jsx-runtime";

export type TooltipDirection = "top" | "bottom" | "left" | "right";

export interface TooltipProps {
body?: JSX.Element;
children?: JSX.Element;
tooltipText: string;
delay?: number;
direction?: TooltipDirection;
tooltipClass?: string;
unsetWidth?: boolean;
}
Expand Down

0 comments on commit 9cd45f5

Please sign in to comment.