Skip to content

Build your personal knowledge base with Trilium Notes

refactor: remove what the old layout left behind

Elian Doran8d76d6526583
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index d4cb11e20f..7daa0c19f8 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -1203,12 +1203,6 @@
"opening_api_docs_message": "Opening API docs...",
"sql_console_saved_message": "SQL Console note has been saved into {{note_path}}"
},
- "hide_floating_buttons_button": {
- "button_title": "Hide buttons"
- },
- "show_floating_buttons_button": {
- "button_title": "Show buttons"
- },
"relation_map_buttons": {
"create_child_note_title": "Create child note and add it to map",
"create_child_note_text": "Add note"
diff --git a/apps/client/src/widgets/attribute_widgets/AttributeEditor.tsx b/apps/client/src/widgets/attribute_widgets/AttributeEditor.tsx
index a640fc3988..eb7dd2aff0 100644
--- a/apps/client/src/widgets/attribute_widgets/AttributeEditor.tsx
+++ b/apps/client/src/widgets/attribute_widgets/AttributeEditor.tsx
@@ -15,18 +15,15 @@ import attribute_renderer from "../../services/attribute_renderer";
import attributes from "../../services/attributes";
import froca from "../../services/froca";
import { t } from "../../services/i18n";
-import { ATTRIBUTE_HELP_PAGE } from "../../services/in_app_help";
import link from "../../services/link";
import server from "../../services/server";
import { isIMEComposing } from "../../services/shortcuts";
import { escapeQuotes, getErrorMessage } from "../../services/utils";
import ActionButton from "../react/ActionButton";
import CKEditor, { CKEditorApi } from "../react/CKEditor";
-import HelpDropdown from "../react/HelpDropdown";
import { useLegacyImperativeHandlers, useLegacyWidget, useTriliumEvent } from "../react/hooks";
import { createAutocompleteMentionList, createNoteMentionList } from "../type_widgets/text/mention_list_view";
import AttributeDetailWidget, { AttributeNameSuggestion, fetchAttributeNames } from "./attribute_detail";
-import AttributeHelp from "./AttributeHelp";
type AttributeCommandNames = FilteredCommandNames<CommandData>;
@@ -43,11 +40,6 @@ interface AttributeEditorProps {
notePath?: string | null;
ntxId?: string | null;
hidden?: boolean;
- /**
- * Suppresses the editor's own `?` button, for hosts that already offer the same help elsewhere
- * (the new layout's attributes panel carries it in its title bar).
- */
- hideHelpButton?: boolean;
}
export interface AttributeEditorImperativeHandlers {
@@ -57,7 +49,7 @@ export interface AttributeEditorImperativeHandlers {
renderOwnedAttributes(ownedAttributes: FAttribute[]): Promise<void>;
}
-export default function AttributeEditor({ api, note, componentId, notePath, ntxId, hidden, hideHelpButton }: AttributeEditorProps) {
+export default function AttributeEditor({ api, note, componentId, notePath, ntxId, hidden }: AttributeEditorProps) {
const [ currentValue, setCurrentValue ] = useState("");
const [ error, setError ] = useState<unknown>();
const [ needsSaving, setNeedsSaving ] = useState(false);
@@ -329,18 +321,6 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
onClick={save}
/> }
- { !hideHelpButton && (
- // This button lives inside the wrapper the detail popup treats as its
- // spawner, so its outside-click dismissal exempts it. Close it by hand to
- // match the hosts whose help button sits outside (the attributes panel).
- <HelpDropdown
- helpPage={ATTRIBUTE_HELP_PAGE}
- onShown={() => attributeDetailWidget.hide()}
- >
- <AttributeHelp />
- </HelpDropdown>
- ) }
-
<ActionButton
icon="bx bx-plus"
className="add-new-attribute-button tn-tool-button"
diff --git a/apps/client/src/widgets/attribute_widgets/AttributeHelp.tsx b/apps/client/src/widgets/attribute_widgets/AttributeHelp.tsx
index 8481a484c2..15e6dced87 100644
--- a/apps/client/src/widgets/attribute_widgets/AttributeHelp.tsx
+++ b/apps/client/src/widgets/attribute_widgets/AttributeHelp.tsx
@@ -5,7 +5,7 @@ import { RawHtmlBlock } from "../react/RawHtml";
/**
* Quick reference on how to type attributes into the attribute editor. Rendered inside a
- * `HelpDropdown`, either the editor's own `?` button or the attributes panel's one in the new layout.
+ * `HelpDropdown` in the title bar of the status bar's attributes panel.
*/
export default function AttributeHelp() {
return (
diff --git a/apps/client/src/widgets/layout/StatusBar.tsx b/apps/client/src/widgets/layout/StatusBar.tsx
index cce8dfa8de..97cc02cab6 100644
--- a/apps/client/src/widgets/layout/StatusBar.tsx
+++ b/apps/client/src/widgets/layout/StatusBar.tsx
@@ -505,8 +505,6 @@ function AttributesPane({ note, noteContext, attributesShown, setAttributesShown
api={api}
notePath={noteContext.notePath}
ntxId={noteContext.ntxId}
- // The panel's title bar already carries the same help.
- hideHelpButton
/>}
</BottomPanel>
);
diff --git a/apps/client/src/widgets/note_title.tsx b/apps/client/src/widgets/note_title.tsx
index 6e31893570..930146b5b0 100644
--- a/apps/client/src/widgets/note_title.tsx
+++ b/apps/client/src/widgets/note_title.tsx
@@ -75,7 +75,7 @@ export default function NoteTitleWidget(props: {className?: string}) {
// "active" in the tab manager), match on it; otherwise fall back to the active context.
const isTargeted = e.ntxId ? e.ntxId === noteContext?.ntxId : noteContext?.isActive();
if (isTargeted && textBoxRef.current) {
- // In the new layout, there are two NoteTitleWidget instances. Only handle if visible.
+ // A note context has two NoteTitleWidget instances, the title row's and InlineTitle's. Only handle if visible.
if (!textBoxRef.current.checkVisibility({ checkOpacity: true })) {
return;
}
diff --git a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx b/apps/client/src/widgets/sidebar/RightPanelContainer.tsx
index 3bddb9266a..b6fd790093 100644
--- a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx
+++ b/apps/client/src/widgets/sidebar/RightPanelContainer.tsx
@@ -1,4 +1,3 @@
-//! This is currently only used for the new layout.
import "./RightPanelContainer.css";
import Split from "@triliumnext/split.js";
diff --git a/apps/client/src/widgets/type_widgets/options/components/options_components.spec.tsx b/apps/client/src/widgets/type_widgets/options/components/options_components.spec.tsx
index 3e43ab091f..d108464376 100644
--- a/apps/client/src/widgets/type_widgets/options/components/options_components.spec.tsx
+++ b/apps/client/src/widgets/type_widgets/options/components/options_components.spec.tsx
@@ -56,23 +56,23 @@ describe("CheckboxList", () => {
describe("RadioWithIllustration", () => {
const VALUES = [
- { key: "old", text: "Old layout", illustration: <span className="old-picture" /> },
- { key: "new", text: "New layout", illustration: <span className="new-picture" /> }
+ { key: "vertical", text: "Vertical", illustration: <span className="vertical-picture" /> },
+ { key: "horizontal", text: "Horizontal", illustration: <span className="horizontal-picture" /> }
];
it("marks the choice in force and reports the other when its picture is pressed", () => {
const onChange = vi.fn();
const container = renderInto(
- <RadioWithIllustration values={VALUES} currentValue="old" onChange={onChange} />
+ <RadioWithIllustration values={VALUES} currentValue="vertical" onChange={onChange} />
);
const items = [ ...container.querySelectorAll("li") ];
expect(items.map((item) => item.className)).toEqual([ "selected", "" ]);
// The picture is what is pressed, the caption naming it beneath.
- expect(items[1].querySelector("figcaption")?.textContent).toBe("New layout");
+ expect(items[1].querySelector("figcaption")?.textContent).toBe("Horizontal");
items[1].querySelector<HTMLElement>(".illustration")?.click();
- expect(onChange).toHaveBeenCalledWith("new");
+ expect(onChange).toHaveBeenCalledWith("horizontal");
});
});
diff --git a/apps/client/src/widgets/type_widgets/text/ai_assistant_stream.spec.ts b/apps/client/src/widgets/type_widgets/text/ai_assistant_stream.spec.ts
index 4e087d091e..dee0228fff 100644
--- a/apps/client/src/widgets/type_widgets/text/ai_assistant_stream.spec.ts
+++ b/apps/client/src/widgets/type_widgets/text/ai_assistant_stream.spec.ts
@@ -469,7 +469,7 @@ describe("buildAiAssistantQuickActions", () => {
});
// The list is configurable, so what configures it closes the submenu — the same row the status
- // bar and the ribbon end their language pickers with, raising the same modal.
+ // bar's language picker ends with, raising the same modal.
it("closes the Translate submenu with the row that configures the list", () => {
const group = buildAiAssistantQuickActions().find((candidate) => candidate.id === "translate");
expect(group?.footer?.label).toBe("note_language.configure-languages");
diff --git a/packages/trilium-core/src/routes/api/files.spec.ts b/packages/trilium-core/src/routes/api/files.spec.ts
index 812273807c..73853a3260 100644
--- a/packages/trilium-core/src/routes/api/files.spec.ts
+++ b/packages/trilium-core/src/routes/api/files.spec.ts
@@ -156,7 +156,7 @@ describe("Files API (core)", () => {
});
it("sanitizes an image note opened inline, and the unregistered `image/svg` spelling too", async () => {
- // An ordinary `.svg` upload lands as an image note, whose ribbon has the same Open
+ // An ordinary `.svg` upload lands as an image note, whose note actions have the same Open
// button — the sink is reachable without an import at all.
for (const mime of [ "image/svg+xml", "image/svg" ]) {
const noteId = await createSvgNote(mime, "image");
diff --git a/packages/trilium-core/src/services/options_init.ts b/packages/trilium-core/src/services/options_init.ts
index 91edf987b9..5416d7c17c 100644
--- a/packages/trilium-core/src/services/options_init.ts
+++ b/packages/trilium-core/src/services/options_init.ts
@@ -353,7 +353,7 @@ const defaultOptions: DefaultOption[] = [
{
name: "seenCallToActions",
value: JSON.stringify([
- "new_layout", "background_effects", "next_theme"
+ "background_effects", "next_theme"
]),
isSynced: true
},