fix(ribbon): formatting toolbar disappearing after viewing attachments

This commit is contained in:
Elian Doran 2025-11-29 10:31:56 +02:00
parent a6ed4d92c9
commit 12abdcaf6c
No known key found for this signature in database
2 changed files with 55 additions and 56 deletions

View File

@ -8,6 +8,7 @@ import NoteActions from "./NoteActions";
import { KeyboardActionNames } from "@triliumnext/commons";
import { RIBBON_TAB_DEFINITIONS } from "./RibbonDefinition";
import { TabConfiguration, TitleContext } from "./ribbon-interface";
import clsx from "clsx";
const TAB_CONFIGURATION = numberObjectsInPlace<TabConfiguration>(RIBBON_TAB_DEFINITIONS);
@ -63,9 +64,10 @@ export default function Ribbon() {
}, [ computedTabs, activeTabIndex ]));
return (
<div className="ribbon-container" style={{ contain: "none" }}>
{noteContext?.viewScope?.viewMode === "default" && (
<>
<div
className={clsx("ribbon-container", noteContext?.viewScope?.viewMode !== "default" && "hidden-ext")}
style={{ contain: "none" }}
>
<div className="ribbon-top-row">
<div className="ribbon-tab-container">
{computedTabs && computedTabs.map(({ title, icon, index, toggleCommand, shouldShow }) => (
@ -117,8 +119,6 @@ export default function Ribbon() {
);
})}
</div>
</>
)}
</div>
)
}

View File

@ -41,7 +41,6 @@ export default function ReadOnlyText({ note, noteContext, ntxId }: TypeWidgetPro
// React to included note changes.
useTriliumEvent("refreshIncludedNote", ({ noteId }) => {
console.log("Refresh ", noteId);
if (!contentRef.current) return;
refreshIncludedNote(contentRef.current, noteId);
});