Skip to content

Build your personal knowledge base with Trilium Notes

refactor(import): move OneNote "attach original HTML" toggle into the panel

Elian Doran9c23e34b2abc
diff --git a/apps/client/src/widgets/dialogs/import/onenote.css b/apps/client/src/widgets/dialogs/import/onenote.css
deleted file mode 100644
index 9351214497..0000000000
--- a/apps/client/src/widgets/dialogs/import/onenote.css
+++ /dev/null
@@ -1,9 +0,0 @@
-/* The OneNote import footer keeps the "attach source" checkbox on the left while the import
- button stays on the right, independent of the dialog's right-aligned footer default. */
-.modal-footer .onenote-footer {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 1em;
-}
diff --git a/apps/client/src/widgets/dialogs/import/onenote.tsx b/apps/client/src/widgets/dialogs/import/onenote.tsx
index 764de4b0f4..37058303b8 100644
--- a/apps/client/src/widgets/dialogs/import/onenote.tsx
+++ b/apps/client/src/widgets/dialogs/import/onenote.tsx
@@ -1,5 +1,3 @@
-import "./onenote.css";
-
import { useCallback, useEffect, useRef, useState } from "preact/hooks";
import { t } from "../../../services/i18n.js";
@@ -148,28 +146,19 @@ function OneNotePanel({ parentNoteId, closeDialog, setFooter }: ImportProviderPa
const doImportRef = useRef(doImport);
doImportRef.current = doImport;
- // Surface the primary actions in the dialog's pinned footer once notebooks are loaded; the other
+ // Surface the import button in the dialog's pinned footer once notebooks are loaded; the other
// phases set it to null so the connect screens show no footer.
const importDisabled = selectedIds.size === 0;
useEffect(() => {
setFooter(phase !== "ready" ? null : (
- <div className="onenote-footer">
- <FormCheckbox
- name="onenote-debug"
- label={t("onenote_import.attach_source")}
- hint={t("onenote_import.attach_source_hint")}
- currentValue={debug}
- onChange={setDebug}
- />
- <Button
- text={t("onenote_import.import")}
- kind="primary"
- disabled={importDisabled}
- onClick={() => void doImportRef.current()}
- />
- </div>
+ <Button
+ text={t("onenote_import.import")}
+ kind="primary"
+ disabled={importDisabled}
+ onClick={() => void doImportRef.current()}
+ />
));
- }, [phase, debug, importDisabled, setFooter]);
+ }, [phase, importDisabled, setFooter]);
if (phase === "checking") {
return <Card><CardSection className="onenote-panel"><LoadingSpinner /></CardSection></Card>;
@@ -212,6 +201,13 @@ function OneNotePanel({ parentNoteId, closeDialog, setFooter }: ImportProviderPa
<ExtendedAdmonition type="note" icon="bx bx-info-circle" title={t("onenote_import.order_hint_title")}>
{t("onenote_import.order_hint")}
</ExtendedAdmonition>
+ <FormCheckbox
+ name="onenote-debug"
+ label={t("onenote_import.attach_source")}
+ hint={t("onenote_import.attach_source_hint")}
+ currentValue={debug}
+ onChange={setDebug}
+ />
</>
)}
</CardSection>