Skip to content

Build your personal knowledge base with Trilium Notes

chore(sidebar): borderless note map

Elian Dorandcac2a7bf20a
diff --git a/apps/client/src/widgets/sidebar/NoteMap.tsx b/apps/client/src/widgets/sidebar/NoteMap.tsx
index 3dd1688ef9..0b2a5c903f 100644
--- a/apps/client/src/widgets/sidebar/NoteMap.tsx
+++ b/apps/client/src/widgets/sidebar/NoteMap.tsx
@@ -11,7 +11,11 @@ import RightPanelWidget from "./RightPanelWidget";
*/
export default function NoteMap() {
return (
- <RightPanelWidget id="noteMap" title={t("note_map.title")}>
+ <RightPanelWidget
+ id="noteMap"
+ title={t("note_map.title")}
+ noPadding
+ >
<LazyComponent loader={() => import("./NoteMapGraph.jsx")} />
</RightPanelWidget>
);
diff --git a/apps/client/src/widgets/sidebar/RightPanelContainer.css b/apps/client/src/widgets/sidebar/RightPanelContainer.css
index 2d9bf03b99..192c98a702 100644
--- a/apps/client/src/widgets/sidebar/RightPanelContainer.css
+++ b/apps/client/src/widgets/sidebar/RightPanelContainer.css
@@ -95,7 +95,7 @@ body.experimental-feature-new-layout #right-pane-host.peek > .right-pane-peek-sp
/* Pin/close controls, shown whenever the pane is open (pin only in peek mode). */
body.experimental-feature-new-layout #right-pane .right-pane-actions {
--icon-button-size: 24px;
-
+
position: absolute;
top: 0;
right: 0;
@@ -303,6 +303,10 @@ body.experimental-feature-new-layout #right-pane {
.gutter-vertical + .card .card-header {
padding-top: 0;
}
+
+ .card-body.no-padding {
+ padding: 0;
+ }
}
/* A wash rather than a cover: what is in the card stays readable throughout the flash. */
@@ -314,4 +318,4 @@ body.experimental-feature-new-layout #right-pane {
/* Backdrop effects are disabled, so peek mode needs a solid background. */
body.experimental-feature-new-layout.backdrop-effects-disabled #right-pane.right-pane-mode-peek {
background: var(--right-pane-background-color);
-}
\ No newline at end of file
+}
diff --git a/apps/client/src/widgets/sidebar/RightPanelWidget.tsx b/apps/client/src/widgets/sidebar/RightPanelWidget.tsx
index 1971f7ba9e..c6e9c8d669 100644
--- a/apps/client/src/widgets/sidebar/RightPanelWidget.tsx
+++ b/apps/client/src/widgets/sidebar/RightPanelWidget.tsx
@@ -49,9 +49,11 @@ interface RightPanelWidgetProps {
* and (because its hooks live in the always-mounted parent) not re-wired on expand.
*/
keepMounted?: boolean;
+ /** Add no padding to the widget body. */
+ noPadding?: true;
}
-export default function RightPanelWidget({ id, title, buttons, children, containerRef: externalContainerRef, contextMenuItems, grow, keepMounted }: RightPanelWidgetProps) {
+export default function RightPanelWidget({ id, title, buttons, children, containerRef: externalContainerRef, contextMenuItems, grow, keepMounted, noPadding }: RightPanelWidgetProps) {
const [ rightPaneCollapsedItems, setRightPaneCollapsedItems ] = useTriliumOptionJson<string[]>("rightPaneCollapsedItems");
const [ collapsedByUser, setCollapsedByUser ] = useState(rightPaneCollapsedItems.includes(id));
const [ scrollPending, setScrollPending ] = useState(false);
@@ -96,7 +98,7 @@ export default function RightPanelWidget({ id, title, buttons, children, contain
<div
ref={containerRef}
id={id}
- class={clsx("card widget", {
+ className={clsx("card widget", {
collapsed: !expanded,
"not-collapsible": !collapsible,
grow,
@@ -147,7 +149,7 @@ export default function RightPanelWidget({ id, title, buttons, children, contain
{/* keepMounted widgets stay in the DOM when collapsed and hide via an inline display:none
(which beats any stylesheet `.card-body` display rule, unlike the `hidden` attribute), so
their state and DOM-attached listeners survive a collapse; others unmount as before. */}
- {(expanded || keepMounted) && <div class="card-body" style={!expanded ? { display: "none" } : undefined}>
+ {(expanded || keepMounted) && <div class={clsx("card-body", { "no-padding": noPadding })} style={!expanded ? { display: "none" } : undefined}>
{children}
</div>}
</div>