Skip to content

Build your personal knowledge base with Trilium Notes

feat(attributes): let the note's own attributes take the leftover height

Elian Doranac2222b03b96
diff --git a/apps/client/src/widgets/sidebar/AttributeList.tsx b/apps/client/src/widgets/sidebar/AttributeList.tsx
index 791ba8751c..778c18ca22 100644
--- a/apps/client/src/widgets/sidebar/AttributeList.tsx
+++ b/apps/client/src/widgets/sidebar/AttributeList.tsx
@@ -162,6 +162,7 @@ export default function AttributeList() {
<RightPanelWidget
id="attributes"
title={t("attribute_list_panel.owned", { count: sections.owned.length })}
+ grow
buttons={note && (
<>
<HelpButton helpPage={ATTRIBUTE_HELP_PAGE} />
diff --git a/apps/client/src/widgets/sidebar/RightPanelWidget.tsx b/apps/client/src/widgets/sidebar/RightPanelWidget.tsx
index 3949e03e14..c3af8dac85 100644
--- a/apps/client/src/widgets/sidebar/RightPanelWidget.tsx
+++ b/apps/client/src/widgets/sidebar/RightPanelWidget.tsx
@@ -20,6 +20,14 @@ interface RightPanelWidgetProps {
buttons?: ComponentChildren;
containerRef?: RefObject<HTMLDivElement>;
contextMenuItems?: MenuItem<unknown>[];
+ /**
+ * Take the height the other widgets of the tab leave over, scrolling the body within it, instead of
+ * keeping to the height of the content. Use for the one widget a tab is really about — a note's own
+ * attributes, its table of contents, the chat — so that the rest keep to their content around it.
+ *
+ * At most one widget per tab should ask for it: they would otherwise share the leftover height
+ * between them. It lapses while the widget is collapsed, so the others move up to fill the room.
+ */
grow?: boolean;
/**
* Keep the body in the DOM when collapsed (hidden via CSS) instead of unmounting it. Use for a