From 35da7908f81952b2fcf697fb1eddfa67d150c304 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 20 Oct 2024 00:25:11 +0300 Subject: [PATCH 1/9] client: Move promoted attributes to scrolling container --- src/public/app/layouts/desktop_layout.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js index fd4aff19f..1fc15fb69 100644 --- a/src/public/app/layouts/desktop_layout.js +++ b/src/public/app/layouts/desktop_layout.js @@ -140,7 +140,6 @@ export default class DesktopLayout { // the order of the widgets matter. Some of these want to "activate" themselves // when visible. When this happens to multiple of them, the first one "wins". // promoted attributes should always win. - .ribbon(new PromotedAttributesWidget()) .ribbon(new ScriptExecutorWidget()) .ribbon(new SearchDefinitionWidget()) .ribbon(new EditedNotesWidget()) @@ -157,7 +156,7 @@ export default class DesktopLayout { .ribbon(new NoteInfoWidget()) .button(new RevisionsButton()) .button(new NoteActionsWidget()) - ) + ) .child(new SharedInfoWidget()) .child(new WatchedFileUpdateStatusWidget()) .child(new FloatingButtons() @@ -175,6 +174,7 @@ export default class DesktopLayout { .child( new ScrollingContainer() .filling() + .child(new PromotedAttributesWidget()) .child(new SqlTableSchemasWidget()) .child(new NoteDetailWidget()) .child(new NoteListWidget()) From 18b0907841c92c2271e6f9681fec6acb73191c9f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 20 Oct 2024 00:26:55 +0300 Subject: [PATCH 2/9] client: Move note title to scrolling container --- src/public/app/layouts/desktop_layout.js | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js index 1fc15fb69..2ba26c307 100644 --- a/src/public/app/layouts/desktop_layout.js +++ b/src/public/app/layouts/desktop_layout.js @@ -121,20 +121,7 @@ export default class DesktopLayout { .collapsible() .id('center-pane') .child(new SplitNoteContainer(() => - new NoteWrapperWidget() - .child(new FlexContainer('row').class('title-row') - .css("height", "50px") - .css("min-height", "50px") - .css('align-items', "center") - .cssBlock('.title-row > * { margin: 5px; }') - .child(new NoteIconWidget()) - .child(new NoteTitleWidget()) - .child(new SpacerWidget(0, 1)) - .child(new MovePaneButton(true)) - .child(new MovePaneButton(false)) - .child(new ClosePaneButton()) - .child(new CreatePaneButton()) - ) + new NoteWrapperWidget() .child( new RibbonContainer() // the order of the widgets matter. Some of these want to "activate" themselves @@ -171,9 +158,22 @@ export default class DesktopLayout { .child(new HideFloatingButtonsButton()) ) .child(new MermaidWidget()) - .child( + .child( new ScrollingContainer() .filling() + .child(new FlexContainer('row').class('title-row') + .css("height", "50px") + .css("min-height", "50px") + .css('align-items', "center") + .cssBlock('.title-row > * { margin: 5px; }') + .child(new NoteIconWidget()) + .child(new NoteTitleWidget()) + .child(new SpacerWidget(0, 1)) + .child(new MovePaneButton(true)) + .child(new MovePaneButton(false)) + .child(new ClosePaneButton()) + .child(new CreatePaneButton()) + ) .child(new PromotedAttributesWidget()) .child(new SqlTableSchemasWidget()) .child(new NoteDetailWidget()) From fcebb43410bdb0c3fa9d843349b17a68c9043bc8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 20 Oct 2024 00:38:17 +0300 Subject: [PATCH 3/9] client: Use single column layout for promoted attributes --- .../ribbon_widgets/promoted_attributes.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/public/app/widgets/ribbon_widgets/promoted_attributes.js b/src/public/app/widgets/ribbon_widgets/promoted_attributes.js index 5c91b4223..6811ea1c6 100644 --- a/src/public/app/widgets/ribbon_widgets/promoted_attributes.js +++ b/src/public/app/widgets/ribbon_widgets/promoted_attributes.js @@ -18,32 +18,35 @@ const TPL = ` } .promoted-attributes-container { - margin: auto; - display: flex; - flex-direction: row; - flex-shrink: 0; - flex-grow: 0; - justify-content: space-evenly; + margin: 0 1.5em; overflow: auto; max-height: 400px; flex-wrap: wrap; + display: table; } - .promoted-attribute-cell { display: flex; align-items: center; margin: 10px; + display: table-row; + } + .promoted-attribute-cell > * { + display: table-cell; + padding: 1px 0; } .promoted-attribute-cell div.input-group { margin-left: 10px; + display: flex; } .promoted-attribute-cell strong { word-break:keep-all; white-space: nowrap; } .promoted-attribute-cell input[type="checkbox"] { - height: 1.5em; + height: 1.5em; + flex-grow: 0; + width: unset; } @@ -211,9 +214,6 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget { } else if (definition.labelType === 'boolean') { $input.prop("type", "checkbox"); - // hack, without this the checkbox is invisible - // we should be using a different bootstrap structure for checkboxes - $input.css('width', '80px'); if (valueAttr.value === "true") { $input.prop("checked", "checked"); From ac61d0f3ea41693af79b835859dd1d96fe89654e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 20 Oct 2024 00:56:05 +0300 Subject: [PATCH 4/9] client: Move ribbon at the bottom --- src/public/app/layouts/desktop_layout.js | 46 +++++++++---------- .../widgets/containers/ribbon_container.js | 14 +++--- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js index 2ba26c307..b6a0583d9 100644 --- a/src/public/app/layouts/desktop_layout.js +++ b/src/public/app/layouts/desktop_layout.js @@ -121,29 +121,7 @@ export default class DesktopLayout { .collapsible() .id('center-pane') .child(new SplitNoteContainer(() => - new NoteWrapperWidget() - .child( - new RibbonContainer() - // the order of the widgets matter. Some of these want to "activate" themselves - // when visible. When this happens to multiple of them, the first one "wins". - // promoted attributes should always win. - .ribbon(new ScriptExecutorWidget()) - .ribbon(new SearchDefinitionWidget()) - .ribbon(new EditedNotesWidget()) - .ribbon(new BookPropertiesWidget()) - .ribbon(new NotePropertiesWidget()) - .ribbon(new FilePropertiesWidget()) - .ribbon(new ImagePropertiesWidget()) - .ribbon(new BasicPropertiesWidget()) - .ribbon(new OwnedAttributeListWidget()) - .ribbon(new InheritedAttributesWidget()) - .ribbon(new NotePathsWidget()) - .ribbon(new NoteMapRibbonWidget()) - .ribbon(new SimilarNotesWidget()) - .ribbon(new NoteInfoWidget()) - .button(new RevisionsButton()) - .button(new NoteActionsWidget()) - ) + new NoteWrapperWidget() .child(new SharedInfoWidget()) .child(new WatchedFileUpdateStatusWidget()) .child(new FloatingButtons() @@ -188,6 +166,28 @@ export default class DesktopLayout { ...this.customWidgets.get('node-detail-pane'), // typo, let's keep it for a while as BC ...this.customWidgets.get('note-detail-pane') ) + .child( + new RibbonContainer() + // the order of the widgets matter. Some of these want to "activate" themselves + // when visible. When this happens to multiple of them, the first one "wins". + // promoted attributes should always win. + .ribbon(new ScriptExecutorWidget()) + .ribbon(new SearchDefinitionWidget()) + .ribbon(new EditedNotesWidget()) + .ribbon(new BookPropertiesWidget()) + .ribbon(new NotePropertiesWidget()) + .ribbon(new FilePropertiesWidget()) + .ribbon(new ImagePropertiesWidget()) + .ribbon(new BasicPropertiesWidget()) + .ribbon(new OwnedAttributeListWidget()) + .ribbon(new InheritedAttributesWidget()) + .ribbon(new NotePathsWidget()) + .ribbon(new NoteMapRibbonWidget()) + .ribbon(new SimilarNotesWidget()) + .ribbon(new NoteInfoWidget()) + .button(new RevisionsButton()) + .button(new NoteActionsWidget()) + ) ) ) .child(...this.customWidgets.get('center-pane')) diff --git a/src/public/app/widgets/containers/ribbon_container.js b/src/public/app/widgets/containers/ribbon_container.js index c75776a99..604d2c28e 100644 --- a/src/public/app/widgets/containers/ribbon_container.js +++ b/src/public/app/widgets/containers/ribbon_container.js @@ -6,7 +6,7 @@ const TPL = `