Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(options): have settings navigation only in the modal
Elian Doran4322a2448520
diff --git a/apps/client/src/widgets/type_widgets/ContentWidget.css b/apps/client/src/widgets/type_widgets/ContentWidget.cssindex 1e2b338621..d5a0aa8b7b 100644--- a/apps/client/src/widgets/type_widgets/ContentWidget.css+++ b/apps/client/src/widgets/type_widgets/ContentWidget.css@@ -6,31 +6,3 @@padding: 0;height: 100%;}--/* Options pages: in-content page selector on the left, the page itself on the right. */-.options-with-nav {- display: flex;- align-items: flex-start;-}--.options-with-nav > .note-detail-content-widget-content.options {- flex: 1 1 auto;- min-width: 0;-}--.options-with-nav > .settings-navigation {- flex: 0 0 auto;- align-self: flex-start;- position: sticky;- top: 0;- width: 220px;- /* Align the first entry with the first card of the page (which has its own top padding/margin). */- padding: calc(15px + 1em) 12px 15px 15px;-}--/* On narrow screens the tree is the primary navigation, so the in-content list collapses away. */-@media (max-width: 768px) {- .options-with-nav > .settings-navigation {- display: none;- }-}diff --git a/apps/client/src/widgets/type_widgets/ContentWidget.tsx b/apps/client/src/widgets/type_widgets/ContentWidget.tsxindex 29f18b6536..e15bd47853 100644--- a/apps/client/src/widgets/type_widgets/ContentWidget.tsx+++ b/apps/client/src/widgets/type_widgets/ContentWidget.tsx@@ -19,7 +19,6 @@ import LlmSettings from "./options/llm";import "./ContentWidget.css";import { t } from "../../services/i18n";import BackendLog from "./code/BackendLog";-import SettingsNavigation from "./options/components/SettingsNavigation";export type OptionPages = "_optionsAppearance" | "_optionsShortcuts" | "_optionsTextNotes" | "_optionsCodeNotes" | "_optionsMedia" | "_optionsSpellcheck" | "_optionsPassword" | "_optionsMFA" | "_optionsEtapi" | "_optionsBackup" | "_optionsSync" | "_optionsOther" | "_optionsLocalization" | "_optionsSecurity" | "_optionsAdvanced" | "_optionsLlm";@@ -51,39 +50,11 @@ const CONTENT_WIDGETS: Record<OptionPages | "_backendLog", (props: TypeWidgetPro*/export default function ContentWidget({ note, ...restProps }: TypeWidgetProps) {const Content = CONTENT_WIDGETS[note.noteId];- const isOptions = note.noteId.startsWith("_options");- const content = Content- ? <Content note={note} {...restProps} />- : (t("content_widget.unknown_widget", { id: note.noteId }));-- // For options pages, render an in-content page selector beside the page. The selector- // duplicates the (hoisted) note tree's list so users can switch pages without the tree.- // `.note-detail-content-widget-content.options` stays the direct parent of the page so the- // theme's existing options styling keeps applying.- // In the quick-edit popup the selector is provided by the modal's own sidebar instead, so we- // skip the in-content one there to avoid showing it twice.- if (isOptions) {- const inPopupEditor = restProps.noteContext?.ntxId === "_popup-editor";- if (inPopupEditor) {- return (- <div className="note-detail-content-widget-content options">- {content}- </div>- );- }- return (- <div className="options-with-nav">- <SettingsNavigation activeNoteId={note.noteId} noteContext={restProps.noteContext} />- <div className="note-detail-content-widget-content options">- {content}- </div>- </div>- );- }-return (- <div className="note-detail-content-widget-content">- {content}+ <div className={`note-detail-content-widget-content ${note.noteId.startsWith("_options") ? "options" : ""}`}>+ {Content+ ? <Content note={note} {...restProps} />+ : (t("content_widget.unknown_widget", { id: note.noteId }))}</div>)}