diff --git a/core/indexing/docs/suggestions/packageCrawlers/TsJs.ts b/core/indexing/docs/suggestions/packageCrawlers/TsJs.ts index 42c500748..3a9ef96c2 100644 --- a/core/indexing/docs/suggestions/packageCrawlers/TsJs.ts +++ b/core/indexing/docs/suggestions/packageCrawlers/TsJs.ts @@ -59,6 +59,11 @@ export class NodePackageCrawler implements PackageCrawler { throw new Error(`Could not fetch data for package ${name}`); } const data = await response.json(); + + // const dependencies = Object.keys(packageContentData.dependencies || {}) + // .concat(Object.keys(packageContentData.devDependencies || {})); + // const usesTypescript = dependencies.includes("typescript"); + return { docsLink: data.homepage as string | undefined, title: name, // package.json doesn't have specific title field diff --git a/gui/src/components/AccountDialog.tsx b/gui/src/components/AccountDialog.tsx index 5438d11df..db61fe3c0 100644 --- a/gui/src/components/AccountDialog.tsx +++ b/gui/src/components/AccountDialog.tsx @@ -65,8 +65,6 @@ function AccountDialog() { ); } - const dispatch = useDispatch(); - const changeProfileId = (id: string) => { ideMessenger.post("didChangeSelectedProfile", { id }); dispatch(setSelectedProfileId(id)); diff --git a/gui/src/components/dialogs/AddDocsDialog.tsx b/gui/src/components/dialogs/AddDocsDialog.tsx index 1467a3fa5..68039e85c 100644 --- a/gui/src/components/dialogs/AddDocsDialog.tsx +++ b/gui/src/components/dialogs/AddDocsDialog.tsx @@ -7,7 +7,9 @@ import { ExclamationTriangleIcon, InformationCircleIcon, LinkIcon, + PencilIcon, PlusCircleIcon, + PlusIcon, } from "@heroicons/react/24/outline"; import { IndexingStatus, PackageDocsResult, SiteIndexingConfig } from "core"; import { usePostHog } from "posthog-js/react"; @@ -27,6 +29,7 @@ import FileIcon from "../FileIcon"; import DocsIndexingPeeks from "../indexing/DocsIndexingPeeks"; import { updateIndexingStatus } from "../../redux/slices/stateSlice"; import preIndexedDocs from "core/indexing/docs/preIndexedDocs"; +import { NewSessionButton } from "../mainInput/NewSessionButton"; function AddDocsDialog() { const posthog = usePostHog(); @@ -168,13 +171,13 @@ function AddDocsDialog() { return (
-
+

Add documentation

Add docs

For the @docs context provider

- {sortedDocsSuggestions.length && ( + {!!sortedDocsSuggestions.length && (

Suggestions

)}
@@ -183,80 +186,65 @@ function AddDocsDialog() { const { language, name, version } = docsResult.packageInfo; const id = `${language}-${name}-${version}`; return ( - <> -
{ - handleSelectSuggestion(docsResult); - }} - > -
- {error ? ( -
- - - Docs URL not found - -
- ) : details.docsLinkWarning ? ( -
- - - Start URL might not lead to docs - -
- ) : ( - - )} -
-
-
- { + handleSelectSuggestion(docsResult); + }} + > +
+ {error || details.docsLinkWarning ? ( +
+ + + This may not be a docs page +
- {name} + ) : ( + + )} +
+
+
+
-
- {error ? ( - - No docs link found - - ) : ( -
- {/*
+ {name} +
+
+ {error ? ( + + No docs link found + + ) : ( +
+ {/*
*/} -

- {details.docsLink} -

-
- )} -
-
- - -

{`Version: ${version}`}

-

{`Found in ${docsResult.packageInfo.packageFile.path}`}

-
-
+

+ {details.docsLink} +

+
+ )}
- - {error ? "Add to form" : "Index these docs"} - - +
+ + +

{`Version: ${version}`}

+

{`Found in ${docsResult.packageInfo.packageFile.path}`}

+
+
+
); })}
@@ -313,31 +301,36 @@ function AddDocsDialog() { }} /> + {/*
+ +
*/}
- - Done - - + Add +
-
- {docsIndexingStatuses.length ? ( -

- - It is safe to close this form while indexing -

- ) : null} +
+
+ {docsIndexingStatuses.length ? ( +

+ + It is safe to close this form while indexing +

+ ) : null} +
+ {/* */}
); diff --git a/gui/src/components/indexing/DocsIndexingPeeks.tsx b/gui/src/components/indexing/DocsIndexingPeeks.tsx index 9c5f96ec8..e50b4adcf 100644 --- a/gui/src/components/indexing/DocsIndexingPeeks.tsx +++ b/gui/src/components/indexing/DocsIndexingPeeks.tsx @@ -45,9 +45,9 @@ function DocsIndexingPeek({ status }: DocsIndexingPeekProps) { {progressPercentage.toFixed(0)}% - + > */}
); @@ -58,17 +58,19 @@ interface DocsIndexingPeeksProps { } function DocsIndexingPeekList({ statuses }: DocsIndexingPeeksProps) { - if (!statuses.length) return null; - return ( -
+

- Currently Indexing + Currently Indexing:

- {statuses.map((status) => { - return ; - })} + {statuses.length ? ( + statuses.map((status) => { + return ; + }) + ) : ( +

None

+ )}
); diff --git a/gui/src/components/indexing/IndexingStatuses.tsx b/gui/src/components/indexing/IndexingStatuses.tsx index 746bc71ed..3ea04216f 100644 --- a/gui/src/components/indexing/IndexingStatuses.tsx +++ b/gui/src/components/indexing/IndexingStatuses.tsx @@ -28,20 +28,29 @@ function IndexingStatuses() {

@docs indexes

{docsStatuses.length ? ( - <> - { - dispatch(setShowDialog(true)); - dispatch(setDialogMessage()); - }} - /> - - Add Docs - - - ) : null} +
{ + dispatch(setShowDialog(true)); + dispatch(setDialogMessage()); + }} + > + Add +
+ ) : //
+ // { + // dispatch(setShowDialog(true)); + // dispatch(setDialogMessage()); + // }} + // /> + // + // Add Docs + // + //
+ null}
Manage your documentation sources