diff --git a/apps/client/src/widgets/ribbon/RibbonDefinition.ts b/apps/client/src/widgets/ribbon/RibbonDefinition.ts
index 0eb63002a..280f7cdda 100644
--- a/apps/client/src/widgets/ribbon/RibbonDefinition.ts
+++ b/apps/client/src/widgets/ribbon/RibbonDefinition.ts
@@ -16,6 +16,7 @@ import FormattingToolbar from "./FormattingToolbar";
import options from "../../services/options";
import { t } from "../../services/i18n";
import { TabConfiguration } from "./ribbon-interface";
+import { isExperimentalFeatureEnabled } from "../../services/experimental_features";
export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
{
@@ -27,7 +28,8 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
toggleCommand: "toggleRibbonTabClassicEditor",
content: FormattingToolbar,
activate: ({ note }) => !options.is("editedNotesOpenInRibbon") || !note?.hasOwnedLabel("dateNote"),
- stayInDom: true
+ stayInDom: !isExperimentalFeatureEnabled("new-layout"),
+ avoidInNewLayout: true
},
{
title: ({ note }) => note?.isTriliumSqlite() ? t("script_executor.query") : t("script_executor.script"),
diff --git a/apps/client/src/widgets/ribbon/ribbon-interface.ts b/apps/client/src/widgets/ribbon/ribbon-interface.ts
index 7ab982dd2..a83bbc55f 100644
--- a/apps/client/src/widgets/ribbon/ribbon-interface.ts
+++ b/apps/client/src/widgets/ribbon/ribbon-interface.ts
@@ -30,4 +30,5 @@ export interface TabConfiguration {
* By default the tab content will not be rendered unless the tab is active (i.e. selected by the user). Setting to `true` will ensure that the tab is rendered even when inactive, for cases where the tab needs to be accessible at all times (e.g. for the detached editor toolbar) or if event handling is needed.
*/
stayInDom?: boolean;
+ avoidInNewLayout?: boolean;
}
diff --git a/apps/client/src/widgets/ribbon/style.css b/apps/client/src/widgets/ribbon/style.css
index 8c2a5fbb5..b1813d65f 100644
--- a/apps/client/src/widgets/ribbon/style.css
+++ b/apps/client/src/widgets/ribbon/style.css
@@ -415,3 +415,24 @@ body[dir=rtl] .attribute-list-editor {
pointer-events: none; /* makes it unclickable */
}
/* #endregion */
+
+/* #region Experimental layout */
+body.experimental-feature-new-layout {
+ .ribbon-container {
+ display: flex;
+ flex-direction: column-reverse;
+ border-top: 1px solid var(--main-border-color);
+
+ .ribbon-tab-spacer,
+ .ribbon-tab-title,
+ .ribbon-body {
+ border-bottom: 0 !important;
+ }
+ }
+
+ .ribbon-button-container {
+ border-bottom: 0 !important;
+ margin: 0;
+ }
+}
+/* #endregion */
diff --git a/apps/client/src/widgets/shared_info.tsx b/apps/client/src/widgets/shared_info.tsx
index bd0b72bc2..954ceb5f0 100644
--- a/apps/client/src/widgets/shared_info.tsx
+++ b/apps/client/src/widgets/shared_info.tsx
@@ -10,8 +10,23 @@ import RawHtml from "./react/RawHtml";
export default function SharedInfo() {
const { note } = useNoteContext();
- const [ syncServerHost ] = useTriliumOption("syncServerHost");
+ const { isSharedExternally, link } = useShareInfo(note);
+
+ return (
+
+ {link && (
+
+ )}
+
+
+ );
+}
+
+export function useShareInfo(note: FNote | null | undefined) {
const [ link, setLink ] = useState
();
+ const [ syncServerHost ] = useTriliumOption("syncServerHost");
function refresh() {
if (!note) return;
@@ -48,16 +63,7 @@ export default function SharedInfo() {
}
});
- return (
-
- {link && (
-
- )}
-
-
- )
+ return { link, isSharedExternally: !!syncServerHost };
}
function getShareId(note: FNote) {
@@ -66,4 +72,4 @@ function getShareId(note: FNote) {
}
return note.getOwnedLabelValue("shareAlias") || note.noteId;
-}
\ No newline at end of file
+}
diff --git a/apps/client/src/widgets/type_widgets/options/advanced.tsx b/apps/client/src/widgets/type_widgets/options/advanced.tsx
index b16dca89d..958180063 100644
--- a/apps/client/src/widgets/type_widgets/options/advanced.tsx
+++ b/apps/client/src/widgets/type_widgets/options/advanced.tsx
@@ -7,6 +7,9 @@ import FormText from "../../react/FormText";
import OptionsSection from "./components/OptionsSection"
import Column from "../../react/Column";
import { useEffect, useState } from "preact/hooks";
+import CheckboxList from "./components/CheckboxList";
+import { experimentalFeatures } from "../../../services/experimental_features";
+import { useTriliumOptionJson } from "../../react/hooks";
export default function AdvancedSettings() {
return <>
@@ -14,6 +17,7 @@ export default function AdvancedSettings() {
+
>;
}
@@ -44,14 +48,14 @@ function DatabaseIntegrityOptions() {
return (
{t("database_integrity_check.description")}
-
+